From 34fbee2cf549acb8b34f0b2b2de8ff3a0bbde3fe Mon Sep 17 00:00:00 2001 From: jagpreetsinghsasan Date: Thu, 11 Jan 2024 12:50:29 +0530 Subject: [PATCH] build(api-client): generate java, go clients Primary Changes --------------- 1. Updated package.json of packages to include the new codegen scripts 2. Added a new workflow to create and upload the jars from the newly added code Changes required to incorporate 1) --------------------------------- 3. Added replace package to assist the codegen scripts written in package.json Fixes #393 Signed-off-by: jagpreetsinghsasan --- .../.dast-nuclei-cmd-api-server.yaml | 2 +- .../ghpkg-all-java-api-clients-publish.yaml | 197 ++ .../package.json | 4 +- .../go-client/.openapi-generator/FILES | 20 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 122 + .../openapi/go-client/api/openapi.yaml | 335 +++ .../openapi/go-client/api_default.go | 338 +++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 231 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../model_counterparty_htlc_request.go | 264 ++ .../openapi/go-client/model_htlc_package.go | 111 + .../go-client/model_own_htlc_request.go | 487 ++++ .../model_web3_signing_credential.go | 178 ++ ..._signing_credential_cactus_keychain_ref.go | 201 ++ .../model_web3_signing_credential_none.go | 117 + ...web3_signing_credential_private_key_hex.go | 173 ++ .../model_web3_signing_credential_type.go | 115 + .../model_withdraw_counterparty_request.go | 329 +++ .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 61 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 50 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 147 ++ .../openapi/java-client/api/openapi.yaml | 342 +++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1566 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 419 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 432 ++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../client/model/CounterpartyHTLCRequest.java | 371 +++ .../client/model/HtlcPackage.java | 73 + .../client/model/OwnHTLCRequest.java | 631 +++++ .../client/model/Web3SigningCredential.java | 338 +++ ...eb3SigningCredentialCactusKeychainRef.java | 310 +++ .../model/Web3SigningCredentialNone.java | 214 ++ .../Web3SigningCredentialPrivateKeyHex.java | 278 ++ .../model/Web3SigningCredentialType.java | 77 + .../model/WithdrawCounterpartyRequest.java | 434 ++++ .../client/api/DefaultApiTest.java | 72 + .../model/CounterpartyHTLCRequestTest.java | 91 + .../client/model/HtlcPackageTest.java | 33 + .../client/model/OwnHTLCRequestTest.java | 157 ++ ...igningCredentialCactusKeychainRefTest.java | 73 + .../model/Web3SigningCredentialNoneTest.java | 49 + ...eb3SigningCredentialPrivateKeyHexTest.java | 65 + .../model/Web3SigningCredentialTest.java | 84 + .../model/Web3SigningCredentialTypeTest.java | 33 + .../WithdrawCounterpartyRequestTest.java | 107 + .../package.json | 6 +- .../go-client/.openapi-generator/FILES | 17 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 119 + .../openapi/go-client/api/openapi.yaml | 229 ++ .../openapi/go-client/api_default.go | 350 +++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 231 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../go-client/model_get_object_request_v1.go | 118 + .../go-client/model_get_object_response_v1.go | 146 ++ .../go-client/model_has_object_request_v1.go | 118 + .../go-client/model_has_object_response_v1.go | 174 ++ .../go-client/model_set_object_request_v1.go | 146 ++ .../go-client/model_set_object_response_v1.go | 118 + .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 61 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 44 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 144 ++ .../openapi/java-client/api/openapi.yaml | 236 ++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1566 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 406 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 450 ++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../client/model/GetObjectRequestV1.java | 216 ++ .../client/model/GetObjectResponseV1.java | 248 ++ .../client/model/HasObjectRequestV1.java | 216 ++ .../client/model/HasObjectResponseV1.java | 277 ++ .../client/model/SetObjectRequestV1.java | 248 ++ .../client/model/SetObjectResponseV1.java | 216 ++ .../client/api/DefaultApiTest.java | 75 + .../client/model/GetObjectRequestV1Test.java | 48 + .../client/model/GetObjectResponseV1Test.java | 56 + .../client/model/HasObjectRequestV1Test.java | 48 + .../client/model/HasObjectResponseV1Test.java | 64 + .../client/model/SetObjectRequestV1Test.java | 56 + .../client/model/SetObjectResponseV1Test.java | 48 + openapi-generator-ignore | 3 + package.json | 1 + packages/cactus-cmd-api-server/package.json | 2 + .../go-client/.openapi-generator/FILES | 14 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 116 + .../openapi/go-client/api/openapi.yaml | 129 + .../openapi/go-client/api_default.go | 318 +++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../go-client/model_health_check_response.go | 180 ++ .../openapi/go-client/model_memory_usage.go | 270 ++ .../go-client/model_watch_healthcheck_v1.go | 117 + .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 61 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 38 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 140 + .../openapi/java-client/api/openapi.yaml | 133 + .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 402 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 415 +++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../client/model/HealthCheckResponse.java | 276 ++ .../client/model/MemoryUsage.java | 318 +++ .../client/model/WatchHealthcheckV1.java | 79 + .../client/api/DefaultApiTest.java | 69 + .../client/model/HealthCheckResponseTest.java | 65 + .../client/model/MemoryUsageTest.java | 81 + .../client/model/WatchHealthcheckV1Test.java | 33 + packages/cactus-core-api/package.json | 2 + .../go-client/.openapi-generator/FILES | 41 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 141 + .../openapi/go-client/api/openapi.yaml | 712 +++++ .../go/generated/openapi/go-client/client.go | 653 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../openapi/go-client/model_cactus_node.go | 281 ++ .../go-client/model_cactus_node_all_of.go | 226 ++ .../go-client/model_cactus_node_meta.go | 145 ++ ...algorithm_families_with_out_tx_finality.go | 109 + ...sus_algorithm_families_with_tx_finality.go | 111 + .../model_consensus_algorithm_family.go | 113 + .../openapi/go-client/model_consortium.go | 199 ++ .../go-client/model_consortium_database.go | 230 ++ .../go-client/model_consortium_member.go | 172 ++ .../openapi/go-client/model_constants.go | 109 + .../model_delete_keychain_entry_request_v1.go | 118 + ...model_delete_keychain_entry_response_v1.go | 118 + .../model_get_keychain_entry_request_v1.go | 118 + .../model_get_keychain_entry_response_v1.go | 146 ++ .../go-client/model_get_object_request_v1.go | 118 + .../go-client/model_get_object_response_v1.go | 146 ++ .../model_has_keychain_entry_request_v1.go | 118 + .../model_has_keychain_entry_response_v1.go | 174 ++ .../go-client/model_has_object_request_v1.go | 118 + .../go-client/model_has_object_response_v1.go | 174 ++ .../openapi/go-client/model_jws_general.go | 144 ++ .../openapi/go-client/model_jws_recipient.go | 189 ++ .../openapi/go-client/model_ledger.go | 180 ++ .../openapi/go-client/model_ledger_type.go | 123 + .../openapi/go-client/model_plugin_import.go | 208 ++ .../go-client/model_plugin_import_action.go | 111 + .../go-client/model_plugin_import_type.go | 111 + .../go-client/model_plugin_instance.go | 144 ++ .../model_set_keychain_entry_request_v1.go | 146 ++ .../model_set_keychain_entry_response_v1.go | 118 + .../go-client/model_set_object_request_v1.go | 146 ++ .../go-client/model_set_object_response_v1.go | 118 + .../generated/openapi/go-client/response.go | 47 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 94 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 139 + .../openapi/java-client/api/openapi.yaml | 713 +++++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 425 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../openapitools/client/model/CactusNode.java | 432 ++++ .../client/model/CactusNodeAllOf.java | 368 +++ .../client/model/CactusNodeMeta.java | 248 ++ ...susAlgorithmFamiliesWithOutTxFinality.java | 71 + ...sensusAlgorithmFamiliesWithTxFinality.java | 73 + .../model/ConsensusAlgorithmFamily.java | 75 + .../openapitools/client/model/Consortium.java | 325 +++ .../client/model/ConsortiumDatabase.java | 426 +++ .../client/model/ConsortiumMember.java | 293 +++ .../openapitools/client/model/Constants.java | 71 + .../model/DeleteKeychainEntryRequestV1.java | 216 ++ .../model/DeleteKeychainEntryResponseV1.java | 216 ++ .../model/GetKeychainEntryRequestV1.java | 216 ++ .../model/GetKeychainEntryResponseV1.java | 248 ++ .../client/model/GetObjectRequestV1.java | 216 ++ .../client/model/GetObjectResponseV1.java | 248 ++ .../model/HasKeychainEntryRequestV1.java | 216 ++ .../model/HasKeychainEntryResponseV1.java | 277 ++ .../client/model/HasObjectRequestV1.java | 216 ++ .../client/model/HasObjectResponseV1.java | 277 ++ .../openapitools/client/model/JWSGeneral.java | 266 ++ .../client/model/JWSRecipient.java | 285 ++ .../org/openapitools/client/model/Ledger.java | 277 ++ .../openapitools/client/model/LedgerType.java | 85 + .../client/model/PluginImport.java | 316 +++ .../client/model/PluginImportAction.java | 73 + .../client/model/PluginImportType.java | 73 + .../client/model/PluginInstance.java | 248 ++ .../model/SetKeychainEntryRequestV1.java | 248 ++ .../model/SetKeychainEntryResponseV1.java | 216 ++ .../client/model/SetObjectRequestV1.java | 248 ++ .../client/model/SetObjectResponseV1.java | 216 ++ .../client/model/CactusNodeAllOfTest.java | 82 + .../client/model/CactusNodeMetaTest.java | 56 + .../client/model/CactusNodeTest.java | 98 + ...lgorithmFamiliesWithOutTxFinalityTest.java | 33 + ...usAlgorithmFamiliesWithTxFinalityTest.java | 33 + .../model/ConsensusAlgorithmFamilyTest.java | 33 + .../client/model/ConsortiumDatabaseTest.java | 87 + .../client/model/ConsortiumMemberTest.java | 66 + .../client/model/ConsortiumTest.java | 74 + .../client/model/ConstantsTest.java | 33 + .../DeleteKeychainEntryRequestV1Test.java | 48 + .../DeleteKeychainEntryResponseV1Test.java | 48 + .../model/GetKeychainEntryRequestV1Test.java | 48 + .../model/GetKeychainEntryResponseV1Test.java | 56 + .../client/model/GetObjectRequestV1Test.java | 48 + .../client/model/GetObjectResponseV1Test.java | 56 + .../model/HasKeychainEntryRequestV1Test.java | 48 + .../model/HasKeychainEntryResponseV1Test.java | 64 + .../client/model/HasObjectRequestV1Test.java | 48 + .../client/model/HasObjectResponseV1Test.java | 64 + .../client/model/JWSGeneralTest.java | 59 + .../client/model/JWSRecipientTest.java | 66 + .../openapitools/client/model/LedgerTest.java | 65 + .../client/model/LedgerTypeTest.java | 33 + .../client/model/PluginImportActionTest.java | 33 + .../client/model/PluginImportTest.java | 75 + .../client/model/PluginImportTypeTest.java | 33 + .../client/model/PluginInstanceTest.java | 56 + .../model/SetKeychainEntryRequestV1Test.java | 56 + .../model/SetKeychainEntryResponseV1Test.java | 48 + .../client/model/SetObjectRequestV1Test.java | 56 + .../client/model/SetObjectResponseV1Test.java | 48 + .../package.json | 2 + .../go-client/.openapi-generator/FILES | 15 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 117 + .../openapi/go-client/api/openapi.yaml | 166 ++ .../openapi/go-client/api_default.go | 332 +++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../model_get_consortium_jws_response.go | 117 + .../go-client/model_get_node_jws_response.go | 117 + .../openapi/go-client/model_jws_general.go | 144 ++ .../openapi/go-client/model_jws_recipient.go | 189 ++ .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 61 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 40 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 142 + .../openapi/java-client/api/openapi.yaml | 172 ++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 404 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 426 +++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../model/GetConsortiumJwsResponse.java | 216 ++ .../client/model/GetNodeJwsResponse.java | 216 ++ .../openapitools/client/model/JWSGeneral.java | 266 ++ .../client/model/JWSRecipient.java | 285 ++ .../client/api/DefaultApiTest.java | 72 + .../model/GetConsortiumJwsResponseTest.java | 49 + .../client/model/GetNodeJwsResponseTest.java | 49 + .../client/model/JWSGeneralTest.java | 59 + .../client/model/JWSRecipientTest.java | 66 + .../package.json | 2 + .../go-client/.openapi-generator/FILES | 26 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 131 + .../openapi/go-client/api/openapi.yaml | 575 +++++ .../openapi/go-client/api_default.go | 653 +++++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../model_get_single_status_request.go | 198 ++ .../go-client/model_get_status_request.go | 198 ++ .../go-client/model_initialize_request.go | 236 ++ .../model_invoke_contract_v1_response.go | 190 ++ .../go-client/model_new_contract_request.go | 461 ++++ .../model_new_contract_request_gas.go | 148 ++ .../openapi/go-client/model_refund_request.go | 237 ++ .../model_run_transaction_response.go | 117 + .../model_web3_signing_credential.go | 178 ++ ..._signing_credential_cactus_keychain_ref.go | 201 ++ .../model_web3_signing_credential_none.go | 117 + ...web3_signing_credential_private_key_hex.go | 173 ++ .../model_web3_signing_credential_type.go | 115 + .../model_web3_transaction_receipt.go | 385 +++ .../go-client/model_withdraw_request.go | 265 ++ .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 97 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 62 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 156 ++ .../openapi/java-client/api/openapi.yaml | 588 +++++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 426 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 791 ++++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../client/model/GetSingleStatusRequest.java | 312 +++ .../client/model/GetStatusRequest.java | 325 +++ .../client/model/InitializeRequest.java | 354 +++ .../model/InvokeContractV1Response.java | 282 ++ .../client/model/NewContractRequest.java | 593 +++++ .../client/model/NewContractRequestGas.java | 277 ++ .../client/model/RefundRequest.java | 345 +++ .../client/model/RunTransactionResponse.java | 214 ++ .../client/model/Web3SigningCredential.java | 338 +++ ...eb3SigningCredentialCactusKeychainRef.java | 310 +++ .../model/Web3SigningCredentialNone.java | 214 ++ .../Web3SigningCredentialPrivateKeyHex.java | 278 ++ .../model/Web3SigningCredentialType.java | 77 + .../client/model/Web3TransactionReceipt.java | 547 ++++ .../client/model/WithdrawRequest.java | 377 +++ .../client/api/DefaultApiTest.java | 109 + .../model/GetSingleStatusRequestTest.java | 73 + .../client/model/GetStatusRequestTest.java | 75 + .../client/model/InitializeRequestTest.java | 84 + .../model/InvokeContractV1ResponseTest.java | 66 + .../model/NewContractRequestGasTest.java | 35 + .../client/model/NewContractRequestTest.java | 147 ++ .../client/model/RefundRequestTest.java | 82 + .../model/RunTransactionResponseTest.java | 49 + ...igningCredentialCactusKeychainRefTest.java | 73 + .../model/Web3SigningCredentialNoneTest.java | 49 + ...eb3SigningCredentialPrivateKeyHexTest.java | 65 + .../model/Web3SigningCredentialTest.java | 84 + .../model/Web3SigningCredentialTypeTest.java | 33 + .../model/Web3TransactionReceiptTest.java | 114 + .../client/model/WithdrawRequestTest.java | 90 + .../cactus-plugin-htlc-eth-besu/package.json | 2 + .../go-client/.openapi-generator/FILES | 26 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 131 + .../openapi/go-client/api/openapi.yaml | 547 ++++ .../openapi/go-client/api_default.go | 653 +++++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../model_get_single_status_request.go | 198 ++ .../go-client/model_get_status_request.go | 198 ++ .../go-client/model_initialize_request.go | 236 ++ .../model_invoke_contract_v1_response.go | 190 ++ .../go-client/model_new_contract_obj.go | 444 ++++ .../go-client/model_new_contract_obj_gas.go | 148 ++ .../openapi/go-client/model_refund_req.go | 237 ++ .../model_run_transaction_response.go | 117 + .../model_web3_signing_credential.go | 178 ++ ..._signing_credential_cactus_keychain_ref.go | 201 ++ .../model_web3_signing_credential_none.go | 117 + ...web3_signing_credential_private_key_hex.go | 173 ++ .../model_web3_signing_credential_type.go | 115 + .../model_web3_transaction_receipt.go | 385 +++ .../openapi/go-client/model_withdraw_req.go | 265 ++ .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 97 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 62 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 156 ++ .../openapi/java-client/api/openapi.yaml | 560 ++++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 426 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 791 ++++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../client/model/GetSingleStatusRequest.java | 312 +++ .../client/model/GetStatusRequest.java | 325 +++ .../client/model/InitializeRequest.java | 354 +++ .../model/InvokeContractV1Response.java | 282 ++ .../client/model/NewContractObj.java | 559 ++++ .../client/model/NewContractObjGas.java | 277 ++ .../openapitools/client/model/RefundReq.java | 345 +++ .../client/model/RunTransactionResponse.java | 214 ++ .../client/model/Web3SigningCredential.java | 338 +++ ...eb3SigningCredentialCactusKeychainRef.java | 310 +++ .../model/Web3SigningCredentialNone.java | 214 ++ .../Web3SigningCredentialPrivateKeyHex.java | 278 ++ .../model/Web3SigningCredentialType.java | 77 + .../client/model/Web3TransactionReceipt.java | 547 ++++ .../client/model/WithdrawReq.java | 377 +++ .../client/api/DefaultApiTest.java | 101 + .../model/GetSingleStatusRequestTest.java | 73 + .../client/model/GetStatusRequestTest.java | 75 + .../client/model/InitializeRequestTest.java | 84 + .../model/InvokeContractV1ResponseTest.java | 66 + .../client/model/NewContractObjGasTest.java | 35 + .../client/model/NewContractObjTest.java | 139 + .../client/model/RefundReqTest.java | 82 + .../model/RunTransactionResponseTest.java | 49 + ...igningCredentialCactusKeychainRefTest.java | 73 + .../model/Web3SigningCredentialNoneTest.java | 49 + ...eb3SigningCredentialPrivateKeyHexTest.java | 65 + .../model/Web3SigningCredentialTest.java | 84 + .../model/Web3SigningCredentialTypeTest.java | 33 + .../model/Web3TransactionReceiptTest.java | 114 + .../client/model/WithdrawReqTest.java | 90 + .../package.json | 2 + .../go-client/.openapi-generator/FILES | 19 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 123 + .../openapi/go-client/api/openapi.yaml | 364 +++ .../openapi/go-client/api_default.go | 556 ++++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../model_delete_keychain_entry_request_v1.go | 118 + ...model_delete_keychain_entry_response_v1.go | 118 + .../model_get_keychain_entry_request_v1.go | 118 + .../model_get_keychain_entry_response_v1.go | 146 ++ .../model_has_keychain_entry_request_v1.go | 118 + .../model_has_keychain_entry_response_v1.go | 174 ++ .../model_set_keychain_entry_request_v1.go | 146 ++ .../model_set_keychain_entry_response_v1.go | 118 + .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 85 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 48 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 148 ++ .../openapi/java-client/api/openapi.yaml | 374 +++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 408 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 740 ++++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../model/DeleteKeychainEntryRequestV1.java | 216 ++ .../model/DeleteKeychainEntryResponseV1.java | 216 ++ .../model/GetKeychainEntryRequestV1.java | 216 ++ .../model/GetKeychainEntryResponseV1.java | 248 ++ .../model/HasKeychainEntryRequestV1.java | 216 ++ .../model/HasKeychainEntryResponseV1.java | 277 ++ .../model/SetKeychainEntryRequestV1.java | 248 ++ .../model/SetKeychainEntryResponseV1.java | 216 ++ .../client/api/DefaultApiTest.java | 100 + .../DeleteKeychainEntryRequestV1Test.java | 48 + .../DeleteKeychainEntryResponseV1Test.java | 48 + .../model/GetKeychainEntryRequestV1Test.java | 48 + .../model/GetKeychainEntryResponseV1Test.java | 56 + .../model/HasKeychainEntryRequestV1Test.java | 48 + .../model/HasKeychainEntryResponseV1Test.java | 64 + .../model/SetKeychainEntryRequestV1Test.java | 56 + .../model/SetKeychainEntryResponseV1Test.java | 48 + .../package.json | 2 + .../go-client/.openapi-generator/FILES | 19 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 122 + .../openapi/go-client/api/openapi.yaml | 344 +++ .../openapi/go-client/api_default.go | 459 ++++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../model_delete_keychain_entry_request_v1.go | 118 + ...model_delete_keychain_entry_response_v1.go | 118 + .../model_get_keychain_entry_request_v1.go | 118 + .../model_get_keychain_entry_response_v1.go | 146 ++ .../model_has_keychain_entry_request_v1.go | 118 + .../model_has_keychain_entry_response_v1.go | 174 ++ .../model_set_keychain_entry_request_v1.go | 146 ++ .../model_set_keychain_entry_response_v1.go | 118 + .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 73 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 48 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 147 ++ .../openapi/java-client/api/openapi.yaml | 353 +++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 408 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 627 +++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../model/DeleteKeychainEntryRequestV1.java | 216 ++ .../model/DeleteKeychainEntryResponseV1.java | 216 ++ .../model/GetKeychainEntryRequestV1.java | 216 ++ .../model/GetKeychainEntryResponseV1.java | 248 ++ .../model/HasKeychainEntryRequestV1.java | 216 ++ .../model/HasKeychainEntryResponseV1.java | 277 ++ .../model/SetKeychainEntryRequestV1.java | 248 ++ .../model/SetKeychainEntryResponseV1.java | 216 ++ .../client/api/DefaultApiTest.java | 89 + .../DeleteKeychainEntryRequestV1Test.java | 48 + .../DeleteKeychainEntryResponseV1Test.java | 48 + .../model/GetKeychainEntryRequestV1Test.java | 48 + .../model/GetKeychainEntryResponseV1Test.java | 56 + .../model/HasKeychainEntryRequestV1Test.java | 48 + .../model/HasKeychainEntryResponseV1Test.java | 64 + .../model/SetKeychainEntryRequestV1Test.java | 56 + .../model/SetKeychainEntryResponseV1Test.java | 48 + .../package.json | 2 + .../go-client/.openapi-generator/FILES | 19 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 122 + .../openapi/go-client/api/openapi.yaml | 324 +++ .../openapi/go-client/api_default.go | 459 ++++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../model_delete_keychain_entry_request_v1.go | 118 + ...model_delete_keychain_entry_response_v1.go | 118 + .../model_get_keychain_entry_request_v1.go | 118 + .../model_get_keychain_entry_response_v1.go | 146 ++ .../model_has_keychain_entry_request_v1.go | 118 + .../model_has_keychain_entry_response_v1.go | 174 ++ .../model_set_keychain_entry_request_v1.go | 146 ++ .../model_set_keychain_entry_response_v1.go | 118 + .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 73 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 48 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 147 ++ .../openapi/java-client/api/openapi.yaml | 333 +++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 408 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 615 +++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../model/DeleteKeychainEntryRequestV1.java | 216 ++ .../model/DeleteKeychainEntryResponseV1.java | 216 ++ .../model/GetKeychainEntryRequestV1.java | 216 ++ .../model/GetKeychainEntryResponseV1.java | 248 ++ .../model/HasKeychainEntryRequestV1.java | 216 ++ .../model/HasKeychainEntryResponseV1.java | 277 ++ .../model/SetKeychainEntryRequestV1.java | 248 ++ .../model/SetKeychainEntryResponseV1.java | 216 ++ .../client/api/DefaultApiTest.java | 89 + .../DeleteKeychainEntryRequestV1Test.java | 48 + .../DeleteKeychainEntryResponseV1Test.java | 48 + .../model/GetKeychainEntryRequestV1Test.java | 48 + .../model/GetKeychainEntryResponseV1Test.java | 56 + .../model/HasKeychainEntryRequestV1Test.java | 48 + .../model/HasKeychainEntryResponseV1Test.java | 64 + .../model/SetKeychainEntryRequestV1Test.java | 56 + .../model/SetKeychainEntryResponseV1Test.java | 48 + .../package.json | 2 + .../go-client/.openapi-generator/FILES | 19 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 122 + .../openapi/go-client/api/openapi.yaml | 340 +++ .../openapi/go-client/api_default.go | 459 ++++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../model_delete_keychain_entry_request_v1.go | 118 + ...model_delete_keychain_entry_response_v1.go | 118 + .../model_get_keychain_entry_request_v1.go | 118 + .../model_get_keychain_entry_response_v1.go | 146 ++ .../model_has_keychain_entry_request_v1.go | 118 + .../model_has_keychain_entry_response_v1.go | 174 ++ .../model_set_keychain_entry_request_v1.go | 146 ++ .../model_set_keychain_entry_response_v1.go | 118 + .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 73 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 48 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 147 ++ .../openapi/java-client/api/openapi.yaml | 349 +++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 408 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 627 +++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../model/DeleteKeychainEntryRequestV1.java | 216 ++ .../model/DeleteKeychainEntryResponseV1.java | 216 ++ .../model/GetKeychainEntryRequestV1.java | 216 ++ .../model/GetKeychainEntryResponseV1.java | 248 ++ .../model/HasKeychainEntryRequestV1.java | 216 ++ .../model/HasKeychainEntryResponseV1.java | 277 ++ .../model/SetKeychainEntryRequestV1.java | 248 ++ .../model/SetKeychainEntryResponseV1.java | 216 ++ .../client/api/DefaultApiTest.java | 89 + .../DeleteKeychainEntryRequestV1Test.java | 48 + .../DeleteKeychainEntryResponseV1Test.java | 48 + .../model/GetKeychainEntryRequestV1Test.java | 48 + .../model/GetKeychainEntryResponseV1Test.java | 56 + .../model/HasKeychainEntryRequestV1Test.java | 48 + .../model/HasKeychainEntryResponseV1Test.java | 64 + .../model/SetKeychainEntryRequestV1Test.java | 56 + .../model/SetKeychainEntryResponseV1Test.java | 48 + .../package.json | 2 + .../go-client/.openapi-generator/FILES | 19 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 123 + .../openapi/go-client/api/openapi.yaml | 357 +++ .../openapi/go-client/api_default.go | 556 ++++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../model_delete_keychain_entry_request_v1.go | 118 + ...model_delete_keychain_entry_response_v1.go | 118 + .../model_get_keychain_entry_request_v1.go | 118 + .../model_get_keychain_entry_response_v1.go | 146 ++ .../model_has_keychain_entry_request_v1.go | 118 + .../model_has_keychain_entry_response_v1.go | 174 ++ .../model_set_keychain_entry_request_v1.go | 146 ++ .../model_set_keychain_entry_response_v1.go | 118 + .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 85 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 48 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 148 ++ .../openapi/java-client/api/openapi.yaml | 367 +++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 408 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 740 ++++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../model/DeleteKeychainEntryRequestV1.java | 216 ++ .../model/DeleteKeychainEntryResponseV1.java | 216 ++ .../model/GetKeychainEntryRequestV1.java | 216 ++ .../model/GetKeychainEntryResponseV1.java | 248 ++ .../model/HasKeychainEntryRequestV1.java | 216 ++ .../model/HasKeychainEntryResponseV1.java | 277 ++ .../model/SetKeychainEntryRequestV1.java | 248 ++ .../model/SetKeychainEntryResponseV1.java | 216 ++ .../client/api/DefaultApiTest.java | 100 + .../DeleteKeychainEntryRequestV1Test.java | 48 + .../DeleteKeychainEntryResponseV1Test.java | 48 + .../model/GetKeychainEntryRequestV1Test.java | 48 + .../model/GetKeychainEntryResponseV1Test.java | 56 + .../model/HasKeychainEntryRequestV1Test.java | 48 + .../model/HasKeychainEntryResponseV1Test.java | 64 + .../model/SetKeychainEntryRequestV1Test.java | 56 + .../model/SetKeychainEntryResponseV1Test.java | 48 + .../cactus-plugin-keychain-vault/package.json | 2 + .../go-client/.openapi-generator/FILES | 19 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 123 + .../openapi/go-client/api/openapi.yaml | 310 +++ .../openapi/go-client/api_default.go | 548 ++++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../model_delete_keychain_entry_request_v1.go | 118 + ...model_delete_keychain_entry_response_v1.go | 118 + .../model_get_keychain_entry_request_v1.go | 118 + .../model_get_keychain_entry_response_v1.go | 146 ++ .../model_has_keychain_entry_request_v1.go | 118 + .../model_has_keychain_entry_response_v1.go | 174 ++ .../model_set_keychain_entry_request_v1.go | 146 ++ .../model_set_keychain_entry_response_v1.go | 118 + .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 85 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 48 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 148 ++ .../openapi/java-client/api/openapi.yaml | 320 +++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 408 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 706 +++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../model/DeleteKeychainEntryRequestV1.java | 216 ++ .../model/DeleteKeychainEntryResponseV1.java | 216 ++ .../model/GetKeychainEntryRequestV1.java | 216 ++ .../model/GetKeychainEntryResponseV1.java | 248 ++ .../model/HasKeychainEntryRequestV1.java | 216 ++ .../model/HasKeychainEntryResponseV1.java | 277 ++ .../model/SetKeychainEntryRequestV1.java | 248 ++ .../model/SetKeychainEntryResponseV1.java | 216 ++ .../client/api/DefaultApiTest.java | 100 + .../DeleteKeychainEntryRequestV1Test.java | 48 + .../DeleteKeychainEntryResponseV1Test.java | 48 + .../model/GetKeychainEntryRequestV1Test.java | 48 + .../model/GetKeychainEntryResponseV1Test.java | 56 + .../model/HasKeychainEntryRequestV1Test.java | 48 + .../model/HasKeychainEntryResponseV1Test.java | 64 + .../model/SetKeychainEntryRequestV1Test.java | 56 + .../model/SetKeychainEntryResponseV1Test.java | 48 + .../package.json | 2 + .../go-client/.openapi-generator/FILES | 52 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 162 ++ .../openapi/go-client/api/openapi.yaml | 1228 +++++++++ .../openapi/go-client/api_default.go | 1167 +++++++++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../model_besu_private_transaction_config.go | 144 ++ .../model_besu_transaction_config.go | 410 +++ .../model_besu_transaction_config_to.go | 118 + .../go-client/model_consistency_strategy.go | 182 ++ ...y_contract_solidity_bytecode_v1_request.go | 405 +++ ..._contract_solidity_bytecode_v1_response.go | 117 + .../model_eth_contract_invocation_type.go | 111 + .../openapi/go-client/model_evm_block.go | 739 ++++++ .../openapi/go-client/model_evm_log.go | 306 +++ .../go-client/model_evm_transaction.go | 490 ++++ .../go-client/model_get_balance_v1_request.go | 154 ++ .../model_get_balance_v1_response.go | 117 + .../model_get_besu_record_v1_request.go | 162 ++ .../model_get_besu_record_v1_response.go | 236 ++ .../go-client/model_get_block_v1_request.go | 121 + .../go-client/model_get_block_v1_response.go | 117 + .../model_get_past_logs_v1_request.go | 237 ++ .../model_get_past_logs_v1_response.go | 117 + .../model_get_transaction_v1_request.go | 117 + .../model_get_transaction_v1_response.go | 117 + .../model_invoke_contract_v1_request.go | 559 ++++ .../model_invoke_contract_v1_response.go | 190 ++ .../openapi/go-client/model_receipt_type.go | 111 + .../model_run_transaction_request.go | 207 ++ .../model_run_transaction_response.go | 117 + .../model_sign_transaction_request.go | 172 ++ .../model_sign_transaction_response.go | 118 + .../model_solidity_contract_json_artifact.go | 441 ++++ ...olidity_contract_json_artifact_compiler.go | 188 ++ ...ty_contract_json_artifact_gas_estimates.go | 162 ++ ...ct_json_artifact_gas_estimates_creation.go | 198 ++ .../go-client/model_watch_blocks_v1.go | 117 + .../model_watch_blocks_v1_progress.go | 117 + .../go-client/model_web3_block_header.go | 468 ++++ .../model_web3_block_header_timestamp.go | 148 ++ .../model_web3_signing_credential.go | 178 ++ ..._signing_credential_cactus_keychain_ref.go | 201 ++ .../model_web3_signing_credential_none.go | 117 + ...web3_signing_credential_private_key_hex.go | 173 ++ .../model_web3_signing_credential_type.go | 115 + .../model_web3_transaction_receipt.go | 385 +++ .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 157 ++ .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 114 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 187 ++ .../openapi/java-client/api/openapi.yaml | 1249 +++++++++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 449 ++++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 1390 ++++++++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../model/BesuPrivateTransactionConfig.java | 261 ++ .../client/model/BesuTransactionConfig.java | 506 ++++ .../client/model/BesuTransactionConfigTo.java | 224 ++ .../client/model/ConsistencyStrategy.java | 274 ++ ...ployContractSolidityBytecodeV1Request.java | 522 ++++ ...loyContractSolidityBytecodeV1Response.java | 214 ++ .../model/EthContractInvocationType.java | 73 + .../openapitools/client/model/EvmBlock.java | 747 ++++++ .../org/openapitools/client/model/EvmLog.java | 445 ++++ .../client/model/EvmTransaction.java | 513 ++++ .../client/model/GetBalanceV1Request.java | 256 ++ .../client/model/GetBalanceV1Response.java | 216 ++ .../client/model/GetBesuRecordV1Request.java | 241 ++ .../client/model/GetBesuRecordV1Response.java | 307 +++ .../client/model/GetBlockV1Request.java | 213 ++ .../client/model/GetBlockV1Response.java | 216 ++ .../client/model/GetPastLogsV1Request.java | 315 +++ .../client/model/GetPastLogsV1Response.java | 234 ++ .../client/model/GetTransactionV1Request.java | 216 ++ .../model/GetTransactionV1Response.java | 216 ++ .../client/model/InvokeContractV1Request.java | 645 +++++ .../model/InvokeContractV1Response.java | 282 ++ .../client/model/ReceiptType.java | 73 + .../client/model/RunTransactionRequest.java | 311 +++ .../client/model/RunTransactionResponse.java | 214 ++ .../client/model/SignTransactionRequest.java | 280 ++ .../client/model/SignTransactionResponse.java | 216 ++ .../model/SolidityContractJsonArtifact.java | 502 ++++ .../SolidityContractJsonArtifactCompiler.java | 314 +++ ...idityContractJsonArtifactGasEstimates.java | 248 ++ ...tractJsonArtifactGasEstimatesCreation.java | 270 ++ .../client/model/WatchBlocksV1.java | 79 + .../client/model/WatchBlocksV1Progress.java | 216 ++ .../client/model/Web3BlockHeader.java | 624 +++++ .../model/Web3BlockHeaderTimestamp.java | 277 ++ .../client/model/Web3SigningCredential.java | 338 +++ ...eb3SigningCredentialCactusKeychainRef.java | 310 +++ .../model/Web3SigningCredentialNone.java | 214 ++ .../Web3SigningCredentialPrivateKeyHex.java | 278 ++ .../model/Web3SigningCredentialType.java | 77 + .../client/model/Web3TransactionReceipt.java | 547 ++++ .../client/api/DefaultApiTest.java | 183 ++ .../BesuPrivateTransactionConfigTest.java | 58 + .../model/BesuTransactionConfigTest.java | 107 + .../model/BesuTransactionConfigToTest.java | 34 + .../client/model/ConsistencyStrategyTest.java | 65 + ...ContractSolidityBytecodeV1RequestTest.java | 125 + ...ontractSolidityBytecodeV1ResponseTest.java | 49 + .../model/EthContractInvocationTypeTest.java | 33 + .../client/model/EvmBlockTest.java | 188 ++ .../openapitools/client/model/EvmLogTest.java | 107 + .../client/model/EvmTransactionTest.java | 130 + .../client/model/GetBalanceV1RequestTest.java | 57 + .../model/GetBalanceV1ResponseTest.java | 48 + .../model/GetBesuRecordV1RequestTest.java | 57 + .../model/GetBesuRecordV1ResponseTest.java | 73 + .../client/model/GetBlockV1RequestTest.java | 48 + .../client/model/GetBlockV1ResponseTest.java | 49 + .../model/GetPastLogsV1RequestTest.java | 75 + .../model/GetPastLogsV1ResponseTest.java | 51 + .../model/GetTransactionV1RequestTest.java | 48 + .../model/GetTransactionV1ResponseTest.java | 49 + .../model/InvokeContractV1RequestTest.java | 159 ++ .../model/InvokeContractV1ResponseTest.java | 66 + .../client/model/ReceiptTypeTest.java | 33 + .../model/RunTransactionRequestTest.java | 76 + .../model/RunTransactionResponseTest.java | 49 + .../model/SignTransactionRequestTest.java | 64 + .../model/SignTransactionResponseTest.java | 48 + ...idityContractJsonArtifactCompilerTest.java | 56 + ...tJsonArtifactGasEstimatesCreationTest.java | 64 + ...yContractJsonArtifactGasEstimatesTest.java | 59 + .../SolidityContractJsonArtifactTest.java | 124 + .../model/WatchBlocksV1ProgressTest.java | 49 + .../client/model/WatchBlocksV1Test.java | 33 + .../client/model/Web3BlockHeaderTest.java | 154 ++ .../model/Web3BlockHeaderTimestampTest.java | 35 + ...igningCredentialCactusKeychainRefTest.java | 73 + .../model/Web3SigningCredentialNoneTest.java | 49 + ...eb3SigningCredentialPrivateKeyHexTest.java | 65 + .../model/Web3SigningCredentialTest.java | 84 + .../model/Web3SigningCredentialTypeTest.java | 33 + .../model/Web3TransactionReceiptTest.java | 114 + .../package.json | 2 + .../go-client/.openapi-generator/FILES | 46 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 155 ++ .../openapi/go-client/api/openapi.yaml | 1384 ++++++++++ .../openapi/go-client/api_default.go | 1081 ++++++++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + ...l_clear_monitor_transactions_v1_request.go | 173 ++ ..._clear_monitor_transactions_v1_response.go | 146 ++ .../model_corda_node_ssh_credentials.go | 225 ++ .../go-client/model_corda_rpc_credentials.go | 198 ++ .../go-client/model_corda_x500_name.go | 306 +++ .../model_cordapp_deployment_config.go | 256 ++ .../openapi/go-client/model_cordapp_info.go | 341 +++ ...y_contract_jars_bad_request_v1_response.go | 117 + ...eploy_contract_jars_success_v1_response.go | 117 + .../model_deploy_contract_jars_v1_request.go | 145 ++ .../model_diagnose_node_v1_request.go | 127 + .../model_diagnose_node_v1_response.go | 117 + .../go-client/model_flow_invocation_type.go | 111 + ...del_get_monitor_transactions_v1_request.go | 146 ++ ...el_get_monitor_transactions_v1_response.go | 219 ++ ...nitor_transactions_v1_response_tx_inner.go | 162 ++ .../model_invoke_contract_v1_request.go | 214 ++ .../model_invoke_contract_v1_response.go | 247 ++ .../openapi/go-client/model_jar_file.go | 199 ++ .../openapi/go-client/model_jvm_object.go | 216 ++ .../openapi/go-client/model_jvm_type.go | 190 ++ .../openapi/go-client/model_jvm_type_kind.go | 111 + .../go-client/model_list_flows_v1_request.go | 126 + .../go-client/model_list_flows_v1_response.go | 118 + .../go-client/model_network_host_and_port.go | 144 ++ .../go-client/model_node_diagnostic_info.go | 230 ++ .../openapi/go-client/model_node_info.go | 225 ++ .../openapi/go-client/model_party.go | 144 ++ .../openapi/go-client/model_public_key.go | 171 ++ .../openapi/go-client/model_sha256.go | 171 ++ .../model_start_monitor_v1_request.go | 146 ++ .../model_start_monitor_v1_response.go | 146 ++ .../model_stop_monitor_v1_request.go | 146 ++ .../model_stop_monitor_v1_response.go | 146 ++ .../openapi/go-client/model_x500_principal.go | 145 ++ .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 145 ++ .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 102 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 180 ++ .../openapi/java-client/api/openapi.yaml | 1404 ++++++++++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 433 ++++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 1272 +++++++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../ClearMonitorTransactionsV1Request.java | 293 +++ .../ClearMonitorTransactionsV1Response.java | 245 ++ .../client/model/CordaNodeSshCredentials.java | 343 +++ .../client/model/CordaRpcCredentials.java | 311 +++ .../client/model/CordaX500Name.java | 405 +++ .../client/model/CordappDeploymentConfig.java | 376 +++ .../client/model/CordappInfo.java | 464 ++++ ...eployContractJarsBadRequestV1Response.java | 229 ++ .../DeployContractJarsSuccessV1Response.java | 229 ++ .../model/DeployContractJarsV1Request.java | 278 ++ .../client/model/DiagnoseNodeV1Request.java | 219 ++ .../client/model/DiagnoseNodeV1Response.java | 216 ++ .../client/model/FlowInvocationType.java | 73 + .../GetMonitorTransactionsV1Request.java | 248 ++ .../GetMonitorTransactionsV1Response.java | 329 +++ ...tMonitorTransactionsV1ResponseTxInner.java | 239 ++ .../client/model/InvokeContractV1Request.java | 325 +++ .../model/InvokeContractV1Response.java | 347 +++ .../openapitools/client/model/JarFile.java | 352 +++ .../openapitools/client/model/JvmObject.java | 326 +++ .../openapitools/client/model/JvmType.java | 280 ++ .../client/model/JvmTypeKind.java | 73 + .../client/model/ListFlowsV1Request.java | 208 ++ .../client/model/ListFlowsV1Response.java | 229 ++ .../client/model/NetworkHostAndPort.java | 246 ++ .../client/model/NodeDiagnosticInfo.java | 359 +++ .../openapitools/client/model/NodeInfo.java | 384 +++ .../org/openapitools/client/model/Party.java | 248 ++ .../openapitools/client/model/PublicKey.java | 280 ++ .../org/openapitools/client/model/SHA256.java | 274 ++ .../client/model/StartMonitorV1Request.java | 248 ++ .../client/model/StartMonitorV1Response.java | 245 ++ .../client/model/StopMonitorV1Request.java | 248 ++ .../client/model/StopMonitorV1Response.java | 245 ++ .../client/model/X500Principal.java | 248 ++ .../client/api/DefaultApiTest.java | 170 ++ ...ClearMonitorTransactionsV1RequestTest.java | 66 + ...learMonitorTransactionsV1ResponseTest.java | 56 + .../model/CordaNodeSshCredentialsTest.java | 80 + .../client/model/CordaRpcCredentialsTest.java | 72 + .../client/model/CordaX500NameTest.java | 97 + .../model/CordappDeploymentConfigTest.java | 90 + .../client/model/CordappInfoTest.java | 113 + ...yContractJarsBadRequestV1ResponseTest.java | 50 + ...ployContractJarsSuccessV1ResponseTest.java | 50 + .../DeployContractJarsV1RequestTest.java | 60 + .../model/DiagnoseNodeV1RequestTest.java | 50 + .../model/DiagnoseNodeV1ResponseTest.java | 49 + .../client/model/FlowInvocationTypeTest.java | 33 + .../GetMonitorTransactionsV1RequestTest.java | 56 + .../GetMonitorTransactionsV1ResponseTest.java | 75 + ...itorTransactionsV1ResponseTxInnerTest.java | 56 + .../model/InvokeContractV1RequestTest.java | 76 + .../model/InvokeContractV1ResponseTest.java | 82 + .../client/model/JarFileTest.java | 64 + .../client/model/JvmObjectTest.java | 76 + .../client/model/JvmTypeKindTest.java | 33 + .../client/model/JvmTypeTest.java | 65 + .../client/model/ListFlowsV1RequestTest.java | 48 + .../client/model/ListFlowsV1ResponseTest.java | 50 + .../client/model/NetworkHostAndPortTest.java | 57 + .../client/model/NodeDiagnosticInfoTest.java | 83 + .../client/model/NodeInfoTest.java | 85 + .../openapitools/client/model/PartyTest.java | 58 + .../client/model/PublicKeyTest.java | 64 + .../openapitools/client/model/SHA256Test.java | 64 + .../model/StartMonitorV1RequestTest.java | 56 + .../model/StartMonitorV1ResponseTest.java | 56 + .../model/StopMonitorV1RequestTest.java | 56 + .../model/StopMonitorV1ResponseTest.java | 56 + .../client/model/X500PrincipalTest.java | 56 + .../package.json | 2 + .../go-client/.openapi-generator/FILES | 47 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 152 ++ .../openapi/go-client/api/openapi.yaml | 1003 ++++++++ .../openapi/go-client/api_default.go | 695 +++++ .../go/generated/openapi/go-client/client.go | 655 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../openapi/go-client/model_contract_json.go | 570 ++++ .../model_contract_json_definition.go | 117 + .../model_contract_keychain_definition.go | 146 ++ .../model_deploy_contract_v1_request.go | 254 ++ ...del_deploy_contract_v1_request_contract.go | 148 ++ ...model_deployed_contract_json_definition.go | 144 ++ .../model_error_exception_response_v1.go | 146 ++ .../model_eth_contract_invocation_type.go | 111 + ...del_eth_contract_invocation_web3_method.go | 115 + .../model_ethereum_transaction_config.go | 342 +++ .../go-client/model_gas_transaction_config.go | 148 ++ .../model_gas_transaction_config_eip1559.go | 201 ++ .../model_gas_transaction_config_legacy.go | 164 ++ .../model_invoke_contract_v1_request.go | 349 +++ ...del_invoke_contract_v1_request_contract.go | 148 ++ .../model_invoke_contract_v1_response.go | 190 ++ ...invoke_raw_web3_eth_contract_v1_request.go | 279 ++ ...nvoke_raw_web3_eth_contract_v1_response.go | 193 ++ ...l_invoke_raw_web3_eth_method_v1_request.go | 155 ++ ..._invoke_raw_web3_eth_method_v1_response.go | 193 ++ .../model_run_transaction_request.go | 185 ++ .../model_run_transaction_response.go | 117 + .../go-client/model_watch_blocks_v1.go | 117 + .../model_watch_blocks_v1_block_data.go | 720 ++++++ ...el_watch_blocks_v1_block_data_timestamp.go | 148 ++ .../model_watch_blocks_v1_options.go | 126 + .../model_watch_blocks_v1_progress.go | 162 ++ .../go-client/model_web3_block_header.go | 603 +++++ .../model_web3_signing_credential.go | 208 ++ ...3_signing_credential_cacti_keychain_ref.go | 210 ++ ...gning_credential_geth_keychain_password.go | 173 ++ .../model_web3_signing_credential_none.go | 117 + ...web3_signing_credential_private_key_hex.go | 173 ++ .../model_web3_signing_credential_type.go | 115 + .../go-client/model_web3_transaction.go | 549 ++++ .../model_web3_transaction_receipt.go | 681 +++++ .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 97 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 104 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 176 ++ .../openapi/java-client/api/openapi.yaml | 1015 ++++++++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1546 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 39 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 445 ++++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 810 ++++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../client/model/ContractJSON.java | 669 +++++ .../client/model/ContractJsonDefinition.java | 211 ++ .../model/ContractKeychainDefinition.java | 246 ++ .../client/model/DeployContractV1Request.java | 355 +++ .../DeployContractV1RequestContract.java | 285 ++ .../model/DeployedContractJsonDefinition.java | 244 ++ .../model/ErrorExceptionResponseV1.java | 246 ++ .../model/EthContractInvocationType.java | 73 + .../EthContractInvocationWeb3Method.java | 77 + .../model/EthereumTransactionConfig.java | 399 +++ .../client/model/GasTransactionConfig.java | 284 ++ .../model/GasTransactionConfigEIP1559.java | 269 ++ .../model/GasTransactionConfigLegacy.java | 237 ++ .../client/model/InvokeContractV1Request.java | 451 ++++ .../InvokeContractV1RequestContract.java | 285 ++ .../model/InvokeContractV1Response.java | 281 ++ .../InvokeRawWeb3EthContractV1Request.java | 379 +++ .../InvokeRawWeb3EthContractV1Response.java | 284 ++ .../InvokeRawWeb3EthMethodV1Request.java | 256 ++ .../InvokeRawWeb3EthMethodV1Response.java | 284 ++ .../client/model/RunTransactionRequest.java | 277 ++ .../client/model/RunTransactionResponse.java | 211 ++ .../client/model/WatchBlocksV1.java | 79 + .../client/model/WatchBlocksV1BlockData.java | 889 +++++++ .../WatchBlocksV1BlockDataTimestamp.java | 277 ++ .../client/model/WatchBlocksV1Options.java | 202 ++ .../client/model/WatchBlocksV1Progress.java | 241 ++ .../client/model/Web3BlockHeader.java | 663 +++++ .../client/model/Web3SigningCredential.java | 391 +++ ...Web3SigningCredentialCactiKeychainRef.java | 309 +++ ...SigningCredentialGethKeychainPassword.java | 277 ++ .../model/Web3SigningCredentialNone.java | 211 ++ .../Web3SigningCredentialPrivateKeyHex.java | 277 ++ .../model/Web3SigningCredentialType.java | 77 + .../client/model/Web3Transaction.java | 705 +++++ .../client/model/Web3TransactionReceipt.java | 827 ++++++ .../client/api/DefaultApiTest.java | 114 + .../client/model/ContractJSONTest.java | 146 ++ .../model/ContractJsonDefinitionTest.java | 49 + .../model/ContractKeychainDefinitionTest.java | 56 + .../DeployContractV1RequestContractTest.java | 67 + .../model/DeployContractV1RequestTest.java | 85 + .../DeployedContractJsonDefinitionTest.java | 57 + .../model/ErrorExceptionResponseV1Test.java | 56 + .../model/EthContractInvocationTypeTest.java | 33 + .../EthContractInvocationWeb3MethodTest.java | 33 + .../model/EthereumTransactionConfigTest.java | 97 + .../GasTransactionConfigEIP1559Test.java | 64 + .../model/GasTransactionConfigLegacyTest.java | 56 + .../model/GasTransactionConfigTest.java | 82 + .../InvokeContractV1RequestContractTest.java | 75 + .../model/InvokeContractV1RequestTest.java | 111 + .../model/InvokeContractV1ResponseTest.java | 66 + ...InvokeRawWeb3EthContractV1RequestTest.java | 91 + ...nvokeRawWeb3EthContractV1ResponseTest.java | 66 + .../InvokeRawWeb3EthMethodV1RequestTest.java | 58 + .../InvokeRawWeb3EthMethodV1ResponseTest.java | 66 + .../model/RunTransactionRequestTest.java | 67 + .../model/RunTransactionResponseTest.java | 49 + .../model/WatchBlocksV1BlockDataTest.java | 212 ++ .../WatchBlocksV1BlockDataTimestampTest.java | 35 + .../model/WatchBlocksV1OptionsTest.java | 48 + .../model/WatchBlocksV1ProgressTest.java | 58 + .../client/model/WatchBlocksV1Test.java | 33 + .../client/model/Web3BlockHeaderTest.java | 160 ++ ...SigningCredentialCactiKeychainRefTest.java | 73 + ...ingCredentialGethKeychainPasswordTest.java | 65 + .../model/Web3SigningCredentialNoneTest.java | 49 + ...eb3SigningCredentialPrivateKeyHexTest.java | 65 + .../model/Web3SigningCredentialTest.java | 85 + .../model/Web3SigningCredentialTypeTest.java | 33 + .../model/Web3TransactionReceiptTest.java | 179 ++ .../client/model/Web3TransactionTest.java | 168 ++ .../package.json | 2 + .../go-client/.openapi-generator/FILES | 62 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 168 ++ .../openapi/go-client/api/openapi.yaml | 1808 +++++++++++++ .../openapi/go-client/api_default.go | 815 ++++++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../model_chain_code_language_runtime.go | 113 + ...chain_code_life_cycle_command_responses.go | 315 +++ .../model_chain_code_programming_language.go | 115 + .../go-client/model_connection_profile.go | 448 ++++ .../model_connection_profile_client.go | 126 + .../model_default_event_handler_strategy.go | 115 + ...ploy_contract_go_source_v1_501_response.go | 126 + ...el_deploy_contract_go_source_v1_request.go | 474 ++++ ...t_go_source_v1_request_constructor_args.go | 126 + ...l_deploy_contract_go_source_v1_response.go | 171 ++ .../model_deploy_contract_v1_request.go | 540 ++++ .../model_deploy_contract_v1_response.go | 171 ++ .../model_deployment_target_org_fabric2x.go | 267 ++ .../model_deployment_target_organization.go | 230 ++ .../model_error_exception_response_v1.go | 144 ++ .../model_fabric_contract_invocation_type.go | 113 + .../model_fabric_signing_credential.go | 252 ++ .../model_fabric_signing_credential_type.go | 113 + .../openapi/go-client/model_file_base64.go | 183 ++ .../model_gateway_discovery_options.go | 162 ++ .../model_gateway_event_handler_options.go | 189 ++ .../go-client/model_gateway_options.go | 252 ++ .../go-client/model_gateway_options_wallet.go | 162 ++ .../go-client/model_get_block_request_v1.go | 250 ++ .../model_get_block_request_v1_query.go | 200 ++ ...l_get_block_request_v1_query_block_hash.go | 155 ++ .../model_get_block_response_decoded_v1.go | 122 + .../model_get_block_response_encoded_v1.go | 117 + .../go-client/model_get_block_response_v1.go | 148 ++ .../model_get_transaction_receipt_response.go | 450 ++++ ..._run_delegated_sign_transaction_request.go | 464 ++++ .../model_run_transaction_request.go | 435 ++++ .../model_run_transaction_response.go | 144 ++ .../model_run_transaction_response_type.go | 111 + .../model_ssh_exec_command_response.go | 202 ++ .../model_transact_receipt_block_meta_data.go | 198 ++ ...el_transact_receipt_transaction_creator.go | 162 ++ ...ransact_receipt_transaction_endorsement.go | 198 ++ .../go-client/model_vault_transit_key.go | 146 ++ ...l_watch_blocks_cactus_error_response_v1.go | 146 ++ ...tch_blocks_cactus_transactions_event_v1.go | 202 ++ ..._blocks_cactus_transactions_response_v1.go | 118 + ..._watch_blocks_delegated_sign_options_v1.go | 273 ++ ...model_watch_blocks_filtered_response_v1.go | 122 + .../model_watch_blocks_full_response_v1.go | 122 + .../model_watch_blocks_listener_type_v1.go | 115 + .../model_watch_blocks_options_v1.go | 209 ++ .../model_watch_blocks_private_response_v1.go | 122 + .../model_watch_blocks_response_v1.go | 238 ++ .../go-client/model_watch_blocks_v1.go | 119 + .../openapi/go-client/model_web_socket_key.go | 146 ++ .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 109 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 134 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 193 ++ .../openapi/java-client/api/openapi.yaml | 1822 +++++++++++++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 443 ++++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 949 +++++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../model/ChainCodeLanguageRuntime.java | 75 + .../ChainCodeLifeCycleCommandResponses.java | 456 ++++ .../model/ChainCodeProgrammingLanguage.java | 77 + .../client/model/ConnectionProfile.java | 602 +++++ .../client/model/ConnectionProfileClient.java | 208 ++ .../model/DefaultEventHandlerStrategy.java | 77 + .../DeployContractGoSourceV1501Response.java | 208 ++ .../DeployContractGoSourceV1Request.java | 613 +++++ ...tractGoSourceV1RequestConstructorArgs.java | 219 ++ .../DeployContractGoSourceV1Response.java | 294 +++ .../client/model/DeployContractV1Request.java | 689 +++++ .../model/DeployContractV1Response.java | 290 +++ .../model/DeploymentTargetOrgFabric2x.java | 375 +++ .../model/DeploymentTargetOrganization.java | 344 +++ .../model/ErrorExceptionResponseV1.java | 248 ++ .../model/FabricContractInvocationType.java | 75 + .../client/model/FabricSigningCredential.java | 343 +++ .../model/FabricSigningCredentialType.java | 75 + .../openapitools/client/model/FileBase64.java | 279 ++ .../client/model/GatewayDiscoveryOptions.java | 233 ++ .../model/GatewayEventHandlerOptions.java | 271 ++ .../client/model/GatewayOptions.java | 343 +++ .../client/model/GatewayOptionsWallet.java | 241 ++ .../client/model/GetBlockRequestV1.java | 339 +++ .../client/model/GetBlockRequestV1Query.java | 272 ++ .../GetBlockRequestV1QueryBlockHash.java | 247 ++ .../model/GetBlockResponseDecodedV1.java | 213 ++ .../model/GetBlockResponseEncodedV1.java | 216 ++ .../client/model/GetBlockResponseV1.java | 284 ++ .../model/GetTransactionReceiptResponse.java | 513 ++++ .../RunDelegatedSignTransactionRequest.java | 596 +++++ .../client/model/RunTransactionRequest.java | 569 ++++ .../client/model/RunTransactionResponse.java | 248 ++ .../model/RunTransactionResponseType.java | 73 + .../client/model/SSHExecCommandResponse.java | 309 +++ .../model/TransactReceiptBlockMetaData.java | 270 ++ .../TransactReceiptTransactionCreator.java | 239 ++ ...TransactReceiptTransactionEndorsement.java | 270 ++ .../client/model/VaultTransitKey.java | 248 ++ .../WatchBlocksCactusErrorResponseV1.java | 246 ++ .../WatchBlocksCactusTransactionsEventV1.java | 325 +++ ...tchBlocksCactusTransactionsResponseV1.java | 234 ++ .../WatchBlocksDelegatedSignOptionsV1.java | 381 +++ .../model/WatchBlocksFilteredResponseV1.java | 213 ++ .../model/WatchBlocksFullResponseV1.java | 213 ++ .../model/WatchBlocksListenerTypeV1.java | 77 + .../client/model/WatchBlocksOptionsV1.java | 309 +++ .../model/WatchBlocksPrivateResponseV1.java | 213 ++ .../client/model/WatchBlocksResponseV1.java | 447 ++++ .../client/model/WatchBlocksV1.java | 81 + .../client/model/WebSocketKey.java | 248 ++ .../client/api/DefaultApiTest.java | 134 + .../model/ChainCodeLanguageRuntimeTest.java | 33 + ...hainCodeLifeCycleCommandResponsesTest.java | 99 + .../ChainCodeProgrammingLanguageTest.java | 33 + .../model/ConnectionProfileClientTest.java | 48 + .../client/model/ConnectionProfileTest.java | 123 + .../DefaultEventHandlerStrategyTest.java | 33 + ...ployContractGoSourceV1501ResponseTest.java | 48 + ...tGoSourceV1RequestConstructorArgsTest.java | 50 + .../DeployContractGoSourceV1RequestTest.java | 142 + .../DeployContractGoSourceV1ResponseTest.java | 67 + .../model/DeployContractV1RequestTest.java | 167 ++ .../model/DeployContractV1ResponseTest.java | 67 + .../DeploymentTargetOrgFabric2xTest.java | 88 + .../DeploymentTargetOrganizationTest.java | 80 + .../model/ErrorExceptionResponseV1Test.java | 56 + .../FabricContractInvocationTypeTest.java | 33 + .../model/FabricSigningCredentialTest.java | 83 + .../FabricSigningCredentialTypeTest.java | 33 + .../client/model/FileBase64Test.java | 64 + .../model/GatewayDiscoveryOptionsTest.java | 56 + .../model/GatewayEventHandlerOptionsTest.java | 66 + .../client/model/GatewayOptionsTest.java | 84 + .../model/GatewayOptionsWalletTest.java | 57 + .../GetBlockRequestV1QueryBlockHashTest.java | 56 + .../model/GetBlockRequestV1QueryTest.java | 65 + .../client/model/GetBlockRequestV1Test.java | 82 + .../model/GetBlockResponseDecodedV1Test.java | 48 + .../model/GetBlockResponseEncodedV1Test.java | 48 + .../client/model/GetBlockResponseV1Test.java | 58 + .../GetTransactionReceiptResponseTest.java | 125 + ...unDelegatedSignTransactionRequestTest.java | 141 + .../model/RunTransactionRequestTest.java | 135 + .../model/RunTransactionResponseTest.java | 56 + .../model/RunTransactionResponseTypeTest.java | 33 + .../model/SSHExecCommandResponseTest.java | 72 + .../TransactReceiptBlockMetaDataTest.java | 64 + ...TransactReceiptTransactionCreatorTest.java | 56 + ...sactReceiptTransactionEndorsementTest.java | 64 + .../client/model/VaultTransitKeyTest.java | 56 + .../WatchBlocksCactusErrorResponseV1Test.java | 57 + ...chBlocksCactusTransactionsEventV1Test.java | 74 + ...locksCactusTransactionsResponseV1Test.java | 51 + ...WatchBlocksDelegatedSignOptionsV1Test.java | 90 + .../WatchBlocksFilteredResponseV1Test.java | 48 + .../model/WatchBlocksFullResponseV1Test.java | 48 + .../model/WatchBlocksListenerTypeV1Test.java | 33 + .../model/WatchBlocksOptionsV1Test.java | 74 + .../WatchBlocksPrivateResponseV1Test.java | 48 + .../model/WatchBlocksResponseV1Test.java | 97 + .../client/model/WatchBlocksV1Test.java | 33 + .../client/model/WebSocketKeyTest.java | 56 + .../package.json | 2 + .../go-client/.openapi-generator/FILES | 59 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 161 ++ .../openapi/go-client/api/openapi.yaml | 897 +++++++ .../openapi/go-client/api_default.go | 383 +++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + ...l_add_asset_quantity_request_parameters.go | 144 ++ .../model_add_peer_request_parameters.go | 216 ++ .../model_add_signatory_request_parameters.go | 144 ++ .../model_append_role_request_parameters.go | 144 ++ .../model_call_engine_request_parameters.go | 171 ++ ...d_set_account_detail_request_parameters.go | 234 ++ ...model_create_account_request_parameters.go | 171 ++ .../model_create_asset_request_parameters.go | 171 ++ .../model_create_domain_request_parameters.go | 144 ++ .../model_create_role_request_parameters.go | 144 ++ .../model_detach_role_request_parameters.go | 144 ++ .../model_error_exception_json_response_v1.go | 261 ++ .../model_error_exception_response_v1.go | 144 ++ .../model_generate_transaction_request_v1.go | 215 ++ ...t_asset_transactions_request_parameters.go | 198 ++ ...l_get_account_assets_request_parameters.go | 180 ++ ...l_get_account_detail_request_parameters.go | 279 ++ .../model_get_account_request_parameters.go | 117 + ...account_transactions_request_parameters.go | 315 +++ ...model_get_asset_info_request_parameters.go | 117 + .../model_get_block_request_parameters.go | 117 + ..._get_engine_receipts_request_parameters.go | 117 + ...pending_transactions_request_parameters.go | 225 ++ ...get_role_permissions_request_parameters.go | 117 + ...odel_get_signatories_request_parameters.go | 117 + ...del_get_transactions_request_parameters.go | 117 + ...del_grant_permission_request_parameters.go | 144 ++ .../go-client/model_iroha_base_config.go | 422 +++ .../go-client/model_iroha_block_progress.go | 117 + .../go-client/model_iroha_block_response.go | 144 ++ .../model_iroha_block_response_payload.go | 252 ++ .../openapi/go-client/model_iroha_command.go | 147 ++ .../openapi/go-client/model_iroha_query.go | 137 + .../model_iroha_socket_io_transact_v1.go | 111 + .../openapi/go-client/model_key_pair.go | 146 ++ .../model_remove_peer_request_parameters.go | 117 + ...del_remove_signatory_request_parameters.go | 144 ++ ...el_revoke_permission_request_parameters.go | 144 ++ .../model_run_transaction_request_v1.go | 171 ++ .../model_run_transaction_request_v1_body.go | 148 ++ ...model_run_transaction_request_v1_params.go | 1048 ++++++++ .../model_run_transaction_response.go | 121 + ...model_run_transaction_signed_request_v1.go | 154 ++ ...l_set_account_detail_request_parameters.go | 171 ++ ...l_set_account_quorum_request_parameters.go | 144 ++ ...tract_asset_quantity_request_parameters.go | 144 ++ ...model_transfer_asset_request_parameters.go | 225 ++ .../go-client/model_watch_blocks_v1.go | 117 + .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 61 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 128 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 186 ++ .../openapi/java-client/api/openapi.yaml | 903 +++++++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 444 ++++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 450 ++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../AddAssetQuantityRequestParameters.java | 246 ++ .../model/AddPeerRequestParameters.java | 307 +++ .../model/AddSignatoryRequestParameters.java | 248 ++ .../model/AppendRoleRequestParameters.java | 248 ++ .../model/CallEngineRequestParameters.java | 280 ++ ...eAndSetAccountDetailRequestParameters.java | 340 +++ .../model/CreateAccountRequestParameters.java | 280 ++ .../model/CreateAssetRequestParameters.java | 277 ++ .../model/CreateDomainRequestParameters.java | 248 ++ .../model/CreateRoleRequestParameters.java | 262 ++ .../model/DetachRoleRequestParameters.java | 248 ++ .../model/ErrorExceptionJsonResponseV1.java | 340 +++ .../model/ErrorExceptionResponseV1.java | 248 ++ .../model/GenerateTransactionRequestV1.java | 304 +++ ...untAssetTransactionsRequestParameters.java | 309 +++ .../GetAccountAssetsRequestParameters.java | 277 ++ .../GetAccountDetailRequestParameters.java | 370 +++ .../model/GetAccountRequestParameters.java | 216 ++ ...tAccountTransactionsRequestParameters.java | 389 +++ .../model/GetAssetInfoRequestParameters.java | 216 ++ .../model/GetBlockRequestParameters.java | 213 ++ .../GetEngineReceiptsRequestParameters.java | 216 ++ ...tPendingTransactionsRequestParameters.java | 300 +++ .../GetRolePermissionsRequestParameters.java | 216 ++ .../GetSignatoriesRequestParameters.java | 216 ++ .../GetTransactionsRequestParameters.java | 229 ++ .../GrantPermissionRequestParameters.java | 248 ++ .../client/model/IrohaBaseConfig.java | 509 ++++ .../client/model/IrohaBlockProgress.java | 216 ++ .../client/model/IrohaBlockResponse.java | 261 ++ .../model/IrohaBlockResponsePayload.java | 392 +++ .../client/model/IrohaCommand.java | 169 ++ .../openapitools/client/model/IrohaQuery.java | 144 ++ .../client/model/IrohaSocketIOTransactV1.java | 73 + .../openapitools/client/model/KeyPair.java | 248 ++ .../model/RemovePeerRequestParameters.java | 216 ++ .../RemoveSignatoryRequestParameters.java | 248 ++ .../RevokePermissionRequestParameters.java | 246 ++ .../client/model/RunTransactionRequestV1.java | 278 ++ .../model/RunTransactionRequestV1Body.java | 286 +++ .../model/RunTransactionRequestV1Params.java | 1876 ++++++++++++++ .../client/model/RunTransactionResponse.java | 213 ++ .../model/RunTransactionSignedRequestV1.java | 245 ++ .../SetAccountDetailRequestParameters.java | 280 ++ .../SetAccountQuorumRequestParameters.java | 245 ++ ...ubtractAssetQuantityRequestParameters.java | 246 ++ .../model/TransferAssetRequestParameters.java | 342 +++ .../client/model/WatchBlocksV1.java | 79 + .../client/api/DefaultApiTest.java | 73 + ...AddAssetQuantityRequestParametersTest.java | 57 + .../model/AddPeerRequestParametersTest.java | 72 + .../AddSignatoryRequestParametersTest.java | 56 + .../AppendRoleRequestParametersTest.java | 56 + .../CallEngineRequestParametersTest.java | 64 + ...SetAccountDetailRequestParametersTest.java | 80 + .../CreateAccountRequestParametersTest.java | 64 + .../CreateAssetRequestParametersTest.java | 64 + .../CreateDomainRequestParametersTest.java | 56 + .../CreateRoleRequestParametersTest.java | 59 + .../DetachRoleRequestParametersTest.java | 56 + .../ErrorExceptionJsonResponseV1Test.java | 80 + .../model/ErrorExceptionResponseV1Test.java | 56 + .../GenerateTransactionRequestV1Test.java | 74 + ...ssetTransactionsRequestParametersTest.java | 72 + ...GetAccountAssetsRequestParametersTest.java | 65 + ...GetAccountDetailRequestParametersTest.java | 88 + .../GetAccountRequestParametersTest.java | 48 + ...ountTransactionsRequestParametersTest.java | 96 + .../GetAssetInfoRequestParametersTest.java | 48 + .../model/GetBlockRequestParametersTest.java | 48 + ...etEngineReceiptsRequestParametersTest.java | 48 + ...dingTransactionsRequestParametersTest.java | 72 + ...tRolePermissionsRequestParametersTest.java | 48 + .../GetSignatoriesRequestParametersTest.java | 48 + .../GetTransactionsRequestParametersTest.java | 50 + .../GrantPermissionRequestParametersTest.java | 56 + .../client/model/IrohaBaseConfigTest.java | 108 + .../client/model/IrohaBlockProgressTest.java | 49 + .../model/IrohaBlockResponsePayloadTest.java | 91 + .../client/model/IrohaBlockResponseTest.java | 59 + .../client/model/IrohaCommandTest.java | 33 + .../client/model/IrohaQueryTest.java | 33 + .../model/IrohaSocketIOTransactV1Test.java | 33 + .../client/model/KeyPairTest.java | 56 + .../RemovePeerRequestParametersTest.java | 48 + .../RemoveSignatoryRequestParametersTest.java | 56 + ...RevokePermissionRequestParametersTest.java | 57 + .../RunTransactionRequestV1BodyTest.java | 76 + .../RunTransactionRequestV1ParamsTest.java | 402 +++ .../model/RunTransactionRequestV1Test.java | 66 + .../model/RunTransactionResponseTest.java | 48 + .../RunTransactionSignedRequestV1Test.java | 57 + ...SetAccountDetailRequestParametersTest.java | 64 + ...SetAccountQuorumRequestParametersTest.java | 56 + ...actAssetQuantityRequestParametersTest.java | 57 + .../TransferAssetRequestParametersTest.java | 81 + .../client/model/WatchBlocksV1Test.java | 33 + .../package.json | 4 +- .../go-client/.openapi-generator/FILES | 40 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 142 + .../openapi/go-client/api/openapi.yaml | 585 +++++ .../openapi/go-client/api_default.go | 368 +++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../openapi/go-client/model_block_type_v1.go | 111 + .../model_error_exception_response_v1.go | 146 ++ .../model_generate_transaction_request_v1.go | 153 ++ ...generate_transaction_request_v1_request.go | 148 ++ .../go-client/model_iroha2_account_id.go | 144 ++ .../go-client/model_iroha2_base_config.go | 189 ++ ...l_iroha2_base_config_signing_credential.go | 148 ++ .../model_iroha2_base_config_torii.go | 162 ++ .../go-client/model_iroha2_key_json.go | 144 ++ .../go-client/model_iroha2_key_pair.go | 144 ++ .../go-client/model_iroha_instruction.go | 121 + .../model_iroha_instruction_request_v1.go | 146 ++ .../openapi/go-client/model_iroha_query.go | 131 + .../model_iroha_query_definition_v1.go | 155 ++ .../model_iroha_signed_query_definition_v1.go | 146 ++ .../model_iroha_transaction_definition_v1.go | 153 ++ ...a_transaction_definition_v1_instruction.go | 148 ++ .../model_iroha_transaction_parameters_v1.go | 228 ++ .../go-client/model_keychain_reference.go | 146 ++ .../go-client/model_query_request_v1.go | 198 ++ .../go-client/model_query_response_v1.go | 122 + .../go-client/model_transact_request_v1.go | 240 ++ .../go-client/model_transact_response_v1.go | 182 ++ .../go-client/model_transaction_status_v1.go | 113 + .../model_watch_blocks_binary_response_v1.go | 117 + .../model_watch_blocks_options_v1.go | 199 ++ .../model_watch_blocks_raw_response_v1.go | 117 + .../model_watch_blocks_response_v1.go | 178 ++ .../go-client/model_watch_blocks_v1.go | 117 + .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 61 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 90 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 167 ++ .../openapi/java-client/api/openapi.yaml | 592 +++++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 424 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 448 ++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../client/model/BlockTypeV1.java | 79 + .../model/ErrorExceptionResponseV1.java | 248 ++ .../model/GenerateTransactionRequestV1.java | 249 ++ .../GenerateTransactionRequestV1Request.java | 288 +++ .../client/model/Iroha2AccountId.java | 248 ++ .../client/model/Iroha2BaseConfig.java | 282 ++ .../Iroha2BaseConfigSigningCredential.java | 285 ++ .../client/model/Iroha2BaseConfigTorii.java | 239 ++ .../client/model/Iroha2KeyJson.java | 248 ++ .../client/model/Iroha2KeyPair.java | 248 ++ .../client/model/IrohaInstruction.java | 104 + .../model/IrohaInstructionRequestV1.java | 259 ++ .../openapitools/client/model/IrohaQuery.java | 129 + .../client/model/IrohaQueryDefinitionV1.java | 256 ++ .../model/IrohaSignedQueryDefinitionV1.java | 246 ++ .../model/IrohaTransactionDefinitionV1.java | 245 ++ ...ohaTransactionDefinitionV1Instruction.java | 286 +++ .../model/IrohaTransactionParametersV1.java | 343 +++ .../client/model/KeychainReference.java | 248 ++ .../client/model/QueryRequestV1.java | 276 ++ .../client/model/QueryResponseV1.java | 213 ++ .../client/model/TransactRequestV1.java | 302 +++ .../client/model/TransactResponseV1.java | 277 ++ .../client/model/TransactionStatusV1.java | 84 + .../model/WatchBlocksBinaryResponseV1.java | 216 ++ .../client/model/WatchBlocksOptionsV1.java | 270 ++ .../model/WatchBlocksRawResponseV1.java | 216 ++ .../client/model/WatchBlocksResponseV1.java | 337 +++ .../client/model/WatchBlocksV1.java | 79 + .../client/api/DefaultApiTest.java | 75 + .../client/model/BlockTypeV1Test.java | 33 + .../model/ErrorExceptionResponseV1Test.java | 56 + ...nerateTransactionRequestV1RequestTest.java | 70 + .../GenerateTransactionRequestV1Test.java | 58 + .../client/model/Iroha2AccountIdTest.java | 56 + ...Iroha2BaseConfigSigningCredentialTest.java | 75 + .../client/model/Iroha2BaseConfigTest.java | 67 + .../model/Iroha2BaseConfigToriiTest.java | 56 + .../client/model/Iroha2KeyJsonTest.java | 56 + .../client/model/Iroha2KeyPairTest.java | 57 + .../model/IrohaInstructionRequestV1Test.java | 59 + .../client/model/IrohaInstructionTest.java | 33 + .../model/IrohaQueryDefinitionV1Test.java | 59 + .../client/model/IrohaQueryTest.java | 33 + .../IrohaSignedQueryDefinitionV1Test.java | 57 + ...ransactionDefinitionV1InstructionTest.java | 60 + .../IrohaTransactionDefinitionV1Test.java | 58 + .../IrohaTransactionParametersV1Test.java | 65 + .../client/model/KeychainReferenceTest.java | 56 + .../client/model/QueryRequestV1Test.java | 67 + .../client/model/QueryResponseV1Test.java | 48 + .../client/model/TransactRequestV1Test.java | 74 + .../client/model/TransactResponseV1Test.java | 65 + .../client/model/TransactionStatusV1Test.java | 33 + .../WatchBlocksBinaryResponseV1Test.java | 48 + .../model/WatchBlocksOptionsV1Test.java | 66 + .../model/WatchBlocksRawResponseV1Test.java | 48 + .../model/WatchBlocksResponseV1Test.java | 75 + .../client/model/WatchBlocksV1Test.java | 33 + .../package.json | 2 + .../go-client/.openapi-generator/FILES | 47 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 154 ++ .../openapi/go-client/api/openapi.yaml | 1288 ++++++++++ .../openapi/go-client/api_default.go | 855 ++++++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../openapi/go-client/model_contract_json.go | 579 +++++ ...olidity_bytecode_json_object_v1_request.go | 294 +++ ...y_contract_solidity_bytecode_v1_request.go | 542 ++++ ..._contract_solidity_bytecode_v1_response.go | 117 + .../model_eth_contract_invocation_type.go | 111 + ...del_eth_contract_invocation_web3_method.go | 115 + ..._invoke_contract_json_object_v1_request.go | 476 ++++ .../model_invoke_contract_v1_request.go | 441 ++++ .../model_invoke_contract_v1_response.go | 190 ++ ...invoke_raw_web3_eth_contract_v1_request.go | 275 ++ ...nvoke_raw_web3_eth_contract_v1_response.go | 193 ++ ...l_invoke_raw_web3_eth_method_v1_request.go | 155 ++ ..._invoke_raw_web3_eth_method_v1_response.go | 193 ++ ...model_quorum_private_transaction_config.go | 337 +++ .../model_quorum_transaction_config.go | 410 +++ .../model_quorum_transaction_config_from.go | 148 ++ .../model_quorum_transaction_config_to.go | 118 + .../model_run_transaction_request.go | 221 ++ .../model_run_transaction_response.go | 117 + .../model_solidity_contract_json_artifact.go | 441 ++++ ...olidity_contract_json_artifact_compiler.go | 188 ++ ...ty_contract_json_artifact_gas_estimates.go | 162 ++ ...ct_json_artifact_gas_estimates_creation.go | 198 ++ .../go-client/model_watch_blocks_v1.go | 117 + .../model_watch_blocks_v1_block_data.go | 666 +++++ .../model_watch_blocks_v1_options.go | 126 + .../model_watch_blocks_v1_progress.go | 162 ++ .../go-client/model_web3_block_header.go | 558 ++++ .../model_web3_signing_credential.go | 208 ++ ..._signing_credential_cactus_keychain_ref.go | 210 ++ ...gning_credential_geth_keychain_password.go | 173 ++ .../model_web3_signing_credential_none.go | 117 + ...web3_signing_credential_private_key_hex.go | 173 ++ .../model_web3_signing_credential_type.go | 115 + .../go-client/model_web3_transaction.go | 503 ++++ .../model_web3_transaction_receipt.go | 607 +++++ .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 121 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 104 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 179 ++ .../openapi/java-client/api/openapi.yaml | 1304 ++++++++++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 445 ++++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 1026 ++++++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../client/model/ContractJSON.java | 660 +++++ ...ctSolidityBytecodeJsonObjectV1Request.java | 377 +++ ...ployContractSolidityBytecodeV1Request.java | 596 +++++ ...loyContractSolidityBytecodeV1Response.java | 214 ++ .../model/EthContractInvocationType.java | 73 + .../EthContractInvocationWeb3Method.java | 77 + .../InvokeContractJsonObjectV1Request.java | 573 +++++ .../client/model/InvokeContractV1Request.java | 542 ++++ .../model/InvokeContractV1Response.java | 282 ++ .../InvokeRawWeb3EthContractV1Request.java | 391 +++ .../InvokeRawWeb3EthContractV1Response.java | 285 ++ .../InvokeRawWeb3EthMethodV1Request.java | 258 ++ .../InvokeRawWeb3EthMethodV1Response.java | 285 ++ .../model/QuorumPrivateTransactionConfig.java | 407 +++ .../client/model/QuorumTransactionConfig.java | 506 ++++ .../model/QuorumTransactionConfigFrom.java | 277 ++ .../model/QuorumTransactionConfigTo.java | 224 ++ .../client/model/RunTransactionRequest.java | 309 +++ .../client/model/RunTransactionResponse.java | 214 ++ .../model/SolidityContractJsonArtifact.java | 502 ++++ .../SolidityContractJsonArtifactCompiler.java | 314 +++ ...idityContractJsonArtifactGasEstimates.java | 248 ++ ...tractJsonArtifactGasEstimatesCreation.java | 270 ++ .../client/model/WatchBlocksV1.java | 79 + .../client/model/WatchBlocksV1BlockData.java | 838 ++++++ .../client/model/WatchBlocksV1Options.java | 205 ++ .../client/model/WatchBlocksV1Progress.java | 243 ++ .../client/model/Web3BlockHeader.java | 684 +++++ .../client/model/Web3SigningCredential.java | 391 +++ ...eb3SigningCredentialCactusKeychainRef.java | 309 +++ ...SigningCredentialGethKeychainPassword.java | 278 ++ .../model/Web3SigningCredentialNone.java | 214 ++ .../Web3SigningCredentialPrivateKeyHex.java | 278 ++ .../model/Web3SigningCredentialType.java | 77 + .../client/model/Web3Transaction.java | 618 +++++ .../client/model/Web3TransactionReceipt.java | 741 ++++++ .../client/api/DefaultApiTest.java | 140 + .../client/model/ContractJSONTest.java | 146 ++ ...lidityBytecodeJsonObjectV1RequestTest.java | 93 + ...ContractSolidityBytecodeV1RequestTest.java | 149 ++ ...ontractSolidityBytecodeV1ResponseTest.java | 49 + .../model/EthContractInvocationTypeTest.java | 33 + .../EthContractInvocationWeb3MethodTest.java | 33 + ...InvokeContractJsonObjectV1RequestTest.java | 144 ++ .../model/InvokeContractV1RequestTest.java | 134 + .../model/InvokeContractV1ResponseTest.java | 66 + ...InvokeRawWeb3EthContractV1RequestTest.java | 91 + ...nvokeRawWeb3EthContractV1ResponseTest.java | 66 + .../InvokeRawWeb3EthMethodV1RequestTest.java | 58 + .../InvokeRawWeb3EthMethodV1ResponseTest.java | 66 + .../QuorumPrivateTransactionConfigTest.java | 99 + .../QuorumTransactionConfigFromTest.java | 35 + .../model/QuorumTransactionConfigTest.java | 107 + .../model/QuorumTransactionConfigToTest.java | 34 + .../model/RunTransactionRequestTest.java | 76 + .../model/RunTransactionResponseTest.java | 49 + ...idityContractJsonArtifactCompilerTest.java | 56 + ...tJsonArtifactGasEstimatesCreationTest.java | 64 + ...yContractJsonArtifactGasEstimatesTest.java | 59 + .../SolidityContractJsonArtifactTest.java | 124 + .../model/WatchBlocksV1BlockDataTest.java | 205 ++ .../model/WatchBlocksV1OptionsTest.java | 48 + .../model/WatchBlocksV1ProgressTest.java | 58 + .../client/model/WatchBlocksV1Test.java | 33 + .../client/model/Web3BlockHeaderTest.java | 170 ++ ...igningCredentialCactusKeychainRefTest.java | 73 + ...ingCredentialGethKeychainPasswordTest.java | 65 + .../model/Web3SigningCredentialNoneTest.java | 49 + ...eb3SigningCredentialPrivateKeyHexTest.java | 65 + .../model/Web3SigningCredentialTest.java | 85 + .../model/Web3SigningCredentialTypeTest.java | 33 + .../model/Web3TransactionReceiptTest.java | 164 ++ .../client/model/Web3TransactionTest.java | 153 ++ .../package.json | 2 + .../go-client/.openapi-generator/FILES | 28 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 128 + .../openapi/go-client/api/openapi.yaml | 279 ++ .../openapi/go-client/api_default.go | 130 + .../go/generated/openapi/go-client/client.go | 655 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../go-client/model_cacti_transaction_v1.go | 203 ++ .../model_cacti_transaction_v1_all_of.go | 122 + .../model_error_exception_response_v1.go | 144 ++ .../model_sawtooth_batch_header_v1.go | 144 ++ .../go-client/model_sawtooth_batch_v1.go | 171 ++ .../model_sawtooth_block_header_v1.go | 252 ++ .../go-client/model_sawtooth_block_v1.go | 171 ++ .../model_sawtooth_transaction_header_v1.go | 333 +++ .../model_sawtooth_transaction_v1.go | 171 ++ .../go-client/model_status_response_v1.go | 230 ++ .../go-client/model_watch_blocks_v1.go | 117 + ...h_blocks_v1_cacti_transactions_response.go | 118 + .../model_watch_blocks_v1_full_response.go | 117 + .../model_watch_blocks_v1_listener_type.go | 111 + .../model_watch_blocks_v1_options.go | 162 ++ .../model_watch_blocks_v1_progress.go | 148 ++ ...odel_watch_blocks_v1_transaction_filter.go | 126 + .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 37 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 66 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 151 ++ .../openapi/java-client/api/openapi.yaml | 281 ++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1546 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 39 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 415 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 195 ++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../client/model/CactiTransactionV1.java | 309 +++ .../client/model/CactiTransactionV1AllOf.java | 210 ++ .../model/ErrorExceptionResponseV1.java | 246 ++ .../client/model/SawtoothBatchHeaderV1.java | 256 ++ .../client/model/SawtoothBatchV1.java | 294 +++ .../client/model/SawtoothBlockHeaderV1.java | 385 +++ .../client/model/SawtoothBlockV1.java | 294 +++ .../model/SawtoothTransactionHeaderV1.java | 503 ++++ .../client/model/SawtoothTransactionV1.java | 279 ++ .../client/model/StatusResponseV1.java | 315 +++ .../client/model/WatchBlocksV1.java | 79 + ...atchBlocksV1CactiTransactionsResponse.java | 228 ++ .../model/WatchBlocksV1FullResponse.java | 213 ++ .../model/WatchBlocksV1ListenerType.java | 73 + .../client/model/WatchBlocksV1Options.java | 237 ++ .../client/model/WatchBlocksV1Progress.java | 288 +++ .../model/WatchBlocksV1TransactionFilter.java | 205 ++ .../client/api/DefaultApiTest.java | 46 + .../model/CactiTransactionV1AllOfTest.java | 48 + .../client/model/CactiTransactionV1Test.java | 73 + .../model/ErrorExceptionResponseV1Test.java | 56 + .../model/SawtoothBatchHeaderV1Test.java | 58 + .../client/model/SawtoothBatchV1Test.java | 68 + .../model/SawtoothBlockHeaderV1Test.java | 90 + .../client/model/SawtoothBlockV1Test.java | 68 + .../SawtoothTransactionHeaderV1Test.java | 114 + .../model/SawtoothTransactionV1Test.java | 65 + .../client/model/StatusResponseV1Test.java | 73 + ...BlocksV1CactiTransactionsResponseTest.java | 51 + .../model/WatchBlocksV1FullResponseTest.java | 49 + .../model/WatchBlocksV1ListenerTypeTest.java | 33 + .../model/WatchBlocksV1OptionsTest.java | 58 + .../model/WatchBlocksV1ProgressTest.java | 62 + .../client/model/WatchBlocksV1Test.java | 33 + .../WatchBlocksV1TransactionFilterTest.java | 48 + .../package.json | 5 +- .../go-client/.openapi-generator/FILES | 12 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 112 + .../openapi/go-client/api/openapi.yaml | 48 + .../openapi/go-client/api_default.go | 119 + .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + ...el_get_transactions_by_address_endpoint.go | 171 ++ .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 36 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 34 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 136 + .../openapi/java-client/api/openapi.yaml | 51 + .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 401 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 189 ++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../GetTransactionsByAddressEndpoint.java | 280 ++ .../client/api/DefaultApiTest.java | 46 + .../GetTransactionsByAddressEndpointTest.java | 64 + .../package.json | 2 + .../go-client/.openapi-generator/FILES | 38 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 143 ++ .../openapi/go-client/api/openapi.yaml | 896 +++++++ .../openapi/go-client/api_default.go | 645 +++++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../go-client/model_consistency_strategy.go | 219 ++ .../openapi/go-client/model_contract_json.go | 570 ++++ ..._deploy_contract_json_object_v1_request.go | 294 +++ .../model_deploy_contract_v1_request.go | 322 +++ .../model_deploy_contract_v1_response.go | 117 + .../go-client/model_deploy_request_base_v1.go | 293 +++ .../model_eth_contract_invocation_type.go | 111 + ..._invoke_contract_json_object_v1_request.go | 440 ++++ .../model_invoke_contract_v1_request.go | 441 ++++ .../model_invoke_contract_v1_response.go | 190 ++ .../go-client/model_invoke_request_base_v1.go | 440 ++++ .../openapi/go-client/model_receipt_type.go | 111 + .../model_run_transaction_v1_request.go | 171 ++ .../model_run_transaction_v1_response.go | 117 + .../model_solidity_contract_json_artifact.go | 441 ++++ ...olidity_contract_json_artifact_compiler.go | 188 ++ ...ty_contract_json_artifact_gas_estimates.go | 162 ++ ...ct_json_artifact_gas_estimates_creation.go | 198 ++ .../model_web3_signing_credential.go | 178 ++ ..._signing_credential_cactus_keychain_ref.go | 201 ++ .../model_web3_signing_credential_none.go | 117 + ...web3_signing_credential_private_key_hex.go | 173 ++ .../model_web3_signing_credential_type.go | 115 + .../model_web3_transaction_receipt.go | 385 +++ .../model_xdai_transaction_config.go | 410 +++ .../model_xdai_transaction_config_from.go | 148 ++ .../model_xdai_transaction_config_to.go | 118 + .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 97 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 86 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 168 ++ .../openapi/java-client/api/openapi.yaml | 908 +++++++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 436 ++++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 786 ++++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../client/model/ConsistencyStrategy.java | 303 +++ .../client/model/ContractJSON.java | 663 +++++ .../DeployContractJsonObjectV1Request.java | 377 +++ .../client/model/DeployContractV1Request.java | 411 +++ .../model/DeployContractV1Response.java | 214 ++ .../client/model/DeployRequestBaseV1.java | 383 +++ .../model/EthContractInvocationType.java | 73 + .../InvokeContractJsonObjectV1Request.java | 540 ++++ .../client/model/InvokeContractV1Request.java | 542 ++++ .../model/InvokeContractV1Response.java | 282 ++ .../client/model/InvokeRequestBaseV1.java | 540 ++++ .../client/model/ReceiptType.java | 73 + .../client/model/RunTransactionV1Request.java | 278 ++ .../model/RunTransactionV1Response.java | 214 ++ .../model/SolidityContractJsonArtifact.java | 502 ++++ .../SolidityContractJsonArtifactCompiler.java | 314 +++ ...idityContractJsonArtifactGasEstimates.java | 248 ++ ...tractJsonArtifactGasEstimatesCreation.java | 270 ++ .../client/model/Web3SigningCredential.java | 338 +++ ...eb3SigningCredentialCactusKeychainRef.java | 310 +++ .../model/Web3SigningCredentialNone.java | 214 ++ .../Web3SigningCredentialPrivateKeyHex.java | 278 ++ .../model/Web3SigningCredentialType.java | 77 + .../client/model/Web3TransactionReceipt.java | 547 ++++ .../client/model/XdaiTransactionConfig.java | 506 ++++ .../model/XdaiTransactionConfigFrom.java | 277 ++ .../client/model/XdaiTransactionConfigTo.java | 224 ++ .../client/api/DefaultApiTest.java | 112 + .../client/model/ConsistencyStrategyTest.java | 73 + .../client/model/ContractJSONTest.java | 146 ++ ...DeployContractJsonObjectV1RequestTest.java | 93 + .../model/DeployContractV1RequestTest.java | 100 + .../model/DeployContractV1ResponseTest.java | 49 + .../client/model/DeployRequestBaseV1Test.java | 94 + .../model/EthContractInvocationTypeTest.java | 33 + ...InvokeContractJsonObjectV1RequestTest.java | 135 + .../model/InvokeContractV1RequestTest.java | 134 + .../model/InvokeContractV1ResponseTest.java | 66 + .../client/model/InvokeRequestBaseV1Test.java | 135 + .../client/model/ReceiptTypeTest.java | 33 + .../model/RunTransactionV1RequestTest.java | 67 + .../model/RunTransactionV1ResponseTest.java | 49 + ...idityContractJsonArtifactCompilerTest.java | 56 + ...tJsonArtifactGasEstimatesCreationTest.java | 64 + ...yContractJsonArtifactGasEstimatesTest.java | 59 + .../SolidityContractJsonArtifactTest.java | 124 + ...igningCredentialCactusKeychainRefTest.java | 73 + .../model/Web3SigningCredentialNoneTest.java | 49 + ...eb3SigningCredentialPrivateKeyHexTest.java | 65 + .../model/Web3SigningCredentialTest.java | 84 + .../model/Web3SigningCredentialTypeTest.java | 33 + .../model/Web3TransactionReceiptTest.java | 114 + .../model/XdaiTransactionConfigFromTest.java | 35 + .../model/XdaiTransactionConfigTest.java | 107 + .../model/XdaiTransactionConfigToTest.java | 34 + .../cactus-plugin-odap-hermes/package.json | 2 + .../go-client/.openapi-generator/FILES | 38 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 155 ++ .../openapi/go-client/api/openapi.yaml | 1600 ++++++++++++ .../openapi/go-client/api_default.go | 1762 +++++++++++++ .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../openapi/go-client/model_asset_profile.go | 513 ++++ .../go-client/model_client_v1_request.go | 684 +++++ ...v1_request_client_gateway_configuration.go | 117 + .../model_commit_final_v1_request.go | 388 +++ .../model_commit_final_v1_response.go | 378 +++ .../model_commit_preparation_v1_request.go | 315 +++ .../model_commit_preparation_v1_response.go | 315 +++ .../go-client/model_credential_profile.go | 113 + .../openapi/go-client/model_history.go | 342 +++ .../model_lock_evidence_v1_request.go | 451 ++++ .../model_lock_evidence_v1_response.go | 325 +++ .../openapi/go-client/model_odap_local_log.go | 279 ++ .../openapi/go-client/model_odap_message.go | 522 ++++ .../model_odap_message_action_response.go | 162 ++ .../go-client/model_payload_profile.go | 153 ++ .../model_recover_success_v1_message.go | 171 ++ .../model_recover_update_ack_v1_message.go | 198 ++ .../model_recover_update_v1_message.go | 171 ++ .../go-client/model_recover_v1_message.go | 315 +++ .../model_rollback_ack_v1_message.go | 171 ++ .../go-client/model_rollback_v1_message.go | 225 ++ .../openapi/go-client/model_session_data.go | 2286 +++++++++++++++++ .../model_transfer_commence_v1_request.go | 496 ++++ .../model_transfer_commence_v1_response.go | 361 +++ .../model_transfer_complete_v1_request.go | 352 +++ ...odel_transfer_initialization_v1_request.go | 1035 ++++++++ ...del_transfer_initialization_v1_response.go | 405 +++ .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 224 ++ .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 86 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 180 ++ .../openapi/java-client/api/openapi.yaml | 1637 ++++++++++++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 426 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 2132 +++++++++++++++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../client/model/AssetProfile.java | 595 +++++ .../client/model/ClientV1Request.java | 882 +++++++ ...ntV1RequestClientGatewayConfiguration.java | 216 ++ .../client/model/CommitFinalV1Request.java | 506 ++++ .../client/model/CommitFinalV1Response.java | 494 ++++ .../model/CommitPreparationV1Request.java | 434 ++++ .../model/CommitPreparationV1Response.java | 437 ++++ .../client/model/CredentialProfile.java | 75 + .../openapitools/client/model/History.java | 408 +++ .../client/model/LockEvidenceV1Request.java | 569 ++++ .../client/model/LockEvidenceV1Response.java | 446 ++++ .../client/model/OdapLocalLog.java | 373 +++ .../client/model/OdapMessage.java | 654 +++++ .../model/OdapMessageActionResponse.java | 297 +++ .../client/model/PayloadProfile.java | 247 ++ .../client/model/RecoverSuccessV1Message.java | 277 ++ .../model/RecoverUpdateAckV1Message.java | 322 +++ .../client/model/RecoverUpdateV1Message.java | 298 +++ .../client/model/RecoverV1Message.java | 434 ++++ .../client/model/RollbackAckV1Message.java | 277 ++ .../client/model/RollbackV1Message.java | 365 +++ .../client/model/SessionData.java | 2147 ++++++++++++++++ .../model/TransferCommenceV1Request.java | 633 +++++ .../model/TransferCommenceV1Response.java | 477 ++++ .../model/TransferCompleteV1Request.java | 478 ++++ .../TransferInitializationV1Request.java | 1232 +++++++++ .../TransferInitializationV1Response.java | 594 +++++ .../client/api/DefaultApiTest.java | 267 ++ .../client/model/AssetProfileTest.java | 138 + ...RequestClientGatewayConfigurationTest.java | 48 + .../client/model/ClientV1RequestTest.java | 220 ++ .../model/CommitFinalV1RequestTest.java | 122 + .../model/CommitFinalV1ResponseTest.java | 121 + .../model/CommitPreparationV1RequestTest.java | 105 + .../CommitPreparationV1ResponseTest.java | 105 + .../client/model/CredentialProfileTest.java | 33 + .../client/model/HistoryTest.java | 98 + .../model/LockEvidenceV1RequestTest.java | 138 + .../model/LockEvidenceV1ResponseTest.java | 106 + .../client/model/OdapLocalLogTest.java | 88 + .../model/OdapMessageActionResponseTest.java | 58 + .../client/model/OdapMessageTest.java | 141 + .../client/model/PayloadProfileTest.java | 57 + .../model/RecoverSuccessV1MessageTest.java | 64 + .../model/RecoverUpdateAckV1MessageTest.java | 74 + .../model/RecoverUpdateV1MessageTest.java | 67 + .../client/model/RecoverV1MessageTest.java | 105 + .../model/RollbackAckV1MessageTest.java | 64 + .../client/model/RollbackV1MessageTest.java | 82 + .../client/model/SessionDataTest.java | 533 ++++ .../model/TransferCommenceV1RequestTest.java | 153 ++ .../model/TransferCommenceV1ResponseTest.java | 114 + .../model/TransferCompleteV1RequestTest.java | 114 + .../TransferInitializationV1RequestTest.java | 294 +++ .../TransferInitializationV1ResponseTest.java | 131 + .../package.json | 5 +- .../go-client/.openapi-generator/FILES | 16 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 116 + .../openapi/go-client/api/openapi.yaml | 148 ++ .../openapi/go-client/api_default.go | 130 + .../go/generated/openapi/go-client/client.go | 656 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../model_error_exception_response_v1.go | 144 ++ .../go-client/model_monitored_token.go | 173 ++ .../go-client/model_status_response_v1.go | 285 ++ .../openapi/go-client/model_token_type_v1.go | 111 + .../go-client/model_tracked_operation_v1.go | 146 ++ .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 37 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 42 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 140 + .../openapi/java-client/api/openapi.yaml | 150 ++ .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 404 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/api/DefaultApi.java | 195 ++ .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ .../model/ErrorExceptionResponseV1.java | 248 ++ .../client/model/MonitoredToken.java | 278 ++ .../client/model/StatusResponseV1.java | 412 +++ .../client/model/TokenTypeV1.java | 79 + .../client/model/TrackedOperationV1.java | 248 ++ .../client/api/DefaultApiTest.java | 46 + .../model/ErrorExceptionResponseV1Test.java | 56 + .../client/model/MonitoredTokenTest.java | 65 + .../client/model/StatusResponseV1Test.java | 100 + .../client/model/TokenTypeV1Test.java | 33 + .../client/model/TrackedOperationV1Test.java | 56 + .../package.json | 5 +- .../go-client/.openapi-generator/FILES | 9 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 109 + .../openapi/go-client/api/openapi.yaml | 13 + .../go/generated/openapi/go-client/client.go | 653 +++++ .../openapi/go-client/configuration.go | 215 ++ .../go/generated/openapi/go-client/go.mod | 6 + .../go/generated/openapi/go-client/go.sum | 11 + .../generated/openapi/go-client/response.go | 47 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../java-client/.github/workflows/maven.yml | 30 + .../java-client/.openapi-generator/FILES | 30 + .../java-client/.openapi-generator/VERSION | 1 + .../generated/openapi/java-client/.travis.yml | 22 + .../generated/openapi/java-client/README.md | 107 + .../openapi/java-client/api/openapi.yaml | 14 + .../openapi/java-client/build.gradle | 168 ++ .../generated/openapi/java-client/build.sbt | 28 + .../openapi/java-client/gradle.properties | 6 + .../generated/openapi/java-client/gradlew | 234 ++ .../generated/openapi/java-client/gradlew.bat | 89 + .../generated/openapi/java-client/pom.xml | 353 +++ .../openapi/java-client/settings.gradle | 1 + .../java-client/src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiCallback.java | 62 + .../org/openapitools/client/ApiClient.java | 1547 +++++++++++ .../org/openapitools/client/ApiException.java | 166 ++ .../org/openapitools/client/ApiResponse.java | 76 + .../openapitools/client/Configuration.java | 41 + .../client/GzipRequestInterceptor.java | 85 + .../java/org/openapitools/client/JSON.java | 400 +++ .../java/org/openapitools/client/Pair.java | 57 + .../client/ProgressRequestBody.java | 73 + .../client/ProgressResponseBody.java | 70 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 83 + .../openapitools/client/auth/ApiKeyAuth.java | 80 + .../client/auth/Authentication.java | 36 + .../client/auth/HttpBasicAuth.java | 57 + .../client/auth/HttpBearerAuth.java | 63 + .../client/model/AbstractOpenApiSchema.java | 149 ++ tools/clear-openapi-codegen-folders.js | 2 + yarn.lock | 48 +- 2701 files changed, 497475 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/ghpkg-all-java-api-clients-publish.yaml create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/README.md create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/client.go create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/go.mod create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/go.sum create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_counterparty_htlc_request.go create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_htlc_package.go create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_own_htlc_request.go create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_withdraw_counterparty_request.go create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/response.go create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/utils.go create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/README.md create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradlew create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CounterpartyHTLCRequest.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HtlcPackage.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OwnHTLCRequest.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawCounterpartyRequest.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CounterpartyHTLCRequestTest.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HtlcPackageTest.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OwnHTLCRequestTest.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java create mode 100644 extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawCounterpartyRequestTest.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/README.md create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/client.go create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/go.mod create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/go.sum create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_get_object_request_v1.go create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_get_object_response_v1.go create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_has_object_request_v1.go create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_has_object_response_v1.go create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_set_object_request_v1.go create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_set_object_response_v1.go create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/response.go create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/utils.go create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/README.md create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradlew create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectRequestV1.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectResponseV1.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectRequestV1.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectResponseV1.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectRequestV1.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectResponseV1.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectRequestV1Test.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectResponseV1Test.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectRequestV1Test.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectResponseV1Test.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectRequestV1Test.java create mode 100644 extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectResponseV1Test.java create mode 100644 packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_health_check_response.go create mode 100644 packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_memory_usage.go create mode 100644 packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_watch_healthcheck_v1.go create mode 100644 packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HealthCheckResponse.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/MemoryUsage.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchHealthcheckV1.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HealthCheckResponseTest.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/MemoryUsageTest.java create mode 100644 packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchHealthcheckV1Test.java create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node_all_of.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node_meta.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_families_with_out_tx_finality.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_families_with_tx_finality.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_family.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium_database.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium_member.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_constants.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_object_request_v1.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_object_response_v1.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_object_request_v1.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_object_response_v1.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_jws_general.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_jws_recipient.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_ledger.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_ledger_type.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import_action.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import_type.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_instance.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_object_request_v1.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_object_response_v1.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-core-api/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNode.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNodeAllOf.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNodeMeta.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinality.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinality.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamily.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Consortium.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsortiumDatabase.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsortiumMember.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Constants.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectRequestV1.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectResponseV1.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectRequestV1.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectResponseV1.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSGeneral.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSRecipient.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Ledger.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LedgerType.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImport.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImportAction.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImportType.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginInstance.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectRequestV1.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectResponseV1.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeAllOfTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeMetaTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinalityTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinalityTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamilyTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumDatabaseTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumMemberTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConstantsTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectRequestV1Test.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectResponseV1Test.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectRequestV1Test.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectResponseV1Test.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSGeneralTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSRecipientTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LedgerTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LedgerTypeTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportActionTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportTypeTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginInstanceTest.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectRequestV1Test.java create mode 100644 packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectResponseV1Test.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_get_consortium_jws_response.go create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_get_node_jws_response.go create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_jws_general.go create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_jws_recipient.go create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetConsortiumJwsResponse.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetNodeJwsResponse.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSGeneral.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSRecipient.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetConsortiumJwsResponseTest.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetNodeJwsResponseTest.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSGeneralTest.java create mode 100644 packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSRecipientTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_get_single_status_request.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_get_status_request.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_initialize_request.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_new_contract_request.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_new_contract_request_gas.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_refund_request.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_run_transaction_response.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_withdraw_request.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetStatusRequest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InitializeRequest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractRequest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractRequestGas.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RefundRequest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawRequest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSingleStatusRequestTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetStatusRequestTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InitializeRequestTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractRequestGasTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractRequestTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RefundRequestTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawRequestTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_get_single_status_request.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_get_status_request.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_initialize_request.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_new_contract_obj.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_new_contract_obj_gas.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_refund_req.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_run_transaction_response.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_withdraw_req.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetStatusRequest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InitializeRequest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractObj.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractObjGas.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RefundReq.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawReq.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSingleStatusRequestTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetStatusRequestTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InitializeRequestTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractObjGasTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractObjTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RefundReqTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java create mode 100644 packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawReqTest.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java create mode 100644 packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_private_transaction_config.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_transaction_config.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_transaction_config_to.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_consistency_strategy.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_block.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_log.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_transaction.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_balance_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_balance_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_besu_record_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_besu_record_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_block_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_block_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_past_logs_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_past_logs_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_transaction_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_transaction_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_receipt_type.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_run_transaction_request.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_run_transaction_response.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_sign_transaction_request.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_sign_transaction_response.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_block_header.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_block_header_timestamp.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuPrivateTransactionConfig.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuTransactionConfig.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuTransactionConfigTo.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsistencyStrategy.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmBlock.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmLog.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmTransaction.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBalanceV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBalanceV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBesuRecordV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBesuRecordV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPastLogsV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPastLogsV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ReceiptType.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SignTransactionRequest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SignTransactionResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeaderTimestamp.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuPrivateTransactionConfigTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuTransactionConfigTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuTransactionConfigToTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsistencyStrategyTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmBlockTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmLogTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmTransactionTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBalanceV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBalanceV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBesuRecordV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBesuRecordV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPastLogsV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPastLogsV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ReceiptTypeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SignTransactionRequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SignTransactionResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTimestampTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_clear_monitor_transactions_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_clear_monitor_transactions_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_node_ssh_credentials.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_rpc_credentials.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_x500_name.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_cordapp_deployment_config.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_cordapp_info.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_bad_request_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_success_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_diagnose_node_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_diagnose_node_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_flow_invocation_type.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_response_tx_inner.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jar_file.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_object.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_type.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_type_kind.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_list_flows_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_list_flows_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_network_host_and_port.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_node_diagnostic_info.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_node_info.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_party.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_public_key.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_sha256.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_start_monitor_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_start_monitor_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_stop_monitor_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_stop_monitor_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_x500_principal.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaNodeSshCredentials.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaRpcCredentials.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaX500Name.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordappDeploymentConfig.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordappInfo.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsBadRequestV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsSuccessV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DiagnoseNodeV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DiagnoseNodeV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FlowInvocationType.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInner.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JarFile.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmObject.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmType.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmTypeKind.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ListFlowsV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ListFlowsV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NetworkHostAndPort.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NodeDiagnosticInfo.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NodeInfo.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Party.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PublicKey.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SHA256.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StartMonitorV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StartMonitorV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StopMonitorV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StopMonitorV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/X500Principal.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClearMonitorTransactionsV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClearMonitorTransactionsV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaNodeSshCredentialsTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaRpcCredentialsTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaX500NameTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordappDeploymentConfigTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordappInfoTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsBadRequestV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsSuccessV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DiagnoseNodeV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DiagnoseNodeV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FlowInvocationTypeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInnerTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JarFileTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmObjectTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmTypeKindTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmTypeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ListFlowsV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ListFlowsV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NetworkHostAndPortTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NodeDiagnosticInfoTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NodeInfoTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PartyTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PublicKeyTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SHA256Test.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StartMonitorV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StartMonitorV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StopMonitorV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StopMonitorV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/X500PrincipalTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_contract_json.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_contract_json_definition.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_contract_keychain_definition.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request_contract.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deployed_contract_json_definition.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_web3_method.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_ethereum_transaction_config.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config_eip1559.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config_legacy.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request_contract.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_run_transaction_request.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_run_transaction_response.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data_timestamp.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_block_header.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cacti_keychain_ref.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_geth_keychain_password.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_transaction.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJsonDefinition.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractKeychainDefinition.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1RequestContract.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployedContractJsonDefinition.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthereumTransactionConfig.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfig.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfigEIP1559.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfigLegacy.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1RequestContract.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestamp.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactiKeychainRef.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3Transaction.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJsonDefinitionTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractKeychainDefinitionTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestContractTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployedContractJsonDefinitionTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationWeb3MethodTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthereumTransactionConfigTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigEIP1559Test.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigLegacyTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestContractTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestampTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactiKeychainRefTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPasswordTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_language_runtime.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_life_cycle_command_responses.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_programming_language.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_connection_profile.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_connection_profile_client.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_default_event_handler_strategy.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_501_response.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_request_constructor_args.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deployment_target_org_fabric2x.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deployment_target_organization.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_contract_invocation_type.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_signing_credential.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_signing_credential_type.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_file_base64.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_discovery_options.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_event_handler_options.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_options.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_options_wallet.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1_query.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1_query_block_hash.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_decoded_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_encoded_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_transaction_receipt_response.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_delegated_sign_transaction_request.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_transaction_request.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_transaction_response.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_transaction_response_type.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_ssh_exec_command_response.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_block_meta_data.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_transaction_creator.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_transaction_endorsement.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_vault_transit_key.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_error_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_transactions_event_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_transactions_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_delegated_sign_options_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_filtered_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_full_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_listener_type_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_options_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_private_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_web_socket_key.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeLanguageRuntime.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponses.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeProgrammingLanguage.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConnectionProfile.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConnectionProfileClient.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DefaultEventHandlerStrategy.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1501Response.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgs.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeploymentTargetOrgFabric2x.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeploymentTargetOrganization.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricContractInvocationType.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricSigningCredential.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricSigningCredentialType.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FileBase64.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayDiscoveryOptions.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayEventHandlerOptions.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayOptions.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayOptionsWallet.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1Query.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHash.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseDecodedV1.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseEncodedV1.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionReceiptResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunDelegatedSignTransactionRequest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponseType.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SSHExecCommandResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptBlockMetaData.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptTransactionCreator.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptTransactionEndorsement.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/VaultTransitKey.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksDelegatedSignOptionsV1.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksFullResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksListenerTypeV1.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WebSocketKey.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeLanguageRuntimeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponsesTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeProgrammingLanguageTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConnectionProfileClientTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConnectionProfileTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DefaultEventHandlerStrategyTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1501ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgsTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeploymentTargetOrgFabric2xTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeploymentTargetOrganizationTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricContractInvocationTypeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricSigningCredentialTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricSigningCredentialTypeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FileBase64Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayDiscoveryOptionsTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayEventHandlerOptionsTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayOptionsTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayOptionsWalletTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHashTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1QueryTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseDecodedV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseEncodedV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionReceiptResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunDelegatedSignTransactionRequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTypeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SSHExecCommandResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptBlockMetaDataTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptTransactionCreatorTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptTransactionEndorsementTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/VaultTransitKeyTest.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksDelegatedSignOptionsV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksFullResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksListenerTypeV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksOptionsV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WebSocketKeyTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_asset_quantity_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_peer_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_signatory_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_append_role_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_call_engine_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_compare_and_set_account_detail_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_account_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_asset_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_domain_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_role_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_detach_role_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_error_exception_json_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_asset_transactions_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_assets_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_detail_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_transactions_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_asset_info_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_block_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_engine_receipts_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_pending_transactions_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_role_permissions_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_signatories_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_transactions_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_grant_permission_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_base_config.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_progress.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_response.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_response_payload.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_command.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_query.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_socket_io_transact_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_key_pair.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_remove_peer_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_remove_signatory_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_revoke_permission_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1_body.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1_params.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_response.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_signed_request_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_set_account_detail_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_set_account_quorum_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_subtract_asset_quantity_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_transfer_asset_request_parameters.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddAssetQuantityRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddPeerRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddSignatoryRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AppendRoleRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CallEngineRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateAccountRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateAssetRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateDomainRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateRoleRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DetachRoleRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountAssetsRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountDetailRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountTransactionsRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAssetInfoRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetEngineReceiptsRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPendingTransactionsRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetRolePermissionsRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSignatoriesRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionsRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GrantPermissionRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBaseConfig.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockProgress.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockResponsePayload.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaCommand.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQuery.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaSocketIOTransactV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/KeyPair.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RemovePeerRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RemoveSignatoryRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RevokePermissionRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1Body.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1Params.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionSignedRequestV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetAccountDetailRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetAccountQuorumRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SubtractAssetQuantityRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferAssetRequestParameters.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddAssetQuantityRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddPeerRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddSignatoryRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AppendRoleRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CallEngineRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateAccountRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateAssetRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateDomainRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateRoleRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DetachRoleRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountAssetsRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountDetailRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountTransactionsRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAssetInfoRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetEngineReceiptsRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPendingTransactionsRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetRolePermissionsRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSignatoriesRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionsRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GrantPermissionRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBaseConfigTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockProgressTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockResponsePayloadTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaCommandTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaSocketIOTransactV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/KeyPairTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RemovePeerRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RemoveSignatoryRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RevokePermissionRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1BodyTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1ParamsTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionSignedRequestV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetAccountDetailRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetAccountQuorumRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SubtractAssetQuantityRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferAssetRequestParametersTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_block_type_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_account_id.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config_signing_credential.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config_torii.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_key_json.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_key_pair.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_instruction.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_instruction_request_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_query.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_query_definition_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_signed_query_definition_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_definition_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_definition_v1_instruction.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_parameters_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_keychain_reference.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_query_request_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_query_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transact_request_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transact_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transaction_status_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_binary_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_options_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_raw_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BlockTypeV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2AccountId.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfig.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredential.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfigTorii.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2KeyJson.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2KeyPair.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaInstruction.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaInstructionRequestV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQuery.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQueryDefinitionV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Instruction.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionParametersV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/KeychainReference.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QueryRequestV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QueryResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactRequestV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactionStatusV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksRawResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BlockTypeV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2AccountIdTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredentialTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigToriiTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2KeyJsonTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2KeyPairTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaInstructionRequestV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaInstructionTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryDefinitionV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionDefinitionV1InstructionTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionParametersV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/KeychainReferenceTest.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QueryRequestV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QueryResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactRequestV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactionStatusV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksOptionsV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksRawResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_contract_json.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_json_object_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_web3_method.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_private_transaction_config.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config_from.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config_to.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_run_transaction_request.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_run_transaction_response.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_block_header.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_geth_keychain_password.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_transaction.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumPrivateTransactionConfig.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfig.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfigFrom.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfigTo.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3Transaction.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationWeb3MethodTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumPrivateTransactionConfigTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigFromTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigToTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPasswordTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java create mode 100644 packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionTest.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_cacti_transaction_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_cacti_transaction_v1_all_of.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_batch_header_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_batch_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_block_header_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_block_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_transaction_header_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_transaction_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_status_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_cacti_transactions_response.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_full_response.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_listener_type.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_transaction_filter.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactiTransactionV1.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactiTransactionV1AllOf.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothBatchHeaderV1.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothBatchV1.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothBlockHeaderV1.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothBlockV1.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothTransactionHeaderV1.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothTransactionV1.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StatusResponseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1CactiTransactionsResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1FullResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1ListenerType.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1TransactionFilter.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactiTransactionV1AllOfTest.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactiTransactionV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothBatchHeaderV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothBatchV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothBlockHeaderV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothBlockV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothTransactionHeaderV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothTransactionV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StatusResponseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1CactiTransactionsResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1FullResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ListenerTypeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1TransactionFilterTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/model_get_transactions_by_address_endpoint.go create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionsByAddressEndpoint.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionsByAddressEndpointTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_consistency_strategy.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_contract_json.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_json_object_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_request_base_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_request_base_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_receipt_type.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_run_transaction_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_run_transaction_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config_from.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config_to.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsistencyStrategy.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJsonObjectV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployRequestBaseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRequestBaseV1.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ReceiptType.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionV1Request.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionV1Response.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfig.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfigFrom.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfigTo.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsistencyStrategyTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJsonObjectV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployRequestBaseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRequestBaseV1Test.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ReceiptTypeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionV1RequestTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionV1ResponseTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigFromTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigTest.java create mode 100644 packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigToTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_asset_profile.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request_client_gateway_configuration.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_request.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_response.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_request.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_response.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_credential_profile.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_history.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_request.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_response.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_local_log.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_message.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_message_action_response.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_payload_profile.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_success_v1_message.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_update_ack_v1_message.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_update_v1_message.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_v1_message.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_rollback_ack_v1_message.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_rollback_v1_message.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_session_data.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_request.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_response.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_complete_v1_request.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_request.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_response.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AssetProfile.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClientV1Request.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfiguration.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitFinalV1Request.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitFinalV1Response.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitPreparationV1Request.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitPreparationV1Response.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CredentialProfile.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/History.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LockEvidenceV1Request.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LockEvidenceV1Response.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapLocalLog.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapMessage.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapMessageActionResponse.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PayloadProfile.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverSuccessV1Message.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverUpdateAckV1Message.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverUpdateV1Message.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverV1Message.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RollbackAckV1Message.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RollbackV1Message.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SessionData.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCommenceV1Request.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCommenceV1Response.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCompleteV1Request.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferInitializationV1Request.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferInitializationV1Response.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AssetProfileTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfigurationTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClientV1RequestTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitFinalV1RequestTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitFinalV1ResponseTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitPreparationV1RequestTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitPreparationV1ResponseTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CredentialProfileTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HistoryTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LockEvidenceV1RequestTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LockEvidenceV1ResponseTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapLocalLogTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapMessageActionResponseTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapMessageTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PayloadProfileTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverSuccessV1MessageTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverUpdateAckV1MessageTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverUpdateV1MessageTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverV1MessageTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RollbackAckV1MessageTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RollbackV1MessageTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SessionDataTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCommenceV1RequestTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCommenceV1ResponseTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCompleteV1RequestTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferInitializationV1RequestTest.java create mode 100644 packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferInitializationV1ResponseTest.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_monitored_token.go create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_status_response_v1.go create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_token_type_v1.go create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_tracked_operation_v1.go create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/MonitoredToken.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StatusResponseV1.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TokenTypeV1.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TrackedOperationV1.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/MonitoredTokenTest.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StatusResponseV1Test.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TokenTypeV1Test.java create mode 100644 packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TrackedOperationV1Test.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.travis.yml create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/README.md create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/build.gradle create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/build.sbt create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradle.properties create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradlew create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradlew.bat create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/pom.xml create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/settings.gradle create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java diff --git a/.github/workflows/.dast-nuclei-cmd-api-server.yaml b/.github/workflows/.dast-nuclei-cmd-api-server.yaml index 6f1f0d3ff6e..4e575b13d86 100644 --- a/.github/workflows/.dast-nuclei-cmd-api-server.yaml +++ b/.github/workflows/.dast-nuclei-cmd-api-server.yaml @@ -142,4 +142,4 @@ jobs: # - name: GitHub Security Dashboard Alerts update # uses: github/codeql-action/upload-sarif@v1 # with: - # sarif_file: ~/nuclei.sarif + # sarif_file: ~/nuclei.sarif \ No newline at end of file diff --git a/.github/workflows/ghpkg-all-java-api-clients-publish.yaml b/.github/workflows/ghpkg-all-java-api-clients-publish.yaml new file mode 100644 index 00000000000..38719dc2837 --- /dev/null +++ b/.github/workflows/ghpkg-all-java-api-clients-publish.yaml @@ -0,0 +1,197 @@ +name: ghpkg-all-java-api-clients-publish + +on: + push: + branches: [main, dev] + + pull_request: + branches: [main, dev] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + publish: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3.5.2 + with: + fetch-depth: 0 + + - name: Get the latest release version + run: | + export GITVERSION=$(git describe --tags | awk -F'.' '{print $$1}') + echo "GITVERSION=$GITVERSION" >> $GITHUB_ENV + - uses: actions/setup-java@v3.11.0 + with: + distribution: 'adopt' + java-version: '8' + + - name: Setup maven for packaging jars + uses: s4u/setup-maven-action@v1.10.0 + with: + maven-version: 3.9.4 + + - name: Set up NodeJS v16.14.2 + uses: actions/setup-node@v3.6.0 + with: + node-version: v16.14.2 + + - run: yarn && yarn configure + + - name: build-cactus-cmd-api-server-java-client + run: | + WDIR=`pwd` + cd ${WDIR}/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client + mvn clean package + - name: publish-cactus-cmd-api-server-java-client + uses: actions/upload-artifact@v3.0.0 + with: + name: cactus-cmd-api-server-java-client-${{ env.GITVERSION }}.jar + path: packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/target/openapi-java-client-1.jar + + - name: build-cactus-plugin-keychain-aws-sm-java-client + run: | + WDIR=`pwd` + cd ${WDIR}/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client + mvn clean package + - name: publish-cactus-plugin-keychain-aws-sm-java-client + uses: actions/upload-artifact@v3.0.0 + with: + name: cactus-plugin-keychain-aws-sm-java-client-${{ env.GITVERSION }}.jar + path: packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/target/openapi-java-client-1.jar + + - name: build-cactus-plugin-keychain-azure-kv-java-client + run: | + WDIR=`pwd` + cd ${WDIR}/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client + mvn clean package + - name: publish-cactus-plugin-keychain-azure-kv-java-client + uses: actions/upload-artifact@v3.0.0 + with: + name: cactus-plugin-keychain-azure-kv-java-client-${{ env.GITVERSION }}.jar + path: packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/target/openapi-java-client-1.jar + + - name: build-cactus-plugin-keychain-google-sm-java-client + run: | + WDIR=`pwd` + cd ${WDIR}/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client + mvn clean package + - name: publish-cactus-plugin-keychain-google-sm-java-client + uses: actions/upload-artifact@v3.0.0 + with: + name: cactus-plugin-keychain-google-sm-java-client-${{ env.GITVERSION }}.jar + path: packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/target/openapi-java-client-1.jar + + - name: build-cactus-plugin-keychain-memory-java-client + run: | + WDIR=`pwd` + cd ${WDIR}/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client + mvn clean package + - name: publish-cactus-plugin-keychain-memory-java-client + uses: actions/upload-artifact@v3.0.0 + with: + name: cactus-plugin-keychain-memory-java-client-${{ env.GITVERSION }}.jar + path: packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/target/openapi-java-client-1.jar + + - name: build-cactus-plugin-keychain-memory-wasm-java-client + run: | + WDIR=`pwd` + cd ${WDIR}/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client + mvn clean package + - name: publish-cactus-plugin-keychain-memory-wasm-java-client + uses: actions/upload-artifact@v3.0.0 + with: + name: cactus-plugin-keychain-memory-wasm-java-client-${{ env.GITVERSION }}.jar + path: packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/target/openapi-java-client-1.jar + + - name: build-cactus-plugin-keychain-vault-java-client + run: | + WDIR=`pwd` + cd ${WDIR}/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client + mvn clean package + - name: publish-cactus-plugin-keychain-vault-java-client + uses: actions/upload-artifact@v3.0.0 + with: + name: cactus-plugin-keychain-vault-java-client-${{ env.GITVERSION }}.jar + path: packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/target/openapi-java-client-1.jar + + - name: build-cactus-plugin-ledger-connector-corda-java-client + run: | + WDIR=`pwd` + cd ${WDIR}/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client + mvn clean package + - name: publish-cactus-plugin-ledger-connector-corda-java-client + uses: actions/upload-artifact@v3.0.0 + with: + name: cactus-plugin-ledger-connector-corda-java-client-${{ env.GITVERSION }}.jar + path: packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/target/openapi-java-client-1.jar + + - name: build-cactus-plugin-ledger-connector-fabric-java-client + run: | + WDIR=`pwd` + cd ${WDIR}/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client + mvn clean package + - name: publish-cactus-plugin-ledger-connector-fabric-java-client + uses: actions/upload-artifact@v3.0.0 + with: + name: cactus-plugin-ledger-connector-fabric-java-client-${{ env.GITVERSION }}.jar + path: packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/target/openapi-java-client-1.jar + + - name: build-cactus-plugin-ledger-connector-sawtooth-java-client + run: | + WDIR=`pwd` + cd ${WDIR}/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client + mvn clean package + - name: publish-cactus-plugin-ledger-connector-sawtooth-java-client + uses: actions/upload-artifact@v3.0.0 + with: + name: cactus-plugin-ledger-connector-sawtooth-java-client-${{ env.GITVERSION }}.jar + path: packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/target/openapi-java-client-1.jar + + - name: build-cactus-plugin-ledger-connector-ubiquity-java-client + run: | + WDIR=`pwd` + cd ${WDIR}/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client + mvn clean package + - name: publish-cactus-plugin-ledger-connector-ubiquity-java-client + uses: actions/upload-artifact@v3.0.0 + with: + name: cactus-plugin-ledger-connector-ubiquity-java-client-${{ env.GITVERSION }}.jar + path: packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/target/openapi-java-client-1.jar + + - name: build-cactus-plugin-odap-hermes-java-client + run: | + WDIR=`pwd` + cd ${WDIR}/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client + mvn clean package + - name: publish-cactus-plugin-odap-hermes-java-client + uses: actions/upload-artifact@v3.0.0 + with: + name: cactus-plugin-odap-hermes-java-client-${{ env.GITVERSION }}.jar + path: packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/target/openapi-java-client-1.jar + + - name: build-cactus-plugin-persistence-ethereum-java-client + run: | + WDIR=`pwd` + cd ${WDIR}/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client + mvn clean package + - name: publish-cactus-plugin-persistence-ethereum-java-client + uses: actions/upload-artifact@v3.0.0 + with: + name: cactus-plugin-persistence-ethereum-java-client-${{ env.GITVERSION }}.jar + path: packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/target/openapi-java-client-1.jar + + - name: build-cactus-plugin-persistence-fabric-java-client + run: | + WDIR=`pwd` + cd ${WDIR}/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client + mvn clean package + - name: publish-cactus-plugin-persistence-fabric-java-client + uses: actions/upload-artifact@v3.0.0 + with: + name: cactus-plugin-persistence-fabric-java-client-${{ env.GITVERSION }}.jar + path: packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/target/openapi-java-client-1.jar + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/package.json b/extensions/cactus-plugin-htlc-coordinator-besu/package.json index 8613080dfba..6d127c1de8d 100644 --- a/extensions/cactus-plugin-htlc-coordinator-besu/package.json +++ b/extensions/cactus-plugin-htlc-coordinator-besu/package.json @@ -46,7 +46,9 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "run-p generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --ignore-file-override=../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --ignore-file-override=../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev webpack:prod", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..04570a0c164 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,20 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_counterparty_htlc_request.go +model_htlc_package.go +model_own_htlc_request.go +model_web3_signing_credential.go +model_web3_signing_credential_cactus_keychain_ref.go +model_web3_signing_credential_none.go +model_web3_signing_credential_private_key_hex.go +model_web3_signing_credential_type.go +model_withdraw_counterparty_request.go +response.go +test/api_default_test.go +utils.go diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.travis.yml b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/README.md b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..2a172aae2e4 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,122 @@ +# Go API client for cactus-plugin-htlc-coordinator-besu + +Can exchange assets between networks + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-htlc-coordinator-besu "github.com/hyperledger/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-coordinator-besu.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-coordinator-besu.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-coordinator-besu.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-htlc-coordinator-besu.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://www.cactus.stream* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**CounterpartyHtlcV1**](docs/DefaultApi.md#counterpartyhtlcv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc | Create an instance to interact with the counterparty HTLC +*DefaultApi* | [**OwnHtlcV1**](docs/DefaultApi.md#ownhtlcv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc | Create an instance to interact with the own HTLC. +*DefaultApi* | [**WithdrawCounterpartyV1**](docs/DefaultApi.md#withdrawcounterpartyv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty | Withdraw funds of the counterparty HTLC + + +## Documentation For Models + + - [CounterpartyHTLCRequest](docs/CounterpartyHTLCRequest.md) + - [HtlcPackage](docs/HtlcPackage.md) + - [OwnHTLCRequest](docs/OwnHTLCRequest.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [WithdrawCounterpartyRequest](docs/WithdrawCounterpartyRequest.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..bf233a5046d --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,335 @@ +openapi: 3.0.3 +info: + description: Can exchange assets between networks + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - HTLC Coordinator + version: v2.0.0-alpha.2 +servers: +- description: Public test instance + url: "https://www.cactus.stream/{basePath}" + variables: + basePath: + default: "" +- description: Local test instance + url: "http://localhost:4000/{basePath}" + variables: + basePath: + default: "" +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc: + post: + operationId: ownHtlcV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OwnHTLCRequest' + responses: + "200": + content: + application/json: + schema: {} + description: OK + summary: Create an instance to interact with the own HTLC. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc: + post: + operationId: counterpartyHtlcV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CounterpartyHTLCRequest' + responses: + "200": + content: + application/json: + schema: {} + description: OK + summary: Create an instance to interact with the counterparty HTLC + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty: + post: + operationId: withdrawCounterpartyV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WithdrawCounterpartyRequest' + responses: + "200": + content: + application/json: + schema: {} + description: OK + summary: Withdraw funds of the counterparty HTLC + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty +components: + schemas: + OwnHTLCRequest: + example: + htlcPackage: null + receiver: receiver + connectorInstanceId: connectorInstanceId + constructorArgs: + - "" + - "" + outputAmount: 6.027456183070403 + outputNetwork: outputNetwork + hashLock: hashLock + inputAmount: 0.8008281904610115 + tokenAddress: tokenAddress + outputAddress: outputAddress + keychainId: keychainId + gas: 5.962133916683182 + web3SigningCredential: + type: null + expiration: 1.4658129805029452 + properties: + htlcPackage: + $ref: '#/components/schemas/HtlcPackage' + connectorInstanceId: + description: connector Instance Id for the connector plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + inputAmount: + description: Input amount to lock + nullable: false + type: number + outputAmount: + description: Output amount to lock + nullable: false + type: number + expiration: + description: Timestamp to expire the contract + nullable: false + type: number + hashLock: + description: Hashlock needed to refund the amount + nullable: false + type: string + tokenAddress: + description: The token address + nullable: false + type: string + receiver: + description: The receiver address + nullable: false + type: string + outputNetwork: + description: The output network id + nullable: false + type: string + outputAddress: + description: The output addreess to receive the tokens + nullable: false + type: string + gas: + type: number + required: + - connectorInstanceId + - constructorArgs + - expiration + - hashLock + - htlcPackage + - inputAmount + - keychainId + - outputAddress + - outputAmount + - outputNetwork + - receiver + - tokenAddress + - web3SigningCredential + type: object + CounterpartyHTLCRequest: + example: + htlcPackage: null + htlcId: htlcId + keychainId: keychainId + connectorInstanceId: connectorInstanceId + gas: 0.8008281904610115 + web3SigningCredential: + type: null + properties: + htlcPackage: + $ref: '#/components/schemas/HtlcPackage' + connectorInstanceId: + description: connector Instance Id for the connector plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + htlcId: + description: Id for the HTLC + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + type: number + required: + - connectorInstanceId + - htlcId + - htlcPackage + - keychainId + - web3SigningCredential + type: object + WithdrawCounterpartyRequest: + example: + htlcPackage: null + htlcId: htlcId + keychainId: keychainId + connectorInstanceId: connectorInstanceId + contractId: contractId + gas: 0.8008281904610115 + web3SigningCredential: + type: null + secret: secret + properties: + htlcPackage: + $ref: '#/components/schemas/HtlcPackage' + connectorInstanceId: + description: connector Instance Id for the connector plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + contractId: + description: contractId for the contract + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + htlcId: + description: Id for the HTLC + nullable: false + type: string + secret: + description: Counterparty HTLC secret + nullable: false + type: string + gas: + type: number + required: + - connectorInstanceId + - htlcId + - htlcPackage + - keychainId + - secret + - web3SigningCredential + type: object + HtlcPackage: + enum: + - BESU + - BESU_ERC20 + type: string + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/api_default.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..2a878130dfe --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,338 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiCounterpartyHtlcV1Request struct { + ctx context.Context + ApiService *DefaultApiService + counterpartyHTLCRequest *CounterpartyHTLCRequest +} + +func (r ApiCounterpartyHtlcV1Request) CounterpartyHTLCRequest(counterpartyHTLCRequest CounterpartyHTLCRequest) ApiCounterpartyHtlcV1Request { + r.counterpartyHTLCRequest = &counterpartyHTLCRequest + return r +} + +func (r ApiCounterpartyHtlcV1Request) Execute() (interface{}, *http.Response, error) { + return r.ApiService.CounterpartyHtlcV1Execute(r) +} + +/* +CounterpartyHtlcV1 Create an instance to interact with the counterparty HTLC + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCounterpartyHtlcV1Request +*/ +func (a *DefaultApiService) CounterpartyHtlcV1(ctx context.Context) ApiCounterpartyHtlcV1Request { + return ApiCounterpartyHtlcV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return interface{} +func (a *DefaultApiService) CounterpartyHtlcV1Execute(r ApiCounterpartyHtlcV1Request) (interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CounterpartyHtlcV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.counterpartyHTLCRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOwnHtlcV1Request struct { + ctx context.Context + ApiService *DefaultApiService + ownHTLCRequest *OwnHTLCRequest +} + +func (r ApiOwnHtlcV1Request) OwnHTLCRequest(ownHTLCRequest OwnHTLCRequest) ApiOwnHtlcV1Request { + r.ownHTLCRequest = &ownHTLCRequest + return r +} + +func (r ApiOwnHtlcV1Request) Execute() (interface{}, *http.Response, error) { + return r.ApiService.OwnHtlcV1Execute(r) +} + +/* +OwnHtlcV1 Create an instance to interact with the own HTLC. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOwnHtlcV1Request +*/ +func (a *DefaultApiService) OwnHtlcV1(ctx context.Context) ApiOwnHtlcV1Request { + return ApiOwnHtlcV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return interface{} +func (a *DefaultApiService) OwnHtlcV1Execute(r ApiOwnHtlcV1Request) (interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.OwnHtlcV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.ownHTLCRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWithdrawCounterpartyV1Request struct { + ctx context.Context + ApiService *DefaultApiService + withdrawCounterpartyRequest *WithdrawCounterpartyRequest +} + +func (r ApiWithdrawCounterpartyV1Request) WithdrawCounterpartyRequest(withdrawCounterpartyRequest WithdrawCounterpartyRequest) ApiWithdrawCounterpartyV1Request { + r.withdrawCounterpartyRequest = &withdrawCounterpartyRequest + return r +} + +func (r ApiWithdrawCounterpartyV1Request) Execute() (interface{}, *http.Response, error) { + return r.ApiService.WithdrawCounterpartyV1Execute(r) +} + +/* +WithdrawCounterpartyV1 Withdraw funds of the counterparty HTLC + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWithdrawCounterpartyV1Request +*/ +func (a *DefaultApiService) WithdrawCounterpartyV1(ctx context.Context) ApiWithdrawCounterpartyV1Request { + return ApiWithdrawCounterpartyV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return interface{} +func (a *DefaultApiService) WithdrawCounterpartyV1Execute(r ApiWithdrawCounterpartyV1Request) (interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.WithdrawCounterpartyV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.withdrawCounterpartyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/client.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..ea9ac1e7db0 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - HTLC Coordinator API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/configuration.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..c6a42a4a002 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,231 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "https://www.cactus.stream/{basePath}", + Description: "Public test instance", + Variables: map[string]ServerVariable{ + "basePath": ServerVariable{ + Description: "No description provided", + DefaultValue: "", + }, + }, + }, + { + URL: "http://localhost:4000/{basePath}", + Description: "Local test instance", + Variables: map[string]ServerVariable{ + "basePath": ServerVariable{ + Description: "No description provided", + DefaultValue: "", + }, + }, + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/go.mod b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..23a18c809de --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/go.sum b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_counterparty_htlc_request.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_counterparty_htlc_request.go new file mode 100644 index 00000000000..67fae80c12b --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_counterparty_htlc_request.go @@ -0,0 +1,264 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" +) + +// checks if the CounterpartyHTLCRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CounterpartyHTLCRequest{} + +// CounterpartyHTLCRequest struct for CounterpartyHTLCRequest +type CounterpartyHTLCRequest struct { + HtlcPackage HtlcPackage `json:"htlcPackage"` + // connector Instance Id for the connector plugin + ConnectorInstanceId string `json:"connectorInstanceId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + // Id for the HTLC + HtlcId string `json:"htlcId"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + Gas *float32 `json:"gas,omitempty"` +} + +// NewCounterpartyHTLCRequest instantiates a new CounterpartyHTLCRequest 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 +// will change when the set of required properties is changed +func NewCounterpartyHTLCRequest(htlcPackage HtlcPackage, connectorInstanceId string, keychainId string, htlcId string, web3SigningCredential Web3SigningCredential) *CounterpartyHTLCRequest { + this := CounterpartyHTLCRequest{} + this.HtlcPackage = htlcPackage + this.ConnectorInstanceId = connectorInstanceId + this.KeychainId = keychainId + this.HtlcId = htlcId + this.Web3SigningCredential = web3SigningCredential + return &this +} + +// NewCounterpartyHTLCRequestWithDefaults instantiates a new CounterpartyHTLCRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCounterpartyHTLCRequestWithDefaults() *CounterpartyHTLCRequest { + this := CounterpartyHTLCRequest{} + return &this +} + +// GetHtlcPackage returns the HtlcPackage field value +func (o *CounterpartyHTLCRequest) GetHtlcPackage() HtlcPackage { + if o == nil { + var ret HtlcPackage + return ret + } + + return o.HtlcPackage +} + +// GetHtlcPackageOk returns a tuple with the HtlcPackage field value +// and a boolean to check if the value has been set. +func (o *CounterpartyHTLCRequest) GetHtlcPackageOk() (*HtlcPackage, bool) { + if o == nil { + return nil, false + } + return &o.HtlcPackage, true +} + +// SetHtlcPackage sets field value +func (o *CounterpartyHTLCRequest) SetHtlcPackage(v HtlcPackage) { + o.HtlcPackage = v +} + +// GetConnectorInstanceId returns the ConnectorInstanceId field value +func (o *CounterpartyHTLCRequest) GetConnectorInstanceId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorInstanceId +} + +// GetConnectorInstanceIdOk returns a tuple with the ConnectorInstanceId field value +// and a boolean to check if the value has been set. +func (o *CounterpartyHTLCRequest) GetConnectorInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorInstanceId, true +} + +// SetConnectorInstanceId sets field value +func (o *CounterpartyHTLCRequest) SetConnectorInstanceId(v string) { + o.ConnectorInstanceId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *CounterpartyHTLCRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *CounterpartyHTLCRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *CounterpartyHTLCRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetHtlcId returns the HtlcId field value +func (o *CounterpartyHTLCRequest) GetHtlcId() string { + if o == nil { + var ret string + return ret + } + + return o.HtlcId +} + +// GetHtlcIdOk returns a tuple with the HtlcId field value +// and a boolean to check if the value has been set. +func (o *CounterpartyHTLCRequest) GetHtlcIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HtlcId, true +} + +// SetHtlcId sets field value +func (o *CounterpartyHTLCRequest) SetHtlcId(v string) { + o.HtlcId = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *CounterpartyHTLCRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *CounterpartyHTLCRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *CounterpartyHTLCRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *CounterpartyHTLCRequest) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CounterpartyHTLCRequest) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *CounterpartyHTLCRequest) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *CounterpartyHTLCRequest) SetGas(v float32) { + o.Gas = &v +} + +func (o CounterpartyHTLCRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CounterpartyHTLCRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["htlcPackage"] = o.HtlcPackage + toSerialize["connectorInstanceId"] = o.ConnectorInstanceId + toSerialize["keychainId"] = o.KeychainId + toSerialize["htlcId"] = o.HtlcId + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableCounterpartyHTLCRequest struct { + value *CounterpartyHTLCRequest + isSet bool +} + +func (v NullableCounterpartyHTLCRequest) Get() *CounterpartyHTLCRequest { + return v.value +} + +func (v *NullableCounterpartyHTLCRequest) Set(val *CounterpartyHTLCRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCounterpartyHTLCRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCounterpartyHTLCRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCounterpartyHTLCRequest(val *CounterpartyHTLCRequest) *NullableCounterpartyHTLCRequest { + return &NullableCounterpartyHTLCRequest{value: val, isSet: true} +} + +func (v NullableCounterpartyHTLCRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCounterpartyHTLCRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_htlc_package.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_htlc_package.go new file mode 100644 index 00000000000..adeccb4cda5 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_htlc_package.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" + "fmt" +) + +// HtlcPackage the model 'HtlcPackage' +type HtlcPackage string + +// List of HtlcPackage +const ( + BESU HtlcPackage = "BESU" + BESU_ERC20 HtlcPackage = "BESU_ERC20" +) + +// All allowed values of HtlcPackage enum +var AllowedHtlcPackageEnumValues = []HtlcPackage{ + "BESU", + "BESU_ERC20", +} + +func (v *HtlcPackage) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := HtlcPackage(value) + for _, existing := range AllowedHtlcPackageEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid HtlcPackage", value) +} + +// NewHtlcPackageFromValue returns a pointer to a valid HtlcPackage +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewHtlcPackageFromValue(v string) (*HtlcPackage, error) { + ev := HtlcPackage(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for HtlcPackage: valid values are %v", v, AllowedHtlcPackageEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v HtlcPackage) IsValid() bool { + for _, existing := range AllowedHtlcPackageEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to HtlcPackage value +func (v HtlcPackage) Ptr() *HtlcPackage { + return &v +} + +type NullableHtlcPackage struct { + value *HtlcPackage + isSet bool +} + +func (v NullableHtlcPackage) Get() *HtlcPackage { + return v.value +} + +func (v *NullableHtlcPackage) Set(val *HtlcPackage) { + v.value = val + v.isSet = true +} + +func (v NullableHtlcPackage) IsSet() bool { + return v.isSet +} + +func (v *NullableHtlcPackage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHtlcPackage(val *HtlcPackage) *NullableHtlcPackage { + return &NullableHtlcPackage{value: val, isSet: true} +} + +func (v NullableHtlcPackage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHtlcPackage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_own_htlc_request.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_own_htlc_request.go new file mode 100644 index 00000000000..d38473839dc --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_own_htlc_request.go @@ -0,0 +1,487 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" +) + +// checks if the OwnHTLCRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OwnHTLCRequest{} + +// OwnHTLCRequest struct for OwnHTLCRequest +type OwnHTLCRequest struct { + HtlcPackage HtlcPackage `json:"htlcPackage"` + // connector Instance Id for the connector plugin + ConnectorInstanceId string `json:"connectorInstanceId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + ConstructorArgs []interface{} `json:"constructorArgs"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // Input amount to lock + InputAmount float32 `json:"inputAmount"` + // Output amount to lock + OutputAmount float32 `json:"outputAmount"` + // Timestamp to expire the contract + Expiration float32 `json:"expiration"` + // Hashlock needed to refund the amount + HashLock string `json:"hashLock"` + // The token address + TokenAddress string `json:"tokenAddress"` + // The receiver address + Receiver string `json:"receiver"` + // The output network id + OutputNetwork string `json:"outputNetwork"` + // The output addreess to receive the tokens + OutputAddress string `json:"outputAddress"` + Gas *float32 `json:"gas,omitempty"` +} + +// NewOwnHTLCRequest instantiates a new OwnHTLCRequest 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 +// will change when the set of required properties is changed +func NewOwnHTLCRequest(htlcPackage HtlcPackage, connectorInstanceId string, keychainId string, constructorArgs []interface{}, web3SigningCredential Web3SigningCredential, inputAmount float32, outputAmount float32, expiration float32, hashLock string, tokenAddress string, receiver string, outputNetwork string, outputAddress string) *OwnHTLCRequest { + this := OwnHTLCRequest{} + this.HtlcPackage = htlcPackage + this.ConnectorInstanceId = connectorInstanceId + this.KeychainId = keychainId + this.ConstructorArgs = constructorArgs + this.Web3SigningCredential = web3SigningCredential + this.InputAmount = inputAmount + this.OutputAmount = outputAmount + this.Expiration = expiration + this.HashLock = hashLock + this.TokenAddress = tokenAddress + this.Receiver = receiver + this.OutputNetwork = outputNetwork + this.OutputAddress = outputAddress + return &this +} + +// NewOwnHTLCRequestWithDefaults instantiates a new OwnHTLCRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOwnHTLCRequestWithDefaults() *OwnHTLCRequest { + this := OwnHTLCRequest{} + return &this +} + +// GetHtlcPackage returns the HtlcPackage field value +func (o *OwnHTLCRequest) GetHtlcPackage() HtlcPackage { + if o == nil { + var ret HtlcPackage + return ret + } + + return o.HtlcPackage +} + +// GetHtlcPackageOk returns a tuple with the HtlcPackage field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetHtlcPackageOk() (*HtlcPackage, bool) { + if o == nil { + return nil, false + } + return &o.HtlcPackage, true +} + +// SetHtlcPackage sets field value +func (o *OwnHTLCRequest) SetHtlcPackage(v HtlcPackage) { + o.HtlcPackage = v +} + +// GetConnectorInstanceId returns the ConnectorInstanceId field value +func (o *OwnHTLCRequest) GetConnectorInstanceId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorInstanceId +} + +// GetConnectorInstanceIdOk returns a tuple with the ConnectorInstanceId field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetConnectorInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorInstanceId, true +} + +// SetConnectorInstanceId sets field value +func (o *OwnHTLCRequest) SetConnectorInstanceId(v string) { + o.ConnectorInstanceId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *OwnHTLCRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *OwnHTLCRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetConstructorArgs returns the ConstructorArgs field value +func (o *OwnHTLCRequest) GetConstructorArgs() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ConstructorArgs, true +} + +// SetConstructorArgs sets field value +func (o *OwnHTLCRequest) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *OwnHTLCRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *OwnHTLCRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetInputAmount returns the InputAmount field value +func (o *OwnHTLCRequest) GetInputAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.InputAmount +} + +// GetInputAmountOk returns a tuple with the InputAmount field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetInputAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.InputAmount, true +} + +// SetInputAmount sets field value +func (o *OwnHTLCRequest) SetInputAmount(v float32) { + o.InputAmount = v +} + +// GetOutputAmount returns the OutputAmount field value +func (o *OwnHTLCRequest) GetOutputAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.OutputAmount +} + +// GetOutputAmountOk returns a tuple with the OutputAmount field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetOutputAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.OutputAmount, true +} + +// SetOutputAmount sets field value +func (o *OwnHTLCRequest) SetOutputAmount(v float32) { + o.OutputAmount = v +} + +// GetExpiration returns the Expiration field value +func (o *OwnHTLCRequest) GetExpiration() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Expiration +} + +// GetExpirationOk returns a tuple with the Expiration field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetExpirationOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Expiration, true +} + +// SetExpiration sets field value +func (o *OwnHTLCRequest) SetExpiration(v float32) { + o.Expiration = v +} + +// GetHashLock returns the HashLock field value +func (o *OwnHTLCRequest) GetHashLock() string { + if o == nil { + var ret string + return ret + } + + return o.HashLock +} + +// GetHashLockOk returns a tuple with the HashLock field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetHashLockOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashLock, true +} + +// SetHashLock sets field value +func (o *OwnHTLCRequest) SetHashLock(v string) { + o.HashLock = v +} + +// GetTokenAddress returns the TokenAddress field value +func (o *OwnHTLCRequest) GetTokenAddress() string { + if o == nil { + var ret string + return ret + } + + return o.TokenAddress +} + +// GetTokenAddressOk returns a tuple with the TokenAddress field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetTokenAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TokenAddress, true +} + +// SetTokenAddress sets field value +func (o *OwnHTLCRequest) SetTokenAddress(v string) { + o.TokenAddress = v +} + +// GetReceiver returns the Receiver field value +func (o *OwnHTLCRequest) GetReceiver() string { + if o == nil { + var ret string + return ret + } + + return o.Receiver +} + +// GetReceiverOk returns a tuple with the Receiver field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetReceiverOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Receiver, true +} + +// SetReceiver sets field value +func (o *OwnHTLCRequest) SetReceiver(v string) { + o.Receiver = v +} + +// GetOutputNetwork returns the OutputNetwork field value +func (o *OwnHTLCRequest) GetOutputNetwork() string { + if o == nil { + var ret string + return ret + } + + return o.OutputNetwork +} + +// GetOutputNetworkOk returns a tuple with the OutputNetwork field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetOutputNetworkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OutputNetwork, true +} + +// SetOutputNetwork sets field value +func (o *OwnHTLCRequest) SetOutputNetwork(v string) { + o.OutputNetwork = v +} + +// GetOutputAddress returns the OutputAddress field value +func (o *OwnHTLCRequest) GetOutputAddress() string { + if o == nil { + var ret string + return ret + } + + return o.OutputAddress +} + +// GetOutputAddressOk returns a tuple with the OutputAddress field value +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetOutputAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OutputAddress, true +} + +// SetOutputAddress sets field value +func (o *OwnHTLCRequest) SetOutputAddress(v string) { + o.OutputAddress = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *OwnHTLCRequest) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OwnHTLCRequest) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *OwnHTLCRequest) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *OwnHTLCRequest) SetGas(v float32) { + o.Gas = &v +} + +func (o OwnHTLCRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OwnHTLCRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["htlcPackage"] = o.HtlcPackage + toSerialize["connectorInstanceId"] = o.ConnectorInstanceId + toSerialize["keychainId"] = o.KeychainId + toSerialize["constructorArgs"] = o.ConstructorArgs + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["inputAmount"] = o.InputAmount + toSerialize["outputAmount"] = o.OutputAmount + toSerialize["expiration"] = o.Expiration + toSerialize["hashLock"] = o.HashLock + toSerialize["tokenAddress"] = o.TokenAddress + toSerialize["receiver"] = o.Receiver + toSerialize["outputNetwork"] = o.OutputNetwork + toSerialize["outputAddress"] = o.OutputAddress + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableOwnHTLCRequest struct { + value *OwnHTLCRequest + isSet bool +} + +func (v NullableOwnHTLCRequest) Get() *OwnHTLCRequest { + return v.value +} + +func (v *NullableOwnHTLCRequest) Set(val *OwnHTLCRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOwnHTLCRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOwnHTLCRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOwnHTLCRequest(val *OwnHTLCRequest) *NullableOwnHTLCRequest { + return &NullableOwnHTLCRequest{value: val, isSet: true} +} + +func (v NullableOwnHTLCRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOwnHTLCRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go new file mode 100644 index 00000000000..ca4bf4dcc51 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go @@ -0,0 +1,178 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredential - struct for Web3SigningCredential +type Web3SigningCredential struct { + Web3SigningCredentialCactusKeychainRef *Web3SigningCredentialCactusKeychainRef + Web3SigningCredentialNone *Web3SigningCredentialNone + Web3SigningCredentialPrivateKeyHex *Web3SigningCredentialPrivateKeyHex +} + +// Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialCactusKeychainRef wrapped in Web3SigningCredential +func Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential(v *Web3SigningCredentialCactusKeychainRef) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialCactusKeychainRef: v, + } +} + +// Web3SigningCredentialNoneAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialNone wrapped in Web3SigningCredential +func Web3SigningCredentialNoneAsWeb3SigningCredential(v *Web3SigningCredentialNone) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialNone: v, + } +} + +// Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialPrivateKeyHex wrapped in Web3SigningCredential +func Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential(v *Web3SigningCredentialPrivateKeyHex) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialPrivateKeyHex: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Web3SigningCredential) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Web3SigningCredentialCactusKeychainRef + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialCactusKeychainRef) + if err == nil { + jsonWeb3SigningCredentialCactusKeychainRef, _ := json.Marshal(dst.Web3SigningCredentialCactusKeychainRef) + if string(jsonWeb3SigningCredentialCactusKeychainRef) == "{}" { // empty struct + dst.Web3SigningCredentialCactusKeychainRef = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialCactusKeychainRef = nil + } + + // try to unmarshal data into Web3SigningCredentialNone + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialNone) + if err == nil { + jsonWeb3SigningCredentialNone, _ := json.Marshal(dst.Web3SigningCredentialNone) + if string(jsonWeb3SigningCredentialNone) == "{}" { // empty struct + dst.Web3SigningCredentialNone = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialNone = nil + } + + // try to unmarshal data into Web3SigningCredentialPrivateKeyHex + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialPrivateKeyHex) + if err == nil { + jsonWeb3SigningCredentialPrivateKeyHex, _ := json.Marshal(dst.Web3SigningCredentialPrivateKeyHex) + if string(jsonWeb3SigningCredentialPrivateKeyHex) == "{}" { // empty struct + dst.Web3SigningCredentialPrivateKeyHex = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialPrivateKeyHex = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Web3SigningCredentialCactusKeychainRef = nil + dst.Web3SigningCredentialNone = nil + dst.Web3SigningCredentialPrivateKeyHex = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Web3SigningCredential)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Web3SigningCredential)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Web3SigningCredential) MarshalJSON() ([]byte, error) { + if src.Web3SigningCredentialCactusKeychainRef != nil { + return json.Marshal(&src.Web3SigningCredentialCactusKeychainRef) + } + + if src.Web3SigningCredentialNone != nil { + return json.Marshal(&src.Web3SigningCredentialNone) + } + + if src.Web3SigningCredentialPrivateKeyHex != nil { + return json.Marshal(&src.Web3SigningCredentialPrivateKeyHex) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Web3SigningCredential) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Web3SigningCredentialCactusKeychainRef != nil { + return obj.Web3SigningCredentialCactusKeychainRef + } + + if obj.Web3SigningCredentialNone != nil { + return obj.Web3SigningCredentialNone + } + + if obj.Web3SigningCredentialPrivateKeyHex != nil { + return obj.Web3SigningCredentialPrivateKeyHex + } + + // all schemas are nil + return nil +} + +type NullableWeb3SigningCredential struct { + value *Web3SigningCredential + isSet bool +} + +func (v NullableWeb3SigningCredential) Get() *Web3SigningCredential { + return v.value +} + +func (v *NullableWeb3SigningCredential) Set(val *Web3SigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredential(val *Web3SigningCredential) *NullableWeb3SigningCredential { + return &NullableWeb3SigningCredential{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go new file mode 100644 index 00000000000..4f0c40bc458 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go @@ -0,0 +1,201 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialCactusKeychainRef type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialCactusKeychainRef{} + +// Web3SigningCredentialCactusKeychainRef struct for Web3SigningCredentialCactusKeychainRef +type Web3SigningCredentialCactusKeychainRef struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + KeychainEntryKey string `json:"keychainEntryKey"` + // The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + KeychainId string `json:"keychainId"` +} + +// NewWeb3SigningCredentialCactusKeychainRef instantiates a new Web3SigningCredentialCactusKeychainRef 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialCactusKeychainRef(type_ Web3SigningCredentialType, ethAccount string, keychainEntryKey string, keychainId string) *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + this.Type = type_ + this.EthAccount = ethAccount + this.KeychainEntryKey = keychainEntryKey + this.KeychainId = keychainId + return &this +} + +// NewWeb3SigningCredentialCactusKeychainRefWithDefaults instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialCactusKeychainRefWithDefaults() *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialCactusKeychainRef) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetKeychainEntryKey returns the KeychainEntryKey field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKey() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainEntryKey +} + +// GetKeychainEntryKeyOk returns a tuple with the KeychainEntryKey field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainEntryKey, true +} + +// SetKeychainEntryKey sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainEntryKey(v string) { + o.KeychainEntryKey = v +} + +// GetKeychainId returns the KeychainId field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o Web3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialCactusKeychainRef) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["keychainEntryKey"] = o.KeychainEntryKey + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableWeb3SigningCredentialCactusKeychainRef struct { + value *Web3SigningCredentialCactusKeychainRef + isSet bool +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) Get() *Web3SigningCredentialCactusKeychainRef { + return v.value +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Set(val *Web3SigningCredentialCactusKeychainRef) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialCactusKeychainRef(val *Web3SigningCredentialCactusKeychainRef) *NullableWeb3SigningCredentialCactusKeychainRef { + return &NullableWeb3SigningCredentialCactusKeychainRef{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go new file mode 100644 index 00000000000..36be4c123d1 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialNone type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialNone{} + +// Web3SigningCredentialNone Using this denotes that there is no signing required because the transaction is pre-signed. +type Web3SigningCredentialNone struct { + Type Web3SigningCredentialType `json:"type"` +} + +// NewWeb3SigningCredentialNone instantiates a new Web3SigningCredentialNone 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialNone(type_ Web3SigningCredentialType) *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + this.Type = type_ + return &this +} + +// NewWeb3SigningCredentialNoneWithDefaults instantiates a new Web3SigningCredentialNone object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialNoneWithDefaults() *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialNone) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialNone) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialNone) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +func (o Web3SigningCredentialNone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialNone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableWeb3SigningCredentialNone struct { + value *Web3SigningCredentialNone + isSet bool +} + +func (v NullableWeb3SigningCredentialNone) Get() *Web3SigningCredentialNone { + return v.value +} + +func (v *NullableWeb3SigningCredentialNone) Set(val *Web3SigningCredentialNone) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialNone) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialNone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialNone(val *Web3SigningCredentialNone) *NullableWeb3SigningCredentialNone { + return &NullableWeb3SigningCredentialNone{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialNone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialNone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go new file mode 100644 index 00000000000..f8b78c4525c --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialPrivateKeyHex type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialPrivateKeyHex{} + +// Web3SigningCredentialPrivateKeyHex struct for Web3SigningCredentialPrivateKeyHex +type Web3SigningCredentialPrivateKeyHex struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The HEX encoded private key of an eth account. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialPrivateKeyHex instantiates a new Web3SigningCredentialPrivateKeyHex 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialPrivateKeyHex(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialPrivateKeyHexWithDefaults instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialPrivateKeyHexWithDefaults() *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialPrivateKeyHex) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialPrivateKeyHex) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialPrivateKeyHex) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialPrivateKeyHex struct { + value *Web3SigningCredentialPrivateKeyHex + isSet bool +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) Get() *Web3SigningCredentialPrivateKeyHex { + return v.value +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Set(val *Web3SigningCredentialPrivateKeyHex) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialPrivateKeyHex(val *Web3SigningCredentialPrivateKeyHex) *NullableWeb3SigningCredentialPrivateKeyHex { + return &NullableWeb3SigningCredentialPrivateKeyHex{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go new file mode 100644 index 00000000000..e8e29b5747a --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredentialType the model 'Web3SigningCredentialType' +type Web3SigningCredentialType string + +// List of Web3SigningCredentialType +const ( + CACTUS_KEYCHAIN_REF Web3SigningCredentialType = "CACTUS_KEYCHAIN_REF" + GETH_KEYCHAIN_PASSWORD Web3SigningCredentialType = "GETH_KEYCHAIN_PASSWORD" + PRIVATE_KEY_HEX Web3SigningCredentialType = "PRIVATE_KEY_HEX" + NONE Web3SigningCredentialType = "NONE" +) + +// All allowed values of Web3SigningCredentialType enum +var AllowedWeb3SigningCredentialTypeEnumValues = []Web3SigningCredentialType{ + "CACTUS_KEYCHAIN_REF", + "GETH_KEYCHAIN_PASSWORD", + "PRIVATE_KEY_HEX", + "NONE", +} + +func (v *Web3SigningCredentialType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Web3SigningCredentialType(value) + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Web3SigningCredentialType", value) +} + +// NewWeb3SigningCredentialTypeFromValue returns a pointer to a valid Web3SigningCredentialType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWeb3SigningCredentialTypeFromValue(v string) (*Web3SigningCredentialType, error) { + ev := Web3SigningCredentialType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Web3SigningCredentialType: valid values are %v", v, AllowedWeb3SigningCredentialTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Web3SigningCredentialType) IsValid() bool { + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Web3SigningCredentialType value +func (v Web3SigningCredentialType) Ptr() *Web3SigningCredentialType { + return &v +} + +type NullableWeb3SigningCredentialType struct { + value *Web3SigningCredentialType + isSet bool +} + +func (v NullableWeb3SigningCredentialType) Get() *Web3SigningCredentialType { + return v.value +} + +func (v *NullableWeb3SigningCredentialType) Set(val *Web3SigningCredentialType) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialType) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialType(val *Web3SigningCredentialType) *NullableWeb3SigningCredentialType { + return &NullableWeb3SigningCredentialType{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_withdraw_counterparty_request.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_withdraw_counterparty_request.go new file mode 100644 index 00000000000..f9d27852862 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/model_withdraw_counterparty_request.go @@ -0,0 +1,329 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" +) + +// checks if the WithdrawCounterpartyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WithdrawCounterpartyRequest{} + +// WithdrawCounterpartyRequest struct for WithdrawCounterpartyRequest +type WithdrawCounterpartyRequest struct { + HtlcPackage HtlcPackage `json:"htlcPackage"` + // connector Instance Id for the connector plugin + ConnectorInstanceId string `json:"connectorInstanceId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + // contractId for the contract + ContractId *string `json:"contractId,omitempty"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // Id for the HTLC + HtlcId string `json:"htlcId"` + // Counterparty HTLC secret + Secret string `json:"secret"` + Gas *float32 `json:"gas,omitempty"` +} + +// NewWithdrawCounterpartyRequest instantiates a new WithdrawCounterpartyRequest 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 +// will change when the set of required properties is changed +func NewWithdrawCounterpartyRequest(htlcPackage HtlcPackage, connectorInstanceId string, keychainId string, web3SigningCredential Web3SigningCredential, htlcId string, secret string) *WithdrawCounterpartyRequest { + this := WithdrawCounterpartyRequest{} + this.HtlcPackage = htlcPackage + this.ConnectorInstanceId = connectorInstanceId + this.KeychainId = keychainId + this.Web3SigningCredential = web3SigningCredential + this.HtlcId = htlcId + this.Secret = secret + return &this +} + +// NewWithdrawCounterpartyRequestWithDefaults instantiates a new WithdrawCounterpartyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWithdrawCounterpartyRequestWithDefaults() *WithdrawCounterpartyRequest { + this := WithdrawCounterpartyRequest{} + return &this +} + +// GetHtlcPackage returns the HtlcPackage field value +func (o *WithdrawCounterpartyRequest) GetHtlcPackage() HtlcPackage { + if o == nil { + var ret HtlcPackage + return ret + } + + return o.HtlcPackage +} + +// GetHtlcPackageOk returns a tuple with the HtlcPackage field value +// and a boolean to check if the value has been set. +func (o *WithdrawCounterpartyRequest) GetHtlcPackageOk() (*HtlcPackage, bool) { + if o == nil { + return nil, false + } + return &o.HtlcPackage, true +} + +// SetHtlcPackage sets field value +func (o *WithdrawCounterpartyRequest) SetHtlcPackage(v HtlcPackage) { + o.HtlcPackage = v +} + +// GetConnectorInstanceId returns the ConnectorInstanceId field value +func (o *WithdrawCounterpartyRequest) GetConnectorInstanceId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorInstanceId +} + +// GetConnectorInstanceIdOk returns a tuple with the ConnectorInstanceId field value +// and a boolean to check if the value has been set. +func (o *WithdrawCounterpartyRequest) GetConnectorInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorInstanceId, true +} + +// SetConnectorInstanceId sets field value +func (o *WithdrawCounterpartyRequest) SetConnectorInstanceId(v string) { + o.ConnectorInstanceId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *WithdrawCounterpartyRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *WithdrawCounterpartyRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *WithdrawCounterpartyRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetContractId returns the ContractId field value if set, zero value otherwise. +func (o *WithdrawCounterpartyRequest) GetContractId() string { + if o == nil || IsNil(o.ContractId) { + var ret string + return ret + } + return *o.ContractId +} + +// GetContractIdOk returns a tuple with the ContractId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WithdrawCounterpartyRequest) GetContractIdOk() (*string, bool) { + if o == nil || IsNil(o.ContractId) { + return nil, false + } + return o.ContractId, true +} + +// HasContractId returns a boolean if a field has been set. +func (o *WithdrawCounterpartyRequest) HasContractId() bool { + if o != nil && !IsNil(o.ContractId) { + return true + } + + return false +} + +// SetContractId gets a reference to the given string and assigns it to the ContractId field. +func (o *WithdrawCounterpartyRequest) SetContractId(v string) { + o.ContractId = &v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *WithdrawCounterpartyRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *WithdrawCounterpartyRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *WithdrawCounterpartyRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetHtlcId returns the HtlcId field value +func (o *WithdrawCounterpartyRequest) GetHtlcId() string { + if o == nil { + var ret string + return ret + } + + return o.HtlcId +} + +// GetHtlcIdOk returns a tuple with the HtlcId field value +// and a boolean to check if the value has been set. +func (o *WithdrawCounterpartyRequest) GetHtlcIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HtlcId, true +} + +// SetHtlcId sets field value +func (o *WithdrawCounterpartyRequest) SetHtlcId(v string) { + o.HtlcId = v +} + +// GetSecret returns the Secret field value +func (o *WithdrawCounterpartyRequest) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *WithdrawCounterpartyRequest) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *WithdrawCounterpartyRequest) SetSecret(v string) { + o.Secret = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *WithdrawCounterpartyRequest) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WithdrawCounterpartyRequest) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *WithdrawCounterpartyRequest) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *WithdrawCounterpartyRequest) SetGas(v float32) { + o.Gas = &v +} + +func (o WithdrawCounterpartyRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WithdrawCounterpartyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["htlcPackage"] = o.HtlcPackage + toSerialize["connectorInstanceId"] = o.ConnectorInstanceId + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.ContractId) { + toSerialize["contractId"] = o.ContractId + } + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["htlcId"] = o.HtlcId + toSerialize["secret"] = o.Secret + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableWithdrawCounterpartyRequest struct { + value *WithdrawCounterpartyRequest + isSet bool +} + +func (v NullableWithdrawCounterpartyRequest) Get() *WithdrawCounterpartyRequest { + return v.value +} + +func (v *NullableWithdrawCounterpartyRequest) Set(val *WithdrawCounterpartyRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWithdrawCounterpartyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWithdrawCounterpartyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWithdrawCounterpartyRequest(val *WithdrawCounterpartyRequest) *NullableWithdrawCounterpartyRequest { + return &NullableWithdrawCounterpartyRequest{value: val, isSet: true} +} + +func (v NullableWithdrawCounterpartyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWithdrawCounterpartyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/response.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..ee4602e8e6d --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..99a47e3316c --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,61 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-htlc-coordinator-besu + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-htlc-coordinator-besu_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService CounterpartyHtlcV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.CounterpartyHtlcV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService OwnHtlcV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.OwnHtlcV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService WithdrawCounterpartyV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.WithdrawCounterpartyV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/utils.go b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..c04e4c876e3 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - HTLC Coordinator + +Can exchange assets between networks + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-coordinator-besu + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..25a3aab9e98 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - HTLC Coordinator + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..fd302ceba89 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,50 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/CounterpartyHTLCRequest.java +src/main/java/org/openapitools/client/model/HtlcPackage.java +src/main/java/org/openapitools/client/model/OwnHTLCRequest.java +src/main/java/org/openapitools/client/model/Web3SigningCredential.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java +src/main/java/org/openapitools/client/model/WithdrawCounterpartyRequest.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/CounterpartyHTLCRequestTest.java +src/test/java/org/openapitools/client/model/HtlcPackageTest.java +src/test/java/org/openapitools/client/model/OwnHTLCRequestTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java +src/test/java/org/openapitools/client/model/WithdrawCounterpartyRequestTest.java diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.travis.yml b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/README.md b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..92b964218d5 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,147 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - HTLC Coordinator +- API version: v2.0.0-alpha.2 + +Can exchange assets between networks + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://www.cactus.stream"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + CounterpartyHTLCRequest counterpartyHTLCRequest = new CounterpartyHTLCRequest(); // CounterpartyHTLCRequest | + try { + Object result = apiInstance.counterpartyHtlcV1(counterpartyHTLCRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#counterpartyHtlcV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://www.cactus.stream* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**counterpartyHtlcV1**](docs/DefaultApi.md#counterpartyHtlcV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc | Create an instance to interact with the counterparty HTLC +*DefaultApi* | [**ownHtlcV1**](docs/DefaultApi.md#ownHtlcV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc | Create an instance to interact with the own HTLC. +*DefaultApi* | [**withdrawCounterpartyV1**](docs/DefaultApi.md#withdrawCounterpartyV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty | Withdraw funds of the counterparty HTLC + + +## Documentation for Models + + - [CounterpartyHTLCRequest](docs/CounterpartyHTLCRequest.md) + - [HtlcPackage](docs/HtlcPackage.md) + - [OwnHTLCRequest](docs/OwnHTLCRequest.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [WithdrawCounterpartyRequest](docs/WithdrawCounterpartyRequest.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..7ad3e0bd5ed --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,342 @@ +openapi: 3.0.3 +info: + description: Can exchange assets between networks + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - HTLC Coordinator + version: v2.0.0-alpha.2 +servers: +- description: Public test instance + url: "https://www.cactus.stream/{basePath}" + variables: + basePath: + default: "" +- description: Local test instance + url: "http://localhost:4000/{basePath}" + variables: + basePath: + default: "" +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc: + post: + operationId: ownHtlcV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OwnHTLCRequest' + responses: + "200": + content: + application/json: + schema: {} + description: OK + summary: Create an instance to interact with the own HTLC. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc: + post: + operationId: counterpartyHtlcV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CounterpartyHTLCRequest' + responses: + "200": + content: + application/json: + schema: {} + description: OK + summary: Create an instance to interact with the counterparty HTLC + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty: + post: + operationId: withdrawCounterpartyV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WithdrawCounterpartyRequest' + responses: + "200": + content: + application/json: + schema: {} + description: OK + summary: Withdraw funds of the counterparty HTLC + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty + x-content-type: application/json + x-accepts: application/json +components: + schemas: + OwnHTLCRequest: + example: + htlcPackage: null + receiver: receiver + connectorInstanceId: connectorInstanceId + constructorArgs: + - "" + - "" + outputAmount: 6.027456183070403 + outputNetwork: outputNetwork + hashLock: hashLock + inputAmount: 0.8008281904610115 + tokenAddress: tokenAddress + outputAddress: outputAddress + keychainId: keychainId + gas: 5.962133916683182 + web3SigningCredential: + type: null + expiration: 1.4658129805029452 + properties: + htlcPackage: + $ref: '#/components/schemas/HtlcPackage' + connectorInstanceId: + description: connector Instance Id for the connector plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + inputAmount: + description: Input amount to lock + nullable: false + type: number + outputAmount: + description: Output amount to lock + nullable: false + type: number + expiration: + description: Timestamp to expire the contract + nullable: false + type: number + hashLock: + description: Hashlock needed to refund the amount + nullable: false + type: string + tokenAddress: + description: The token address + nullable: false + type: string + receiver: + description: The receiver address + nullable: false + type: string + outputNetwork: + description: The output network id + nullable: false + type: string + outputAddress: + description: The output addreess to receive the tokens + nullable: false + type: string + gas: + type: number + required: + - connectorInstanceId + - constructorArgs + - expiration + - hashLock + - htlcPackage + - inputAmount + - keychainId + - outputAddress + - outputAmount + - outputNetwork + - receiver + - tokenAddress + - web3SigningCredential + type: object + CounterpartyHTLCRequest: + example: + htlcPackage: null + htlcId: htlcId + keychainId: keychainId + connectorInstanceId: connectorInstanceId + gas: 0.8008281904610115 + web3SigningCredential: + type: null + properties: + htlcPackage: + $ref: '#/components/schemas/HtlcPackage' + connectorInstanceId: + description: connector Instance Id for the connector plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + htlcId: + description: Id for the HTLC + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + type: number + required: + - connectorInstanceId + - htlcId + - htlcPackage + - keychainId + - web3SigningCredential + type: object + WithdrawCounterpartyRequest: + example: + htlcPackage: null + htlcId: htlcId + keychainId: keychainId + connectorInstanceId: connectorInstanceId + contractId: contractId + gas: 0.8008281904610115 + web3SigningCredential: + type: null + secret: secret + properties: + htlcPackage: + $ref: '#/components/schemas/HtlcPackage' + connectorInstanceId: + description: connector Instance Id for the connector plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + contractId: + description: contractId for the contract + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + htlcId: + description: Id for the HTLC + nullable: false + type: string + secret: + description: Counterparty HTLC secret + nullable: false + type: string + gas: + type: number + required: + - connectorInstanceId + - htlcId + - htlcPackage + - keychainId + - secret + - web3SigningCredential + type: object + HtlcPackage: + enum: + - BESU + - BESU_ERC20 + type: string + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/build.gradle b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/build.sbt b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradle.properties b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradlew b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradlew.bat b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/pom.xml b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/settings.gradle b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..f85866524c6 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..9ddf5220094 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1566 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "https://www.cactus.stream"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "https://www.cactus.stream/{basePath}", + "Public test instance", + new HashMap() {{ + put("basePath", new ServerVariable( + "No description provided", + "", + new HashSet( + ) + )); + }} + ), + new ServerConfiguration( + "http://localhost:4000/{basePath}", + "Local test instance", + new HashMap() {{ + put("basePath", new ServerVariable( + "No description provided", + "", + new HashSet( + ) + )); + }} + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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 https://www.cactus.stream + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..57bc57c8a30 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..bed20f1b613 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..940ab5b6167 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..cf5eb261023 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..b533d45bd80 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,419 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(org.openapitools.client.model.Web3SigningCredential.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Web3SigningCredentialCactusKeychainRef", org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.class); + classByDiscriminatorValue.put("Web3SigningCredentialNone", org.openapitools.client.model.Web3SigningCredentialNone.class); + classByDiscriminatorValue.put("Web3SigningCredentialPrivateKeyHex", org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.class); + classByDiscriminatorValue.put("Web3SigningCredential", org.openapitools.client.model.Web3SigningCredential.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) + ; + 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; + } + + { + 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.CounterpartyHTLCRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OwnHTLCRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialNone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WithdrawCounterpartyRequest.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); + } + } + } + + /** + * 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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..0b959c0d3a9 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..08fdc49a353 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..19de2d55860 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..9ba41a9c36c --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..3099993711e --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,432 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.CounterpartyHTLCRequest; +import org.openapitools.client.model.OwnHTLCRequest; +import org.openapitools.client.model.WithdrawCounterpartyRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 counterpartyHtlcV1 + * @param counterpartyHTLCRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call counterpartyHtlcV1Call(CounterpartyHTLCRequest counterpartyHTLCRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = counterpartyHTLCRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc"; + + 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 counterpartyHtlcV1ValidateBeforeCall(CounterpartyHTLCRequest counterpartyHTLCRequest, final ApiCallback _callback) throws ApiException { + return counterpartyHtlcV1Call(counterpartyHTLCRequest, _callback); + + } + + /** + * Create an instance to interact with the counterparty HTLC + * + * @param counterpartyHTLCRequest (optional) + * @return Object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public Object counterpartyHtlcV1(CounterpartyHTLCRequest counterpartyHTLCRequest) throws ApiException { + ApiResponse localVarResp = counterpartyHtlcV1WithHttpInfo(counterpartyHTLCRequest); + return localVarResp.getData(); + } + + /** + * Create an instance to interact with the counterparty HTLC + * + * @param counterpartyHTLCRequest (optional) + * @return ApiResponse<Object> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse counterpartyHtlcV1WithHttpInfo(CounterpartyHTLCRequest counterpartyHTLCRequest) throws ApiException { + okhttp3.Call localVarCall = counterpartyHtlcV1ValidateBeforeCall(counterpartyHTLCRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create an instance to interact with the counterparty HTLC (asynchronously) + * + * @param counterpartyHTLCRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call counterpartyHtlcV1Async(CounterpartyHTLCRequest counterpartyHTLCRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = counterpartyHtlcV1ValidateBeforeCall(counterpartyHTLCRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for ownHtlcV1 + * @param ownHTLCRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call ownHtlcV1Call(OwnHTLCRequest ownHTLCRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = ownHTLCRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc"; + + 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 ownHtlcV1ValidateBeforeCall(OwnHTLCRequest ownHTLCRequest, final ApiCallback _callback) throws ApiException { + return ownHtlcV1Call(ownHTLCRequest, _callback); + + } + + /** + * Create an instance to interact with the own HTLC. + * + * @param ownHTLCRequest (optional) + * @return Object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public Object ownHtlcV1(OwnHTLCRequest ownHTLCRequest) throws ApiException { + ApiResponse localVarResp = ownHtlcV1WithHttpInfo(ownHTLCRequest); + return localVarResp.getData(); + } + + /** + * Create an instance to interact with the own HTLC. + * + * @param ownHTLCRequest (optional) + * @return ApiResponse<Object> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse ownHtlcV1WithHttpInfo(OwnHTLCRequest ownHTLCRequest) throws ApiException { + okhttp3.Call localVarCall = ownHtlcV1ValidateBeforeCall(ownHTLCRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create an instance to interact with the own HTLC. (asynchronously) + * + * @param ownHTLCRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call ownHtlcV1Async(OwnHTLCRequest ownHTLCRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = ownHtlcV1ValidateBeforeCall(ownHTLCRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for withdrawCounterpartyV1 + * @param withdrawCounterpartyRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call withdrawCounterpartyV1Call(WithdrawCounterpartyRequest withdrawCounterpartyRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = withdrawCounterpartyRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty"; + + 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 withdrawCounterpartyV1ValidateBeforeCall(WithdrawCounterpartyRequest withdrawCounterpartyRequest, final ApiCallback _callback) throws ApiException { + return withdrawCounterpartyV1Call(withdrawCounterpartyRequest, _callback); + + } + + /** + * Withdraw funds of the counterparty HTLC + * + * @param withdrawCounterpartyRequest (optional) + * @return Object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public Object withdrawCounterpartyV1(WithdrawCounterpartyRequest withdrawCounterpartyRequest) throws ApiException { + ApiResponse localVarResp = withdrawCounterpartyV1WithHttpInfo(withdrawCounterpartyRequest); + return localVarResp.getData(); + } + + /** + * Withdraw funds of the counterparty HTLC + * + * @param withdrawCounterpartyRequest (optional) + * @return ApiResponse<Object> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse withdrawCounterpartyV1WithHttpInfo(WithdrawCounterpartyRequest withdrawCounterpartyRequest) throws ApiException { + okhttp3.Call localVarCall = withdrawCounterpartyV1ValidateBeforeCall(withdrawCounterpartyRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Withdraw funds of the counterparty HTLC (asynchronously) + * + * @param withdrawCounterpartyRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call withdrawCounterpartyV1Async(WithdrawCounterpartyRequest withdrawCounterpartyRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = withdrawCounterpartyV1ValidateBeforeCall(withdrawCounterpartyRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..a2573625af4 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..82efbff0a00 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..1136c110f06 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..705ff6ca28a --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..4469b62aad3 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CounterpartyHTLCRequest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CounterpartyHTLCRequest.java new file mode 100644 index 00000000000..f56152e2a44 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CounterpartyHTLCRequest.java @@ -0,0 +1,371 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.HtlcPackage; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CounterpartyHTLCRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CounterpartyHTLCRequest { + public static final String SERIALIZED_NAME_HTLC_PACKAGE = "htlcPackage"; + @SerializedName(SERIALIZED_NAME_HTLC_PACKAGE) + private HtlcPackage htlcPackage; + + public static final String SERIALIZED_NAME_CONNECTOR_INSTANCE_ID = "connectorInstanceId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_INSTANCE_ID) + private String connectorInstanceId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_HTLC_ID = "htlcId"; + @SerializedName(SERIALIZED_NAME_HTLC_ID) + private String htlcId; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public CounterpartyHTLCRequest() { + } + + public CounterpartyHTLCRequest htlcPackage(HtlcPackage htlcPackage) { + + this.htlcPackage = htlcPackage; + return this; + } + + /** + * Get htlcPackage + * @return htlcPackage + **/ + @javax.annotation.Nonnull + public HtlcPackage getHtlcPackage() { + return htlcPackage; + } + + + public void setHtlcPackage(HtlcPackage htlcPackage) { + this.htlcPackage = htlcPackage; + } + + + public CounterpartyHTLCRequest connectorInstanceId(String connectorInstanceId) { + + this.connectorInstanceId = connectorInstanceId; + return this; + } + + /** + * connector Instance Id for the connector plugin + * @return connectorInstanceId + **/ + @javax.annotation.Nonnull + public String getConnectorInstanceId() { + return connectorInstanceId; + } + + + public void setConnectorInstanceId(String connectorInstanceId) { + this.connectorInstanceId = connectorInstanceId; + } + + + public CounterpartyHTLCRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public CounterpartyHTLCRequest htlcId(String htlcId) { + + this.htlcId = htlcId; + return this; + } + + /** + * Id for the HTLC + * @return htlcId + **/ + @javax.annotation.Nonnull + public String getHtlcId() { + return htlcId; + } + + + public void setHtlcId(String htlcId) { + this.htlcId = htlcId; + } + + + public CounterpartyHTLCRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public CounterpartyHTLCRequest gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CounterpartyHTLCRequest counterpartyHTLCRequest = (CounterpartyHTLCRequest) o; + return Objects.equals(this.htlcPackage, counterpartyHTLCRequest.htlcPackage) && + Objects.equals(this.connectorInstanceId, counterpartyHTLCRequest.connectorInstanceId) && + Objects.equals(this.keychainId, counterpartyHTLCRequest.keychainId) && + Objects.equals(this.htlcId, counterpartyHTLCRequest.htlcId) && + Objects.equals(this.web3SigningCredential, counterpartyHTLCRequest.web3SigningCredential) && + Objects.equals(this.gas, counterpartyHTLCRequest.gas); + } + + @Override + public int hashCode() { + return Objects.hash(htlcPackage, connectorInstanceId, keychainId, htlcId, web3SigningCredential, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CounterpartyHTLCRequest {\n"); + sb.append(" htlcPackage: ").append(toIndentedString(htlcPackage)).append("\n"); + sb.append(" connectorInstanceId: ").append(toIndentedString(connectorInstanceId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" htlcId: ").append(toIndentedString(htlcId)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("htlcPackage"); + openapiFields.add("connectorInstanceId"); + openapiFields.add("keychainId"); + openapiFields.add("htlcId"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("htlcPackage"); + openapiRequiredFields.add("connectorInstanceId"); + openapiRequiredFields.add("keychainId"); + openapiRequiredFields.add("htlcId"); + openapiRequiredFields.add("web3SigningCredential"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CounterpartyHTLCRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CounterpartyHTLCRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CounterpartyHTLCRequest is not found in the empty JSON string", CounterpartyHTLCRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CounterpartyHTLCRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CounterpartyHTLCRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CounterpartyHTLCRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("connectorInstanceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorInstanceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorInstanceId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + if (!jsonObj.get("htlcId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `htlcId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htlcId").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CounterpartyHTLCRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CounterpartyHTLCRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CounterpartyHTLCRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CounterpartyHTLCRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CounterpartyHTLCRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CounterpartyHTLCRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CounterpartyHTLCRequest + * @throws IOException if the JSON string is invalid with respect to CounterpartyHTLCRequest + */ + public static CounterpartyHTLCRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CounterpartyHTLCRequest.class); + } + + /** + * Convert an instance of CounterpartyHTLCRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HtlcPackage.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HtlcPackage.java new file mode 100644 index 00000000000..25a191818fb --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HtlcPackage.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets HtlcPackage + */ +@JsonAdapter(HtlcPackage.Adapter.class) +public enum HtlcPackage { + + BESU("BESU"), + + BESU_ERC20("BESU_ERC20"); + + private String value; + + HtlcPackage(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static HtlcPackage fromValue(String value) { + for (HtlcPackage b : HtlcPackage.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final HtlcPackage enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public HtlcPackage read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return HtlcPackage.fromValue(value); + } + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OwnHTLCRequest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OwnHTLCRequest.java new file mode 100644 index 00000000000..a77bebd0530 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OwnHTLCRequest.java @@ -0,0 +1,631 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.HtlcPackage; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * OwnHTLCRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OwnHTLCRequest { + public static final String SERIALIZED_NAME_HTLC_PACKAGE = "htlcPackage"; + @SerializedName(SERIALIZED_NAME_HTLC_PACKAGE) + private HtlcPackage htlcPackage; + + public static final String SERIALIZED_NAME_CONNECTOR_INSTANCE_ID = "connectorInstanceId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_INSTANCE_ID) + private String connectorInstanceId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_INPUT_AMOUNT = "inputAmount"; + @SerializedName(SERIALIZED_NAME_INPUT_AMOUNT) + private BigDecimal inputAmount; + + public static final String SERIALIZED_NAME_OUTPUT_AMOUNT = "outputAmount"; + @SerializedName(SERIALIZED_NAME_OUTPUT_AMOUNT) + private BigDecimal outputAmount; + + public static final String SERIALIZED_NAME_EXPIRATION = "expiration"; + @SerializedName(SERIALIZED_NAME_EXPIRATION) + private BigDecimal expiration; + + public static final String SERIALIZED_NAME_HASH_LOCK = "hashLock"; + @SerializedName(SERIALIZED_NAME_HASH_LOCK) + private String hashLock; + + public static final String SERIALIZED_NAME_TOKEN_ADDRESS = "tokenAddress"; + @SerializedName(SERIALIZED_NAME_TOKEN_ADDRESS) + private String tokenAddress; + + public static final String SERIALIZED_NAME_RECEIVER = "receiver"; + @SerializedName(SERIALIZED_NAME_RECEIVER) + private String receiver; + + public static final String SERIALIZED_NAME_OUTPUT_NETWORK = "outputNetwork"; + @SerializedName(SERIALIZED_NAME_OUTPUT_NETWORK) + private String outputNetwork; + + public static final String SERIALIZED_NAME_OUTPUT_ADDRESS = "outputAddress"; + @SerializedName(SERIALIZED_NAME_OUTPUT_ADDRESS) + private String outputAddress; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public OwnHTLCRequest() { + } + + public OwnHTLCRequest htlcPackage(HtlcPackage htlcPackage) { + + this.htlcPackage = htlcPackage; + return this; + } + + /** + * Get htlcPackage + * @return htlcPackage + **/ + @javax.annotation.Nonnull + public HtlcPackage getHtlcPackage() { + return htlcPackage; + } + + + public void setHtlcPackage(HtlcPackage htlcPackage) { + this.htlcPackage = htlcPackage; + } + + + public OwnHTLCRequest connectorInstanceId(String connectorInstanceId) { + + this.connectorInstanceId = connectorInstanceId; + return this; + } + + /** + * connector Instance Id for the connector plugin + * @return connectorInstanceId + **/ + @javax.annotation.Nonnull + public String getConnectorInstanceId() { + return connectorInstanceId; + } + + + public void setConnectorInstanceId(String connectorInstanceId) { + this.connectorInstanceId = connectorInstanceId; + } + + + public OwnHTLCRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public OwnHTLCRequest constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public OwnHTLCRequest addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * Get constructorArgs + * @return constructorArgs + **/ + @javax.annotation.Nonnull + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public OwnHTLCRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public OwnHTLCRequest inputAmount(BigDecimal inputAmount) { + + this.inputAmount = inputAmount; + return this; + } + + /** + * Input amount to lock + * @return inputAmount + **/ + @javax.annotation.Nonnull + public BigDecimal getInputAmount() { + return inputAmount; + } + + + public void setInputAmount(BigDecimal inputAmount) { + this.inputAmount = inputAmount; + } + + + public OwnHTLCRequest outputAmount(BigDecimal outputAmount) { + + this.outputAmount = outputAmount; + return this; + } + + /** + * Output amount to lock + * @return outputAmount + **/ + @javax.annotation.Nonnull + public BigDecimal getOutputAmount() { + return outputAmount; + } + + + public void setOutputAmount(BigDecimal outputAmount) { + this.outputAmount = outputAmount; + } + + + public OwnHTLCRequest expiration(BigDecimal expiration) { + + this.expiration = expiration; + return this; + } + + /** + * Timestamp to expire the contract + * @return expiration + **/ + @javax.annotation.Nonnull + public BigDecimal getExpiration() { + return expiration; + } + + + public void setExpiration(BigDecimal expiration) { + this.expiration = expiration; + } + + + public OwnHTLCRequest hashLock(String hashLock) { + + this.hashLock = hashLock; + return this; + } + + /** + * Hashlock needed to refund the amount + * @return hashLock + **/ + @javax.annotation.Nonnull + public String getHashLock() { + return hashLock; + } + + + public void setHashLock(String hashLock) { + this.hashLock = hashLock; + } + + + public OwnHTLCRequest tokenAddress(String tokenAddress) { + + this.tokenAddress = tokenAddress; + return this; + } + + /** + * The token address + * @return tokenAddress + **/ + @javax.annotation.Nonnull + public String getTokenAddress() { + return tokenAddress; + } + + + public void setTokenAddress(String tokenAddress) { + this.tokenAddress = tokenAddress; + } + + + public OwnHTLCRequest receiver(String receiver) { + + this.receiver = receiver; + return this; + } + + /** + * The receiver address + * @return receiver + **/ + @javax.annotation.Nonnull + public String getReceiver() { + return receiver; + } + + + public void setReceiver(String receiver) { + this.receiver = receiver; + } + + + public OwnHTLCRequest outputNetwork(String outputNetwork) { + + this.outputNetwork = outputNetwork; + return this; + } + + /** + * The output network id + * @return outputNetwork + **/ + @javax.annotation.Nonnull + public String getOutputNetwork() { + return outputNetwork; + } + + + public void setOutputNetwork(String outputNetwork) { + this.outputNetwork = outputNetwork; + } + + + public OwnHTLCRequest outputAddress(String outputAddress) { + + this.outputAddress = outputAddress; + return this; + } + + /** + * The output addreess to receive the tokens + * @return outputAddress + **/ + @javax.annotation.Nonnull + public String getOutputAddress() { + return outputAddress; + } + + + public void setOutputAddress(String outputAddress) { + this.outputAddress = outputAddress; + } + + + public OwnHTLCRequest gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OwnHTLCRequest ownHTLCRequest = (OwnHTLCRequest) o; + return Objects.equals(this.htlcPackage, ownHTLCRequest.htlcPackage) && + Objects.equals(this.connectorInstanceId, ownHTLCRequest.connectorInstanceId) && + Objects.equals(this.keychainId, ownHTLCRequest.keychainId) && + Objects.equals(this.constructorArgs, ownHTLCRequest.constructorArgs) && + Objects.equals(this.web3SigningCredential, ownHTLCRequest.web3SigningCredential) && + Objects.equals(this.inputAmount, ownHTLCRequest.inputAmount) && + Objects.equals(this.outputAmount, ownHTLCRequest.outputAmount) && + Objects.equals(this.expiration, ownHTLCRequest.expiration) && + Objects.equals(this.hashLock, ownHTLCRequest.hashLock) && + Objects.equals(this.tokenAddress, ownHTLCRequest.tokenAddress) && + Objects.equals(this.receiver, ownHTLCRequest.receiver) && + Objects.equals(this.outputNetwork, ownHTLCRequest.outputNetwork) && + Objects.equals(this.outputAddress, ownHTLCRequest.outputAddress) && + Objects.equals(this.gas, ownHTLCRequest.gas); + } + + @Override + public int hashCode() { + return Objects.hash(htlcPackage, connectorInstanceId, keychainId, constructorArgs, web3SigningCredential, inputAmount, outputAmount, expiration, hashLock, tokenAddress, receiver, outputNetwork, outputAddress, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OwnHTLCRequest {\n"); + sb.append(" htlcPackage: ").append(toIndentedString(htlcPackage)).append("\n"); + sb.append(" connectorInstanceId: ").append(toIndentedString(connectorInstanceId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" inputAmount: ").append(toIndentedString(inputAmount)).append("\n"); + sb.append(" outputAmount: ").append(toIndentedString(outputAmount)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" hashLock: ").append(toIndentedString(hashLock)).append("\n"); + sb.append(" tokenAddress: ").append(toIndentedString(tokenAddress)).append("\n"); + sb.append(" receiver: ").append(toIndentedString(receiver)).append("\n"); + sb.append(" outputNetwork: ").append(toIndentedString(outputNetwork)).append("\n"); + sb.append(" outputAddress: ").append(toIndentedString(outputAddress)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("htlcPackage"); + openapiFields.add("connectorInstanceId"); + openapiFields.add("keychainId"); + openapiFields.add("constructorArgs"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("inputAmount"); + openapiFields.add("outputAmount"); + openapiFields.add("expiration"); + openapiFields.add("hashLock"); + openapiFields.add("tokenAddress"); + openapiFields.add("receiver"); + openapiFields.add("outputNetwork"); + openapiFields.add("outputAddress"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("htlcPackage"); + openapiRequiredFields.add("connectorInstanceId"); + openapiRequiredFields.add("keychainId"); + openapiRequiredFields.add("constructorArgs"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("inputAmount"); + openapiRequiredFields.add("outputAmount"); + openapiRequiredFields.add("expiration"); + openapiRequiredFields.add("hashLock"); + openapiRequiredFields.add("tokenAddress"); + openapiRequiredFields.add("receiver"); + openapiRequiredFields.add("outputNetwork"); + openapiRequiredFields.add("outputAddress"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to OwnHTLCRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!OwnHTLCRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OwnHTLCRequest is not found in the empty JSON string", OwnHTLCRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OwnHTLCRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OwnHTLCRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OwnHTLCRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("connectorInstanceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorInstanceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorInstanceId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // ensure the required json array is present + if (jsonObj.get("constructorArgs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("hashLock").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashLock` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashLock").toString())); + } + if (!jsonObj.get("tokenAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tokenAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenAddress").toString())); + } + if (!jsonObj.get("receiver").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `receiver` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiver").toString())); + } + if (!jsonObj.get("outputNetwork").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `outputNetwork` to be a primitive type in the JSON string but got `%s`", jsonObj.get("outputNetwork").toString())); + } + if (!jsonObj.get("outputAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `outputAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("outputAddress").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OwnHTLCRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OwnHTLCRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OwnHTLCRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OwnHTLCRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OwnHTLCRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OwnHTLCRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OwnHTLCRequest + * @throws IOException if the JSON string is invalid with respect to OwnHTLCRequest + */ + public static OwnHTLCRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OwnHTLCRequest.class); + } + + /** + * Convert an instance of OwnHTLCRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java new file mode 100644 index 00000000000..ee59d7ba5db --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java @@ -0,0 +1,338 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredential extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Web3SigningCredential.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWeb3SigningCredentialCactusKeychainRef = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + final TypeAdapter adapterWeb3SigningCredentialNone = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + final TypeAdapter adapterWeb3SigningCredentialPrivateKeyHex = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredential value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialCactusKeychainRef` + if (value.getActualInstance() instanceof Web3SigningCredentialCactusKeychainRef) { + JsonObject obj = adapterWeb3SigningCredentialCactusKeychainRef.toJsonTree((Web3SigningCredentialCactusKeychainRef)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialNone` + if (value.getActualInstance() instanceof Web3SigningCredentialNone) { + JsonObject obj = adapterWeb3SigningCredentialNone.toJsonTree((Web3SigningCredentialNone)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialPrivateKeyHex` + if (value.getActualInstance() instanceof Web3SigningCredentialPrivateKeyHex) { + JsonObject obj = adapterWeb3SigningCredentialPrivateKeyHex.toJsonTree((Web3SigningCredentialPrivateKeyHex)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + @Override + public Web3SigningCredential read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Web3SigningCredentialCactusKeychainRef + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialCactusKeychainRef; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialCactusKeychainRef'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialCactusKeychainRef'", e); + } + + // deserialize Web3SigningCredentialNone + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialNone.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialNone; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialNone'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialNone'", e); + } + + // deserialize Web3SigningCredentialPrivateKeyHex + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialPrivateKeyHex; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialPrivateKeyHex'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialPrivateKeyHex'", e); + } + + if (match == 1) { + Web3SigningCredential ret = new Web3SigningCredential(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Web3SigningCredential: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Web3SigningCredential() { + super("oneOf", Boolean.FALSE); + } + + public Web3SigningCredential(Web3SigningCredentialCactusKeychainRef o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialNone o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialPrivateKeyHex o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Web3SigningCredentialCactusKeychainRef", new GenericType() { + }); + schemas.put("Web3SigningCredentialNone", new GenericType() { + }); + schemas.put("Web3SigningCredentialPrivateKeyHex", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Web3SigningCredential.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Web3SigningCredentialCactusKeychainRef) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialNone) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialPrivateKeyHex) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + /** + * Get the actual instance, which can be the following: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * @return The actual instance (Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialCactusKeychainRef`. If the actual instance is not `Web3SigningCredentialCactusKeychainRef`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialCactusKeychainRef` + * @throws ClassCastException if the instance is not `Web3SigningCredentialCactusKeychainRef` + */ + public Web3SigningCredentialCactusKeychainRef getWeb3SigningCredentialCactusKeychainRef() throws ClassCastException { + return (Web3SigningCredentialCactusKeychainRef)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialNone`. If the actual instance is not `Web3SigningCredentialNone`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialNone` + * @throws ClassCastException if the instance is not `Web3SigningCredentialNone` + */ + public Web3SigningCredentialNone getWeb3SigningCredentialNone() throws ClassCastException { + return (Web3SigningCredentialNone)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialPrivateKeyHex`. If the actual instance is not `Web3SigningCredentialPrivateKeyHex`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialPrivateKeyHex` + * @throws ClassCastException if the instance is not `Web3SigningCredentialPrivateKeyHex` + */ + public Web3SigningCredentialPrivateKeyHex getWeb3SigningCredentialPrivateKeyHex() throws ClassCastException { + return (Web3SigningCredentialPrivateKeyHex)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Web3SigningCredentialCactusKeychainRef + try { + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialNone + try { + Web3SigningCredentialNone.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialPrivateKeyHex + try { + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Web3SigningCredential with oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Web3SigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredential + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredential + */ + public static Web3SigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredential.class); + } + + /** + * Convert an instance of Web3SigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java new file mode 100644 index 00000000000..a2768828872 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java @@ -0,0 +1,310 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialCactusKeychainRef + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialCactusKeychainRef { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY = "keychainEntryKey"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY) + private String keychainEntryKey; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public Web3SigningCredentialCactusKeychainRef() { + } + + public Web3SigningCredentialCactusKeychainRef type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialCactusKeychainRef ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialCactusKeychainRef keychainEntryKey(String keychainEntryKey) { + + this.keychainEntryKey = keychainEntryKey; + return this; + } + + /** + * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + * @return keychainEntryKey + **/ + @javax.annotation.Nonnull + public String getKeychainEntryKey() { + return keychainEntryKey; + } + + + public void setKeychainEntryKey(String keychainEntryKey) { + this.keychainEntryKey = keychainEntryKey; + } + + + public Web3SigningCredentialCactusKeychainRef keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialCactusKeychainRef web3SigningCredentialCactusKeychainRef = (Web3SigningCredentialCactusKeychainRef) o; + return Objects.equals(this.type, web3SigningCredentialCactusKeychainRef.type) && + Objects.equals(this.ethAccount, web3SigningCredentialCactusKeychainRef.ethAccount) && + Objects.equals(this.keychainEntryKey, web3SigningCredentialCactusKeychainRef.keychainEntryKey) && + Objects.equals(this.keychainId, web3SigningCredentialCactusKeychainRef.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, keychainEntryKey, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialCactusKeychainRef {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" keychainEntryKey: ").append(toIndentedString(keychainEntryKey)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("keychainEntryKey"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("keychainEntryKey"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialCactusKeychainRef is not found in the empty JSON string", Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialCactusKeychainRef.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialCactusKeychainRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialCactusKeychainRef.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("keychainEntryKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainEntryKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainEntryKey").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialCactusKeychainRef.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialCactusKeychainRef' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialCactusKeychainRef value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialCactusKeychainRef read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialCactusKeychainRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialCactusKeychainRef + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static Web3SigningCredentialCactusKeychainRef fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialCactusKeychainRef.class); + } + + /** + * Convert an instance of Web3SigningCredentialCactusKeychainRef to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java new file mode 100644 index 00000000000..e5f62bbd77e --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Using this denotes that there is no signing required because the transaction is pre-signed. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialNone { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public Web3SigningCredentialNone() { + } + + public Web3SigningCredentialNone type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialNone web3SigningCredentialNone = (Web3SigningCredentialNone) o; + return Objects.equals(this.type, web3SigningCredentialNone.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialNone {\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(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialNone + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialNone.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialNone is not found in the empty JSON string", Web3SigningCredentialNone.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialNone.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialNone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialNone.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialNone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialNone' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialNone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialNone read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialNone given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialNone + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialNone + */ + public static Web3SigningCredentialNone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialNone.class); + } + + /** + * Convert an instance of Web3SigningCredentialNone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java new file mode 100644 index 00000000000..c1d59a04a00 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialPrivateKeyHex + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialPrivateKeyHex { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialPrivateKeyHex() { + } + + public Web3SigningCredentialPrivateKeyHex type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialPrivateKeyHex ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialPrivateKeyHex secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * The HEX encoded private key of an eth account. + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialPrivateKeyHex web3SigningCredentialPrivateKeyHex = (Web3SigningCredentialPrivateKeyHex) o; + return Objects.equals(this.type, web3SigningCredentialPrivateKeyHex.type) && + Objects.equals(this.ethAccount, web3SigningCredentialPrivateKeyHex.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialPrivateKeyHex.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialPrivateKeyHex {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialPrivateKeyHex is not found in the empty JSON string", Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialPrivateKeyHex.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialPrivateKeyHex` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialPrivateKeyHex.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialPrivateKeyHex.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialPrivateKeyHex' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialPrivateKeyHex value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialPrivateKeyHex read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialPrivateKeyHex given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialPrivateKeyHex + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static Web3SigningCredentialPrivateKeyHex fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialPrivateKeyHex.class); + } + + /** + * Convert an instance of Web3SigningCredentialPrivateKeyHex to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java new file mode 100644 index 00000000000..957e1a3b77e --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Web3SigningCredentialType + */ +@JsonAdapter(Web3SigningCredentialType.Adapter.class) +public enum Web3SigningCredentialType { + + CACTUS_KEYCHAIN_REF("CACTUS_KEYCHAIN_REF"), + + GETH_KEYCHAIN_PASSWORD("GETH_KEYCHAIN_PASSWORD"), + + PRIVATE_KEY_HEX("PRIVATE_KEY_HEX"), + + NONE("NONE"); + + private String value; + + Web3SigningCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Web3SigningCredentialType fromValue(String value) { + for (Web3SigningCredentialType b : Web3SigningCredentialType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Web3SigningCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Web3SigningCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Web3SigningCredentialType.fromValue(value); + } + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawCounterpartyRequest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawCounterpartyRequest.java new file mode 100644 index 00000000000..6d14332c3ff --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawCounterpartyRequest.java @@ -0,0 +1,434 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.HtlcPackage; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WithdrawCounterpartyRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WithdrawCounterpartyRequest { + public static final String SERIALIZED_NAME_HTLC_PACKAGE = "htlcPackage"; + @SerializedName(SERIALIZED_NAME_HTLC_PACKAGE) + private HtlcPackage htlcPackage; + + public static final String SERIALIZED_NAME_CONNECTOR_INSTANCE_ID = "connectorInstanceId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_INSTANCE_ID) + private String connectorInstanceId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_CONTRACT_ID = "contractId"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ID) + private String contractId; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_HTLC_ID = "htlcId"; + @SerializedName(SERIALIZED_NAME_HTLC_ID) + private String htlcId; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public WithdrawCounterpartyRequest() { + } + + public WithdrawCounterpartyRequest htlcPackage(HtlcPackage htlcPackage) { + + this.htlcPackage = htlcPackage; + return this; + } + + /** + * Get htlcPackage + * @return htlcPackage + **/ + @javax.annotation.Nonnull + public HtlcPackage getHtlcPackage() { + return htlcPackage; + } + + + public void setHtlcPackage(HtlcPackage htlcPackage) { + this.htlcPackage = htlcPackage; + } + + + public WithdrawCounterpartyRequest connectorInstanceId(String connectorInstanceId) { + + this.connectorInstanceId = connectorInstanceId; + return this; + } + + /** + * connector Instance Id for the connector plugin + * @return connectorInstanceId + **/ + @javax.annotation.Nonnull + public String getConnectorInstanceId() { + return connectorInstanceId; + } + + + public void setConnectorInstanceId(String connectorInstanceId) { + this.connectorInstanceId = connectorInstanceId; + } + + + public WithdrawCounterpartyRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public WithdrawCounterpartyRequest contractId(String contractId) { + + this.contractId = contractId; + return this; + } + + /** + * contractId for the contract + * @return contractId + **/ + @javax.annotation.Nullable + public String getContractId() { + return contractId; + } + + + public void setContractId(String contractId) { + this.contractId = contractId; + } + + + public WithdrawCounterpartyRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public WithdrawCounterpartyRequest htlcId(String htlcId) { + + this.htlcId = htlcId; + return this; + } + + /** + * Id for the HTLC + * @return htlcId + **/ + @javax.annotation.Nonnull + public String getHtlcId() { + return htlcId; + } + + + public void setHtlcId(String htlcId) { + this.htlcId = htlcId; + } + + + public WithdrawCounterpartyRequest secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * Counterparty HTLC secret + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + public WithdrawCounterpartyRequest gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WithdrawCounterpartyRequest withdrawCounterpartyRequest = (WithdrawCounterpartyRequest) o; + return Objects.equals(this.htlcPackage, withdrawCounterpartyRequest.htlcPackage) && + Objects.equals(this.connectorInstanceId, withdrawCounterpartyRequest.connectorInstanceId) && + Objects.equals(this.keychainId, withdrawCounterpartyRequest.keychainId) && + Objects.equals(this.contractId, withdrawCounterpartyRequest.contractId) && + Objects.equals(this.web3SigningCredential, withdrawCounterpartyRequest.web3SigningCredential) && + Objects.equals(this.htlcId, withdrawCounterpartyRequest.htlcId) && + Objects.equals(this.secret, withdrawCounterpartyRequest.secret) && + Objects.equals(this.gas, withdrawCounterpartyRequest.gas); + } + + @Override + public int hashCode() { + return Objects.hash(htlcPackage, connectorInstanceId, keychainId, contractId, web3SigningCredential, htlcId, secret, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WithdrawCounterpartyRequest {\n"); + sb.append(" htlcPackage: ").append(toIndentedString(htlcPackage)).append("\n"); + sb.append(" connectorInstanceId: ").append(toIndentedString(connectorInstanceId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" contractId: ").append(toIndentedString(contractId)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" htlcId: ").append(toIndentedString(htlcId)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("htlcPackage"); + openapiFields.add("connectorInstanceId"); + openapiFields.add("keychainId"); + openapiFields.add("contractId"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("htlcId"); + openapiFields.add("secret"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("htlcPackage"); + openapiRequiredFields.add("connectorInstanceId"); + openapiRequiredFields.add("keychainId"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("htlcId"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WithdrawCounterpartyRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WithdrawCounterpartyRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WithdrawCounterpartyRequest is not found in the empty JSON string", WithdrawCounterpartyRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WithdrawCounterpartyRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WithdrawCounterpartyRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WithdrawCounterpartyRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("connectorInstanceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorInstanceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorInstanceId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + if ((jsonObj.get("contractId") != null && !jsonObj.get("contractId").isJsonNull()) && !jsonObj.get("contractId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractId").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("htlcId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `htlcId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("htlcId").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WithdrawCounterpartyRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WithdrawCounterpartyRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WithdrawCounterpartyRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WithdrawCounterpartyRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WithdrawCounterpartyRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WithdrawCounterpartyRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of WithdrawCounterpartyRequest + * @throws IOException if the JSON string is invalid with respect to WithdrawCounterpartyRequest + */ + public static WithdrawCounterpartyRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WithdrawCounterpartyRequest.class); + } + + /** + * Convert an instance of WithdrawCounterpartyRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..92430c15680 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,72 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.CounterpartyHTLCRequest; +import org.openapitools.client.model.OwnHTLCRequest; +import org.openapitools.client.model.WithdrawCounterpartyRequest; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Create an instance to interact with the counterparty HTLC + * + * @throws ApiException if the Api call fails + */ + @Test + public void counterpartyHtlcV1Test() throws ApiException { + CounterpartyHTLCRequest counterpartyHTLCRequest = null; + Object response = api.counterpartyHtlcV1(counterpartyHTLCRequest); + // TODO: test validations + } + + /** + * Create an instance to interact with the own HTLC. + * + * @throws ApiException if the Api call fails + */ + @Test + public void ownHtlcV1Test() throws ApiException { + OwnHTLCRequest ownHTLCRequest = null; + Object response = api.ownHtlcV1(ownHTLCRequest); + // TODO: test validations + } + + /** + * Withdraw funds of the counterparty HTLC + * + * @throws ApiException if the Api call fails + */ + @Test + public void withdrawCounterpartyV1Test() throws ApiException { + WithdrawCounterpartyRequest withdrawCounterpartyRequest = null; + Object response = api.withdrawCounterpartyV1(withdrawCounterpartyRequest); + // TODO: test validations + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CounterpartyHTLCRequestTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CounterpartyHTLCRequestTest.java new file mode 100644 index 00000000000..1545b7385fe --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CounterpartyHTLCRequestTest.java @@ -0,0 +1,91 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.client.model.HtlcPackage; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CounterpartyHTLCRequest + */ +public class CounterpartyHTLCRequestTest { + private final CounterpartyHTLCRequest model = new CounterpartyHTLCRequest(); + + /** + * Model tests for CounterpartyHTLCRequest + */ + @Test + public void testCounterpartyHTLCRequest() { + // TODO: test CounterpartyHTLCRequest + } + + /** + * Test the property 'htlcPackage' + */ + @Test + public void htlcPackageTest() { + // TODO: test htlcPackage + } + + /** + * Test the property 'connectorInstanceId' + */ + @Test + public void connectorInstanceIdTest() { + // TODO: test connectorInstanceId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'htlcId' + */ + @Test + public void htlcIdTest() { + // TODO: test htlcId + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HtlcPackageTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HtlcPackageTest.java new file mode 100644 index 00000000000..c2a383ec756 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HtlcPackageTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HtlcPackage + */ +public class HtlcPackageTest { + /** + * Model tests for HtlcPackage + */ + @Test + public void testHtlcPackage() { + // TODO: test HtlcPackage + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OwnHTLCRequestTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OwnHTLCRequestTest.java new file mode 100644 index 00000000000..42d57c524cd --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OwnHTLCRequestTest.java @@ -0,0 +1,157 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.HtlcPackage; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OwnHTLCRequest + */ +public class OwnHTLCRequestTest { + private final OwnHTLCRequest model = new OwnHTLCRequest(); + + /** + * Model tests for OwnHTLCRequest + */ + @Test + public void testOwnHTLCRequest() { + // TODO: test OwnHTLCRequest + } + + /** + * Test the property 'htlcPackage' + */ + @Test + public void htlcPackageTest() { + // TODO: test htlcPackage + } + + /** + * Test the property 'connectorInstanceId' + */ + @Test + public void connectorInstanceIdTest() { + // TODO: test connectorInstanceId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'inputAmount' + */ + @Test + public void inputAmountTest() { + // TODO: test inputAmount + } + + /** + * Test the property 'outputAmount' + */ + @Test + public void outputAmountTest() { + // TODO: test outputAmount + } + + /** + * Test the property 'expiration' + */ + @Test + public void expirationTest() { + // TODO: test expiration + } + + /** + * Test the property 'hashLock' + */ + @Test + public void hashLockTest() { + // TODO: test hashLock + } + + /** + * Test the property 'tokenAddress' + */ + @Test + public void tokenAddressTest() { + // TODO: test tokenAddress + } + + /** + * Test the property 'receiver' + */ + @Test + public void receiverTest() { + // TODO: test receiver + } + + /** + * Test the property 'outputNetwork' + */ + @Test + public void outputNetworkTest() { + // TODO: test outputNetwork + } + + /** + * Test the property 'outputAddress' + */ + @Test + public void outputAddressTest() { + // TODO: test outputAddress + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java new file mode 100644 index 00000000000..e147b711814 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ +public class Web3SigningCredentialCactusKeychainRefTest { + private final Web3SigningCredentialCactusKeychainRef model = new Web3SigningCredentialCactusKeychainRef(); + + /** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ + @Test + public void testWeb3SigningCredentialCactusKeychainRef() { + // TODO: test Web3SigningCredentialCactusKeychainRef + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java new file mode 100644 index 00000000000..d13f62a76de --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialNone + */ +public class Web3SigningCredentialNoneTest { + private final Web3SigningCredentialNone model = new Web3SigningCredentialNone(); + + /** + * Model tests for Web3SigningCredentialNone + */ + @Test + public void testWeb3SigningCredentialNone() { + // TODO: test Web3SigningCredentialNone + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java new file mode 100644 index 00000000000..ffdb627cd38 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ +public class Web3SigningCredentialPrivateKeyHexTest { + private final Web3SigningCredentialPrivateKeyHex model = new Web3SigningCredentialPrivateKeyHex(); + + /** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ + @Test + public void testWeb3SigningCredentialPrivateKeyHex() { + // TODO: test Web3SigningCredentialPrivateKeyHex + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java new file mode 100644 index 00000000000..26dc4659684 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredential + */ +public class Web3SigningCredentialTest { + private final Web3SigningCredential model = new Web3SigningCredential(); + + /** + * Model tests for Web3SigningCredential + */ + @Test + public void testWeb3SigningCredential() { + // TODO: test Web3SigningCredential + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java new file mode 100644 index 00000000000..ceb38b16740 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialType + */ +public class Web3SigningCredentialTypeTest { + /** + * Model tests for Web3SigningCredentialType + */ + @Test + public void testWeb3SigningCredentialType() { + // TODO: test Web3SigningCredentialType + } + +} diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawCounterpartyRequestTest.java b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawCounterpartyRequestTest.java new file mode 100644 index 00000000000..78244d734b8 --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawCounterpartyRequestTest.java @@ -0,0 +1,107 @@ +/* + * Hyperledger Cactus Plugin - HTLC Coordinator + * Can exchange assets between networks + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.client.model.HtlcPackage; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WithdrawCounterpartyRequest + */ +public class WithdrawCounterpartyRequestTest { + private final WithdrawCounterpartyRequest model = new WithdrawCounterpartyRequest(); + + /** + * Model tests for WithdrawCounterpartyRequest + */ + @Test + public void testWithdrawCounterpartyRequest() { + // TODO: test WithdrawCounterpartyRequest + } + + /** + * Test the property 'htlcPackage' + */ + @Test + public void htlcPackageTest() { + // TODO: test htlcPackage + } + + /** + * Test the property 'connectorInstanceId' + */ + @Test + public void connectorInstanceIdTest() { + // TODO: test connectorInstanceId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'contractId' + */ + @Test + public void contractIdTest() { + // TODO: test contractId + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'htlcId' + */ + @Test + public void htlcIdTest() { + // TODO: test htlcId + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/package.json b/extensions/cactus-plugin-object-store-ipfs/package.json index 4e24d18bdf2..4ec1162d27d 100644 --- a/extensions/cactus-plugin-object-store-ipfs/package.json +++ b/extensions/cactus-plugin-object-store-ipfs/package.json @@ -46,8 +46,10 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override=../../openapi-generator-ignore", + "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios --reserved-words-mappings protected=protected --ignore-file-override=../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override=../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..91f5ac392ec --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,17 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_get_object_request_v1.go +model_get_object_response_v1.go +model_has_object_request_v1.go +model_has_object_response_v1.go +model_set_object_request_v1.go +model_set_object_response_v1.go +response.go +test/api_default_test.go +utils.go diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.travis.yml b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/README.md b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..120b55502fe --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,119 @@ +# Go API client for cactus-plugin-object-store-ipfs + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-object-store-ipfs "github.com/hyperledger/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-object-store-ipfs.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-object-store-ipfs.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-object-store-ipfs.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-object-store-ipfs.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://www.cactus.stream* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetObjectV1**](docs/DefaultApi.md#getobjectv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object | Retrieves an object from the object store. +*DefaultApi* | [**HasObjectV1**](docs/DefaultApi.md#hasobjectv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object | Checks the presence of an object in the object store. +*DefaultApi* | [**SetObjectV1**](docs/DefaultApi.md#setobjectv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object | Sets an object in the object store under the specified key. + + +## Documentation For Models + + - [GetObjectRequestV1](docs/GetObjectRequestV1.md) + - [GetObjectResponseV1](docs/GetObjectResponseV1.md) + - [HasObjectRequestV1](docs/HasObjectRequestV1.md) + - [HasObjectResponseV1](docs/HasObjectResponseV1.md) + - [SetObjectRequestV1](docs/SetObjectRequestV1.md) + - [SetObjectResponseV1](docs/SetObjectResponseV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/api/openapi.yaml b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..1d832456394 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,229 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: 'Hyperledger Cactus Plugin - Object Store - IPFS ' + version: v2.0.0-alpha.2 +servers: +- description: Public test instance + url: "https://www.cactus.stream/{basePath}" + variables: + basePath: + default: "" +- description: Local test instance + url: "http://localhost:4000/{basePath}" + variables: + basePath: + default: "" +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object: + post: + operationId: getObjectV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/object_store_get_object_v1_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectResponseV1' + description: OK + summary: Retrieves an object from the object store. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object + /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object: + post: + operationId: setObjectV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/object_store_set_object_v1_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectResponseV1' + description: OK + summary: Sets an object in the object store under the specified key. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object + /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object: + post: + operationId: hasObjectV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/object_store_has_object_v1_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectResponseV1' + description: OK + summary: Checks the presence of an object in the object store. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object +components: + requestBodies: + object_store_get_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectRequestV1' + description: Request body to obtain an object via its key. + required: true + object_store_set_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectRequestV1' + description: Request body to set an object under a key. + required: true + object_store_has_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectRequestV1' + description: Request body to check presence of an object under a key. + required: true + responses: + object_store_get_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectResponseV1' + description: OK + object_store_set_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectResponseV1' + description: OK + object_store_has_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectResponseV1' + description: OK + schemas: + GetObjectRequestV1: + example: + key: key + properties: + key: + description: The key for the entry to get from the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetObjectResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the object + store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key in the object store + as a string. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetObjectRequestV1: + example: + value: value + key: key + properties: + key: + description: The key for the entry to set in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key in the object + store. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetObjectResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasObjectRequestV1: + example: + key: key + properties: + key: + description: The key to check for presence in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasObjectResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an object under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/api_default.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..c917cce4073 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,350 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGetObjectV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getObjectRequestV1 *GetObjectRequestV1 +} + +// Request body to obtain an object via its key. +func (r ApiGetObjectV1Request) GetObjectRequestV1(getObjectRequestV1 GetObjectRequestV1) ApiGetObjectV1Request { + r.getObjectRequestV1 = &getObjectRequestV1 + return r +} + +func (r ApiGetObjectV1Request) Execute() (*GetObjectResponseV1, *http.Response, error) { + return r.ApiService.GetObjectV1Execute(r) +} + +/* +GetObjectV1 Retrieves an object from the object store. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetObjectV1Request +*/ +func (a *DefaultApiService) GetObjectV1(ctx context.Context) ApiGetObjectV1Request { + return ApiGetObjectV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetObjectResponseV1 +func (a *DefaultApiService) GetObjectV1Execute(r ApiGetObjectV1Request) (*GetObjectResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetObjectResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetObjectV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.getObjectRequestV1 == nil { + return localVarReturnValue, nil, reportError("getObjectRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getObjectRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiHasObjectV1Request struct { + ctx context.Context + ApiService *DefaultApiService + hasObjectRequestV1 *HasObjectRequestV1 +} + +// Request body to check presence of an object under a key. +func (r ApiHasObjectV1Request) HasObjectRequestV1(hasObjectRequestV1 HasObjectRequestV1) ApiHasObjectV1Request { + r.hasObjectRequestV1 = &hasObjectRequestV1 + return r +} + +func (r ApiHasObjectV1Request) Execute() (*HasObjectResponseV1, *http.Response, error) { + return r.ApiService.HasObjectV1Execute(r) +} + +/* +HasObjectV1 Checks the presence of an object in the object store. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiHasObjectV1Request +*/ +func (a *DefaultApiService) HasObjectV1(ctx context.Context) ApiHasObjectV1Request { + return ApiHasObjectV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return HasObjectResponseV1 +func (a *DefaultApiService) HasObjectV1Execute(r ApiHasObjectV1Request) (*HasObjectResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HasObjectResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.HasObjectV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.hasObjectRequestV1 == nil { + return localVarReturnValue, nil, reportError("hasObjectRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.hasObjectRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSetObjectV1Request struct { + ctx context.Context + ApiService *DefaultApiService + setObjectRequestV1 *SetObjectRequestV1 +} + +// Request body to set an object under a key. +func (r ApiSetObjectV1Request) SetObjectRequestV1(setObjectRequestV1 SetObjectRequestV1) ApiSetObjectV1Request { + r.setObjectRequestV1 = &setObjectRequestV1 + return r +} + +func (r ApiSetObjectV1Request) Execute() (*SetObjectResponseV1, *http.Response, error) { + return r.ApiService.SetObjectV1Execute(r) +} + +/* +SetObjectV1 Sets an object in the object store under the specified key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSetObjectV1Request +*/ +func (a *DefaultApiService) SetObjectV1(ctx context.Context) ApiSetObjectV1Request { + return ApiSetObjectV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SetObjectResponseV1 +func (a *DefaultApiService) SetObjectV1Execute(r ApiSetObjectV1Request) (*SetObjectResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SetObjectResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SetObjectV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.setObjectRequestV1 == nil { + return localVarReturnValue, nil, reportError("setObjectRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setObjectRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/client.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..342e6982f14 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Object Store - IPFS API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/configuration.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..7362bc081ce --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,231 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "https://www.cactus.stream/{basePath}", + Description: "Public test instance", + Variables: map[string]ServerVariable{ + "basePath": ServerVariable{ + Description: "No description provided", + DefaultValue: "", + }, + }, + }, + { + URL: "http://localhost:4000/{basePath}", + Description: "Local test instance", + Variables: map[string]ServerVariable{ + "basePath": ServerVariable{ + Description: "No description provided", + DefaultValue: "", + }, + }, + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/go.mod b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..68a273a4196 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/go.sum b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_get_object_request_v1.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_get_object_request_v1.go new file mode 100644 index 00000000000..b1e4f4c2ab9 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_get_object_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "encoding/json" +) + +// checks if the GetObjectRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetObjectRequestV1{} + +// GetObjectRequestV1 struct for GetObjectRequestV1 +type GetObjectRequestV1 struct { + // The key for the entry to get from the object store. + Key string `json:"key"` +} + +// NewGetObjectRequestV1 instantiates a new GetObjectRequestV1 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 +// will change when the set of required properties is changed +func NewGetObjectRequestV1(key string) *GetObjectRequestV1 { + this := GetObjectRequestV1{} + this.Key = key + return &this +} + +// NewGetObjectRequestV1WithDefaults instantiates a new GetObjectRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetObjectRequestV1WithDefaults() *GetObjectRequestV1 { + this := GetObjectRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetObjectRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetObjectRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetObjectRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetObjectRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetObjectRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetObjectRequestV1 struct { + value *GetObjectRequestV1 + isSet bool +} + +func (v NullableGetObjectRequestV1) Get() *GetObjectRequestV1 { + return v.value +} + +func (v *NullableGetObjectRequestV1) Set(val *GetObjectRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetObjectRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetObjectRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetObjectRequestV1(val *GetObjectRequestV1) *NullableGetObjectRequestV1 { + return &NullableGetObjectRequestV1{value: val, isSet: true} +} + +func (v NullableGetObjectRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetObjectRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_get_object_response_v1.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_get_object_response_v1.go new file mode 100644 index 00000000000..a120d5be90a --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_get_object_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "encoding/json" +) + +// checks if the GetObjectResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetObjectResponseV1{} + +// GetObjectResponseV1 struct for GetObjectResponseV1 +type GetObjectResponseV1 struct { + // The key that was used to retrieve the value from the object store. + Key string `json:"key"` + // The value associated with the requested key in the object store as a string. + Value string `json:"value"` +} + +// NewGetObjectResponseV1 instantiates a new GetObjectResponseV1 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 +// will change when the set of required properties is changed +func NewGetObjectResponseV1(key string, value string) *GetObjectResponseV1 { + this := GetObjectResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetObjectResponseV1WithDefaults instantiates a new GetObjectResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetObjectResponseV1WithDefaults() *GetObjectResponseV1 { + this := GetObjectResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetObjectResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetObjectResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetObjectResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetObjectResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetObjectResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetObjectResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetObjectResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetObjectResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetObjectResponseV1 struct { + value *GetObjectResponseV1 + isSet bool +} + +func (v NullableGetObjectResponseV1) Get() *GetObjectResponseV1 { + return v.value +} + +func (v *NullableGetObjectResponseV1) Set(val *GetObjectResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetObjectResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetObjectResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetObjectResponseV1(val *GetObjectResponseV1) *NullableGetObjectResponseV1 { + return &NullableGetObjectResponseV1{value: val, isSet: true} +} + +func (v NullableGetObjectResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetObjectResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_has_object_request_v1.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_has_object_request_v1.go new file mode 100644 index 00000000000..c38bbbc1631 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_has_object_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "encoding/json" +) + +// checks if the HasObjectRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasObjectRequestV1{} + +// HasObjectRequestV1 struct for HasObjectRequestV1 +type HasObjectRequestV1 struct { + // The key to check for presence in the object store. + Key string `json:"key"` +} + +// NewHasObjectRequestV1 instantiates a new HasObjectRequestV1 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 +// will change when the set of required properties is changed +func NewHasObjectRequestV1(key string) *HasObjectRequestV1 { + this := HasObjectRequestV1{} + this.Key = key + return &this +} + +// NewHasObjectRequestV1WithDefaults instantiates a new HasObjectRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasObjectRequestV1WithDefaults() *HasObjectRequestV1 { + this := HasObjectRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasObjectRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasObjectRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasObjectRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasObjectRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasObjectRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasObjectRequestV1 struct { + value *HasObjectRequestV1 + isSet bool +} + +func (v NullableHasObjectRequestV1) Get() *HasObjectRequestV1 { + return v.value +} + +func (v *NullableHasObjectRequestV1) Set(val *HasObjectRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasObjectRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasObjectRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasObjectRequestV1(val *HasObjectRequestV1) *NullableHasObjectRequestV1 { + return &NullableHasObjectRequestV1{value: val, isSet: true} +} + +func (v NullableHasObjectRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasObjectRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_has_object_response_v1.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_has_object_response_v1.go new file mode 100644 index 00000000000..b879f589b49 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_has_object_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "encoding/json" +) + +// checks if the HasObjectResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasObjectResponseV1{} + +// HasObjectResponseV1 struct for HasObjectResponseV1 +type HasObjectResponseV1 struct { + // The key that was used to check the presence of the value in the object store. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an object under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasObjectResponseV1 instantiates a new HasObjectResponseV1 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 +// will change when the set of required properties is changed +func NewHasObjectResponseV1(key string, checkedAt string, isPresent bool) *HasObjectResponseV1 { + this := HasObjectResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasObjectResponseV1WithDefaults instantiates a new HasObjectResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasObjectResponseV1WithDefaults() *HasObjectResponseV1 { + this := HasObjectResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasObjectResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasObjectResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasObjectResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasObjectResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasObjectResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasObjectResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasObjectResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasObjectResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasObjectResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasObjectResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasObjectResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasObjectResponseV1 struct { + value *HasObjectResponseV1 + isSet bool +} + +func (v NullableHasObjectResponseV1) Get() *HasObjectResponseV1 { + return v.value +} + +func (v *NullableHasObjectResponseV1) Set(val *HasObjectResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasObjectResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasObjectResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasObjectResponseV1(val *HasObjectResponseV1) *NullableHasObjectResponseV1 { + return &NullableHasObjectResponseV1{value: val, isSet: true} +} + +func (v NullableHasObjectResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasObjectResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_set_object_request_v1.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_set_object_request_v1.go new file mode 100644 index 00000000000..5ffab6a7e45 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_set_object_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "encoding/json" +) + +// checks if the SetObjectRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetObjectRequestV1{} + +// SetObjectRequestV1 struct for SetObjectRequestV1 +type SetObjectRequestV1 struct { + // The key for the entry to set in the object store. + Key string `json:"key"` + // The value that will be associated with the key in the object store. + Value string `json:"value"` +} + +// NewSetObjectRequestV1 instantiates a new SetObjectRequestV1 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 +// will change when the set of required properties is changed +func NewSetObjectRequestV1(key string, value string) *SetObjectRequestV1 { + this := SetObjectRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetObjectRequestV1WithDefaults instantiates a new SetObjectRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetObjectRequestV1WithDefaults() *SetObjectRequestV1 { + this := SetObjectRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetObjectRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetObjectRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetObjectRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetObjectRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetObjectRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetObjectRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetObjectRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetObjectRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetObjectRequestV1 struct { + value *SetObjectRequestV1 + isSet bool +} + +func (v NullableSetObjectRequestV1) Get() *SetObjectRequestV1 { + return v.value +} + +func (v *NullableSetObjectRequestV1) Set(val *SetObjectRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetObjectRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetObjectRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetObjectRequestV1(val *SetObjectRequestV1) *NullableSetObjectRequestV1 { + return &NullableSetObjectRequestV1{value: val, isSet: true} +} + +func (v NullableSetObjectRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetObjectRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_set_object_response_v1.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_set_object_response_v1.go new file mode 100644 index 00000000000..f1a8fe1796b --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/model_set_object_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "encoding/json" +) + +// checks if the SetObjectResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetObjectResponseV1{} + +// SetObjectResponseV1 struct for SetObjectResponseV1 +type SetObjectResponseV1 struct { + // The key that was used to set the value in the object store. + Key string `json:"key"` +} + +// NewSetObjectResponseV1 instantiates a new SetObjectResponseV1 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 +// will change when the set of required properties is changed +func NewSetObjectResponseV1(key string) *SetObjectResponseV1 { + this := SetObjectResponseV1{} + this.Key = key + return &this +} + +// NewSetObjectResponseV1WithDefaults instantiates a new SetObjectResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetObjectResponseV1WithDefaults() *SetObjectResponseV1 { + this := SetObjectResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetObjectResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetObjectResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetObjectResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetObjectResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetObjectResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetObjectResponseV1 struct { + value *SetObjectResponseV1 + isSet bool +} + +func (v NullableSetObjectResponseV1) Get() *SetObjectResponseV1 { + return v.value +} + +func (v *NullableSetObjectResponseV1) Set(val *SetObjectResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetObjectResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetObjectResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetObjectResponseV1(val *SetObjectResponseV1) *NullableSetObjectResponseV1 { + return &NullableSetObjectResponseV1{value: val, isSet: true} +} + +func (v NullableSetObjectResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetObjectResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/response.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..1c67751d5db --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/test/api_default_test.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..20e954c471f --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,61 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-object-store-ipfs + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-object-store-ipfs_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService GetObjectV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetObjectV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService HasObjectV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.HasObjectV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService SetObjectV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.SetObjectV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/utils.go b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..3a41e356d85 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Object Store - IPFS + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-object-store-ipfs + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..058f0a39726 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - Object Store - IPFS + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..92f338d703a --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,44 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/GetObjectRequestV1.java +src/main/java/org/openapitools/client/model/GetObjectResponseV1.java +src/main/java/org/openapitools/client/model/HasObjectRequestV1.java +src/main/java/org/openapitools/client/model/HasObjectResponseV1.java +src/main/java/org/openapitools/client/model/SetObjectRequestV1.java +src/main/java/org/openapitools/client/model/SetObjectResponseV1.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/GetObjectRequestV1Test.java +src/test/java/org/openapitools/client/model/GetObjectResponseV1Test.java +src/test/java/org/openapitools/client/model/HasObjectRequestV1Test.java +src/test/java/org/openapitools/client/model/HasObjectResponseV1Test.java +src/test/java/org/openapitools/client/model/SetObjectRequestV1Test.java +src/test/java/org/openapitools/client/model/SetObjectResponseV1Test.java diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.travis.yml b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/README.md b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..9210536e8f5 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,144 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Object Store - IPFS +- API version: v2.0.0-alpha.2 + +Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://www.cactus.stream"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + GetObjectRequestV1 getObjectRequestV1 = new GetObjectRequestV1(); // GetObjectRequestV1 | Request body to obtain an object via its key. + try { + GetObjectResponseV1 result = apiInstance.getObjectV1(getObjectRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getObjectV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://www.cactus.stream* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**getObjectV1**](docs/DefaultApi.md#getObjectV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object | Retrieves an object from the object store. +*DefaultApi* | [**hasObjectV1**](docs/DefaultApi.md#hasObjectV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object | Checks the presence of an object in the object store. +*DefaultApi* | [**setObjectV1**](docs/DefaultApi.md#setObjectV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object | Sets an object in the object store under the specified key. + + +## Documentation for Models + + - [GetObjectRequestV1](docs/GetObjectRequestV1.md) + - [GetObjectResponseV1](docs/GetObjectResponseV1.md) + - [HasObjectRequestV1](docs/HasObjectRequestV1.md) + - [HasObjectResponseV1](docs/HasObjectResponseV1.md) + - [SetObjectRequestV1](docs/SetObjectRequestV1.md) + - [SetObjectResponseV1](docs/SetObjectResponseV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/api/openapi.yaml b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..21fe4df4bcf --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,236 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: 'Hyperledger Cactus Plugin - Object Store - IPFS ' + version: v2.0.0-alpha.2 +servers: +- description: Public test instance + url: "https://www.cactus.stream/{basePath}" + variables: + basePath: + default: "" +- description: Local test instance + url: "http://localhost:4000/{basePath}" + variables: + basePath: + default: "" +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object: + post: + operationId: getObjectV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/object_store_get_object_v1_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectResponseV1' + description: OK + summary: Retrieves an object from the object store. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object: + post: + operationId: setObjectV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/object_store_set_object_v1_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectResponseV1' + description: OK + summary: Sets an object in the object store under the specified key. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object: + post: + operationId: hasObjectV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/object_store_has_object_v1_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectResponseV1' + description: OK + summary: Checks the presence of an object in the object store. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object + x-content-type: application/json + x-accepts: application/json +components: + requestBodies: + object_store_get_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectRequestV1' + description: Request body to obtain an object via its key. + required: true + object_store_set_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectRequestV1' + description: Request body to set an object under a key. + required: true + object_store_has_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectRequestV1' + description: Request body to check presence of an object under a key. + required: true + responses: + object_store_get_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectResponseV1' + description: OK + object_store_set_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectResponseV1' + description: OK + object_store_has_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectResponseV1' + description: OK + schemas: + GetObjectRequestV1: + example: + key: key + properties: + key: + description: The key for the entry to get from the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetObjectResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the object + store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key in the object store + as a string. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetObjectRequestV1: + example: + value: value + key: key + properties: + key: + description: The key for the entry to set in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key in the object + store. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetObjectResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasObjectRequestV1: + example: + key: key + properties: + key: + description: The key to check for presence in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasObjectResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an object under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/build.gradle b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/build.sbt b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradle.properties b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradlew b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradlew.bat b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/pom.xml b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/settings.gradle b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..123552007ab --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..8a195c7f66a --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1566 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "https://www.cactus.stream"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "https://www.cactus.stream/{basePath}", + "Public test instance", + new HashMap() {{ + put("basePath", new ServerVariable( + "No description provided", + "", + new HashSet( + ) + )); + }} + ), + new ServerConfiguration( + "http://localhost:4000/{basePath}", + "Local test instance", + new HashMap() {{ + put("basePath", new ServerVariable( + "No description provided", + "", + new HashSet( + ) + )); + }} + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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 https://www.cactus.stream + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..767f2be508a --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..5ffa50a03d5 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..9d87d39afde --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..04078ad12f4 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..72f38b71807 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,406 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.GetObjectRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetObjectResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasObjectRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasObjectResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetObjectRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetObjectResponseV1.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); + } + } + } + + /** + * 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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..edeb61bdee7 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..bdef1f05c70 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..4bebf9b5f4c --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..320b8affbf1 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..1071e59b4dc --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,450 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.GetObjectRequestV1; +import org.openapitools.client.model.GetObjectResponseV1; +import org.openapitools.client.model.HasObjectRequestV1; +import org.openapitools.client.model.HasObjectResponseV1; +import org.openapitools.client.model.SetObjectRequestV1; +import org.openapitools.client.model.SetObjectResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 getObjectV1 + * @param getObjectRequestV1 Request body to obtain an object via its key. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getObjectV1Call(GetObjectRequestV1 getObjectRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getObjectRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object"; + + 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 getObjectV1ValidateBeforeCall(GetObjectRequestV1 getObjectRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'getObjectRequestV1' is set + if (getObjectRequestV1 == null) { + throw new ApiException("Missing the required parameter 'getObjectRequestV1' when calling getObjectV1(Async)"); + } + + return getObjectV1Call(getObjectRequestV1, _callback); + + } + + /** + * Retrieves an object from the object store. + * + * @param getObjectRequestV1 Request body to obtain an object via its key. (required) + * @return GetObjectResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetObjectResponseV1 getObjectV1(GetObjectRequestV1 getObjectRequestV1) throws ApiException { + ApiResponse localVarResp = getObjectV1WithHttpInfo(getObjectRequestV1); + return localVarResp.getData(); + } + + /** + * Retrieves an object from the object store. + * + * @param getObjectRequestV1 Request body to obtain an object via its key. (required) + * @return ApiResponse<GetObjectResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getObjectV1WithHttpInfo(GetObjectRequestV1 getObjectRequestV1) throws ApiException { + okhttp3.Call localVarCall = getObjectV1ValidateBeforeCall(getObjectRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves an object from the object store. (asynchronously) + * + * @param getObjectRequestV1 Request body to obtain an object via its key. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getObjectV1Async(GetObjectRequestV1 getObjectRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getObjectV1ValidateBeforeCall(getObjectRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasObjectV1 + * @param hasObjectRequestV1 Request body to check presence of an object under a key. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call hasObjectV1Call(HasObjectRequestV1 hasObjectRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = hasObjectRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object"; + + 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 hasObjectV1ValidateBeforeCall(HasObjectRequestV1 hasObjectRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'hasObjectRequestV1' is set + if (hasObjectRequestV1 == null) { + throw new ApiException("Missing the required parameter 'hasObjectRequestV1' when calling hasObjectV1(Async)"); + } + + return hasObjectV1Call(hasObjectRequestV1, _callback); + + } + + /** + * Checks the presence of an object in the object store. + * + * @param hasObjectRequestV1 Request body to check presence of an object under a key. (required) + * @return HasObjectResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public HasObjectResponseV1 hasObjectV1(HasObjectRequestV1 hasObjectRequestV1) throws ApiException { + ApiResponse localVarResp = hasObjectV1WithHttpInfo(hasObjectRequestV1); + return localVarResp.getData(); + } + + /** + * Checks the presence of an object in the object store. + * + * @param hasObjectRequestV1 Request body to check presence of an object under a key. (required) + * @return ApiResponse<HasObjectResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse hasObjectV1WithHttpInfo(HasObjectRequestV1 hasObjectRequestV1) throws ApiException { + okhttp3.Call localVarCall = hasObjectV1ValidateBeforeCall(hasObjectRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Checks the presence of an object in the object store. (asynchronously) + * + * @param hasObjectRequestV1 Request body to check presence of an object under a key. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call hasObjectV1Async(HasObjectRequestV1 hasObjectRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasObjectV1ValidateBeforeCall(hasObjectRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setObjectV1 + * @param setObjectRequestV1 Request body to set an object under a key. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call setObjectV1Call(SetObjectRequestV1 setObjectRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = setObjectRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object"; + + 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 setObjectV1ValidateBeforeCall(SetObjectRequestV1 setObjectRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'setObjectRequestV1' is set + if (setObjectRequestV1 == null) { + throw new ApiException("Missing the required parameter 'setObjectRequestV1' when calling setObjectV1(Async)"); + } + + return setObjectV1Call(setObjectRequestV1, _callback); + + } + + /** + * Sets an object in the object store under the specified key. + * + * @param setObjectRequestV1 Request body to set an object under a key. (required) + * @return SetObjectResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public SetObjectResponseV1 setObjectV1(SetObjectRequestV1 setObjectRequestV1) throws ApiException { + ApiResponse localVarResp = setObjectV1WithHttpInfo(setObjectRequestV1); + return localVarResp.getData(); + } + + /** + * Sets an object in the object store under the specified key. + * + * @param setObjectRequestV1 Request body to set an object under a key. (required) + * @return ApiResponse<SetObjectResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse setObjectV1WithHttpInfo(SetObjectRequestV1 setObjectRequestV1) throws ApiException { + okhttp3.Call localVarCall = setObjectV1ValidateBeforeCall(setObjectRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Sets an object in the object store under the specified key. (asynchronously) + * + * @param setObjectRequestV1 Request body to set an object under a key. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call setObjectV1Async(SetObjectRequestV1 setObjectRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setObjectV1ValidateBeforeCall(setObjectRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..29933cb6802 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..03c39d40d1b --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..c34ed4a8a1f --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..64b092a41d8 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..8b93769633a --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectRequestV1.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectRequestV1.java new file mode 100644 index 00000000000..a6b3dca8ab3 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetObjectRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetObjectRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetObjectRequestV1() { + } + + public GetObjectRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetObjectRequestV1 getObjectRequestV1 = (GetObjectRequestV1) o; + return Objects.equals(this.key, getObjectRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetObjectRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetObjectRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetObjectRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetObjectRequestV1 is not found in the empty JSON string", GetObjectRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetObjectRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetObjectRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetObjectRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetObjectRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetObjectRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetObjectRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetObjectRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetObjectRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetObjectRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetObjectRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetObjectRequestV1 + */ + public static GetObjectRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetObjectRequestV1.class); + } + + /** + * Convert an instance of GetObjectRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectResponseV1.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectResponseV1.java new file mode 100644 index 00000000000..0af39dd647f --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetObjectResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetObjectResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetObjectResponseV1() { + } + + public GetObjectResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetObjectResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key in the object store as a string. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetObjectResponseV1 getObjectResponseV1 = (GetObjectResponseV1) o; + return Objects.equals(this.key, getObjectResponseV1.key) && + Objects.equals(this.value, getObjectResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetObjectResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetObjectResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetObjectResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetObjectResponseV1 is not found in the empty JSON string", GetObjectResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetObjectResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetObjectResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetObjectResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetObjectResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetObjectResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetObjectResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetObjectResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetObjectResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetObjectResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetObjectResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetObjectResponseV1 + */ + public static GetObjectResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetObjectResponseV1.class); + } + + /** + * Convert an instance of GetObjectResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectRequestV1.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectRequestV1.java new file mode 100644 index 00000000000..c05959faa14 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasObjectRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasObjectRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasObjectRequestV1() { + } + + public HasObjectRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasObjectRequestV1 hasObjectRequestV1 = (HasObjectRequestV1) o; + return Objects.equals(this.key, hasObjectRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasObjectRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasObjectRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasObjectRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasObjectRequestV1 is not found in the empty JSON string", HasObjectRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasObjectRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasObjectRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasObjectRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasObjectRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasObjectRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasObjectRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasObjectRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasObjectRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasObjectRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasObjectRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasObjectRequestV1 + */ + public static HasObjectRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasObjectRequestV1.class); + } + + /** + * Convert an instance of HasObjectRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectResponseV1.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectResponseV1.java new file mode 100644 index 00000000000..a6d20102dea --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasObjectResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasObjectResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasObjectResponseV1() { + } + + public HasObjectResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasObjectResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasObjectResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an object under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasObjectResponseV1 hasObjectResponseV1 = (HasObjectResponseV1) o; + return Objects.equals(this.key, hasObjectResponseV1.key) && + Objects.equals(this.checkedAt, hasObjectResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasObjectResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasObjectResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasObjectResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasObjectResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasObjectResponseV1 is not found in the empty JSON string", HasObjectResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasObjectResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasObjectResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasObjectResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasObjectResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasObjectResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasObjectResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasObjectResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasObjectResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasObjectResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasObjectResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasObjectResponseV1 + */ + public static HasObjectResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasObjectResponseV1.class); + } + + /** + * Convert an instance of HasObjectResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectRequestV1.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectRequestV1.java new file mode 100644 index 00000000000..cd8dd6eec01 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetObjectRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetObjectRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetObjectRequestV1() { + } + + public SetObjectRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set in the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetObjectRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key in the object store. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetObjectRequestV1 setObjectRequestV1 = (SetObjectRequestV1) o; + return Objects.equals(this.key, setObjectRequestV1.key) && + Objects.equals(this.value, setObjectRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetObjectRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetObjectRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetObjectRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetObjectRequestV1 is not found in the empty JSON string", SetObjectRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetObjectRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetObjectRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetObjectRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetObjectRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetObjectRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetObjectRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetObjectRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetObjectRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetObjectRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetObjectRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetObjectRequestV1 + */ + public static SetObjectRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetObjectRequestV1.class); + } + + /** + * Convert an instance of SetObjectRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectResponseV1.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectResponseV1.java new file mode 100644 index 00000000000..3164553fbf7 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetObjectResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetObjectResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetObjectResponseV1() { + } + + public SetObjectResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value in the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetObjectResponseV1 setObjectResponseV1 = (SetObjectResponseV1) o; + return Objects.equals(this.key, setObjectResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetObjectResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetObjectResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetObjectResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetObjectResponseV1 is not found in the empty JSON string", SetObjectResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetObjectResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetObjectResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetObjectResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetObjectResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetObjectResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetObjectResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetObjectResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetObjectResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetObjectResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetObjectResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetObjectResponseV1 + */ + public static SetObjectResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetObjectResponseV1.class); + } + + /** + * Convert an instance of SetObjectResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..f0298ec4b34 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.GetObjectRequestV1; +import org.openapitools.client.model.GetObjectResponseV1; +import org.openapitools.client.model.HasObjectRequestV1; +import org.openapitools.client.model.HasObjectResponseV1; +import org.openapitools.client.model.SetObjectRequestV1; +import org.openapitools.client.model.SetObjectResponseV1; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Retrieves an object from the object store. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getObjectV1Test() throws ApiException { + GetObjectRequestV1 getObjectRequestV1 = null; + GetObjectResponseV1 response = api.getObjectV1(getObjectRequestV1); + // TODO: test validations + } + + /** + * Checks the presence of an object in the object store. + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasObjectV1Test() throws ApiException { + HasObjectRequestV1 hasObjectRequestV1 = null; + HasObjectResponseV1 response = api.hasObjectV1(hasObjectRequestV1); + // TODO: test validations + } + + /** + * Sets an object in the object store under the specified key. + * + * @throws ApiException if the Api call fails + */ + @Test + public void setObjectV1Test() throws ApiException { + SetObjectRequestV1 setObjectRequestV1 = null; + SetObjectResponseV1 response = api.setObjectV1(setObjectRequestV1); + // TODO: test validations + } + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectRequestV1Test.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectRequestV1Test.java new file mode 100644 index 00000000000..75a12d41c65 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetObjectRequestV1 + */ +public class GetObjectRequestV1Test { + private final GetObjectRequestV1 model = new GetObjectRequestV1(); + + /** + * Model tests for GetObjectRequestV1 + */ + @Test + public void testGetObjectRequestV1() { + // TODO: test GetObjectRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectResponseV1Test.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectResponseV1Test.java new file mode 100644 index 00000000000..82aee4abbb4 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetObjectResponseV1 + */ +public class GetObjectResponseV1Test { + private final GetObjectResponseV1 model = new GetObjectResponseV1(); + + /** + * Model tests for GetObjectResponseV1 + */ + @Test + public void testGetObjectResponseV1() { + // TODO: test GetObjectResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectRequestV1Test.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectRequestV1Test.java new file mode 100644 index 00000000000..a91401e4e30 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasObjectRequestV1 + */ +public class HasObjectRequestV1Test { + private final HasObjectRequestV1 model = new HasObjectRequestV1(); + + /** + * Model tests for HasObjectRequestV1 + */ + @Test + public void testHasObjectRequestV1() { + // TODO: test HasObjectRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectResponseV1Test.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectResponseV1Test.java new file mode 100644 index 00000000000..c5ef4104d56 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasObjectResponseV1 + */ +public class HasObjectResponseV1Test { + private final HasObjectResponseV1 model = new HasObjectResponseV1(); + + /** + * Model tests for HasObjectResponseV1 + */ + @Test + public void testHasObjectResponseV1() { + // TODO: test HasObjectResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectRequestV1Test.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectRequestV1Test.java new file mode 100644 index 00000000000..6e5b15e32c2 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetObjectRequestV1 + */ +public class SetObjectRequestV1Test { + private final SetObjectRequestV1 model = new SetObjectRequestV1(); + + /** + * Model tests for SetObjectRequestV1 + */ + @Test + public void testSetObjectRequestV1() { + // TODO: test SetObjectRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectResponseV1Test.java b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectResponseV1Test.java new file mode 100644 index 00000000000..3c6732996e5 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Object Store - IPFS + * Contains/describes the Hyperledger Cactus Object Store IPFS plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetObjectResponseV1 + */ +public class SetObjectResponseV1Test { + private final SetObjectResponseV1 model = new SetObjectResponseV1(); + + /** + * Model tests for SetObjectResponseV1 + */ + @Test + public void testSetObjectResponseV1() { + // TODO: test SetObjectResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/openapi-generator-ignore b/openapi-generator-ignore index a10faf6d12f..89659643968 100644 --- a/openapi-generator-ignore +++ b/openapi-generator-ignore @@ -3,4 +3,7 @@ **/.gitignore **/generated/openapi/kotlin-client/docs/** **/generated/openapi/kotlin-client/gradle/** +**/generated/openapi/java-client/docs/** +**/generated/openapi/java-client/gradle/** +**/generated/openapi/go-client/docs/** **/generated/**/.openapi-generator-ignore \ No newline at end of file diff --git a/package.json b/package.json index db58d9b5a4b..6e340520292 100644 --- a/package.json +++ b/package.json @@ -160,6 +160,7 @@ "openapi-types": "12.1.3", "prettier": "3.0.3", "protoc-gen-ts": "0.8.6", + "replace": "1.2.2", "run-time-error": "1.4.0", "run-time-error-cjs": "1.4.0", "secp256k1": "4.0.3", diff --git a/packages/cactus-cmd-api-server/package.json b/packages/cactus-cmd-api-server/package.json index 1e925cb7239..0af9bcf7daa 100644 --- a/packages/cactus-cmd-api-server/package.json +++ b/packages/cactus-cmd-api-server/package.json @@ -49,6 +49,8 @@ "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "proto:openapi": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g protobuf-schema --model-name-suffix=PB --additional-properties=packageName=org.hyperledger.cactus.cmd_api_server -o ./src/main/proto/generated/openapi/ -t=./src/main/openapi-generator/templates/protobuf-schema/", "proto:protoc-gen-ts": "yarn run grpc_tools_node_protoc --plugin=protoc-gen-ts=../../node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./src/main/typescript/generated/proto/protoc-gen-ts/ --proto_path ./src/main/proto/generated/openapi/ ./src/main/proto/generated/openapi/services/*.proto", "watch": "npm-watch", diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..cb1787cc1ac --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,14 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_health_check_response.go +model_memory_usage.go +model_watch_healthcheck_v1.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..6652235c31b --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,116 @@ +# Go API client for cactus-cmd-api-server + +Interact with a Cactus deployment through HTTP. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-cmd-api-server "github.com/hyperledger/cactus-cmd-api-server/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-cmd-api-server.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-cmd-api-server.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-cmd-api-server.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-cmd-api-server.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetHealthCheckV1**](docs/DefaultApi.md#gethealthcheckv1) | **Get** /api/v1/api-server/healthcheck | Can be used to verify liveness of an API server instance +*DefaultApi* | [**GetOpenApiSpecV1**](docs/DefaultApi.md#getopenapispecv1) | **Get** /api/v1/api-server/get-open-api-spec | +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/api-server/get-prometheus-exporter-metrics | Get the Prometheus Metrics + + +## Documentation For Models + + - [HealthCheckResponse](docs/HealthCheckResponse.md) + - [MemoryUsage](docs/MemoryUsage.md) + - [WatchHealthcheckV1](docs/WatchHealthcheckV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..355d99b677a --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,129 @@ +openapi: 3.0.3 +info: + description: Interact with a Cactus deployment through HTTP. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/api-server/healthcheck: + get: + description: Returns the current timestamp of the API server as proof of health/liveness + operationId: getHealthCheckV1 + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResponse' + description: OK + summary: Can be used to verify liveness of an API server instance + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/api-server/healthcheck + /api/v1/api-server/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/api-server/get-prometheus-exporter-metrics + /api/v1/api-server/get-open-api-spec: + get: + description: Returns the openapi.json document of specific plugin. + operationId: getOpenApiSpecV1 + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetOpenApiSpecV1EndpointResponse' + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/api-server/get-open-api-spec +components: + schemas: + WatchHealthcheckV1: + enum: + - org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Subscribe + - org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Next + - org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Unsubscribe + - org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Error + - org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + MemoryUsage: + example: + heapUsed: 1.4658129805029452 + external: 5.962133916683182 + rss: 0.8008281904610115 + heapTotal: 6.027456183070403 + arrayBuffers: 5.637376656633329 + properties: + rss: + title: Resident Set Size + type: number + heapTotal: + title: V8 memory usage - heap total + type: number + heapUsed: + title: V8 memory usage - heap used + type: number + external: + title: Memory usage of C++ objects bound to JavaScript objects managed by + V8 + type: number + arrayBuffers: + title: "Memory allocated for ArrayBuffers and SharedArrayBuffers, including\ + \ all Node.js Buffers" + type: number + type: object + HealthCheckResponse: + example: + createdAt: createdAt + memoryUsage: + heapUsed: 1.4658129805029452 + external: 5.962133916683182 + rss: 0.8008281904610115 + heapTotal: 6.027456183070403 + arrayBuffers: 5.637376656633329 + success: true + properties: + success: + type: boolean + createdAt: + type: string + memoryUsage: + $ref: '#/components/schemas/MemoryUsage' + required: + - createdAt + - memoryUsage + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetOpenApiSpecV1EndpointResponse: + nullable: false + type: string diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..4b3aa35b03e --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,318 @@ +/* +Hyperledger Cactus API + +Interact with a Cactus deployment through HTTP. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-cmd-api-server + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGetHealthCheckV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetHealthCheckV1Request) Execute() (*HealthCheckResponse, *http.Response, error) { + return r.ApiService.GetHealthCheckV1Execute(r) +} + +/* +GetHealthCheckV1 Can be used to verify liveness of an API server instance + +Returns the current timestamp of the API server as proof of health/liveness + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetHealthCheckV1Request +*/ +func (a *DefaultApiService) GetHealthCheckV1(ctx context.Context) ApiGetHealthCheckV1Request { + return ApiGetHealthCheckV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return HealthCheckResponse +func (a *DefaultApiService) GetHealthCheckV1Execute(r ApiGetHealthCheckV1Request) (*HealthCheckResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HealthCheckResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetHealthCheckV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/api-server/healthcheck" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetOpenApiSpecV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetOpenApiSpecV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetOpenApiSpecV1Execute(r) +} + +/* +GetOpenApiSpecV1 Method for GetOpenApiSpecV1 + +Returns the openapi.json document of specific plugin. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetOpenApiSpecV1Request +*/ +func (a *DefaultApiService) GetOpenApiSpecV1(ctx context.Context) ApiGetOpenApiSpecV1Request { + return ApiGetOpenApiSpecV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetOpenApiSpecV1Execute(r ApiGetOpenApiSpecV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOpenApiSpecV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/api-server/get-open-api-spec" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/api-server/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..46db3c98dde --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus API + +Interact with a Cactus deployment through HTTP. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-cmd-api-server + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus API API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..9ffd4406b19 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus API + +Interact with a Cactus deployment through HTTP. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-cmd-api-server + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..cf6f7e9b4ab --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-cmd-api-server/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_health_check_response.go b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_health_check_response.go new file mode 100644 index 00000000000..a38d59d4c9b --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_health_check_response.go @@ -0,0 +1,180 @@ +/* +Hyperledger Cactus API + +Interact with a Cactus deployment through HTTP. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-cmd-api-server + +import ( + "encoding/json" +) + +// checks if the HealthCheckResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HealthCheckResponse{} + +// HealthCheckResponse struct for HealthCheckResponse +type HealthCheckResponse struct { + Success *bool `json:"success,omitempty"` + CreatedAt string `json:"createdAt"` + MemoryUsage MemoryUsage `json:"memoryUsage"` +} + +// NewHealthCheckResponse instantiates a new HealthCheckResponse 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 +// will change when the set of required properties is changed +func NewHealthCheckResponse(createdAt string, memoryUsage MemoryUsage) *HealthCheckResponse { + this := HealthCheckResponse{} + this.CreatedAt = createdAt + this.MemoryUsage = memoryUsage + return &this +} + +// NewHealthCheckResponseWithDefaults instantiates a new HealthCheckResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHealthCheckResponseWithDefaults() *HealthCheckResponse { + this := HealthCheckResponse{} + return &this +} + +// GetSuccess returns the Success field value if set, zero value otherwise. +func (o *HealthCheckResponse) GetSuccess() bool { + if o == nil || IsNil(o.Success) { + var ret bool + return ret + } + return *o.Success +} + +// GetSuccessOk returns a tuple with the Success field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HealthCheckResponse) GetSuccessOk() (*bool, bool) { + if o == nil || IsNil(o.Success) { + return nil, false + } + return o.Success, true +} + +// HasSuccess returns a boolean if a field has been set. +func (o *HealthCheckResponse) HasSuccess() bool { + if o != nil && !IsNil(o.Success) { + return true + } + + return false +} + +// SetSuccess gets a reference to the given bool and assigns it to the Success field. +func (o *HealthCheckResponse) SetSuccess(v bool) { + o.Success = &v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *HealthCheckResponse) GetCreatedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *HealthCheckResponse) GetCreatedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *HealthCheckResponse) SetCreatedAt(v string) { + o.CreatedAt = v +} + +// GetMemoryUsage returns the MemoryUsage field value +func (o *HealthCheckResponse) GetMemoryUsage() MemoryUsage { + if o == nil { + var ret MemoryUsage + return ret + } + + return o.MemoryUsage +} + +// GetMemoryUsageOk returns a tuple with the MemoryUsage field value +// and a boolean to check if the value has been set. +func (o *HealthCheckResponse) GetMemoryUsageOk() (*MemoryUsage, bool) { + if o == nil { + return nil, false + } + return &o.MemoryUsage, true +} + +// SetMemoryUsage sets field value +func (o *HealthCheckResponse) SetMemoryUsage(v MemoryUsage) { + o.MemoryUsage = v +} + +func (o HealthCheckResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HealthCheckResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Success) { + toSerialize["success"] = o.Success + } + toSerialize["createdAt"] = o.CreatedAt + toSerialize["memoryUsage"] = o.MemoryUsage + return toSerialize, nil +} + +type NullableHealthCheckResponse struct { + value *HealthCheckResponse + isSet bool +} + +func (v NullableHealthCheckResponse) Get() *HealthCheckResponse { + return v.value +} + +func (v *NullableHealthCheckResponse) Set(val *HealthCheckResponse) { + v.value = val + v.isSet = true +} + +func (v NullableHealthCheckResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableHealthCheckResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHealthCheckResponse(val *HealthCheckResponse) *NullableHealthCheckResponse { + return &NullableHealthCheckResponse{value: val, isSet: true} +} + +func (v NullableHealthCheckResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHealthCheckResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_memory_usage.go b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_memory_usage.go new file mode 100644 index 00000000000..e1076e04599 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_memory_usage.go @@ -0,0 +1,270 @@ +/* +Hyperledger Cactus API + +Interact with a Cactus deployment through HTTP. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-cmd-api-server + +import ( + "encoding/json" +) + +// checks if the MemoryUsage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MemoryUsage{} + +// MemoryUsage struct for MemoryUsage +type MemoryUsage struct { + Rss *float32 `json:"rss,omitempty"` + HeapTotal *float32 `json:"heapTotal,omitempty"` + HeapUsed *float32 `json:"heapUsed,omitempty"` + External *float32 `json:"external,omitempty"` + ArrayBuffers *float32 `json:"arrayBuffers,omitempty"` +} + +// NewMemoryUsage instantiates a new MemoryUsage 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 +// will change when the set of required properties is changed +func NewMemoryUsage() *MemoryUsage { + this := MemoryUsage{} + return &this +} + +// NewMemoryUsageWithDefaults instantiates a new MemoryUsage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMemoryUsageWithDefaults() *MemoryUsage { + this := MemoryUsage{} + return &this +} + +// GetRss returns the Rss field value if set, zero value otherwise. +func (o *MemoryUsage) GetRss() float32 { + if o == nil || IsNil(o.Rss) { + var ret float32 + return ret + } + return *o.Rss +} + +// GetRssOk returns a tuple with the Rss field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MemoryUsage) GetRssOk() (*float32, bool) { + if o == nil || IsNil(o.Rss) { + return nil, false + } + return o.Rss, true +} + +// HasRss returns a boolean if a field has been set. +func (o *MemoryUsage) HasRss() bool { + if o != nil && !IsNil(o.Rss) { + return true + } + + return false +} + +// SetRss gets a reference to the given float32 and assigns it to the Rss field. +func (o *MemoryUsage) SetRss(v float32) { + o.Rss = &v +} + +// GetHeapTotal returns the HeapTotal field value if set, zero value otherwise. +func (o *MemoryUsage) GetHeapTotal() float32 { + if o == nil || IsNil(o.HeapTotal) { + var ret float32 + return ret + } + return *o.HeapTotal +} + +// GetHeapTotalOk returns a tuple with the HeapTotal field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MemoryUsage) GetHeapTotalOk() (*float32, bool) { + if o == nil || IsNil(o.HeapTotal) { + return nil, false + } + return o.HeapTotal, true +} + +// HasHeapTotal returns a boolean if a field has been set. +func (o *MemoryUsage) HasHeapTotal() bool { + if o != nil && !IsNil(o.HeapTotal) { + return true + } + + return false +} + +// SetHeapTotal gets a reference to the given float32 and assigns it to the HeapTotal field. +func (o *MemoryUsage) SetHeapTotal(v float32) { + o.HeapTotal = &v +} + +// GetHeapUsed returns the HeapUsed field value if set, zero value otherwise. +func (o *MemoryUsage) GetHeapUsed() float32 { + if o == nil || IsNil(o.HeapUsed) { + var ret float32 + return ret + } + return *o.HeapUsed +} + +// GetHeapUsedOk returns a tuple with the HeapUsed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MemoryUsage) GetHeapUsedOk() (*float32, bool) { + if o == nil || IsNil(o.HeapUsed) { + return nil, false + } + return o.HeapUsed, true +} + +// HasHeapUsed returns a boolean if a field has been set. +func (o *MemoryUsage) HasHeapUsed() bool { + if o != nil && !IsNil(o.HeapUsed) { + return true + } + + return false +} + +// SetHeapUsed gets a reference to the given float32 and assigns it to the HeapUsed field. +func (o *MemoryUsage) SetHeapUsed(v float32) { + o.HeapUsed = &v +} + +// GetExternal returns the External field value if set, zero value otherwise. +func (o *MemoryUsage) GetExternal() float32 { + if o == nil || IsNil(o.External) { + var ret float32 + return ret + } + return *o.External +} + +// GetExternalOk returns a tuple with the External field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MemoryUsage) GetExternalOk() (*float32, bool) { + if o == nil || IsNil(o.External) { + return nil, false + } + return o.External, true +} + +// HasExternal returns a boolean if a field has been set. +func (o *MemoryUsage) HasExternal() bool { + if o != nil && !IsNil(o.External) { + return true + } + + return false +} + +// SetExternal gets a reference to the given float32 and assigns it to the External field. +func (o *MemoryUsage) SetExternal(v float32) { + o.External = &v +} + +// GetArrayBuffers returns the ArrayBuffers field value if set, zero value otherwise. +func (o *MemoryUsage) GetArrayBuffers() float32 { + if o == nil || IsNil(o.ArrayBuffers) { + var ret float32 + return ret + } + return *o.ArrayBuffers +} + +// GetArrayBuffersOk returns a tuple with the ArrayBuffers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MemoryUsage) GetArrayBuffersOk() (*float32, bool) { + if o == nil || IsNil(o.ArrayBuffers) { + return nil, false + } + return o.ArrayBuffers, true +} + +// HasArrayBuffers returns a boolean if a field has been set. +func (o *MemoryUsage) HasArrayBuffers() bool { + if o != nil && !IsNil(o.ArrayBuffers) { + return true + } + + return false +} + +// SetArrayBuffers gets a reference to the given float32 and assigns it to the ArrayBuffers field. +func (o *MemoryUsage) SetArrayBuffers(v float32) { + o.ArrayBuffers = &v +} + +func (o MemoryUsage) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MemoryUsage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Rss) { + toSerialize["rss"] = o.Rss + } + if !IsNil(o.HeapTotal) { + toSerialize["heapTotal"] = o.HeapTotal + } + if !IsNil(o.HeapUsed) { + toSerialize["heapUsed"] = o.HeapUsed + } + if !IsNil(o.External) { + toSerialize["external"] = o.External + } + if !IsNil(o.ArrayBuffers) { + toSerialize["arrayBuffers"] = o.ArrayBuffers + } + return toSerialize, nil +} + +type NullableMemoryUsage struct { + value *MemoryUsage + isSet bool +} + +func (v NullableMemoryUsage) Get() *MemoryUsage { + return v.value +} + +func (v *NullableMemoryUsage) Set(val *MemoryUsage) { + v.value = val + v.isSet = true +} + +func (v NullableMemoryUsage) IsSet() bool { + return v.isSet +} + +func (v *NullableMemoryUsage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMemoryUsage(val *MemoryUsage) *NullableMemoryUsage { + return &NullableMemoryUsage{value: val, isSet: true} +} + +func (v NullableMemoryUsage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMemoryUsage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_watch_healthcheck_v1.go b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_watch_healthcheck_v1.go new file mode 100644 index 00000000000..86d9f434bf3 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/model_watch_healthcheck_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus API + +Interact with a Cactus deployment through HTTP. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-cmd-api-server + +import ( + "encoding/json" + "fmt" +) + +// WatchHealthcheckV1 the model 'WatchHealthcheckV1' +type WatchHealthcheckV1 string + +// List of WatchHealthcheckV1 +const ( + Subscribe WatchHealthcheckV1 = "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Subscribe" + Next WatchHealthcheckV1 = "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Next" + Unsubscribe WatchHealthcheckV1 = "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Unsubscribe" + Error WatchHealthcheckV1 = "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Error" + Complete WatchHealthcheckV1 = "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Complete" +) + +// All allowed values of WatchHealthcheckV1 enum +var AllowedWatchHealthcheckV1EnumValues = []WatchHealthcheckV1{ + "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Subscribe", + "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Next", + "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Unsubscribe", + "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Error", + "org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Complete", +} + +func (v *WatchHealthcheckV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchHealthcheckV1(value) + for _, existing := range AllowedWatchHealthcheckV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchHealthcheckV1", value) +} + +// NewWatchHealthcheckV1FromValue returns a pointer to a valid WatchHealthcheckV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchHealthcheckV1FromValue(v string) (*WatchHealthcheckV1, error) { + ev := WatchHealthcheckV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchHealthcheckV1: valid values are %v", v, AllowedWatchHealthcheckV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchHealthcheckV1) IsValid() bool { + for _, existing := range AllowedWatchHealthcheckV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchHealthcheckV1 value +func (v WatchHealthcheckV1) Ptr() *WatchHealthcheckV1 { + return &v +} + +type NullableWatchHealthcheckV1 struct { + value *WatchHealthcheckV1 + isSet bool +} + +func (v NullableWatchHealthcheckV1) Get() *WatchHealthcheckV1 { + return v.value +} + +func (v *NullableWatchHealthcheckV1) Set(val *WatchHealthcheckV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchHealthcheckV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchHealthcheckV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchHealthcheckV1(val *WatchHealthcheckV1) *NullableWatchHealthcheckV1 { + return &NullableWatchHealthcheckV1{value: val, isSet: true} +} + +func (v NullableWatchHealthcheckV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchHealthcheckV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..f5fa6c50596 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus API + +Interact with a Cactus deployment through HTTP. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-cmd-api-server + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..6631815e841 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,61 @@ +/* +Hyperledger Cactus API + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-cmd-api-server + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-cmd-api-server/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-cmd-api-server_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService GetHealthCheckV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetHealthCheckV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetOpenApiSpecV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetOpenApiSpecV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPrometheusMetricsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPrometheusMetricsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..40599c80fcb --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus API + +Interact with a Cactus deployment through HTTP. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-cmd-api-server + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..3d2648acac0 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus API + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..6ee5f287c16 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,38 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/HealthCheckResponse.java +src/main/java/org/openapitools/client/model/MemoryUsage.java +src/main/java/org/openapitools/client/model/WatchHealthcheckV1.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/HealthCheckResponseTest.java +src/test/java/org/openapitools/client/model/MemoryUsageTest.java +src/test/java/org/openapitools/client/model/WatchHealthcheckV1Test.java diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..2b1bb8aa630 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,140 @@ +# openapi-java-client + +Hyperledger Cactus API +- API version: v2.0.0-alpha.2 + +Interact with a Cactus deployment through HTTP. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + HealthCheckResponse result = apiInstance.getHealthCheckV1(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getHealthCheckV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**getHealthCheckV1**](docs/DefaultApi.md#getHealthCheckV1) | **GET** /api/v1/api-server/healthcheck | Can be used to verify liveness of an API server instance +*DefaultApi* | [**getOpenApiSpecV1**](docs/DefaultApi.md#getOpenApiSpecV1) | **GET** /api/v1/api-server/get-open-api-spec | +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/api-server/get-prometheus-exporter-metrics | Get the Prometheus Metrics + + +## Documentation for Models + + - [HealthCheckResponse](docs/HealthCheckResponse.md) + - [MemoryUsage](docs/MemoryUsage.md) + - [WatchHealthcheckV1](docs/WatchHealthcheckV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..de49ba15ef7 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,133 @@ +openapi: 3.0.3 +info: + description: Interact with a Cactus deployment through HTTP. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/api-server/healthcheck: + get: + description: Returns the current timestamp of the API server as proof of health/liveness + operationId: getHealthCheckV1 + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResponse' + description: OK + summary: Can be used to verify liveness of an API server instance + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/api-server/healthcheck + x-accepts: application/json + /api/v1/api-server/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/api-server/get-prometheus-exporter-metrics + x-accepts: text/plain + /api/v1/api-server/get-open-api-spec: + get: + description: Returns the openapi.json document of specific plugin. + operationId: getOpenApiSpecV1 + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetOpenApiSpecV1EndpointResponse' + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/api-server/get-open-api-spec + x-accepts: application/json +components: + schemas: + WatchHealthcheckV1: + enum: + - org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Subscribe + - org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Next + - org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Unsubscribe + - org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Error + - org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + MemoryUsage: + example: + heapUsed: 1.4658129805029452 + external: 5.962133916683182 + rss: 0.8008281904610115 + heapTotal: 6.027456183070403 + arrayBuffers: 5.637376656633329 + properties: + rss: + title: Resident Set Size + type: number + heapTotal: + title: V8 memory usage - heap total + type: number + heapUsed: + title: V8 memory usage - heap used + type: number + external: + title: Memory usage of C++ objects bound to JavaScript objects managed by + V8 + type: number + arrayBuffers: + title: "Memory allocated for ArrayBuffers and SharedArrayBuffers, including\ + \ all Node.js Buffers" + type: number + type: object + HealthCheckResponse: + example: + createdAt: createdAt + memoryUsage: + heapUsed: 1.4658129805029452 + external: 5.962133916683182 + rss: 0.8008281904610115 + heapTotal: 6.027456183070403 + arrayBuffers: 5.637376656633329 + success: true + properties: + success: + type: boolean + createdAt: + type: string + memoryUsage: + $ref: '#/components/schemas/MemoryUsage' + required: + - createdAt + - memoryUsage + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetOpenApiSpecV1EndpointResponse: + nullable: false + type: string + diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..2409e99e33e --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..3bc66600c09 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..fd240bf0e38 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..b5257a3d48f --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..03c2ea56758 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..2ec42303fe0 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..b3386d0e8dd --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,402 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.HealthCheckResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.MemoryUsage.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); + } + } + } + + /** + * 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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..f7390b9cf19 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..a471d8b0465 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..aa7c3668d35 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..77282310e47 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..5301efef65b --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,415 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.HealthCheckResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 getHealthCheckV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getHealthCheckV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/api-server/healthcheck"; + + 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 getHealthCheckV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getHealthCheckV1Call(_callback); + + } + + /** + * Can be used to verify liveness of an API server instance + * Returns the current timestamp of the API server as proof of health/liveness + * @return HealthCheckResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public HealthCheckResponse getHealthCheckV1() throws ApiException { + ApiResponse localVarResp = getHealthCheckV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Can be used to verify liveness of an API server instance + * Returns the current timestamp of the API server as proof of health/liveness + * @return ApiResponse<HealthCheckResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getHealthCheckV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getHealthCheckV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Can be used to verify liveness of an API server instance (asynchronously) + * Returns the current timestamp of the API server as proof of health/liveness + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getHealthCheckV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getHealthCheckV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOpenApiSpecV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getOpenApiSpecV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/api-server/get-open-api-spec"; + + 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 getOpenApiSpecV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getOpenApiSpecV1Call(_callback); + + } + + /** + * + * Returns the openapi.json document of specific plugin. + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getOpenApiSpecV1() throws ApiException { + ApiResponse localVarResp = getOpenApiSpecV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * Returns the openapi.json document of specific plugin. + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getOpenApiSpecV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getOpenApiSpecV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Returns the openapi.json document of specific plugin. + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getOpenApiSpecV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getOpenApiSpecV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/api-server/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + 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 getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..bf8caad49e3 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..1fea47cc135 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..0350d9363b5 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..3c4df1037bb --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..3e98421bd8e --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HealthCheckResponse.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HealthCheckResponse.java new file mode 100644 index 00000000000..58f7ff42bf0 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HealthCheckResponse.java @@ -0,0 +1,276 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.MemoryUsage; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HealthCheckResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HealthCheckResponse { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_MEMORY_USAGE = "memoryUsage"; + @SerializedName(SERIALIZED_NAME_MEMORY_USAGE) + private MemoryUsage memoryUsage; + + public HealthCheckResponse() { + } + + public HealthCheckResponse success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nullable + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public HealthCheckResponse createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + **/ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public HealthCheckResponse memoryUsage(MemoryUsage memoryUsage) { + + this.memoryUsage = memoryUsage; + return this; + } + + /** + * Get memoryUsage + * @return memoryUsage + **/ + @javax.annotation.Nonnull + public MemoryUsage getMemoryUsage() { + return memoryUsage; + } + + + public void setMemoryUsage(MemoryUsage memoryUsage) { + this.memoryUsage = memoryUsage; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HealthCheckResponse healthCheckResponse = (HealthCheckResponse) o; + return Objects.equals(this.success, healthCheckResponse.success) && + Objects.equals(this.createdAt, healthCheckResponse.createdAt) && + Objects.equals(this.memoryUsage, healthCheckResponse.memoryUsage); + } + + @Override + public int hashCode() { + return Objects.hash(success, createdAt, memoryUsage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResponse {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" memoryUsage: ").append(toIndentedString(memoryUsage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("createdAt"); + openapiFields.add("memoryUsage"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("memoryUsage"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HealthCheckResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HealthCheckResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HealthCheckResponse is not found in the empty JSON string", HealthCheckResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HealthCheckResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HealthCheckResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HealthCheckResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("createdAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `createdAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdAt").toString())); + } + // validate the required field `memoryUsage` + MemoryUsage.validateJsonObject(jsonObj.getAsJsonObject("memoryUsage")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HealthCheckResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HealthCheckResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HealthCheckResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HealthCheckResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HealthCheckResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HealthCheckResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of HealthCheckResponse + * @throws IOException if the JSON string is invalid with respect to HealthCheckResponse + */ + public static HealthCheckResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HealthCheckResponse.class); + } + + /** + * Convert an instance of HealthCheckResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/MemoryUsage.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/MemoryUsage.java new file mode 100644 index 00000000000..d5c3e9d973f --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/MemoryUsage.java @@ -0,0 +1,318 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * MemoryUsage + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MemoryUsage { + public static final String SERIALIZED_NAME_RSS = "rss"; + @SerializedName(SERIALIZED_NAME_RSS) + private BigDecimal rss; + + public static final String SERIALIZED_NAME_HEAP_TOTAL = "heapTotal"; + @SerializedName(SERIALIZED_NAME_HEAP_TOTAL) + private BigDecimal heapTotal; + + public static final String SERIALIZED_NAME_HEAP_USED = "heapUsed"; + @SerializedName(SERIALIZED_NAME_HEAP_USED) + private BigDecimal heapUsed; + + public static final String SERIALIZED_NAME_EXTERNAL = "external"; + @SerializedName(SERIALIZED_NAME_EXTERNAL) + private BigDecimal external; + + public static final String SERIALIZED_NAME_ARRAY_BUFFERS = "arrayBuffers"; + @SerializedName(SERIALIZED_NAME_ARRAY_BUFFERS) + private BigDecimal arrayBuffers; + + public MemoryUsage() { + } + + public MemoryUsage rss(BigDecimal rss) { + + this.rss = rss; + return this; + } + + /** + * Get rss + * @return rss + **/ + @javax.annotation.Nullable + public BigDecimal getRss() { + return rss; + } + + + public void setRss(BigDecimal rss) { + this.rss = rss; + } + + + public MemoryUsage heapTotal(BigDecimal heapTotal) { + + this.heapTotal = heapTotal; + return this; + } + + /** + * Get heapTotal + * @return heapTotal + **/ + @javax.annotation.Nullable + public BigDecimal getHeapTotal() { + return heapTotal; + } + + + public void setHeapTotal(BigDecimal heapTotal) { + this.heapTotal = heapTotal; + } + + + public MemoryUsage heapUsed(BigDecimal heapUsed) { + + this.heapUsed = heapUsed; + return this; + } + + /** + * Get heapUsed + * @return heapUsed + **/ + @javax.annotation.Nullable + public BigDecimal getHeapUsed() { + return heapUsed; + } + + + public void setHeapUsed(BigDecimal heapUsed) { + this.heapUsed = heapUsed; + } + + + public MemoryUsage external(BigDecimal external) { + + this.external = external; + return this; + } + + /** + * Get external + * @return external + **/ + @javax.annotation.Nullable + public BigDecimal getExternal() { + return external; + } + + + public void setExternal(BigDecimal external) { + this.external = external; + } + + + public MemoryUsage arrayBuffers(BigDecimal arrayBuffers) { + + this.arrayBuffers = arrayBuffers; + return this; + } + + /** + * Get arrayBuffers + * @return arrayBuffers + **/ + @javax.annotation.Nullable + public BigDecimal getArrayBuffers() { + return arrayBuffers; + } + + + public void setArrayBuffers(BigDecimal arrayBuffers) { + this.arrayBuffers = arrayBuffers; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MemoryUsage memoryUsage = (MemoryUsage) o; + return Objects.equals(this.rss, memoryUsage.rss) && + Objects.equals(this.heapTotal, memoryUsage.heapTotal) && + Objects.equals(this.heapUsed, memoryUsage.heapUsed) && + Objects.equals(this.external, memoryUsage.external) && + Objects.equals(this.arrayBuffers, memoryUsage.arrayBuffers); + } + + @Override + public int hashCode() { + return Objects.hash(rss, heapTotal, heapUsed, external, arrayBuffers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MemoryUsage {\n"); + sb.append(" rss: ").append(toIndentedString(rss)).append("\n"); + sb.append(" heapTotal: ").append(toIndentedString(heapTotal)).append("\n"); + sb.append(" heapUsed: ").append(toIndentedString(heapUsed)).append("\n"); + sb.append(" external: ").append(toIndentedString(external)).append("\n"); + sb.append(" arrayBuffers: ").append(toIndentedString(arrayBuffers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rss"); + openapiFields.add("heapTotal"); + openapiFields.add("heapUsed"); + openapiFields.add("external"); + openapiFields.add("arrayBuffers"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MemoryUsage + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!MemoryUsage.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MemoryUsage is not found in the empty JSON string", MemoryUsage.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MemoryUsage.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MemoryUsage` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MemoryUsage.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MemoryUsage' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MemoryUsage.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MemoryUsage value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MemoryUsage read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MemoryUsage given an JSON string + * + * @param jsonString JSON string + * @return An instance of MemoryUsage + * @throws IOException if the JSON string is invalid with respect to MemoryUsage + */ + public static MemoryUsage fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MemoryUsage.class); + } + + /** + * Convert an instance of MemoryUsage to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchHealthcheckV1.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchHealthcheckV1.java new file mode 100644 index 00000000000..6d792108a82 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchHealthcheckV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets WatchHealthcheckV1 + */ +@JsonAdapter(WatchHealthcheckV1.Adapter.class) +public enum WatchHealthcheckV1 { + + Subscribe("org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Subscribe"), + + Next("org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Next"), + + Unsubscribe("org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Unsubscribe"), + + Error("org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Error"), + + Complete("org.hyperledger.cactus.api.async.besu.WatchHealthcheckV1.Complete"); + + private String value; + + WatchHealthcheckV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchHealthcheckV1 fromValue(String value) { + for (WatchHealthcheckV1 b : WatchHealthcheckV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchHealthcheckV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchHealthcheckV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchHealthcheckV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..e44dbdb6dc3 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,69 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.HealthCheckResponse; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Can be used to verify liveness of an API server instance + * + * Returns the current timestamp of the API server as proof of health/liveness + * + * @throws ApiException if the Api call fails + */ + @Test + public void getHealthCheckV1Test() throws ApiException { + HealthCheckResponse response = api.getHealthCheckV1(); + // TODO: test validations + } + + /** + * Returns the openapi.json document of specific plugin. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getOpenApiSpecV1Test() throws ApiException { + String response = api.getOpenApiSpecV1(); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HealthCheckResponseTest.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HealthCheckResponseTest.java new file mode 100644 index 00000000000..36900a96692 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HealthCheckResponseTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.MemoryUsage; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HealthCheckResponse + */ +public class HealthCheckResponseTest { + private final HealthCheckResponse model = new HealthCheckResponse(); + + /** + * Model tests for HealthCheckResponse + */ + @Test + public void testHealthCheckResponse() { + // TODO: test HealthCheckResponse + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'memoryUsage' + */ + @Test + public void memoryUsageTest() { + // TODO: test memoryUsage + } + +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/MemoryUsageTest.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/MemoryUsageTest.java new file mode 100644 index 00000000000..3c020e7cfda --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/MemoryUsageTest.java @@ -0,0 +1,81 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for MemoryUsage + */ +public class MemoryUsageTest { + private final MemoryUsage model = new MemoryUsage(); + + /** + * Model tests for MemoryUsage + */ + @Test + public void testMemoryUsage() { + // TODO: test MemoryUsage + } + + /** + * Test the property 'rss' + */ + @Test + public void rssTest() { + // TODO: test rss + } + + /** + * Test the property 'heapTotal' + */ + @Test + public void heapTotalTest() { + // TODO: test heapTotal + } + + /** + * Test the property 'heapUsed' + */ + @Test + public void heapUsedTest() { + // TODO: test heapUsed + } + + /** + * Test the property 'external' + */ + @Test + public void externalTest() { + // TODO: test external + } + + /** + * Test the property 'arrayBuffers' + */ + @Test + public void arrayBuffersTest() { + // TODO: test arrayBuffers + } + +} diff --git a/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchHealthcheckV1Test.java b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchHealthcheckV1Test.java new file mode 100644 index 00000000000..1cc95516f32 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchHealthcheckV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus API + * Interact with a Cactus deployment through HTTP. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchHealthcheckV1 + */ +public class WatchHealthcheckV1Test { + /** + * Model tests for WatchHealthcheckV1 + */ + @Test + public void testWatchHealthcheckV1() { + // TODO: test WatchHealthcheckV1 + } + +} diff --git a/packages/cactus-core-api/package.json b/packages/cactus-core-api/package.json index 88f585712eb..1abae7a6edb 100644 --- a/packages/cactus-core-api/package.json +++ b/packages/cactus-core-api/package.json @@ -49,6 +49,8 @@ "generate-sdk": "run-s 'generate-sdk:*'", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "proto:protoc-gen-ts": "run-s proto:protoc-gen-ts:make-dir proto:protoc-gen-ts:grpc_tools_node_protoc", "proto:protoc-gen-ts:make-dir": "make-dir ./src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/", "proto:protoc-gen-ts:grpc_tools_node_protoc": "yarn run grpc_tools_node_protoc --plugin=protoc-gen-ts=../../node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./src/main/typescript/generated/proto/protoc-gen-ts/weaver/common/protos/ --proto_path ./src/main/proto/weaver/common/protos/ ./src/main/proto/weaver/common/protos/common/*.proto ./src/main/proto/weaver/common/protos/corda/*.proto ./src/main/proto/weaver/common/protos/driver/*.proto ./src/main/proto/weaver/common/protos/networks/*.proto ./src/main/proto/weaver/common/protos/relay/*.proto", diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..c284722caae --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,41 @@ +.travis.yml +README.md +api/openapi.yaml +client.go +configuration.go +go.mod +go.sum +model_cactus_node.go +model_cactus_node_all_of.go +model_cactus_node_meta.go +model_consensus_algorithm_families_with_out_tx_finality.go +model_consensus_algorithm_families_with_tx_finality.go +model_consensus_algorithm_family.go +model_consortium.go +model_consortium_database.go +model_consortium_member.go +model_constants.go +model_delete_keychain_entry_request_v1.go +model_delete_keychain_entry_response_v1.go +model_get_keychain_entry_request_v1.go +model_get_keychain_entry_response_v1.go +model_get_object_request_v1.go +model_get_object_response_v1.go +model_has_keychain_entry_request_v1.go +model_has_keychain_entry_response_v1.go +model_has_object_request_v1.go +model_has_object_response_v1.go +model_jws_general.go +model_jws_recipient.go +model_ledger.go +model_ledger_type.go +model_plugin_import.go +model_plugin_import_action.go +model_plugin_import_type.go +model_plugin_instance.go +model_set_keychain_entry_request_v1.go +model_set_keychain_entry_response_v1.go +model_set_object_request_v1.go +model_set_object_response_v1.go +response.go +utils.go diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..64389fb3092 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,141 @@ +# Go API client for cactus-core-api + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-core-api "github.com/hyperledger/cactus-core-api/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-core-api.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-core-api.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-core-api.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-core-api.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- + + +## Documentation For Models + + - [CactusNode](docs/CactusNode.md) + - [CactusNodeAllOf](docs/CactusNodeAllOf.md) + - [CactusNodeMeta](docs/CactusNodeMeta.md) + - [ConsensusAlgorithmFamiliesWithOutTxFinality](docs/ConsensusAlgorithmFamiliesWithOutTxFinality.md) + - [ConsensusAlgorithmFamiliesWithTxFinality](docs/ConsensusAlgorithmFamiliesWithTxFinality.md) + - [ConsensusAlgorithmFamily](docs/ConsensusAlgorithmFamily.md) + - [Consortium](docs/Consortium.md) + - [ConsortiumDatabase](docs/ConsortiumDatabase.md) + - [ConsortiumMember](docs/ConsortiumMember.md) + - [Constants](docs/Constants.md) + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [GetObjectRequestV1](docs/GetObjectRequestV1.md) + - [GetObjectResponseV1](docs/GetObjectResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [HasObjectRequestV1](docs/HasObjectRequestV1.md) + - [HasObjectResponseV1](docs/HasObjectResponseV1.md) + - [JWSGeneral](docs/JWSGeneral.md) + - [JWSRecipient](docs/JWSRecipient.md) + - [Ledger](docs/Ledger.md) + - [LedgerType](docs/LedgerType.md) + - [PluginImport](docs/PluginImport.md) + - [PluginImportAction](docs/PluginImportAction.md) + - [PluginImportType](docs/PluginImportType.md) + - [PluginInstance](docs/PluginInstance.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + - [SetObjectRequestV1](docs/SetObjectRequestV1.md) + - [SetObjectResponseV1](docs/SetObjectResponseV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..12b5808786d --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,712 @@ +openapi: 3.0.3 +info: + description: "Contains/describes the core API types for Cactus. Does not describe\ + \ actual endpoints on its own as this is left to the implementing plugins who\ + \ can import and re-use commonly needed type definitions from this specification.\ + \ One example of said commonly used type definitions would be the types related\ + \ to consortium management, cactus nodes, ledgers, etc.." + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Core API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: {} +components: + requestBodies: + object_store_get_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectRequestV1' + description: Request body to obtain an object via its key. + required: true + object_store_set_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectRequestV1' + description: Request body to set an object under a key. + required: true + object_store_has_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectRequestV1' + description: Request body to check presence of an object under a key. + required: true + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + responses: + object_store_get_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectResponseV1' + description: OK + object_store_set_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectResponseV1' + description: OK + object_store_has_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectResponseV1' + description: OK + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_delete_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_delete_entry_401: + description: Authorization information is missing or invalid. + keychain_delete_entry_500: + description: Unexpected error. + schemas: + Constants: + enum: + - /api/v1/async/socket-io/connect + type: string + x-enum-varnames: + - SocketIoConnectionPathV1 + PluginImport: + properties: + packageName: + maxLength: 1024 + minLength: 1 + nullable: false + type: string + type: + $ref: '#/components/schemas/PluginImportType' + action: + $ref: '#/components/schemas/PluginImportAction' + options: {} + required: + - action + - packageName + - type + type: object + PluginImportType: + enum: + - org.hyperledger.cactus.plugin_import_type.LOCAL + - org.hyperledger.cactus.plugin_import_type.REMOTE + type: string + PluginImportAction: + enum: + - org.hyperledger.cactus.plugin_import_action.INSTANTIATE + - org.hyperledger.cactus.plugin_import_action.INSTALL + type: string + ConsensusAlgorithmFamily: + description: "Enumerates a list of consensus algorithm families in existence.\ + \ Does not intend to be an exhaustive list, just a practical one, meaning\ + \ that we only include items here that are relevant to Hyperledger Cactus\ + \ in fulfilling its own duties. This can be extended later as more sophisticated\ + \ features of Cactus get implemented. This enum is meant to be first and foremost\ + \ a useful abstraction for achieving practical tasks, not an encyclopedia\ + \ and therefore we ask of everyone that this to be extended only in ways that\ + \ serve a practical purpose for the runtime behavior of Cactus or Cactus plugins\ + \ in general. The bottom line is that we can accept this enum being not 100%\ + \ accurate as long as it 100% satisfies what it was designed to do." + enum: + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK + type: string + ConsensusAlgorithmFamiliesWithTxFinality: + description: Enumerates a list of consensus algorithm families that provide + immediate finality + enum: + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE + type: string + ConsensusAlgorithmFamiliesWithOutTxFinality: + description: Enumerates a list of consensus algorithm families that do not provide + immediate finality + enum: + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK + type: string + x-enum-varnames: + - WORK + PrimaryKey: + maxLength: 128 + minLength: 1 + nullable: false + type: string + ConsortiumMemberId: + $ref: '#/components/schemas/PrimaryKey' + CactusNodeId: + $ref: '#/components/schemas/PrimaryKey' + ConsortiumId: + $ref: '#/components/schemas/PrimaryKey' + LedgerId: + $ref: '#/components/schemas/PrimaryKey' + PluginInstanceId: + $ref: '#/components/schemas/PrimaryKey' + ConsortiumDatabase: + properties: + consortium: + default: [] + description: "A collection of Consortium entities. In practice this should\ + \ only ever contain a single consortium, but we defined it as an array\ + \ to keep the convention up with the rest of the collections defined in\ + \ the Consortium data in general. Also, if we ever decide to somehow have\ + \ some sort of consortium to consortium integration (which does not make\ + \ much sense in the current frame of mind of the author in the year 2020)\ + \ then having this as an array will have proven itself to be an excellent\ + \ long term compatibility/extensibility decision indeed." + items: + $ref: '#/components/schemas/Consortium' + maxItems: 2048 + minItems: 0 + type: array + ledger: + default: [] + description: The complete collection of all ledger entities in existence + within the consortium. + items: + $ref: '#/components/schemas/Ledger' + maxItems: 2048 + minItems: 0 + type: array + consortiumMember: + default: [] + description: The complete collection of all consortium member entities in + existence within the consortium. + items: + $ref: '#/components/schemas/ConsortiumMember' + maxItems: 2048 + minItems: 0 + type: array + cactusNode: + default: [] + description: The complete collection of all cactus nodes entities in existence + within the consortium. + items: + $ref: '#/components/schemas/CactusNode' + maxItems: 2048 + minItems: 0 + type: array + pluginInstance: + default: [] + description: The complete collection of all plugin instance entities in + existence within the consortium. + items: + $ref: '#/components/schemas/PluginInstance' + maxItems: 2048 + minItems: 0 + type: array + required: + - cactusNode + - consortium + - consortiumMember + - ledger + - pluginInstance + Ledger: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + ledgerType: + $ref: '#/components/schemas/LedgerType' + consortiumMemberId: + maxLength: 128 + minLength: 1 + nullable: false + type: string + required: + - id + - ledgerType + type: object + LedgerType: + description: "Enumerates the different ledger vendors and their major versions\ + \ encoded within the name of the LedgerType. For example \"BESU_1X\" involves\ + \ all of the [1.0.0;2.0.0) where 1.0.0 is included and anything up until,\ + \ but not 2.0.0. See: https://stackoverflow.com/a/4396303/698470 for further\ + \ explanation." + enum: + - BESU_1X + - BESU_2X + - BURROW_0X + - CORDA_4X + - FABRIC_14X + - FABRIC_2 + - QUORUM_2X + - SAWTOOTH_1X + type: string + Consortium: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + name: + type: string + mainApiHost: + type: string + memberIds: + default: [] + description: The collection (array) of primary keys of consortium member + entities that belong to this Consortium. + items: + $ref: '#/components/schemas/ConsortiumMemberId' + maxItems: 2048 + minItems: 1 + nullable: false + type: array + required: + - id + - mainApiHost + - memberIds + - name + type: object + ConsortiumMember: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + name: + description: The human readable name a Consortium member can be referred + to while making it easy for humans to distinguish this particular consortium + member entity from any other ones. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + nodeIds: + default: [] + items: + $ref: '#/components/schemas/CactusNodeId' + maxItems: 2048 + minItems: 1 + nullable: false + type: array + required: + - id + - name + - nodeIds + type: object + CactusNodeMeta: + description: A Cactus node meta information + properties: + nodeApiHost: + maxLength: 1024 + minLength: 1 + nullable: false + type: string + publicKeyPem: + description: The PEM encoded public key that was used to generate the JWS + included in the response (the jws property) + format: "Must only contain the public key, never include here the PEM that\ + \ also contains a private key. See PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail" + maxLength: 65535 + minLength: 1 + nullable: false + type: string + required: + - nodeApiHost + - publicKeyPem + type: object + CactusNode: + allOf: + - $ref: '#/components/schemas/CactusNodeMeta' + - $ref: '#/components/schemas/CactusNode_allOf' + description: "A Cactus node can be a single server, or a set of servers behind\ + \ a load balancer acting as one." + type: object + PluginInstance: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + packageName: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + required: + - id + - packageName + type: object + JWSCompact: + description: "A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515\ + \ for info about standard." + example: eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjJ9.DOCNCqEMN7CQ_z-RMndiyldljXOk6WFIZxRzNF5Ylg4 + maxLength: 65535 + minLength: 5 + pattern: "/^[a-zA-Z0-9-_]+?.[a-zA-Z0-9-_]+?.([a-zA-Z0-9-_]+)?$/" + type: string + JWSRecipient: + description: "A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515\ + \ for info about standard." + properties: + signature: + type: string + protected: + type: string + header: + additionalProperties: true + type: object + required: + - signature + type: object + JWSGeneral: + properties: + payload: + maxLength: 65535 + minLength: 1 + type: string + signatures: + items: + $ref: '#/components/schemas/JWSRecipient' + type: array + required: + - payload + - signatures + type: object + GetObjectRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to get from the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetObjectResponseV1: + properties: + key: + description: The key that was used to retrieve the value from the object + store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key in the object store + as a string. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + HasObjectRequestV1: + additionalProperties: false + properties: + key: + description: The key to check for presence in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasObjectResponseV1: + properties: + key: + description: The key that was used to check the presence of the value in + the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an object under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + SetObjectRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to set in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key in the object + store. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetObjectResponseV1: + properties: + key: + description: The key that was used to set the value in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + CactusNode_allOf: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + consortiumId: + maxLength: 128 + minLength: 1 + nullable: false + type: string + memberId: + maxLength: 128 + minLength: 1 + nullable: false + type: string + ledgerIds: + default: [] + description: Stores an array of Ledger entity IDs that are reachable (routable) + via this Cactus Node. This information is used by the client side SDK + API client to figure out at runtime where to send API requests that are + specific to a certain ledger such as requests to execute transactions. + items: + $ref: '#/components/schemas/LedgerId' + maxItems: 2048 + minItems: 0 + nullable: false + type: array + pluginInstanceIds: + default: [] + items: + $ref: '#/components/schemas/PluginInstanceId' + maxItems: 2048 + minItems: 0 + nullable: false + type: array + required: + - consortiumId + - id + - ledgerIds + - memberId + - nodeApiHost + - pluginInstanceIds + - publicKeyPem + type: object + example: null diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..ec644e291c7 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,653 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Core API API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..398c2655a54 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..8571b08d86d --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-core-api/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node.go new file mode 100644 index 00000000000..40756fb619d --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node.go @@ -0,0 +1,281 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the CactusNode type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CactusNode{} + +// CactusNode A Cactus node can be a single server, or a set of servers behind a load balancer acting as one. +type CactusNode struct { + NodeApiHost string `json:"nodeApiHost"` + // The PEM encoded public key that was used to generate the JWS included in the response (the jws property) + PublicKeyPem string `json:"publicKeyPem"` + Id string `json:"id"` + ConsortiumId string `json:"consortiumId"` + MemberId string `json:"memberId"` + // Stores an array of Ledger entity IDs that are reachable (routable) via this Cactus Node. This information is used by the client side SDK API client to figure out at runtime where to send API requests that are specific to a certain ledger such as requests to execute transactions. + LedgerIds []string `json:"ledgerIds"` + PluginInstanceIds []string `json:"pluginInstanceIds"` +} + +// NewCactusNode instantiates a new CactusNode 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 +// will change when the set of required properties is changed +func NewCactusNode(nodeApiHost string, publicKeyPem string, id string, consortiumId string, memberId string, ledgerIds []string, pluginInstanceIds []string) *CactusNode { + this := CactusNode{} + this.NodeApiHost = nodeApiHost + this.PublicKeyPem = publicKeyPem + this.Id = id + this.ConsortiumId = consortiumId + this.MemberId = memberId + this.LedgerIds = ledgerIds + this.PluginInstanceIds = pluginInstanceIds + return &this +} + +// NewCactusNodeWithDefaults instantiates a new CactusNode object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCactusNodeWithDefaults() *CactusNode { + this := CactusNode{} + return &this +} + +// GetNodeApiHost returns the NodeApiHost field value +func (o *CactusNode) GetNodeApiHost() string { + if o == nil { + var ret string + return ret + } + + return o.NodeApiHost +} + +// GetNodeApiHostOk returns a tuple with the NodeApiHost field value +// and a boolean to check if the value has been set. +func (o *CactusNode) GetNodeApiHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NodeApiHost, true +} + +// SetNodeApiHost sets field value +func (o *CactusNode) SetNodeApiHost(v string) { + o.NodeApiHost = v +} + +// GetPublicKeyPem returns the PublicKeyPem field value +func (o *CactusNode) GetPublicKeyPem() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKeyPem +} + +// GetPublicKeyPemOk returns a tuple with the PublicKeyPem field value +// and a boolean to check if the value has been set. +func (o *CactusNode) GetPublicKeyPemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKeyPem, true +} + +// SetPublicKeyPem sets field value +func (o *CactusNode) SetPublicKeyPem(v string) { + o.PublicKeyPem = v +} + +// GetId returns the Id field value +func (o *CactusNode) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CactusNode) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CactusNode) SetId(v string) { + o.Id = v +} + +// GetConsortiumId returns the ConsortiumId field value +func (o *CactusNode) GetConsortiumId() string { + if o == nil { + var ret string + return ret + } + + return o.ConsortiumId +} + +// GetConsortiumIdOk returns a tuple with the ConsortiumId field value +// and a boolean to check if the value has been set. +func (o *CactusNode) GetConsortiumIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConsortiumId, true +} + +// SetConsortiumId sets field value +func (o *CactusNode) SetConsortiumId(v string) { + o.ConsortiumId = v +} + +// GetMemberId returns the MemberId field value +func (o *CactusNode) GetMemberId() string { + if o == nil { + var ret string + return ret + } + + return o.MemberId +} + +// GetMemberIdOk returns a tuple with the MemberId field value +// and a boolean to check if the value has been set. +func (o *CactusNode) GetMemberIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MemberId, true +} + +// SetMemberId sets field value +func (o *CactusNode) SetMemberId(v string) { + o.MemberId = v +} + +// GetLedgerIds returns the LedgerIds field value +func (o *CactusNode) GetLedgerIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.LedgerIds +} + +// GetLedgerIdsOk returns a tuple with the LedgerIds field value +// and a boolean to check if the value has been set. +func (o *CactusNode) GetLedgerIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.LedgerIds, true +} + +// SetLedgerIds sets field value +func (o *CactusNode) SetLedgerIds(v []string) { + o.LedgerIds = v +} + +// GetPluginInstanceIds returns the PluginInstanceIds field value +func (o *CactusNode) GetPluginInstanceIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.PluginInstanceIds +} + +// GetPluginInstanceIdsOk returns a tuple with the PluginInstanceIds field value +// and a boolean to check if the value has been set. +func (o *CactusNode) GetPluginInstanceIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.PluginInstanceIds, true +} + +// SetPluginInstanceIds sets field value +func (o *CactusNode) SetPluginInstanceIds(v []string) { + o.PluginInstanceIds = v +} + +func (o CactusNode) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CactusNode) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["nodeApiHost"] = o.NodeApiHost + toSerialize["publicKeyPem"] = o.PublicKeyPem + toSerialize["id"] = o.Id + toSerialize["consortiumId"] = o.ConsortiumId + toSerialize["memberId"] = o.MemberId + toSerialize["ledgerIds"] = o.LedgerIds + toSerialize["pluginInstanceIds"] = o.PluginInstanceIds + return toSerialize, nil +} + +type NullableCactusNode struct { + value *CactusNode + isSet bool +} + +func (v NullableCactusNode) Get() *CactusNode { + return v.value +} + +func (v *NullableCactusNode) Set(val *CactusNode) { + v.value = val + v.isSet = true +} + +func (v NullableCactusNode) IsSet() bool { + return v.isSet +} + +func (v *NullableCactusNode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCactusNode(val *CactusNode) *NullableCactusNode { + return &NullableCactusNode{value: val, isSet: true} +} + +func (v NullableCactusNode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCactusNode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node_all_of.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node_all_of.go new file mode 100644 index 00000000000..a102d58ae68 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node_all_of.go @@ -0,0 +1,226 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the CactusNodeAllOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CactusNodeAllOf{} + +// CactusNodeAllOf struct for CactusNodeAllOf +type CactusNodeAllOf struct { + Id string `json:"id"` + ConsortiumId string `json:"consortiumId"` + MemberId string `json:"memberId"` + // Stores an array of Ledger entity IDs that are reachable (routable) via this Cactus Node. This information is used by the client side SDK API client to figure out at runtime where to send API requests that are specific to a certain ledger such as requests to execute transactions. + LedgerIds []string `json:"ledgerIds"` + PluginInstanceIds []string `json:"pluginInstanceIds"` +} + +// NewCactusNodeAllOf instantiates a new CactusNodeAllOf 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 +// will change when the set of required properties is changed +func NewCactusNodeAllOf(id string, consortiumId string, memberId string, ledgerIds []string, pluginInstanceIds []string) *CactusNodeAllOf { + this := CactusNodeAllOf{} + this.Id = id + this.ConsortiumId = consortiumId + this.MemberId = memberId + this.LedgerIds = ledgerIds + this.PluginInstanceIds = pluginInstanceIds + return &this +} + +// NewCactusNodeAllOfWithDefaults instantiates a new CactusNodeAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCactusNodeAllOfWithDefaults() *CactusNodeAllOf { + this := CactusNodeAllOf{} + return &this +} + +// GetId returns the Id field value +func (o *CactusNodeAllOf) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CactusNodeAllOf) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *CactusNodeAllOf) SetId(v string) { + o.Id = v +} + +// GetConsortiumId returns the ConsortiumId field value +func (o *CactusNodeAllOf) GetConsortiumId() string { + if o == nil { + var ret string + return ret + } + + return o.ConsortiumId +} + +// GetConsortiumIdOk returns a tuple with the ConsortiumId field value +// and a boolean to check if the value has been set. +func (o *CactusNodeAllOf) GetConsortiumIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConsortiumId, true +} + +// SetConsortiumId sets field value +func (o *CactusNodeAllOf) SetConsortiumId(v string) { + o.ConsortiumId = v +} + +// GetMemberId returns the MemberId field value +func (o *CactusNodeAllOf) GetMemberId() string { + if o == nil { + var ret string + return ret + } + + return o.MemberId +} + +// GetMemberIdOk returns a tuple with the MemberId field value +// and a boolean to check if the value has been set. +func (o *CactusNodeAllOf) GetMemberIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MemberId, true +} + +// SetMemberId sets field value +func (o *CactusNodeAllOf) SetMemberId(v string) { + o.MemberId = v +} + +// GetLedgerIds returns the LedgerIds field value +func (o *CactusNodeAllOf) GetLedgerIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.LedgerIds +} + +// GetLedgerIdsOk returns a tuple with the LedgerIds field value +// and a boolean to check if the value has been set. +func (o *CactusNodeAllOf) GetLedgerIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.LedgerIds, true +} + +// SetLedgerIds sets field value +func (o *CactusNodeAllOf) SetLedgerIds(v []string) { + o.LedgerIds = v +} + +// GetPluginInstanceIds returns the PluginInstanceIds field value +func (o *CactusNodeAllOf) GetPluginInstanceIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.PluginInstanceIds +} + +// GetPluginInstanceIdsOk returns a tuple with the PluginInstanceIds field value +// and a boolean to check if the value has been set. +func (o *CactusNodeAllOf) GetPluginInstanceIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.PluginInstanceIds, true +} + +// SetPluginInstanceIds sets field value +func (o *CactusNodeAllOf) SetPluginInstanceIds(v []string) { + o.PluginInstanceIds = v +} + +func (o CactusNodeAllOf) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CactusNodeAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["consortiumId"] = o.ConsortiumId + toSerialize["memberId"] = o.MemberId + toSerialize["ledgerIds"] = o.LedgerIds + toSerialize["pluginInstanceIds"] = o.PluginInstanceIds + return toSerialize, nil +} + +type NullableCactusNodeAllOf struct { + value *CactusNodeAllOf + isSet bool +} + +func (v NullableCactusNodeAllOf) Get() *CactusNodeAllOf { + return v.value +} + +func (v *NullableCactusNodeAllOf) Set(val *CactusNodeAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableCactusNodeAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableCactusNodeAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCactusNodeAllOf(val *CactusNodeAllOf) *NullableCactusNodeAllOf { + return &NullableCactusNodeAllOf{value: val, isSet: true} +} + +func (v NullableCactusNodeAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCactusNodeAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node_meta.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node_meta.go new file mode 100644 index 00000000000..dc0285e20a8 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_cactus_node_meta.go @@ -0,0 +1,145 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the CactusNodeMeta type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CactusNodeMeta{} + +// CactusNodeMeta A Cactus node meta information +type CactusNodeMeta struct { + NodeApiHost string `json:"nodeApiHost"` + // The PEM encoded public key that was used to generate the JWS included in the response (the jws property) + PublicKeyPem string `json:"publicKeyPem"` +} + +// NewCactusNodeMeta instantiates a new CactusNodeMeta 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 +// will change when the set of required properties is changed +func NewCactusNodeMeta(nodeApiHost string, publicKeyPem string) *CactusNodeMeta { + this := CactusNodeMeta{} + this.NodeApiHost = nodeApiHost + this.PublicKeyPem = publicKeyPem + return &this +} + +// NewCactusNodeMetaWithDefaults instantiates a new CactusNodeMeta object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCactusNodeMetaWithDefaults() *CactusNodeMeta { + this := CactusNodeMeta{} + return &this +} + +// GetNodeApiHost returns the NodeApiHost field value +func (o *CactusNodeMeta) GetNodeApiHost() string { + if o == nil { + var ret string + return ret + } + + return o.NodeApiHost +} + +// GetNodeApiHostOk returns a tuple with the NodeApiHost field value +// and a boolean to check if the value has been set. +func (o *CactusNodeMeta) GetNodeApiHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NodeApiHost, true +} + +// SetNodeApiHost sets field value +func (o *CactusNodeMeta) SetNodeApiHost(v string) { + o.NodeApiHost = v +} + +// GetPublicKeyPem returns the PublicKeyPem field value +func (o *CactusNodeMeta) GetPublicKeyPem() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKeyPem +} + +// GetPublicKeyPemOk returns a tuple with the PublicKeyPem field value +// and a boolean to check if the value has been set. +func (o *CactusNodeMeta) GetPublicKeyPemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKeyPem, true +} + +// SetPublicKeyPem sets field value +func (o *CactusNodeMeta) SetPublicKeyPem(v string) { + o.PublicKeyPem = v +} + +func (o CactusNodeMeta) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CactusNodeMeta) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["nodeApiHost"] = o.NodeApiHost + toSerialize["publicKeyPem"] = o.PublicKeyPem + return toSerialize, nil +} + +type NullableCactusNodeMeta struct { + value *CactusNodeMeta + isSet bool +} + +func (v NullableCactusNodeMeta) Get() *CactusNodeMeta { + return v.value +} + +func (v *NullableCactusNodeMeta) Set(val *CactusNodeMeta) { + v.value = val + v.isSet = true +} + +func (v NullableCactusNodeMeta) IsSet() bool { + return v.isSet +} + +func (v *NullableCactusNodeMeta) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCactusNodeMeta(val *CactusNodeMeta) *NullableCactusNodeMeta { + return &NullableCactusNodeMeta{value: val, isSet: true} +} + +func (v NullableCactusNodeMeta) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCactusNodeMeta) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_families_with_out_tx_finality.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_families_with_out_tx_finality.go new file mode 100644 index 00000000000..e7be3f89472 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_families_with_out_tx_finality.go @@ -0,0 +1,109 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" + "fmt" +) + +// ConsensusAlgorithmFamiliesWithOutTxFinality Enumerates a list of consensus algorithm families that do not provide immediate finality +type ConsensusAlgorithmFamiliesWithOutTxFinality string + +// List of ConsensusAlgorithmFamiliesWithOutTxFinality +const ( + WORK ConsensusAlgorithmFamiliesWithOutTxFinality = "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK" +) + +// All allowed values of ConsensusAlgorithmFamiliesWithOutTxFinality enum +var AllowedConsensusAlgorithmFamiliesWithOutTxFinalityEnumValues = []ConsensusAlgorithmFamiliesWithOutTxFinality{ + "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK", +} + +func (v *ConsensusAlgorithmFamiliesWithOutTxFinality) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ConsensusAlgorithmFamiliesWithOutTxFinality(value) + for _, existing := range AllowedConsensusAlgorithmFamiliesWithOutTxFinalityEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ConsensusAlgorithmFamiliesWithOutTxFinality", value) +} + +// NewConsensusAlgorithmFamiliesWithOutTxFinalityFromValue returns a pointer to a valid ConsensusAlgorithmFamiliesWithOutTxFinality +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConsensusAlgorithmFamiliesWithOutTxFinalityFromValue(v string) (*ConsensusAlgorithmFamiliesWithOutTxFinality, error) { + ev := ConsensusAlgorithmFamiliesWithOutTxFinality(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ConsensusAlgorithmFamiliesWithOutTxFinality: valid values are %v", v, AllowedConsensusAlgorithmFamiliesWithOutTxFinalityEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ConsensusAlgorithmFamiliesWithOutTxFinality) IsValid() bool { + for _, existing := range AllowedConsensusAlgorithmFamiliesWithOutTxFinalityEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ConsensusAlgorithmFamiliesWithOutTxFinality value +func (v ConsensusAlgorithmFamiliesWithOutTxFinality) Ptr() *ConsensusAlgorithmFamiliesWithOutTxFinality { + return &v +} + +type NullableConsensusAlgorithmFamiliesWithOutTxFinality struct { + value *ConsensusAlgorithmFamiliesWithOutTxFinality + isSet bool +} + +func (v NullableConsensusAlgorithmFamiliesWithOutTxFinality) Get() *ConsensusAlgorithmFamiliesWithOutTxFinality { + return v.value +} + +func (v *NullableConsensusAlgorithmFamiliesWithOutTxFinality) Set(val *ConsensusAlgorithmFamiliesWithOutTxFinality) { + v.value = val + v.isSet = true +} + +func (v NullableConsensusAlgorithmFamiliesWithOutTxFinality) IsSet() bool { + return v.isSet +} + +func (v *NullableConsensusAlgorithmFamiliesWithOutTxFinality) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsensusAlgorithmFamiliesWithOutTxFinality(val *ConsensusAlgorithmFamiliesWithOutTxFinality) *NullableConsensusAlgorithmFamiliesWithOutTxFinality { + return &NullableConsensusAlgorithmFamiliesWithOutTxFinality{value: val, isSet: true} +} + +func (v NullableConsensusAlgorithmFamiliesWithOutTxFinality) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsensusAlgorithmFamiliesWithOutTxFinality) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_families_with_tx_finality.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_families_with_tx_finality.go new file mode 100644 index 00000000000..8cafd667f91 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_families_with_tx_finality.go @@ -0,0 +1,111 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" + "fmt" +) + +// ConsensusAlgorithmFamiliesWithTxFinality Enumerates a list of consensus algorithm families that provide immediate finality +type ConsensusAlgorithmFamiliesWithTxFinality string + +// List of ConsensusAlgorithmFamiliesWithTxFinality +const ( + AUTHORITY ConsensusAlgorithmFamiliesWithTxFinality = "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY" + STAKE ConsensusAlgorithmFamiliesWithTxFinality = "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE" +) + +// All allowed values of ConsensusAlgorithmFamiliesWithTxFinality enum +var AllowedConsensusAlgorithmFamiliesWithTxFinalityEnumValues = []ConsensusAlgorithmFamiliesWithTxFinality{ + "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY", + "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE", +} + +func (v *ConsensusAlgorithmFamiliesWithTxFinality) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ConsensusAlgorithmFamiliesWithTxFinality(value) + for _, existing := range AllowedConsensusAlgorithmFamiliesWithTxFinalityEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ConsensusAlgorithmFamiliesWithTxFinality", value) +} + +// NewConsensusAlgorithmFamiliesWithTxFinalityFromValue returns a pointer to a valid ConsensusAlgorithmFamiliesWithTxFinality +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConsensusAlgorithmFamiliesWithTxFinalityFromValue(v string) (*ConsensusAlgorithmFamiliesWithTxFinality, error) { + ev := ConsensusAlgorithmFamiliesWithTxFinality(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ConsensusAlgorithmFamiliesWithTxFinality: valid values are %v", v, AllowedConsensusAlgorithmFamiliesWithTxFinalityEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ConsensusAlgorithmFamiliesWithTxFinality) IsValid() bool { + for _, existing := range AllowedConsensusAlgorithmFamiliesWithTxFinalityEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ConsensusAlgorithmFamiliesWithTxFinality value +func (v ConsensusAlgorithmFamiliesWithTxFinality) Ptr() *ConsensusAlgorithmFamiliesWithTxFinality { + return &v +} + +type NullableConsensusAlgorithmFamiliesWithTxFinality struct { + value *ConsensusAlgorithmFamiliesWithTxFinality + isSet bool +} + +func (v NullableConsensusAlgorithmFamiliesWithTxFinality) Get() *ConsensusAlgorithmFamiliesWithTxFinality { + return v.value +} + +func (v *NullableConsensusAlgorithmFamiliesWithTxFinality) Set(val *ConsensusAlgorithmFamiliesWithTxFinality) { + v.value = val + v.isSet = true +} + +func (v NullableConsensusAlgorithmFamiliesWithTxFinality) IsSet() bool { + return v.isSet +} + +func (v *NullableConsensusAlgorithmFamiliesWithTxFinality) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsensusAlgorithmFamiliesWithTxFinality(val *ConsensusAlgorithmFamiliesWithTxFinality) *NullableConsensusAlgorithmFamiliesWithTxFinality { + return &NullableConsensusAlgorithmFamiliesWithTxFinality{value: val, isSet: true} +} + +func (v NullableConsensusAlgorithmFamiliesWithTxFinality) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsensusAlgorithmFamiliesWithTxFinality) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_family.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_family.go new file mode 100644 index 00000000000..f57749641dc --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consensus_algorithm_family.go @@ -0,0 +1,113 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" + "fmt" +) + +// ConsensusAlgorithmFamily Enumerates a list of consensus algorithm families in existence. Does not intend to be an exhaustive list, just a practical one, meaning that we only include items here that are relevant to Hyperledger Cactus in fulfilling its own duties. This can be extended later as more sophisticated features of Cactus get implemented. This enum is meant to be first and foremost a useful abstraction for achieving practical tasks, not an encyclopedia and therefore we ask of everyone that this to be extended only in ways that serve a practical purpose for the runtime behavior of Cactus or Cactus plugins in general. The bottom line is that we can accept this enum being not 100% accurate as long as it 100% satisfies what it was designed to do. +type ConsensusAlgorithmFamily string + +// List of ConsensusAlgorithmFamily +const ( + AUTHORITY ConsensusAlgorithmFamily = "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY" + STAKE ConsensusAlgorithmFamily = "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE" + WORK ConsensusAlgorithmFamily = "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK" +) + +// All allowed values of ConsensusAlgorithmFamily enum +var AllowedConsensusAlgorithmFamilyEnumValues = []ConsensusAlgorithmFamily{ + "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY", + "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE", + "org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK", +} + +func (v *ConsensusAlgorithmFamily) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ConsensusAlgorithmFamily(value) + for _, existing := range AllowedConsensusAlgorithmFamilyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ConsensusAlgorithmFamily", value) +} + +// NewConsensusAlgorithmFamilyFromValue returns a pointer to a valid ConsensusAlgorithmFamily +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConsensusAlgorithmFamilyFromValue(v string) (*ConsensusAlgorithmFamily, error) { + ev := ConsensusAlgorithmFamily(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ConsensusAlgorithmFamily: valid values are %v", v, AllowedConsensusAlgorithmFamilyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ConsensusAlgorithmFamily) IsValid() bool { + for _, existing := range AllowedConsensusAlgorithmFamilyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ConsensusAlgorithmFamily value +func (v ConsensusAlgorithmFamily) Ptr() *ConsensusAlgorithmFamily { + return &v +} + +type NullableConsensusAlgorithmFamily struct { + value *ConsensusAlgorithmFamily + isSet bool +} + +func (v NullableConsensusAlgorithmFamily) Get() *ConsensusAlgorithmFamily { + return v.value +} + +func (v *NullableConsensusAlgorithmFamily) Set(val *ConsensusAlgorithmFamily) { + v.value = val + v.isSet = true +} + +func (v NullableConsensusAlgorithmFamily) IsSet() bool { + return v.isSet +} + +func (v *NullableConsensusAlgorithmFamily) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsensusAlgorithmFamily(val *ConsensusAlgorithmFamily) *NullableConsensusAlgorithmFamily { + return &NullableConsensusAlgorithmFamily{value: val, isSet: true} +} + +func (v NullableConsensusAlgorithmFamily) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsensusAlgorithmFamily) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium.go new file mode 100644 index 00000000000..a5bbdf41401 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium.go @@ -0,0 +1,199 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the Consortium type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Consortium{} + +// Consortium struct for Consortium +type Consortium struct { + Id string `json:"id"` + Name string `json:"name"` + MainApiHost string `json:"mainApiHost"` + // The collection (array) of primary keys of consortium member entities that belong to this Consortium. + MemberIds []string `json:"memberIds"` +} + +// NewConsortium instantiates a new Consortium 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 +// will change when the set of required properties is changed +func NewConsortium(id string, name string, mainApiHost string, memberIds []string) *Consortium { + this := Consortium{} + this.Id = id + this.Name = name + this.MainApiHost = mainApiHost + this.MemberIds = memberIds + return &this +} + +// NewConsortiumWithDefaults instantiates a new Consortium object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsortiumWithDefaults() *Consortium { + this := Consortium{} + return &this +} + +// GetId returns the Id field value +func (o *Consortium) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Consortium) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Consortium) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *Consortium) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Consortium) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Consortium) SetName(v string) { + o.Name = v +} + +// GetMainApiHost returns the MainApiHost field value +func (o *Consortium) GetMainApiHost() string { + if o == nil { + var ret string + return ret + } + + return o.MainApiHost +} + +// GetMainApiHostOk returns a tuple with the MainApiHost field value +// and a boolean to check if the value has been set. +func (o *Consortium) GetMainApiHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MainApiHost, true +} + +// SetMainApiHost sets field value +func (o *Consortium) SetMainApiHost(v string) { + o.MainApiHost = v +} + +// GetMemberIds returns the MemberIds field value +func (o *Consortium) GetMemberIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.MemberIds +} + +// GetMemberIdsOk returns a tuple with the MemberIds field value +// and a boolean to check if the value has been set. +func (o *Consortium) GetMemberIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.MemberIds, true +} + +// SetMemberIds sets field value +func (o *Consortium) SetMemberIds(v []string) { + o.MemberIds = v +} + +func (o Consortium) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Consortium) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["mainApiHost"] = o.MainApiHost + toSerialize["memberIds"] = o.MemberIds + return toSerialize, nil +} + +type NullableConsortium struct { + value *Consortium + isSet bool +} + +func (v NullableConsortium) Get() *Consortium { + return v.value +} + +func (v *NullableConsortium) Set(val *Consortium) { + v.value = val + v.isSet = true +} + +func (v NullableConsortium) IsSet() bool { + return v.isSet +} + +func (v *NullableConsortium) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsortium(val *Consortium) *NullableConsortium { + return &NullableConsortium{value: val, isSet: true} +} + +func (v NullableConsortium) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsortium) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium_database.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium_database.go new file mode 100644 index 00000000000..6e25b01ebf5 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium_database.go @@ -0,0 +1,230 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the ConsortiumDatabase type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsortiumDatabase{} + +// ConsortiumDatabase struct for ConsortiumDatabase +type ConsortiumDatabase struct { + // A collection of Consortium entities. In practice this should only ever contain a single consortium, but we defined it as an array to keep the convention up with the rest of the collections defined in the Consortium data in general. Also, if we ever decide to somehow have some sort of consortium to consortium integration (which does not make much sense in the current frame of mind of the author in the year 2020) then having this as an array will have proven itself to be an excellent long term compatibility/extensibility decision indeed. + Consortium []Consortium `json:"consortium"` + // The complete collection of all ledger entities in existence within the consortium. + Ledger []Ledger `json:"ledger"` + // The complete collection of all consortium member entities in existence within the consortium. + ConsortiumMember []ConsortiumMember `json:"consortiumMember"` + // The complete collection of all cactus nodes entities in existence within the consortium. + CactusNode []CactusNode `json:"cactusNode"` + // The complete collection of all plugin instance entities in existence within the consortium. + PluginInstance []PluginInstance `json:"pluginInstance"` +} + +// NewConsortiumDatabase instantiates a new ConsortiumDatabase 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 +// will change when the set of required properties is changed +func NewConsortiumDatabase(consortium []Consortium, ledger []Ledger, consortiumMember []ConsortiumMember, cactusNode []CactusNode, pluginInstance []PluginInstance) *ConsortiumDatabase { + this := ConsortiumDatabase{} + this.Consortium = consortium + this.Ledger = ledger + this.ConsortiumMember = consortiumMember + this.CactusNode = cactusNode + this.PluginInstance = pluginInstance + return &this +} + +// NewConsortiumDatabaseWithDefaults instantiates a new ConsortiumDatabase object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsortiumDatabaseWithDefaults() *ConsortiumDatabase { + this := ConsortiumDatabase{} + return &this +} + +// GetConsortium returns the Consortium field value +func (o *ConsortiumDatabase) GetConsortium() []Consortium { + if o == nil { + var ret []Consortium + return ret + } + + return o.Consortium +} + +// GetConsortiumOk returns a tuple with the Consortium field value +// and a boolean to check if the value has been set. +func (o *ConsortiumDatabase) GetConsortiumOk() ([]Consortium, bool) { + if o == nil { + return nil, false + } + return o.Consortium, true +} + +// SetConsortium sets field value +func (o *ConsortiumDatabase) SetConsortium(v []Consortium) { + o.Consortium = v +} + +// GetLedger returns the Ledger field value +func (o *ConsortiumDatabase) GetLedger() []Ledger { + if o == nil { + var ret []Ledger + return ret + } + + return o.Ledger +} + +// GetLedgerOk returns a tuple with the Ledger field value +// and a boolean to check if the value has been set. +func (o *ConsortiumDatabase) GetLedgerOk() ([]Ledger, bool) { + if o == nil { + return nil, false + } + return o.Ledger, true +} + +// SetLedger sets field value +func (o *ConsortiumDatabase) SetLedger(v []Ledger) { + o.Ledger = v +} + +// GetConsortiumMember returns the ConsortiumMember field value +func (o *ConsortiumDatabase) GetConsortiumMember() []ConsortiumMember { + if o == nil { + var ret []ConsortiumMember + return ret + } + + return o.ConsortiumMember +} + +// GetConsortiumMemberOk returns a tuple with the ConsortiumMember field value +// and a boolean to check if the value has been set. +func (o *ConsortiumDatabase) GetConsortiumMemberOk() ([]ConsortiumMember, bool) { + if o == nil { + return nil, false + } + return o.ConsortiumMember, true +} + +// SetConsortiumMember sets field value +func (o *ConsortiumDatabase) SetConsortiumMember(v []ConsortiumMember) { + o.ConsortiumMember = v +} + +// GetCactusNode returns the CactusNode field value +func (o *ConsortiumDatabase) GetCactusNode() []CactusNode { + if o == nil { + var ret []CactusNode + return ret + } + + return o.CactusNode +} + +// GetCactusNodeOk returns a tuple with the CactusNode field value +// and a boolean to check if the value has been set. +func (o *ConsortiumDatabase) GetCactusNodeOk() ([]CactusNode, bool) { + if o == nil { + return nil, false + } + return o.CactusNode, true +} + +// SetCactusNode sets field value +func (o *ConsortiumDatabase) SetCactusNode(v []CactusNode) { + o.CactusNode = v +} + +// GetPluginInstance returns the PluginInstance field value +func (o *ConsortiumDatabase) GetPluginInstance() []PluginInstance { + if o == nil { + var ret []PluginInstance + return ret + } + + return o.PluginInstance +} + +// GetPluginInstanceOk returns a tuple with the PluginInstance field value +// and a boolean to check if the value has been set. +func (o *ConsortiumDatabase) GetPluginInstanceOk() ([]PluginInstance, bool) { + if o == nil { + return nil, false + } + return o.PluginInstance, true +} + +// SetPluginInstance sets field value +func (o *ConsortiumDatabase) SetPluginInstance(v []PluginInstance) { + o.PluginInstance = v +} + +func (o ConsortiumDatabase) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsortiumDatabase) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["consortium"] = o.Consortium + toSerialize["ledger"] = o.Ledger + toSerialize["consortiumMember"] = o.ConsortiumMember + toSerialize["cactusNode"] = o.CactusNode + toSerialize["pluginInstance"] = o.PluginInstance + return toSerialize, nil +} + +type NullableConsortiumDatabase struct { + value *ConsortiumDatabase + isSet bool +} + +func (v NullableConsortiumDatabase) Get() *ConsortiumDatabase { + return v.value +} + +func (v *NullableConsortiumDatabase) Set(val *ConsortiumDatabase) { + v.value = val + v.isSet = true +} + +func (v NullableConsortiumDatabase) IsSet() bool { + return v.isSet +} + +func (v *NullableConsortiumDatabase) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsortiumDatabase(val *ConsortiumDatabase) *NullableConsortiumDatabase { + return &NullableConsortiumDatabase{value: val, isSet: true} +} + +func (v NullableConsortiumDatabase) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsortiumDatabase) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium_member.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium_member.go new file mode 100644 index 00000000000..8b457b910df --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_consortium_member.go @@ -0,0 +1,172 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the ConsortiumMember type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsortiumMember{} + +// ConsortiumMember struct for ConsortiumMember +type ConsortiumMember struct { + Id string `json:"id"` + // The human readable name a Consortium member can be referred to while making it easy for humans to distinguish this particular consortium member entity from any other ones. + Name string `json:"name"` + NodeIds []string `json:"nodeIds"` +} + +// NewConsortiumMember instantiates a new ConsortiumMember 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 +// will change when the set of required properties is changed +func NewConsortiumMember(id string, name string, nodeIds []string) *ConsortiumMember { + this := ConsortiumMember{} + this.Id = id + this.Name = name + this.NodeIds = nodeIds + return &this +} + +// NewConsortiumMemberWithDefaults instantiates a new ConsortiumMember object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsortiumMemberWithDefaults() *ConsortiumMember { + this := ConsortiumMember{} + return &this +} + +// GetId returns the Id field value +func (o *ConsortiumMember) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ConsortiumMember) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ConsortiumMember) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *ConsortiumMember) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConsortiumMember) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConsortiumMember) SetName(v string) { + o.Name = v +} + +// GetNodeIds returns the NodeIds field value +func (o *ConsortiumMember) GetNodeIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.NodeIds +} + +// GetNodeIdsOk returns a tuple with the NodeIds field value +// and a boolean to check if the value has been set. +func (o *ConsortiumMember) GetNodeIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.NodeIds, true +} + +// SetNodeIds sets field value +func (o *ConsortiumMember) SetNodeIds(v []string) { + o.NodeIds = v +} + +func (o ConsortiumMember) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsortiumMember) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["nodeIds"] = o.NodeIds + return toSerialize, nil +} + +type NullableConsortiumMember struct { + value *ConsortiumMember + isSet bool +} + +func (v NullableConsortiumMember) Get() *ConsortiumMember { + return v.value +} + +func (v *NullableConsortiumMember) Set(val *ConsortiumMember) { + v.value = val + v.isSet = true +} + +func (v NullableConsortiumMember) IsSet() bool { + return v.isSet +} + +func (v *NullableConsortiumMember) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsortiumMember(val *ConsortiumMember) *NullableConsortiumMember { + return &NullableConsortiumMember{value: val, isSet: true} +} + +func (v NullableConsortiumMember) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsortiumMember) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_constants.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_constants.go new file mode 100644 index 00000000000..977da8fea4c --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_constants.go @@ -0,0 +1,109 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" + "fmt" +) + +// Constants the model 'Constants' +type Constants string + +// List of Constants +const ( + SocketIoConnectionPathV1 Constants = "/api/v1/async/socket-io/connect" +) + +// All allowed values of Constants enum +var AllowedConstantsEnumValues = []Constants{ + "/api/v1/async/socket-io/connect", +} + +func (v *Constants) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Constants(value) + for _, existing := range AllowedConstantsEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Constants", value) +} + +// NewConstantsFromValue returns a pointer to a valid Constants +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConstantsFromValue(v string) (*Constants, error) { + ev := Constants(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Constants: valid values are %v", v, AllowedConstantsEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Constants) IsValid() bool { + for _, existing := range AllowedConstantsEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Constants value +func (v Constants) Ptr() *Constants { + return &v +} + +type NullableConstants struct { + value *Constants + isSet bool +} + +func (v NullableConstants) Get() *Constants { + return v.value +} + +func (v *NullableConstants) Set(val *Constants) { + v.value = val + v.isSet = true +} + +func (v NullableConstants) IsSet() bool { + return v.isSet +} + +func (v *NullableConstants) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConstants(val *Constants) *NullableConstants { + return &NullableConstants{value: val, isSet: true} +} + +func (v NullableConstants) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConstants) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go new file mode 100644 index 00000000000..a8faaaa7ee3 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryRequestV1{} + +// DeleteKeychainEntryRequestV1 struct for DeleteKeychainEntryRequestV1 +type DeleteKeychainEntryRequestV1 struct { + // The key for the entry to check the presence of on the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryRequestV1 instantiates a new DeleteKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewDeleteKeychainEntryRequestV1(key string) *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryRequestV1WithDefaults instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryRequestV1WithDefaults() *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryRequestV1 struct { + value *DeleteKeychainEntryRequestV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryRequestV1) Get() *DeleteKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryRequestV1) Set(val *DeleteKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryRequestV1(val *DeleteKeychainEntryRequestV1) *NullableDeleteKeychainEntryRequestV1 { + return &NullableDeleteKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go new file mode 100644 index 00000000000..67314473544 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryResponseV1{} + +// DeleteKeychainEntryResponseV1 struct for DeleteKeychainEntryResponseV1 +type DeleteKeychainEntryResponseV1 struct { + // The key that was deleted from the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryResponseV1 instantiates a new DeleteKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewDeleteKeychainEntryResponseV1(key string) *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryResponseV1WithDefaults instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryResponseV1WithDefaults() *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryResponseV1 struct { + value *DeleteKeychainEntryResponseV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryResponseV1) Get() *DeleteKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryResponseV1) Set(val *DeleteKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryResponseV1(val *DeleteKeychainEntryResponseV1) *NullableDeleteKeychainEntryResponseV1 { + return &NullableDeleteKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go new file mode 100644 index 00000000000..31573563b75 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryRequestV1{} + +// GetKeychainEntryRequestV1 struct for GetKeychainEntryRequestV1 +type GetKeychainEntryRequestV1 struct { + // The key for the entry to get from the keychain. + Key string `json:"key"` +} + +// NewGetKeychainEntryRequestV1 instantiates a new GetKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewGetKeychainEntryRequestV1(key string) *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewGetKeychainEntryRequestV1WithDefaults instantiates a new GetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryRequestV1WithDefaults() *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetKeychainEntryRequestV1 struct { + value *GetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableGetKeychainEntryRequestV1) Get() *GetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableGetKeychainEntryRequestV1) Set(val *GetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryRequestV1(val *GetKeychainEntryRequestV1) *NullableGetKeychainEntryRequestV1 { + return &NullableGetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go new file mode 100644 index 00000000000..bebaa7db019 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryResponseV1{} + +// GetKeychainEntryResponseV1 struct for GetKeychainEntryResponseV1 +type GetKeychainEntryResponseV1 struct { + // The key that was used to retrieve the value from the keychain. + Key string `json:"key"` + // The value associated with the requested key on the keychain. + Value string `json:"value"` +} + +// NewGetKeychainEntryResponseV1 instantiates a new GetKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewGetKeychainEntryResponseV1(key string, value string) *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetKeychainEntryResponseV1WithDefaults instantiates a new GetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryResponseV1WithDefaults() *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetKeychainEntryResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetKeychainEntryResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetKeychainEntryResponseV1 struct { + value *GetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableGetKeychainEntryResponseV1) Get() *GetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableGetKeychainEntryResponseV1) Set(val *GetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryResponseV1(val *GetKeychainEntryResponseV1) *NullableGetKeychainEntryResponseV1 { + return &NullableGetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_object_request_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_object_request_v1.go new file mode 100644 index 00000000000..119d21b600b --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_object_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the GetObjectRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetObjectRequestV1{} + +// GetObjectRequestV1 struct for GetObjectRequestV1 +type GetObjectRequestV1 struct { + // The key for the entry to get from the object store. + Key string `json:"key"` +} + +// NewGetObjectRequestV1 instantiates a new GetObjectRequestV1 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 +// will change when the set of required properties is changed +func NewGetObjectRequestV1(key string) *GetObjectRequestV1 { + this := GetObjectRequestV1{} + this.Key = key + return &this +} + +// NewGetObjectRequestV1WithDefaults instantiates a new GetObjectRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetObjectRequestV1WithDefaults() *GetObjectRequestV1 { + this := GetObjectRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetObjectRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetObjectRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetObjectRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetObjectRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetObjectRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetObjectRequestV1 struct { + value *GetObjectRequestV1 + isSet bool +} + +func (v NullableGetObjectRequestV1) Get() *GetObjectRequestV1 { + return v.value +} + +func (v *NullableGetObjectRequestV1) Set(val *GetObjectRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetObjectRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetObjectRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetObjectRequestV1(val *GetObjectRequestV1) *NullableGetObjectRequestV1 { + return &NullableGetObjectRequestV1{value: val, isSet: true} +} + +func (v NullableGetObjectRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetObjectRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_object_response_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_object_response_v1.go new file mode 100644 index 00000000000..284460c6223 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_get_object_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the GetObjectResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetObjectResponseV1{} + +// GetObjectResponseV1 struct for GetObjectResponseV1 +type GetObjectResponseV1 struct { + // The key that was used to retrieve the value from the object store. + Key string `json:"key"` + // The value associated with the requested key in the object store as a string. + Value string `json:"value"` +} + +// NewGetObjectResponseV1 instantiates a new GetObjectResponseV1 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 +// will change when the set of required properties is changed +func NewGetObjectResponseV1(key string, value string) *GetObjectResponseV1 { + this := GetObjectResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetObjectResponseV1WithDefaults instantiates a new GetObjectResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetObjectResponseV1WithDefaults() *GetObjectResponseV1 { + this := GetObjectResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetObjectResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetObjectResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetObjectResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetObjectResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetObjectResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetObjectResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetObjectResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetObjectResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetObjectResponseV1 struct { + value *GetObjectResponseV1 + isSet bool +} + +func (v NullableGetObjectResponseV1) Get() *GetObjectResponseV1 { + return v.value +} + +func (v *NullableGetObjectResponseV1) Set(val *GetObjectResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetObjectResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetObjectResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetObjectResponseV1(val *GetObjectResponseV1) *NullableGetObjectResponseV1 { + return &NullableGetObjectResponseV1{value: val, isSet: true} +} + +func (v NullableGetObjectResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetObjectResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go new file mode 100644 index 00000000000..30ac931db8c --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryRequestV1{} + +// HasKeychainEntryRequestV1 struct for HasKeychainEntryRequestV1 +type HasKeychainEntryRequestV1 struct { + // The key to check for presence in the keychain. + Key string `json:"key"` +} + +// NewHasKeychainEntryRequestV1 instantiates a new HasKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewHasKeychainEntryRequestV1(key string) *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewHasKeychainEntryRequestV1WithDefaults instantiates a new HasKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryRequestV1WithDefaults() *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasKeychainEntryRequestV1 struct { + value *HasKeychainEntryRequestV1 + isSet bool +} + +func (v NullableHasKeychainEntryRequestV1) Get() *HasKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableHasKeychainEntryRequestV1) Set(val *HasKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryRequestV1(val *HasKeychainEntryRequestV1) *NullableHasKeychainEntryRequestV1 { + return &NullableHasKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go new file mode 100644 index 00000000000..7e4394e2568 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryResponseV1{} + +// HasKeychainEntryResponseV1 struct for HasKeychainEntryResponseV1 +type HasKeychainEntryResponseV1 struct { + // The key that was used to check the presence of the value in the entry store. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an entry under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasKeychainEntryResponseV1 instantiates a new HasKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewHasKeychainEntryResponseV1(key string, checkedAt string, isPresent bool) *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasKeychainEntryResponseV1WithDefaults instantiates a new HasKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryResponseV1WithDefaults() *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasKeychainEntryResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasKeychainEntryResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasKeychainEntryResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasKeychainEntryResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasKeychainEntryResponseV1 struct { + value *HasKeychainEntryResponseV1 + isSet bool +} + +func (v NullableHasKeychainEntryResponseV1) Get() *HasKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableHasKeychainEntryResponseV1) Set(val *HasKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryResponseV1(val *HasKeychainEntryResponseV1) *NullableHasKeychainEntryResponseV1 { + return &NullableHasKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_object_request_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_object_request_v1.go new file mode 100644 index 00000000000..01915fca99c --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_object_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the HasObjectRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasObjectRequestV1{} + +// HasObjectRequestV1 struct for HasObjectRequestV1 +type HasObjectRequestV1 struct { + // The key to check for presence in the object store. + Key string `json:"key"` +} + +// NewHasObjectRequestV1 instantiates a new HasObjectRequestV1 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 +// will change when the set of required properties is changed +func NewHasObjectRequestV1(key string) *HasObjectRequestV1 { + this := HasObjectRequestV1{} + this.Key = key + return &this +} + +// NewHasObjectRequestV1WithDefaults instantiates a new HasObjectRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasObjectRequestV1WithDefaults() *HasObjectRequestV1 { + this := HasObjectRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasObjectRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasObjectRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasObjectRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasObjectRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasObjectRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasObjectRequestV1 struct { + value *HasObjectRequestV1 + isSet bool +} + +func (v NullableHasObjectRequestV1) Get() *HasObjectRequestV1 { + return v.value +} + +func (v *NullableHasObjectRequestV1) Set(val *HasObjectRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasObjectRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasObjectRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasObjectRequestV1(val *HasObjectRequestV1) *NullableHasObjectRequestV1 { + return &NullableHasObjectRequestV1{value: val, isSet: true} +} + +func (v NullableHasObjectRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasObjectRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_object_response_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_object_response_v1.go new file mode 100644 index 00000000000..d7794cf7fd4 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_has_object_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the HasObjectResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasObjectResponseV1{} + +// HasObjectResponseV1 struct for HasObjectResponseV1 +type HasObjectResponseV1 struct { + // The key that was used to check the presence of the value in the object store. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an object under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasObjectResponseV1 instantiates a new HasObjectResponseV1 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 +// will change when the set of required properties is changed +func NewHasObjectResponseV1(key string, checkedAt string, isPresent bool) *HasObjectResponseV1 { + this := HasObjectResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasObjectResponseV1WithDefaults instantiates a new HasObjectResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasObjectResponseV1WithDefaults() *HasObjectResponseV1 { + this := HasObjectResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasObjectResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasObjectResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasObjectResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasObjectResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasObjectResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasObjectResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasObjectResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasObjectResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasObjectResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasObjectResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasObjectResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasObjectResponseV1 struct { + value *HasObjectResponseV1 + isSet bool +} + +func (v NullableHasObjectResponseV1) Get() *HasObjectResponseV1 { + return v.value +} + +func (v *NullableHasObjectResponseV1) Set(val *HasObjectResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasObjectResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasObjectResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasObjectResponseV1(val *HasObjectResponseV1) *NullableHasObjectResponseV1 { + return &NullableHasObjectResponseV1{value: val, isSet: true} +} + +func (v NullableHasObjectResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasObjectResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_jws_general.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_jws_general.go new file mode 100644 index 00000000000..fcd0b37c391 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_jws_general.go @@ -0,0 +1,144 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the JWSGeneral type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JWSGeneral{} + +// JWSGeneral struct for JWSGeneral +type JWSGeneral struct { + Payload string `json:"payload"` + Signatures []JWSRecipient `json:"signatures"` +} + +// NewJWSGeneral instantiates a new JWSGeneral 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 +// will change when the set of required properties is changed +func NewJWSGeneral(payload string, signatures []JWSRecipient) *JWSGeneral { + this := JWSGeneral{} + this.Payload = payload + this.Signatures = signatures + return &this +} + +// NewJWSGeneralWithDefaults instantiates a new JWSGeneral object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJWSGeneralWithDefaults() *JWSGeneral { + this := JWSGeneral{} + return &this +} + +// GetPayload returns the Payload field value +func (o *JWSGeneral) GetPayload() string { + if o == nil { + var ret string + return ret + } + + return o.Payload +} + +// GetPayloadOk returns a tuple with the Payload field value +// and a boolean to check if the value has been set. +func (o *JWSGeneral) GetPayloadOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Payload, true +} + +// SetPayload sets field value +func (o *JWSGeneral) SetPayload(v string) { + o.Payload = v +} + +// GetSignatures returns the Signatures field value +func (o *JWSGeneral) GetSignatures() []JWSRecipient { + if o == nil { + var ret []JWSRecipient + return ret + } + + return o.Signatures +} + +// GetSignaturesOk returns a tuple with the Signatures field value +// and a boolean to check if the value has been set. +func (o *JWSGeneral) GetSignaturesOk() ([]JWSRecipient, bool) { + if o == nil { + return nil, false + } + return o.Signatures, true +} + +// SetSignatures sets field value +func (o *JWSGeneral) SetSignatures(v []JWSRecipient) { + o.Signatures = v +} + +func (o JWSGeneral) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JWSGeneral) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["payload"] = o.Payload + toSerialize["signatures"] = o.Signatures + return toSerialize, nil +} + +type NullableJWSGeneral struct { + value *JWSGeneral + isSet bool +} + +func (v NullableJWSGeneral) Get() *JWSGeneral { + return v.value +} + +func (v *NullableJWSGeneral) Set(val *JWSGeneral) { + v.value = val + v.isSet = true +} + +func (v NullableJWSGeneral) IsSet() bool { + return v.isSet +} + +func (v *NullableJWSGeneral) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJWSGeneral(val *JWSGeneral) *NullableJWSGeneral { + return &NullableJWSGeneral{value: val, isSet: true} +} + +func (v NullableJWSGeneral) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJWSGeneral) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_jws_recipient.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_jws_recipient.go new file mode 100644 index 00000000000..a4e375586e6 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_jws_recipient.go @@ -0,0 +1,189 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the JWSRecipient type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JWSRecipient{} + +// JWSRecipient A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515 for info about standard. +type JWSRecipient struct { + Signature string `json:"signature"` + Protected *string `json:"protected,omitempty"` + Header map[string]interface{} `json:"header,omitempty"` +} + +// NewJWSRecipient instantiates a new JWSRecipient 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 +// will change when the set of required properties is changed +func NewJWSRecipient(signature string) *JWSRecipient { + this := JWSRecipient{} + this.Signature = signature + return &this +} + +// NewJWSRecipientWithDefaults instantiates a new JWSRecipient object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJWSRecipientWithDefaults() *JWSRecipient { + this := JWSRecipient{} + return &this +} + +// GetSignature returns the Signature field value +func (o *JWSRecipient) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *JWSRecipient) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *JWSRecipient) SetSignature(v string) { + o.Signature = v +} + +// GetProtected returns the Protected field value if set, zero value otherwise. +func (o *JWSRecipient) GetProtected() string { + if o == nil || IsNil(o.Protected) { + var ret string + return ret + } + return *o.Protected +} + +// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JWSRecipient) GetProtectedOk() (*string, bool) { + if o == nil || IsNil(o.Protected) { + return nil, false + } + return o.Protected, true +} + +// HasProtected returns a boolean if a field has been set. +func (o *JWSRecipient) HasProtected() bool { + if o != nil && !IsNil(o.Protected) { + return true + } + + return false +} + +// SetProtected gets a reference to the given string and assigns it to the Protected field. +func (o *JWSRecipient) SetProtected(v string) { + o.Protected = &v +} + +// GetHeader returns the Header field value if set, zero value otherwise. +func (o *JWSRecipient) GetHeader() map[string]interface{} { + if o == nil || IsNil(o.Header) { + var ret map[string]interface{} + return ret + } + return o.Header +} + +// GetHeaderOk returns a tuple with the Header field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JWSRecipient) GetHeaderOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Header) { + return map[string]interface{}{}, false + } + return o.Header, true +} + +// HasHeader returns a boolean if a field has been set. +func (o *JWSRecipient) HasHeader() bool { + if o != nil && !IsNil(o.Header) { + return true + } + + return false +} + +// SetHeader gets a reference to the given map[string]interface{} and assigns it to the Header field. +func (o *JWSRecipient) SetHeader(v map[string]interface{}) { + o.Header = v +} + +func (o JWSRecipient) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JWSRecipient) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["signature"] = o.Signature + if !IsNil(o.Protected) { + toSerialize["protected"] = o.Protected + } + if !IsNil(o.Header) { + toSerialize["header"] = o.Header + } + return toSerialize, nil +} + +type NullableJWSRecipient struct { + value *JWSRecipient + isSet bool +} + +func (v NullableJWSRecipient) Get() *JWSRecipient { + return v.value +} + +func (v *NullableJWSRecipient) Set(val *JWSRecipient) { + v.value = val + v.isSet = true +} + +func (v NullableJWSRecipient) IsSet() bool { + return v.isSet +} + +func (v *NullableJWSRecipient) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJWSRecipient(val *JWSRecipient) *NullableJWSRecipient { + return &NullableJWSRecipient{value: val, isSet: true} +} + +func (v NullableJWSRecipient) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJWSRecipient) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_ledger.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_ledger.go new file mode 100644 index 00000000000..26791a2fdfe --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_ledger.go @@ -0,0 +1,180 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the Ledger type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Ledger{} + +// Ledger struct for Ledger +type Ledger struct { + Id string `json:"id"` + LedgerType LedgerType `json:"ledgerType"` + ConsortiumMemberId *string `json:"consortiumMemberId,omitempty"` +} + +// NewLedger instantiates a new Ledger 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 +// will change when the set of required properties is changed +func NewLedger(id string, ledgerType LedgerType) *Ledger { + this := Ledger{} + this.Id = id + this.LedgerType = ledgerType + return &this +} + +// NewLedgerWithDefaults instantiates a new Ledger object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLedgerWithDefaults() *Ledger { + this := Ledger{} + return &this +} + +// GetId returns the Id field value +func (o *Ledger) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Ledger) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Ledger) SetId(v string) { + o.Id = v +} + +// GetLedgerType returns the LedgerType field value +func (o *Ledger) GetLedgerType() LedgerType { + if o == nil { + var ret LedgerType + return ret + } + + return o.LedgerType +} + +// GetLedgerTypeOk returns a tuple with the LedgerType field value +// and a boolean to check if the value has been set. +func (o *Ledger) GetLedgerTypeOk() (*LedgerType, bool) { + if o == nil { + return nil, false + } + return &o.LedgerType, true +} + +// SetLedgerType sets field value +func (o *Ledger) SetLedgerType(v LedgerType) { + o.LedgerType = v +} + +// GetConsortiumMemberId returns the ConsortiumMemberId field value if set, zero value otherwise. +func (o *Ledger) GetConsortiumMemberId() string { + if o == nil || IsNil(o.ConsortiumMemberId) { + var ret string + return ret + } + return *o.ConsortiumMemberId +} + +// GetConsortiumMemberIdOk returns a tuple with the ConsortiumMemberId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Ledger) GetConsortiumMemberIdOk() (*string, bool) { + if o == nil || IsNil(o.ConsortiumMemberId) { + return nil, false + } + return o.ConsortiumMemberId, true +} + +// HasConsortiumMemberId returns a boolean if a field has been set. +func (o *Ledger) HasConsortiumMemberId() bool { + if o != nil && !IsNil(o.ConsortiumMemberId) { + return true + } + + return false +} + +// SetConsortiumMemberId gets a reference to the given string and assigns it to the ConsortiumMemberId field. +func (o *Ledger) SetConsortiumMemberId(v string) { + o.ConsortiumMemberId = &v +} + +func (o Ledger) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Ledger) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["ledgerType"] = o.LedgerType + if !IsNil(o.ConsortiumMemberId) { + toSerialize["consortiumMemberId"] = o.ConsortiumMemberId + } + return toSerialize, nil +} + +type NullableLedger struct { + value *Ledger + isSet bool +} + +func (v NullableLedger) Get() *Ledger { + return v.value +} + +func (v *NullableLedger) Set(val *Ledger) { + v.value = val + v.isSet = true +} + +func (v NullableLedger) IsSet() bool { + return v.isSet +} + +func (v *NullableLedger) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLedger(val *Ledger) *NullableLedger { + return &NullableLedger{value: val, isSet: true} +} + +func (v NullableLedger) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLedger) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_ledger_type.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_ledger_type.go new file mode 100644 index 00000000000..656e762843e --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_ledger_type.go @@ -0,0 +1,123 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" + "fmt" +) + +// LedgerType Enumerates the different ledger vendors and their major versions encoded within the name of the LedgerType. For example \"BESU_1X\" involves all of the [1.0.0;2.0.0) where 1.0.0 is included and anything up until, but not 2.0.0. See: https://stackoverflow.com/a/4396303/698470 for further explanation. +type LedgerType string + +// List of LedgerType +const ( + BESU_1_X LedgerType = "BESU_1X" + BESU_2_X LedgerType = "BESU_2X" + BURROW_0_X LedgerType = "BURROW_0X" + CORDA_4_X LedgerType = "CORDA_4X" + FABRIC_14_X LedgerType = "FABRIC_14X" + FABRIC_2 LedgerType = "FABRIC_2" + QUORUM_2_X LedgerType = "QUORUM_2X" + SAWTOOTH_1_X LedgerType = "SAWTOOTH_1X" +) + +// All allowed values of LedgerType enum +var AllowedLedgerTypeEnumValues = []LedgerType{ + "BESU_1X", + "BESU_2X", + "BURROW_0X", + "CORDA_4X", + "FABRIC_14X", + "FABRIC_2", + "QUORUM_2X", + "SAWTOOTH_1X", +} + +func (v *LedgerType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LedgerType(value) + for _, existing := range AllowedLedgerTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid LedgerType", value) +} + +// NewLedgerTypeFromValue returns a pointer to a valid LedgerType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLedgerTypeFromValue(v string) (*LedgerType, error) { + ev := LedgerType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LedgerType: valid values are %v", v, AllowedLedgerTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LedgerType) IsValid() bool { + for _, existing := range AllowedLedgerTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LedgerType value +func (v LedgerType) Ptr() *LedgerType { + return &v +} + +type NullableLedgerType struct { + value *LedgerType + isSet bool +} + +func (v NullableLedgerType) Get() *LedgerType { + return v.value +} + +func (v *NullableLedgerType) Set(val *LedgerType) { + v.value = val + v.isSet = true +} + +func (v NullableLedgerType) IsSet() bool { + return v.isSet +} + +func (v *NullableLedgerType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLedgerType(val *LedgerType) *NullableLedgerType { + return &NullableLedgerType{value: val, isSet: true} +} + +func (v NullableLedgerType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLedgerType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import.go new file mode 100644 index 00000000000..ff7a60d7bac --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import.go @@ -0,0 +1,208 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the PluginImport type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PluginImport{} + +// PluginImport struct for PluginImport +type PluginImport struct { + PackageName string `json:"packageName"` + Type PluginImportType `json:"type"` + Action PluginImportAction `json:"action"` + Options interface{} `json:"options,omitempty"` +} + +// NewPluginImport instantiates a new PluginImport 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 +// will change when the set of required properties is changed +func NewPluginImport(packageName string, type_ PluginImportType, action PluginImportAction) *PluginImport { + this := PluginImport{} + this.PackageName = packageName + this.Type = type_ + this.Action = action + return &this +} + +// NewPluginImportWithDefaults instantiates a new PluginImport object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPluginImportWithDefaults() *PluginImport { + this := PluginImport{} + return &this +} + +// GetPackageName returns the PackageName field value +func (o *PluginImport) GetPackageName() string { + if o == nil { + var ret string + return ret + } + + return o.PackageName +} + +// GetPackageNameOk returns a tuple with the PackageName field value +// and a boolean to check if the value has been set. +func (o *PluginImport) GetPackageNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PackageName, true +} + +// SetPackageName sets field value +func (o *PluginImport) SetPackageName(v string) { + o.PackageName = v +} + +// GetType returns the Type field value +func (o *PluginImport) GetType() PluginImportType { + if o == nil { + var ret PluginImportType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *PluginImport) GetTypeOk() (*PluginImportType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PluginImport) SetType(v PluginImportType) { + o.Type = v +} + +// GetAction returns the Action field value +func (o *PluginImport) GetAction() PluginImportAction { + if o == nil { + var ret PluginImportAction + return ret + } + + return o.Action +} + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *PluginImport) GetActionOk() (*PluginImportAction, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value +func (o *PluginImport) SetAction(v PluginImportAction) { + o.Action = v +} + +// GetOptions returns the Options field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PluginImport) GetOptions() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PluginImport) GetOptionsOk() (*interface{}, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return &o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *PluginImport) HasOptions() bool { + if o != nil && IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given interface{} and assigns it to the Options field. +func (o *PluginImport) SetOptions(v interface{}) { + o.Options = v +} + +func (o PluginImport) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PluginImport) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["packageName"] = o.PackageName + toSerialize["type"] = o.Type + toSerialize["action"] = o.Action + if o.Options != nil { + toSerialize["options"] = o.Options + } + return toSerialize, nil +} + +type NullablePluginImport struct { + value *PluginImport + isSet bool +} + +func (v NullablePluginImport) Get() *PluginImport { + return v.value +} + +func (v *NullablePluginImport) Set(val *PluginImport) { + v.value = val + v.isSet = true +} + +func (v NullablePluginImport) IsSet() bool { + return v.isSet +} + +func (v *NullablePluginImport) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePluginImport(val *PluginImport) *NullablePluginImport { + return &NullablePluginImport{value: val, isSet: true} +} + +func (v NullablePluginImport) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePluginImport) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import_action.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import_action.go new file mode 100644 index 00000000000..0bda1df94ee --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import_action.go @@ -0,0 +1,111 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" + "fmt" +) + +// PluginImportAction the model 'PluginImportAction' +type PluginImportAction string + +// List of PluginImportAction +const ( + INSTANTIATE PluginImportAction = "org.hyperledger.cactus.plugin_import_action.INSTANTIATE" + INSTALL PluginImportAction = "org.hyperledger.cactus.plugin_import_action.INSTALL" +) + +// All allowed values of PluginImportAction enum +var AllowedPluginImportActionEnumValues = []PluginImportAction{ + "org.hyperledger.cactus.plugin_import_action.INSTANTIATE", + "org.hyperledger.cactus.plugin_import_action.INSTALL", +} + +func (v *PluginImportAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PluginImportAction(value) + for _, existing := range AllowedPluginImportActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PluginImportAction", value) +} + +// NewPluginImportActionFromValue returns a pointer to a valid PluginImportAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPluginImportActionFromValue(v string) (*PluginImportAction, error) { + ev := PluginImportAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PluginImportAction: valid values are %v", v, AllowedPluginImportActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PluginImportAction) IsValid() bool { + for _, existing := range AllowedPluginImportActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PluginImportAction value +func (v PluginImportAction) Ptr() *PluginImportAction { + return &v +} + +type NullablePluginImportAction struct { + value *PluginImportAction + isSet bool +} + +func (v NullablePluginImportAction) Get() *PluginImportAction { + return v.value +} + +func (v *NullablePluginImportAction) Set(val *PluginImportAction) { + v.value = val + v.isSet = true +} + +func (v NullablePluginImportAction) IsSet() bool { + return v.isSet +} + +func (v *NullablePluginImportAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePluginImportAction(val *PluginImportAction) *NullablePluginImportAction { + return &NullablePluginImportAction{value: val, isSet: true} +} + +func (v NullablePluginImportAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePluginImportAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import_type.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import_type.go new file mode 100644 index 00000000000..057ec5b0375 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_import_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" + "fmt" +) + +// PluginImportType the model 'PluginImportType' +type PluginImportType string + +// List of PluginImportType +const ( + LOCAL PluginImportType = "org.hyperledger.cactus.plugin_import_type.LOCAL" + REMOTE PluginImportType = "org.hyperledger.cactus.plugin_import_type.REMOTE" +) + +// All allowed values of PluginImportType enum +var AllowedPluginImportTypeEnumValues = []PluginImportType{ + "org.hyperledger.cactus.plugin_import_type.LOCAL", + "org.hyperledger.cactus.plugin_import_type.REMOTE", +} + +func (v *PluginImportType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PluginImportType(value) + for _, existing := range AllowedPluginImportTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PluginImportType", value) +} + +// NewPluginImportTypeFromValue returns a pointer to a valid PluginImportType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPluginImportTypeFromValue(v string) (*PluginImportType, error) { + ev := PluginImportType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PluginImportType: valid values are %v", v, AllowedPluginImportTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PluginImportType) IsValid() bool { + for _, existing := range AllowedPluginImportTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PluginImportType value +func (v PluginImportType) Ptr() *PluginImportType { + return &v +} + +type NullablePluginImportType struct { + value *PluginImportType + isSet bool +} + +func (v NullablePluginImportType) Get() *PluginImportType { + return v.value +} + +func (v *NullablePluginImportType) Set(val *PluginImportType) { + v.value = val + v.isSet = true +} + +func (v NullablePluginImportType) IsSet() bool { + return v.isSet +} + +func (v *NullablePluginImportType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePluginImportType(val *PluginImportType) *NullablePluginImportType { + return &NullablePluginImportType{value: val, isSet: true} +} + +func (v NullablePluginImportType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePluginImportType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_instance.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_instance.go new file mode 100644 index 00000000000..008b14aced8 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_plugin_instance.go @@ -0,0 +1,144 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the PluginInstance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PluginInstance{} + +// PluginInstance struct for PluginInstance +type PluginInstance struct { + Id string `json:"id"` + PackageName string `json:"packageName"` +} + +// NewPluginInstance instantiates a new PluginInstance 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 +// will change when the set of required properties is changed +func NewPluginInstance(id string, packageName string) *PluginInstance { + this := PluginInstance{} + this.Id = id + this.PackageName = packageName + return &this +} + +// NewPluginInstanceWithDefaults instantiates a new PluginInstance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPluginInstanceWithDefaults() *PluginInstance { + this := PluginInstance{} + return &this +} + +// GetId returns the Id field value +func (o *PluginInstance) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PluginInstance) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PluginInstance) SetId(v string) { + o.Id = v +} + +// GetPackageName returns the PackageName field value +func (o *PluginInstance) GetPackageName() string { + if o == nil { + var ret string + return ret + } + + return o.PackageName +} + +// GetPackageNameOk returns a tuple with the PackageName field value +// and a boolean to check if the value has been set. +func (o *PluginInstance) GetPackageNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PackageName, true +} + +// SetPackageName sets field value +func (o *PluginInstance) SetPackageName(v string) { + o.PackageName = v +} + +func (o PluginInstance) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PluginInstance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["packageName"] = o.PackageName + return toSerialize, nil +} + +type NullablePluginInstance struct { + value *PluginInstance + isSet bool +} + +func (v NullablePluginInstance) Get() *PluginInstance { + return v.value +} + +func (v *NullablePluginInstance) Set(val *PluginInstance) { + v.value = val + v.isSet = true +} + +func (v NullablePluginInstance) IsSet() bool { + return v.isSet +} + +func (v *NullablePluginInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePluginInstance(val *PluginInstance) *NullablePluginInstance { + return &NullablePluginInstance{value: val, isSet: true} +} + +func (v NullablePluginInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePluginInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go new file mode 100644 index 00000000000..2b235b8f2f0 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryRequestV1{} + +// SetKeychainEntryRequestV1 struct for SetKeychainEntryRequestV1 +type SetKeychainEntryRequestV1 struct { + // The key for the entry to set on the keychain. + Key string `json:"key"` + // The value that will be associated with the key on the keychain. + Value string `json:"value"` +} + +// NewSetKeychainEntryRequestV1 instantiates a new SetKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewSetKeychainEntryRequestV1(key string, value string) *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetKeychainEntryRequestV1WithDefaults instantiates a new SetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryRequestV1WithDefaults() *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetKeychainEntryRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetKeychainEntryRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetKeychainEntryRequestV1 struct { + value *SetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableSetKeychainEntryRequestV1) Get() *SetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableSetKeychainEntryRequestV1) Set(val *SetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryRequestV1(val *SetKeychainEntryRequestV1) *NullableSetKeychainEntryRequestV1 { + return &NullableSetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go new file mode 100644 index 00000000000..7406c924a90 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryResponseV1{} + +// SetKeychainEntryResponseV1 struct for SetKeychainEntryResponseV1 +type SetKeychainEntryResponseV1 struct { + // The key that was used to set the value on the keychain. + Key string `json:"key"` +} + +// NewSetKeychainEntryResponseV1 instantiates a new SetKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewSetKeychainEntryResponseV1(key string) *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewSetKeychainEntryResponseV1WithDefaults instantiates a new SetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryResponseV1WithDefaults() *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetKeychainEntryResponseV1 struct { + value *SetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableSetKeychainEntryResponseV1) Get() *SetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableSetKeychainEntryResponseV1) Set(val *SetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryResponseV1(val *SetKeychainEntryResponseV1) *NullableSetKeychainEntryResponseV1 { + return &NullableSetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_object_request_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_object_request_v1.go new file mode 100644 index 00000000000..7374fd26e28 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_object_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the SetObjectRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetObjectRequestV1{} + +// SetObjectRequestV1 struct for SetObjectRequestV1 +type SetObjectRequestV1 struct { + // The key for the entry to set in the object store. + Key string `json:"key"` + // The value that will be associated with the key in the object store. + Value string `json:"value"` +} + +// NewSetObjectRequestV1 instantiates a new SetObjectRequestV1 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 +// will change when the set of required properties is changed +func NewSetObjectRequestV1(key string, value string) *SetObjectRequestV1 { + this := SetObjectRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetObjectRequestV1WithDefaults instantiates a new SetObjectRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetObjectRequestV1WithDefaults() *SetObjectRequestV1 { + this := SetObjectRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetObjectRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetObjectRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetObjectRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetObjectRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetObjectRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetObjectRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetObjectRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetObjectRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetObjectRequestV1 struct { + value *SetObjectRequestV1 + isSet bool +} + +func (v NullableSetObjectRequestV1) Get() *SetObjectRequestV1 { + return v.value +} + +func (v *NullableSetObjectRequestV1) Set(val *SetObjectRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetObjectRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetObjectRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetObjectRequestV1(val *SetObjectRequestV1) *NullableSetObjectRequestV1 { + return &NullableSetObjectRequestV1{value: val, isSet: true} +} + +func (v NullableSetObjectRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetObjectRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_object_response_v1.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_object_response_v1.go new file mode 100644 index 00000000000..2a528b4eddc --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_set_object_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" +) + +// checks if the SetObjectResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetObjectResponseV1{} + +// SetObjectResponseV1 struct for SetObjectResponseV1 +type SetObjectResponseV1 struct { + // The key that was used to set the value in the object store. + Key string `json:"key"` +} + +// NewSetObjectResponseV1 instantiates a new SetObjectResponseV1 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 +// will change when the set of required properties is changed +func NewSetObjectResponseV1(key string) *SetObjectResponseV1 { + this := SetObjectResponseV1{} + this.Key = key + return &this +} + +// NewSetObjectResponseV1WithDefaults instantiates a new SetObjectResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetObjectResponseV1WithDefaults() *SetObjectResponseV1 { + this := SetObjectResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetObjectResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetObjectResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetObjectResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetObjectResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetObjectResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetObjectResponseV1 struct { + value *SetObjectResponseV1 + isSet bool +} + +func (v NullableSetObjectResponseV1) Get() *SetObjectResponseV1 { + return v.value +} + +func (v *NullableSetObjectResponseV1) Set(val *SetObjectResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetObjectResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetObjectResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetObjectResponseV1(val *SetObjectResponseV1) *NullableSetObjectResponseV1 { + return &NullableSetObjectResponseV1{value: val, isSet: true} +} + +func (v NullableSetObjectResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetObjectResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..af7605aa623 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-core-api/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..c0343cc47d8 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Core API + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-core-api + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..5956bdc2184 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.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 Hyperledger Core API + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..a6de14c212a --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,94 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/CactusNode.java +src/main/java/org/openapitools/client/model/CactusNodeAllOf.java +src/main/java/org/openapitools/client/model/CactusNodeMeta.java +src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinality.java +src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinality.java +src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamily.java +src/main/java/org/openapitools/client/model/Consortium.java +src/main/java/org/openapitools/client/model/ConsortiumDatabase.java +src/main/java/org/openapitools/client/model/ConsortiumMember.java +src/main/java/org/openapitools/client/model/Constants.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/GetObjectRequestV1.java +src/main/java/org/openapitools/client/model/GetObjectResponseV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/HasObjectRequestV1.java +src/main/java/org/openapitools/client/model/HasObjectResponseV1.java +src/main/java/org/openapitools/client/model/JWSGeneral.java +src/main/java/org/openapitools/client/model/JWSRecipient.java +src/main/java/org/openapitools/client/model/Ledger.java +src/main/java/org/openapitools/client/model/LedgerType.java +src/main/java/org/openapitools/client/model/PluginImport.java +src/main/java/org/openapitools/client/model/PluginImportAction.java +src/main/java/org/openapitools/client/model/PluginImportType.java +src/main/java/org/openapitools/client/model/PluginInstance.java +src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/SetObjectRequestV1.java +src/main/java/org/openapitools/client/model/SetObjectResponseV1.java +src/test/java/org/openapitools/client/model/CactusNodeAllOfTest.java +src/test/java/org/openapitools/client/model/CactusNodeMetaTest.java +src/test/java/org/openapitools/client/model/CactusNodeTest.java +src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinalityTest.java +src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinalityTest.java +src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamilyTest.java +src/test/java/org/openapitools/client/model/ConsortiumDatabaseTest.java +src/test/java/org/openapitools/client/model/ConsortiumMemberTest.java +src/test/java/org/openapitools/client/model/ConsortiumTest.java +src/test/java/org/openapitools/client/model/ConstantsTest.java +src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/GetObjectRequestV1Test.java +src/test/java/org/openapitools/client/model/GetObjectResponseV1Test.java +src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/HasObjectRequestV1Test.java +src/test/java/org/openapitools/client/model/HasObjectResponseV1Test.java +src/test/java/org/openapitools/client/model/JWSGeneralTest.java +src/test/java/org/openapitools/client/model/JWSRecipientTest.java +src/test/java/org/openapitools/client/model/LedgerTest.java +src/test/java/org/openapitools/client/model/LedgerTypeTest.java +src/test/java/org/openapitools/client/model/PluginImportActionTest.java +src/test/java/org/openapitools/client/model/PluginImportTest.java +src/test/java/org/openapitools/client/model/PluginImportTypeTest.java +src/test/java/org/openapitools/client/model/PluginInstanceTest.java +src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/SetObjectRequestV1Test.java +src/test/java/org/openapitools/client/model/SetObjectResponseV1Test.java diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..6dca7bbfcd1 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,139 @@ +# openapi-java-client + +Hyperledger Core API +- API version: v2.0.0-alpha.2 + +Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- + + +## Documentation for Models + + - [CactusNode](docs/CactusNode.md) + - [CactusNodeAllOf](docs/CactusNodeAllOf.md) + - [CactusNodeMeta](docs/CactusNodeMeta.md) + - [ConsensusAlgorithmFamiliesWithOutTxFinality](docs/ConsensusAlgorithmFamiliesWithOutTxFinality.md) + - [ConsensusAlgorithmFamiliesWithTxFinality](docs/ConsensusAlgorithmFamiliesWithTxFinality.md) + - [ConsensusAlgorithmFamily](docs/ConsensusAlgorithmFamily.md) + - [Consortium](docs/Consortium.md) + - [ConsortiumDatabase](docs/ConsortiumDatabase.md) + - [ConsortiumMember](docs/ConsortiumMember.md) + - [Constants](docs/Constants.md) + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [GetObjectRequestV1](docs/GetObjectRequestV1.md) + - [GetObjectResponseV1](docs/GetObjectResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [HasObjectRequestV1](docs/HasObjectRequestV1.md) + - [HasObjectResponseV1](docs/HasObjectResponseV1.md) + - [JWSGeneral](docs/JWSGeneral.md) + - [JWSRecipient](docs/JWSRecipient.md) + - [Ledger](docs/Ledger.md) + - [LedgerType](docs/LedgerType.md) + - [PluginImport](docs/PluginImport.md) + - [PluginImportAction](docs/PluginImportAction.md) + - [PluginImportType](docs/PluginImportType.md) + - [PluginInstance](docs/PluginInstance.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + - [SetObjectRequestV1](docs/SetObjectRequestV1.md) + - [SetObjectResponseV1](docs/SetObjectResponseV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..58e66190249 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,713 @@ +openapi: 3.0.3 +info: + description: "Contains/describes the core API types for Cactus. Does not describe\ + \ actual endpoints on its own as this is left to the implementing plugins who\ + \ can import and re-use commonly needed type definitions from this specification.\ + \ One example of said commonly used type definitions would be the types related\ + \ to consortium management, cactus nodes, ledgers, etc.." + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Core API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: {} +components: + requestBodies: + object_store_get_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectRequestV1' + description: Request body to obtain an object via its key. + required: true + object_store_set_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectRequestV1' + description: Request body to set an object under a key. + required: true + object_store_has_object_v1_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectRequestV1' + description: Request body to check presence of an object under a key. + required: true + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + responses: + object_store_get_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectResponseV1' + description: OK + object_store_set_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetObjectResponseV1' + description: OK + object_store_has_object_v1_response_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasObjectResponseV1' + description: OK + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_delete_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_delete_entry_401: + description: Authorization information is missing or invalid. + keychain_delete_entry_500: + description: Unexpected error. + schemas: + Constants: + enum: + - /api/v1/async/socket-io/connect + type: string + x-enum-varnames: + - SocketIoConnectionPathV1 + PluginImport: + properties: + packageName: + maxLength: 1024 + minLength: 1 + nullable: false + type: string + type: + $ref: '#/components/schemas/PluginImportType' + action: + $ref: '#/components/schemas/PluginImportAction' + options: {} + required: + - action + - packageName + - type + type: object + PluginImportType: + enum: + - org.hyperledger.cactus.plugin_import_type.LOCAL + - org.hyperledger.cactus.plugin_import_type.REMOTE + type: string + PluginImportAction: + enum: + - org.hyperledger.cactus.plugin_import_action.INSTANTIATE + - org.hyperledger.cactus.plugin_import_action.INSTALL + type: string + ConsensusAlgorithmFamily: + description: "Enumerates a list of consensus algorithm families in existence.\ + \ Does not intend to be an exhaustive list, just a practical one, meaning\ + \ that we only include items here that are relevant to Hyperledger Cactus\ + \ in fulfilling its own duties. This can be extended later as more sophisticated\ + \ features of Cactus get implemented. This enum is meant to be first and foremost\ + \ a useful abstraction for achieving practical tasks, not an encyclopedia\ + \ and therefore we ask of everyone that this to be extended only in ways that\ + \ serve a practical purpose for the runtime behavior of Cactus or Cactus plugins\ + \ in general. The bottom line is that we can accept this enum being not 100%\ + \ accurate as long as it 100% satisfies what it was designed to do." + enum: + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK + type: string + ConsensusAlgorithmFamiliesWithTxFinality: + description: Enumerates a list of consensus algorithm families that provide + immediate finality + enum: + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE + type: string + ConsensusAlgorithmFamiliesWithOutTxFinality: + description: Enumerates a list of consensus algorithm families that do not provide + immediate finality + enum: + - org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK + type: string + x-enum-varnames: + - WORK + PrimaryKey: + maxLength: 128 + minLength: 1 + nullable: false + type: string + ConsortiumMemberId: + $ref: '#/components/schemas/PrimaryKey' + CactusNodeId: + $ref: '#/components/schemas/PrimaryKey' + ConsortiumId: + $ref: '#/components/schemas/PrimaryKey' + LedgerId: + $ref: '#/components/schemas/PrimaryKey' + PluginInstanceId: + $ref: '#/components/schemas/PrimaryKey' + ConsortiumDatabase: + properties: + consortium: + default: [] + description: "A collection of Consortium entities. In practice this should\ + \ only ever contain a single consortium, but we defined it as an array\ + \ to keep the convention up with the rest of the collections defined in\ + \ the Consortium data in general. Also, if we ever decide to somehow have\ + \ some sort of consortium to consortium integration (which does not make\ + \ much sense in the current frame of mind of the author in the year 2020)\ + \ then having this as an array will have proven itself to be an excellent\ + \ long term compatibility/extensibility decision indeed." + items: + $ref: '#/components/schemas/Consortium' + maxItems: 2048 + minItems: 0 + type: array + ledger: + default: [] + description: The complete collection of all ledger entities in existence + within the consortium. + items: + $ref: '#/components/schemas/Ledger' + maxItems: 2048 + minItems: 0 + type: array + consortiumMember: + default: [] + description: The complete collection of all consortium member entities in + existence within the consortium. + items: + $ref: '#/components/schemas/ConsortiumMember' + maxItems: 2048 + minItems: 0 + type: array + cactusNode: + default: [] + description: The complete collection of all cactus nodes entities in existence + within the consortium. + items: + $ref: '#/components/schemas/CactusNode' + maxItems: 2048 + minItems: 0 + type: array + pluginInstance: + default: [] + description: The complete collection of all plugin instance entities in + existence within the consortium. + items: + $ref: '#/components/schemas/PluginInstance' + maxItems: 2048 + minItems: 0 + type: array + required: + - cactusNode + - consortium + - consortiumMember + - ledger + - pluginInstance + Ledger: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + ledgerType: + $ref: '#/components/schemas/LedgerType' + consortiumMemberId: + maxLength: 128 + minLength: 1 + nullable: false + type: string + required: + - id + - ledgerType + type: object + LedgerType: + description: "Enumerates the different ledger vendors and their major versions\ + \ encoded within the name of the LedgerType. For example \"BESU_1X\" involves\ + \ all of the [1.0.0;2.0.0) where 1.0.0 is included and anything up until,\ + \ but not 2.0.0. See: https://stackoverflow.com/a/4396303/698470 for further\ + \ explanation." + enum: + - BESU_1X + - BESU_2X + - BURROW_0X + - CORDA_4X + - FABRIC_14X + - FABRIC_2 + - QUORUM_2X + - SAWTOOTH_1X + type: string + Consortium: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + name: + type: string + mainApiHost: + type: string + memberIds: + default: [] + description: The collection (array) of primary keys of consortium member + entities that belong to this Consortium. + items: + $ref: '#/components/schemas/ConsortiumMemberId' + maxItems: 2048 + minItems: 1 + nullable: false + type: array + required: + - id + - mainApiHost + - memberIds + - name + type: object + ConsortiumMember: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + name: + description: The human readable name a Consortium member can be referred + to while making it easy for humans to distinguish this particular consortium + member entity from any other ones. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + nodeIds: + default: [] + items: + $ref: '#/components/schemas/CactusNodeId' + maxItems: 2048 + minItems: 1 + nullable: false + type: array + required: + - id + - name + - nodeIds + type: object + CactusNodeMeta: + description: A Cactus node meta information + properties: + nodeApiHost: + maxLength: 1024 + minLength: 1 + nullable: false + type: string + publicKeyPem: + description: The PEM encoded public key that was used to generate the JWS + included in the response (the jws property) + format: "Must only contain the public key, never include here the PEM that\ + \ also contains a private key. See PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail" + maxLength: 65535 + minLength: 1 + nullable: false + type: string + required: + - nodeApiHost + - publicKeyPem + type: object + CactusNode: + allOf: + - $ref: '#/components/schemas/CactusNodeMeta' + - $ref: '#/components/schemas/CactusNode_allOf' + description: "A Cactus node can be a single server, or a set of servers behind\ + \ a load balancer acting as one." + type: object + PluginInstance: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + packageName: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + required: + - id + - packageName + type: object + JWSCompact: + description: "A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515\ + \ for info about standard." + example: eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjJ9.DOCNCqEMN7CQ_z-RMndiyldljXOk6WFIZxRzNF5Ylg4 + maxLength: 65535 + minLength: 5 + pattern: "/^[a-zA-Z0-9-_]+?.[a-zA-Z0-9-_]+?.([a-zA-Z0-9-_]+)?$/" + type: string + JWSRecipient: + description: "A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515\ + \ for info about standard." + properties: + signature: + type: string + protected: + type: string + header: + additionalProperties: true + type: object + required: + - signature + type: object + JWSGeneral: + properties: + payload: + maxLength: 65535 + minLength: 1 + type: string + signatures: + items: + $ref: '#/components/schemas/JWSRecipient' + type: array + required: + - payload + - signatures + type: object + GetObjectRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to get from the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetObjectResponseV1: + properties: + key: + description: The key that was used to retrieve the value from the object + store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key in the object store + as a string. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + HasObjectRequestV1: + additionalProperties: false + properties: + key: + description: The key to check for presence in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasObjectResponseV1: + properties: + key: + description: The key that was used to check the presence of the value in + the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an object under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + SetObjectRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to set in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key in the object + store. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetObjectResponseV1: + properties: + key: + description: The key that was used to set the value in the object store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + CactusNode_allOf: + properties: + id: + maxLength: 128 + minLength: 1 + nullable: false + type: string + consortiumId: + maxLength: 128 + minLength: 1 + nullable: false + type: string + memberId: + maxLength: 128 + minLength: 1 + nullable: false + type: string + ledgerIds: + default: [] + description: Stores an array of Ledger entity IDs that are reachable (routable) + via this Cactus Node. This information is used by the client side SDK + API client to figure out at runtime where to send API requests that are + specific to a certain ledger such as requests to execute transactions. + items: + $ref: '#/components/schemas/LedgerId' + maxItems: 2048 + minItems: 0 + nullable: false + type: array + pluginInstanceIds: + default: [] + items: + $ref: '#/components/schemas/PluginInstanceId' + maxItems: 2048 + minItems: 0 + nullable: false + type: array + required: + - consortiumId + - id + - ledgerIds + - memberId + - nodeApiHost + - pluginInstanceIds + - publicKeyPem + type: object + example: null + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..f8a0bc97ee1 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..92a34f35750 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..87443e8af27 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..b66f457f4ee --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..9df3a090ef0 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..f5cd28bc551 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..ef9babdabe4 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,425 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.CactusNode.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CactusNodeAllOf.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CactusNodeMeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Consortium.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ConsortiumDatabase.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ConsortiumMember.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetObjectRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetObjectResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasObjectRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasObjectResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.JWSGeneral.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.JWSRecipient.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Ledger.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PluginImport.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PluginInstance.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetObjectRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetObjectResponseV1.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); + } + } + } + + /** + * 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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..055279b29d7 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..81d888d9b18 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..7f35f94d45a --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..aa0a89f20d7 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..7cdf43ddfc0 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..40aa8c4a475 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..f38723336b4 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..6c44e85b458 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..6587cfbccc9 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNode.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNode.java new file mode 100644 index 00000000000..68ca63a778f --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNode.java @@ -0,0 +1,432 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * A Cactus node can be a single server, or a set of servers behind a load balancer acting as one. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CactusNode { + public static final String SERIALIZED_NAME_NODE_API_HOST = "nodeApiHost"; + @SerializedName(SERIALIZED_NAME_NODE_API_HOST) + private String nodeApiHost; + + public static final String SERIALIZED_NAME_PUBLIC_KEY_PEM = "publicKeyPem"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY_PEM) + private String publicKeyPem; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_CONSORTIUM_ID = "consortiumId"; + @SerializedName(SERIALIZED_NAME_CONSORTIUM_ID) + private String consortiumId; + + public static final String SERIALIZED_NAME_MEMBER_ID = "memberId"; + @SerializedName(SERIALIZED_NAME_MEMBER_ID) + private String memberId; + + public static final String SERIALIZED_NAME_LEDGER_IDS = "ledgerIds"; + @SerializedName(SERIALIZED_NAME_LEDGER_IDS) + private List ledgerIds = null; + + public static final String SERIALIZED_NAME_PLUGIN_INSTANCE_IDS = "pluginInstanceIds"; + @SerializedName(SERIALIZED_NAME_PLUGIN_INSTANCE_IDS) + private List pluginInstanceIds = null; + + public CactusNode() { + } + + public CactusNode nodeApiHost(String nodeApiHost) { + + this.nodeApiHost = nodeApiHost; + return this; + } + + /** + * Get nodeApiHost + * @return nodeApiHost + **/ + @javax.annotation.Nonnull + public String getNodeApiHost() { + return nodeApiHost; + } + + + public void setNodeApiHost(String nodeApiHost) { + this.nodeApiHost = nodeApiHost; + } + + + public CactusNode publicKeyPem(String publicKeyPem) { + + this.publicKeyPem = publicKeyPem; + return this; + } + + /** + * The PEM encoded public key that was used to generate the JWS included in the response (the jws property) + * @return publicKeyPem + **/ + @javax.annotation.Nonnull + public String getPublicKeyPem() { + return publicKeyPem; + } + + + public void setPublicKeyPem(String publicKeyPem) { + this.publicKeyPem = publicKeyPem; + } + + + public CactusNode id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public CactusNode consortiumId(String consortiumId) { + + this.consortiumId = consortiumId; + return this; + } + + /** + * Get consortiumId + * @return consortiumId + **/ + @javax.annotation.Nonnull + public String getConsortiumId() { + return consortiumId; + } + + + public void setConsortiumId(String consortiumId) { + this.consortiumId = consortiumId; + } + + + public CactusNode memberId(String memberId) { + + this.memberId = memberId; + return this; + } + + /** + * Get memberId + * @return memberId + **/ + @javax.annotation.Nonnull + public String getMemberId() { + return memberId; + } + + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + + public CactusNode ledgerIds(List ledgerIds) { + + this.ledgerIds = ledgerIds; + return this; + } + + public CactusNode addLedgerIdsItem(String ledgerIdsItem) { + if (this.ledgerIds == null) { + this.ledgerIds = null; + } + this.ledgerIds.add(ledgerIdsItem); + return this; + } + + /** + * Stores an array of Ledger entity IDs that are reachable (routable) via this Cactus Node. This information is used by the client side SDK API client to figure out at runtime where to send API requests that are specific to a certain ledger such as requests to execute transactions. + * @return ledgerIds + **/ + @javax.annotation.Nonnull + public List getLedgerIds() { + return ledgerIds; + } + + + public void setLedgerIds(List ledgerIds) { + this.ledgerIds = ledgerIds; + } + + + public CactusNode pluginInstanceIds(List pluginInstanceIds) { + + this.pluginInstanceIds = pluginInstanceIds; + return this; + } + + public CactusNode addPluginInstanceIdsItem(String pluginInstanceIdsItem) { + if (this.pluginInstanceIds == null) { + this.pluginInstanceIds = null; + } + this.pluginInstanceIds.add(pluginInstanceIdsItem); + return this; + } + + /** + * Get pluginInstanceIds + * @return pluginInstanceIds + **/ + @javax.annotation.Nonnull + public List getPluginInstanceIds() { + return pluginInstanceIds; + } + + + public void setPluginInstanceIds(List pluginInstanceIds) { + this.pluginInstanceIds = pluginInstanceIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CactusNode cactusNode = (CactusNode) o; + return Objects.equals(this.nodeApiHost, cactusNode.nodeApiHost) && + Objects.equals(this.publicKeyPem, cactusNode.publicKeyPem) && + Objects.equals(this.id, cactusNode.id) && + Objects.equals(this.consortiumId, cactusNode.consortiumId) && + Objects.equals(this.memberId, cactusNode.memberId) && + Objects.equals(this.ledgerIds, cactusNode.ledgerIds) && + Objects.equals(this.pluginInstanceIds, cactusNode.pluginInstanceIds); + } + + @Override + public int hashCode() { + return Objects.hash(nodeApiHost, publicKeyPem, id, consortiumId, memberId, ledgerIds, pluginInstanceIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CactusNode {\n"); + sb.append(" nodeApiHost: ").append(toIndentedString(nodeApiHost)).append("\n"); + sb.append(" publicKeyPem: ").append(toIndentedString(publicKeyPem)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" consortiumId: ").append(toIndentedString(consortiumId)).append("\n"); + sb.append(" memberId: ").append(toIndentedString(memberId)).append("\n"); + sb.append(" ledgerIds: ").append(toIndentedString(ledgerIds)).append("\n"); + sb.append(" pluginInstanceIds: ").append(toIndentedString(pluginInstanceIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("nodeApiHost"); + openapiFields.add("publicKeyPem"); + openapiFields.add("id"); + openapiFields.add("consortiumId"); + openapiFields.add("memberId"); + openapiFields.add("ledgerIds"); + openapiFields.add("pluginInstanceIds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("nodeApiHost"); + openapiRequiredFields.add("publicKeyPem"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("consortiumId"); + openapiRequiredFields.add("memberId"); + openapiRequiredFields.add("ledgerIds"); + openapiRequiredFields.add("pluginInstanceIds"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CactusNode + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CactusNode.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CactusNode is not found in the empty JSON string", CactusNode.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CactusNode.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CactusNode` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CactusNode.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("nodeApiHost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nodeApiHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nodeApiHost").toString())); + } + if (!jsonObj.get("publicKeyPem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKeyPem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKeyPem").toString())); + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("consortiumId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `consortiumId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("consortiumId").toString())); + } + if (!jsonObj.get("memberId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `memberId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("memberId").toString())); + } + // ensure the required json array is present + if (jsonObj.get("ledgerIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("ledgerIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ledgerIds` to be an array in the JSON string but got `%s`", jsonObj.get("ledgerIds").toString())); + } + // ensure the required json array is present + if (jsonObj.get("pluginInstanceIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("pluginInstanceIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `pluginInstanceIds` to be an array in the JSON string but got `%s`", jsonObj.get("pluginInstanceIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CactusNode.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CactusNode' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CactusNode.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CactusNode value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CactusNode read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CactusNode given an JSON string + * + * @param jsonString JSON string + * @return An instance of CactusNode + * @throws IOException if the JSON string is invalid with respect to CactusNode + */ + public static CactusNode fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CactusNode.class); + } + + /** + * Convert an instance of CactusNode to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNodeAllOf.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNodeAllOf.java new file mode 100644 index 00000000000..12a8931119a --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNodeAllOf.java @@ -0,0 +1,368 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CactusNodeAllOf + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CactusNodeAllOf { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_CONSORTIUM_ID = "consortiumId"; + @SerializedName(SERIALIZED_NAME_CONSORTIUM_ID) + private String consortiumId; + + public static final String SERIALIZED_NAME_MEMBER_ID = "memberId"; + @SerializedName(SERIALIZED_NAME_MEMBER_ID) + private String memberId; + + public static final String SERIALIZED_NAME_LEDGER_IDS = "ledgerIds"; + @SerializedName(SERIALIZED_NAME_LEDGER_IDS) + private List ledgerIds = null; + + public static final String SERIALIZED_NAME_PLUGIN_INSTANCE_IDS = "pluginInstanceIds"; + @SerializedName(SERIALIZED_NAME_PLUGIN_INSTANCE_IDS) + private List pluginInstanceIds = null; + + public CactusNodeAllOf() { + } + + public CactusNodeAllOf id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public CactusNodeAllOf consortiumId(String consortiumId) { + + this.consortiumId = consortiumId; + return this; + } + + /** + * Get consortiumId + * @return consortiumId + **/ + @javax.annotation.Nonnull + public String getConsortiumId() { + return consortiumId; + } + + + public void setConsortiumId(String consortiumId) { + this.consortiumId = consortiumId; + } + + + public CactusNodeAllOf memberId(String memberId) { + + this.memberId = memberId; + return this; + } + + /** + * Get memberId + * @return memberId + **/ + @javax.annotation.Nonnull + public String getMemberId() { + return memberId; + } + + + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + + public CactusNodeAllOf ledgerIds(List ledgerIds) { + + this.ledgerIds = ledgerIds; + return this; + } + + public CactusNodeAllOf addLedgerIdsItem(String ledgerIdsItem) { + if (this.ledgerIds == null) { + this.ledgerIds = null; + } + this.ledgerIds.add(ledgerIdsItem); + return this; + } + + /** + * Stores an array of Ledger entity IDs that are reachable (routable) via this Cactus Node. This information is used by the client side SDK API client to figure out at runtime where to send API requests that are specific to a certain ledger such as requests to execute transactions. + * @return ledgerIds + **/ + @javax.annotation.Nonnull + public List getLedgerIds() { + return ledgerIds; + } + + + public void setLedgerIds(List ledgerIds) { + this.ledgerIds = ledgerIds; + } + + + public CactusNodeAllOf pluginInstanceIds(List pluginInstanceIds) { + + this.pluginInstanceIds = pluginInstanceIds; + return this; + } + + public CactusNodeAllOf addPluginInstanceIdsItem(String pluginInstanceIdsItem) { + if (this.pluginInstanceIds == null) { + this.pluginInstanceIds = null; + } + this.pluginInstanceIds.add(pluginInstanceIdsItem); + return this; + } + + /** + * Get pluginInstanceIds + * @return pluginInstanceIds + **/ + @javax.annotation.Nonnull + public List getPluginInstanceIds() { + return pluginInstanceIds; + } + + + public void setPluginInstanceIds(List pluginInstanceIds) { + this.pluginInstanceIds = pluginInstanceIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CactusNodeAllOf cactusNodeAllOf = (CactusNodeAllOf) o; + return Objects.equals(this.id, cactusNodeAllOf.id) && + Objects.equals(this.consortiumId, cactusNodeAllOf.consortiumId) && + Objects.equals(this.memberId, cactusNodeAllOf.memberId) && + Objects.equals(this.ledgerIds, cactusNodeAllOf.ledgerIds) && + Objects.equals(this.pluginInstanceIds, cactusNodeAllOf.pluginInstanceIds); + } + + @Override + public int hashCode() { + return Objects.hash(id, consortiumId, memberId, ledgerIds, pluginInstanceIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CactusNodeAllOf {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" consortiumId: ").append(toIndentedString(consortiumId)).append("\n"); + sb.append(" memberId: ").append(toIndentedString(memberId)).append("\n"); + sb.append(" ledgerIds: ").append(toIndentedString(ledgerIds)).append("\n"); + sb.append(" pluginInstanceIds: ").append(toIndentedString(pluginInstanceIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("consortiumId"); + openapiFields.add("memberId"); + openapiFields.add("ledgerIds"); + openapiFields.add("pluginInstanceIds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("consortiumId"); + openapiRequiredFields.add("memberId"); + openapiRequiredFields.add("ledgerIds"); + openapiRequiredFields.add("pluginInstanceIds"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CactusNodeAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CactusNodeAllOf.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CactusNodeAllOf is not found in the empty JSON string", CactusNodeAllOf.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CactusNodeAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CactusNodeAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CactusNodeAllOf.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("consortiumId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `consortiumId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("consortiumId").toString())); + } + if (!jsonObj.get("memberId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `memberId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("memberId").toString())); + } + // ensure the required json array is present + if (jsonObj.get("ledgerIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("ledgerIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ledgerIds` to be an array in the JSON string but got `%s`", jsonObj.get("ledgerIds").toString())); + } + // ensure the required json array is present + if (jsonObj.get("pluginInstanceIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("pluginInstanceIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `pluginInstanceIds` to be an array in the JSON string but got `%s`", jsonObj.get("pluginInstanceIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CactusNodeAllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CactusNodeAllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CactusNodeAllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CactusNodeAllOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CactusNodeAllOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CactusNodeAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of CactusNodeAllOf + * @throws IOException if the JSON string is invalid with respect to CactusNodeAllOf + */ + public static CactusNodeAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CactusNodeAllOf.class); + } + + /** + * Convert an instance of CactusNodeAllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNodeMeta.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNodeMeta.java new file mode 100644 index 00000000000..37dc495808e --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactusNodeMeta.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * A Cactus node meta information + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CactusNodeMeta { + public static final String SERIALIZED_NAME_NODE_API_HOST = "nodeApiHost"; + @SerializedName(SERIALIZED_NAME_NODE_API_HOST) + private String nodeApiHost; + + public static final String SERIALIZED_NAME_PUBLIC_KEY_PEM = "publicKeyPem"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY_PEM) + private String publicKeyPem; + + public CactusNodeMeta() { + } + + public CactusNodeMeta nodeApiHost(String nodeApiHost) { + + this.nodeApiHost = nodeApiHost; + return this; + } + + /** + * Get nodeApiHost + * @return nodeApiHost + **/ + @javax.annotation.Nonnull + public String getNodeApiHost() { + return nodeApiHost; + } + + + public void setNodeApiHost(String nodeApiHost) { + this.nodeApiHost = nodeApiHost; + } + + + public CactusNodeMeta publicKeyPem(String publicKeyPem) { + + this.publicKeyPem = publicKeyPem; + return this; + } + + /** + * The PEM encoded public key that was used to generate the JWS included in the response (the jws property) + * @return publicKeyPem + **/ + @javax.annotation.Nonnull + public String getPublicKeyPem() { + return publicKeyPem; + } + + + public void setPublicKeyPem(String publicKeyPem) { + this.publicKeyPem = publicKeyPem; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CactusNodeMeta cactusNodeMeta = (CactusNodeMeta) o; + return Objects.equals(this.nodeApiHost, cactusNodeMeta.nodeApiHost) && + Objects.equals(this.publicKeyPem, cactusNodeMeta.publicKeyPem); + } + + @Override + public int hashCode() { + return Objects.hash(nodeApiHost, publicKeyPem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CactusNodeMeta {\n"); + sb.append(" nodeApiHost: ").append(toIndentedString(nodeApiHost)).append("\n"); + sb.append(" publicKeyPem: ").append(toIndentedString(publicKeyPem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("nodeApiHost"); + openapiFields.add("publicKeyPem"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("nodeApiHost"); + openapiRequiredFields.add("publicKeyPem"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CactusNodeMeta + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CactusNodeMeta.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CactusNodeMeta is not found in the empty JSON string", CactusNodeMeta.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CactusNodeMeta.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CactusNodeMeta` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CactusNodeMeta.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("nodeApiHost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nodeApiHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nodeApiHost").toString())); + } + if (!jsonObj.get("publicKeyPem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKeyPem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKeyPem").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CactusNodeMeta.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CactusNodeMeta' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CactusNodeMeta.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CactusNodeMeta value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CactusNodeMeta read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CactusNodeMeta given an JSON string + * + * @param jsonString JSON string + * @return An instance of CactusNodeMeta + * @throws IOException if the JSON string is invalid with respect to CactusNodeMeta + */ + public static CactusNodeMeta fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CactusNodeMeta.class); + } + + /** + * Convert an instance of CactusNodeMeta to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinality.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinality.java new file mode 100644 index 00000000000..90fc0cc06ce --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinality.java @@ -0,0 +1,71 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates a list of consensus algorithm families that do not provide immediate finality + */ +@JsonAdapter(ConsensusAlgorithmFamiliesWithOutTxFinality.Adapter.class) +public enum ConsensusAlgorithmFamiliesWithOutTxFinality { + + WORK("org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK"); + + private String value; + + ConsensusAlgorithmFamiliesWithOutTxFinality(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConsensusAlgorithmFamiliesWithOutTxFinality fromValue(String value) { + for (ConsensusAlgorithmFamiliesWithOutTxFinality b : ConsensusAlgorithmFamiliesWithOutTxFinality.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ConsensusAlgorithmFamiliesWithOutTxFinality enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConsensusAlgorithmFamiliesWithOutTxFinality read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConsensusAlgorithmFamiliesWithOutTxFinality.fromValue(value); + } + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinality.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinality.java new file mode 100644 index 00000000000..584631444e7 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinality.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates a list of consensus algorithm families that provide immediate finality + */ +@JsonAdapter(ConsensusAlgorithmFamiliesWithTxFinality.Adapter.class) +public enum ConsensusAlgorithmFamiliesWithTxFinality { + + AUTHORITY("org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY"), + + STAKE("org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE"); + + private String value; + + ConsensusAlgorithmFamiliesWithTxFinality(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConsensusAlgorithmFamiliesWithTxFinality fromValue(String value) { + for (ConsensusAlgorithmFamiliesWithTxFinality b : ConsensusAlgorithmFamiliesWithTxFinality.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ConsensusAlgorithmFamiliesWithTxFinality enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConsensusAlgorithmFamiliesWithTxFinality read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConsensusAlgorithmFamiliesWithTxFinality.fromValue(value); + } + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamily.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamily.java new file mode 100644 index 00000000000..3887970def2 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsensusAlgorithmFamily.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates a list of consensus algorithm families in existence. Does not intend to be an exhaustive list, just a practical one, meaning that we only include items here that are relevant to Hyperledger Cactus in fulfilling its own duties. This can be extended later as more sophisticated features of Cactus get implemented. This enum is meant to be first and foremost a useful abstraction for achieving practical tasks, not an encyclopedia and therefore we ask of everyone that this to be extended only in ways that serve a practical purpose for the runtime behavior of Cactus or Cactus plugins in general. The bottom line is that we can accept this enum being not 100% accurate as long as it 100% satisfies what it was designed to do. + */ +@JsonAdapter(ConsensusAlgorithmFamily.Adapter.class) +public enum ConsensusAlgorithmFamily { + + AUTHORITY("org.hyperledger.cactus.consensusalgorithm.PROOF_OF_AUTHORITY"), + + STAKE("org.hyperledger.cactus.consensusalgorithm.PROOF_OF_STAKE"), + + WORK("org.hyperledger.cactus.consensusalgorithm.PROOF_OF_WORK"); + + private String value; + + ConsensusAlgorithmFamily(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConsensusAlgorithmFamily fromValue(String value) { + for (ConsensusAlgorithmFamily b : ConsensusAlgorithmFamily.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ConsensusAlgorithmFamily enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConsensusAlgorithmFamily read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConsensusAlgorithmFamily.fromValue(value); + } + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Consortium.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Consortium.java new file mode 100644 index 00000000000..83e0f30b8b2 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Consortium.java @@ -0,0 +1,325 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Consortium + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Consortium { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_MAIN_API_HOST = "mainApiHost"; + @SerializedName(SERIALIZED_NAME_MAIN_API_HOST) + private String mainApiHost; + + public static final String SERIALIZED_NAME_MEMBER_IDS = "memberIds"; + @SerializedName(SERIALIZED_NAME_MEMBER_IDS) + private List memberIds = null; + + public Consortium() { + } + + public Consortium id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public Consortium name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public Consortium mainApiHost(String mainApiHost) { + + this.mainApiHost = mainApiHost; + return this; + } + + /** + * Get mainApiHost + * @return mainApiHost + **/ + @javax.annotation.Nonnull + public String getMainApiHost() { + return mainApiHost; + } + + + public void setMainApiHost(String mainApiHost) { + this.mainApiHost = mainApiHost; + } + + + public Consortium memberIds(List memberIds) { + + this.memberIds = memberIds; + return this; + } + + public Consortium addMemberIdsItem(String memberIdsItem) { + if (this.memberIds == null) { + this.memberIds = null; + } + this.memberIds.add(memberIdsItem); + return this; + } + + /** + * The collection (array) of primary keys of consortium member entities that belong to this Consortium. + * @return memberIds + **/ + @javax.annotation.Nonnull + public List getMemberIds() { + return memberIds; + } + + + public void setMemberIds(List memberIds) { + this.memberIds = memberIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Consortium consortium = (Consortium) o; + return Objects.equals(this.id, consortium.id) && + Objects.equals(this.name, consortium.name) && + Objects.equals(this.mainApiHost, consortium.mainApiHost) && + Objects.equals(this.memberIds, consortium.memberIds); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, mainApiHost, memberIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Consortium {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" mainApiHost: ").append(toIndentedString(mainApiHost)).append("\n"); + sb.append(" memberIds: ").append(toIndentedString(memberIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("mainApiHost"); + openapiFields.add("memberIds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("mainApiHost"); + openapiRequiredFields.add("memberIds"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Consortium + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Consortium.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Consortium is not found in the empty JSON string", Consortium.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Consortium.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Consortium` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Consortium.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("mainApiHost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mainApiHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mainApiHost").toString())); + } + // ensure the required json array is present + if (jsonObj.get("memberIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("memberIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `memberIds` to be an array in the JSON string but got `%s`", jsonObj.get("memberIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Consortium.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Consortium' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Consortium.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Consortium value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Consortium read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Consortium given an JSON string + * + * @param jsonString JSON string + * @return An instance of Consortium + * @throws IOException if the JSON string is invalid with respect to Consortium + */ + public static Consortium fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Consortium.class); + } + + /** + * Convert an instance of Consortium to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsortiumDatabase.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsortiumDatabase.java new file mode 100644 index 00000000000..aa6317c4cad --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsortiumDatabase.java @@ -0,0 +1,426 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.CactusNode; +import org.openapitools.client.model.Consortium; +import org.openapitools.client.model.ConsortiumMember; +import org.openapitools.client.model.Ledger; +import org.openapitools.client.model.PluginInstance; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ConsortiumDatabase + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConsortiumDatabase { + public static final String SERIALIZED_NAME_CONSORTIUM = "consortium"; + @SerializedName(SERIALIZED_NAME_CONSORTIUM) + private List consortium = null; + + public static final String SERIALIZED_NAME_LEDGER = "ledger"; + @SerializedName(SERIALIZED_NAME_LEDGER) + private List ledger = null; + + public static final String SERIALIZED_NAME_CONSORTIUM_MEMBER = "consortiumMember"; + @SerializedName(SERIALIZED_NAME_CONSORTIUM_MEMBER) + private List consortiumMember = null; + + public static final String SERIALIZED_NAME_CACTUS_NODE = "cactusNode"; + @SerializedName(SERIALIZED_NAME_CACTUS_NODE) + private List cactusNode = null; + + public static final String SERIALIZED_NAME_PLUGIN_INSTANCE = "pluginInstance"; + @SerializedName(SERIALIZED_NAME_PLUGIN_INSTANCE) + private List pluginInstance = null; + + public ConsortiumDatabase() { + } + + public ConsortiumDatabase consortium(List consortium) { + + this.consortium = consortium; + return this; + } + + public ConsortiumDatabase addConsortiumItem(Consortium consortiumItem) { + if (this.consortium == null) { + this.consortium = null; + } + this.consortium.add(consortiumItem); + return this; + } + + /** + * A collection of Consortium entities. In practice this should only ever contain a single consortium, but we defined it as an array to keep the convention up with the rest of the collections defined in the Consortium data in general. Also, if we ever decide to somehow have some sort of consortium to consortium integration (which does not make much sense in the current frame of mind of the author in the year 2020) then having this as an array will have proven itself to be an excellent long term compatibility/extensibility decision indeed. + * @return consortium + **/ + @javax.annotation.Nonnull + public List getConsortium() { + return consortium; + } + + + public void setConsortium(List consortium) { + this.consortium = consortium; + } + + + public ConsortiumDatabase ledger(List ledger) { + + this.ledger = ledger; + return this; + } + + public ConsortiumDatabase addLedgerItem(Ledger ledgerItem) { + if (this.ledger == null) { + this.ledger = null; + } + this.ledger.add(ledgerItem); + return this; + } + + /** + * The complete collection of all ledger entities in existence within the consortium. + * @return ledger + **/ + @javax.annotation.Nonnull + public List getLedger() { + return ledger; + } + + + public void setLedger(List ledger) { + this.ledger = ledger; + } + + + public ConsortiumDatabase consortiumMember(List consortiumMember) { + + this.consortiumMember = consortiumMember; + return this; + } + + public ConsortiumDatabase addConsortiumMemberItem(ConsortiumMember consortiumMemberItem) { + if (this.consortiumMember == null) { + this.consortiumMember = null; + } + this.consortiumMember.add(consortiumMemberItem); + return this; + } + + /** + * The complete collection of all consortium member entities in existence within the consortium. + * @return consortiumMember + **/ + @javax.annotation.Nonnull + public List getConsortiumMember() { + return consortiumMember; + } + + + public void setConsortiumMember(List consortiumMember) { + this.consortiumMember = consortiumMember; + } + + + public ConsortiumDatabase cactusNode(List cactusNode) { + + this.cactusNode = cactusNode; + return this; + } + + public ConsortiumDatabase addCactusNodeItem(CactusNode cactusNodeItem) { + if (this.cactusNode == null) { + this.cactusNode = null; + } + this.cactusNode.add(cactusNodeItem); + return this; + } + + /** + * The complete collection of all cactus nodes entities in existence within the consortium. + * @return cactusNode + **/ + @javax.annotation.Nonnull + public List getCactusNode() { + return cactusNode; + } + + + public void setCactusNode(List cactusNode) { + this.cactusNode = cactusNode; + } + + + public ConsortiumDatabase pluginInstance(List pluginInstance) { + + this.pluginInstance = pluginInstance; + return this; + } + + public ConsortiumDatabase addPluginInstanceItem(PluginInstance pluginInstanceItem) { + if (this.pluginInstance == null) { + this.pluginInstance = null; + } + this.pluginInstance.add(pluginInstanceItem); + return this; + } + + /** + * The complete collection of all plugin instance entities in existence within the consortium. + * @return pluginInstance + **/ + @javax.annotation.Nonnull + public List getPluginInstance() { + return pluginInstance; + } + + + public void setPluginInstance(List pluginInstance) { + this.pluginInstance = pluginInstance; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsortiumDatabase consortiumDatabase = (ConsortiumDatabase) o; + return Objects.equals(this.consortium, consortiumDatabase.consortium) && + Objects.equals(this.ledger, consortiumDatabase.ledger) && + Objects.equals(this.consortiumMember, consortiumDatabase.consortiumMember) && + Objects.equals(this.cactusNode, consortiumDatabase.cactusNode) && + Objects.equals(this.pluginInstance, consortiumDatabase.pluginInstance); + } + + @Override + public int hashCode() { + return Objects.hash(consortium, ledger, consortiumMember, cactusNode, pluginInstance); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsortiumDatabase {\n"); + sb.append(" consortium: ").append(toIndentedString(consortium)).append("\n"); + sb.append(" ledger: ").append(toIndentedString(ledger)).append("\n"); + sb.append(" consortiumMember: ").append(toIndentedString(consortiumMember)).append("\n"); + sb.append(" cactusNode: ").append(toIndentedString(cactusNode)).append("\n"); + sb.append(" pluginInstance: ").append(toIndentedString(pluginInstance)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("consortium"); + openapiFields.add("ledger"); + openapiFields.add("consortiumMember"); + openapiFields.add("cactusNode"); + openapiFields.add("pluginInstance"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("consortium"); + openapiRequiredFields.add("ledger"); + openapiRequiredFields.add("consortiumMember"); + openapiRequiredFields.add("cactusNode"); + openapiRequiredFields.add("pluginInstance"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsortiumDatabase + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ConsortiumDatabase.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsortiumDatabase is not found in the empty JSON string", ConsortiumDatabase.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsortiumDatabase.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsortiumDatabase` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConsortiumDatabase.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("consortium").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `consortium` to be an array in the JSON string but got `%s`", jsonObj.get("consortium").toString())); + } + + JsonArray jsonArrayconsortium = jsonObj.getAsJsonArray("consortium"); + // validate the required field `consortium` (array) + for (int i = 0; i < jsonArrayconsortium.size(); i++) { + Consortium.validateJsonObject(jsonArrayconsortium.get(i).getAsJsonObject()); + }; + // ensure the json data is an array + if (!jsonObj.get("ledger").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ledger` to be an array in the JSON string but got `%s`", jsonObj.get("ledger").toString())); + } + + JsonArray jsonArrayledger = jsonObj.getAsJsonArray("ledger"); + // validate the required field `ledger` (array) + for (int i = 0; i < jsonArrayledger.size(); i++) { + Ledger.validateJsonObject(jsonArrayledger.get(i).getAsJsonObject()); + }; + // ensure the json data is an array + if (!jsonObj.get("consortiumMember").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `consortiumMember` to be an array in the JSON string but got `%s`", jsonObj.get("consortiumMember").toString())); + } + + JsonArray jsonArrayconsortiumMember = jsonObj.getAsJsonArray("consortiumMember"); + // validate the required field `consortiumMember` (array) + for (int i = 0; i < jsonArrayconsortiumMember.size(); i++) { + ConsortiumMember.validateJsonObject(jsonArrayconsortiumMember.get(i).getAsJsonObject()); + }; + // ensure the json data is an array + if (!jsonObj.get("cactusNode").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `cactusNode` to be an array in the JSON string but got `%s`", jsonObj.get("cactusNode").toString())); + } + + JsonArray jsonArraycactusNode = jsonObj.getAsJsonArray("cactusNode"); + // validate the required field `cactusNode` (array) + for (int i = 0; i < jsonArraycactusNode.size(); i++) { + CactusNode.validateJsonObject(jsonArraycactusNode.get(i).getAsJsonObject()); + }; + // ensure the json data is an array + if (!jsonObj.get("pluginInstance").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `pluginInstance` to be an array in the JSON string but got `%s`", jsonObj.get("pluginInstance").toString())); + } + + JsonArray jsonArraypluginInstance = jsonObj.getAsJsonArray("pluginInstance"); + // validate the required field `pluginInstance` (array) + for (int i = 0; i < jsonArraypluginInstance.size(); i++) { + PluginInstance.validateJsonObject(jsonArraypluginInstance.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsortiumDatabase.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsortiumDatabase' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsortiumDatabase.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsortiumDatabase value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsortiumDatabase read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsortiumDatabase given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsortiumDatabase + * @throws IOException if the JSON string is invalid with respect to ConsortiumDatabase + */ + public static ConsortiumDatabase fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsortiumDatabase.class); + } + + /** + * Convert an instance of ConsortiumDatabase to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsortiumMember.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsortiumMember.java new file mode 100644 index 00000000000..148cd8c3cec --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsortiumMember.java @@ -0,0 +1,293 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ConsortiumMember + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConsortiumMember { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_NODE_IDS = "nodeIds"; + @SerializedName(SERIALIZED_NAME_NODE_IDS) + private List nodeIds = null; + + public ConsortiumMember() { + } + + public ConsortiumMember id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public ConsortiumMember name(String name) { + + this.name = name; + return this; + } + + /** + * The human readable name a Consortium member can be referred to while making it easy for humans to distinguish this particular consortium member entity from any other ones. + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public ConsortiumMember nodeIds(List nodeIds) { + + this.nodeIds = nodeIds; + return this; + } + + public ConsortiumMember addNodeIdsItem(String nodeIdsItem) { + if (this.nodeIds == null) { + this.nodeIds = null; + } + this.nodeIds.add(nodeIdsItem); + return this; + } + + /** + * Get nodeIds + * @return nodeIds + **/ + @javax.annotation.Nonnull + public List getNodeIds() { + return nodeIds; + } + + + public void setNodeIds(List nodeIds) { + this.nodeIds = nodeIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsortiumMember consortiumMember = (ConsortiumMember) o; + return Objects.equals(this.id, consortiumMember.id) && + Objects.equals(this.name, consortiumMember.name) && + Objects.equals(this.nodeIds, consortiumMember.nodeIds); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, nodeIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsortiumMember {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nodeIds: ").append(toIndentedString(nodeIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("nodeIds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("nodeIds"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsortiumMember + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ConsortiumMember.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsortiumMember is not found in the empty JSON string", ConsortiumMember.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsortiumMember.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsortiumMember` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConsortiumMember.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // ensure the required json array is present + if (jsonObj.get("nodeIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("nodeIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `nodeIds` to be an array in the JSON string but got `%s`", jsonObj.get("nodeIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsortiumMember.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsortiumMember' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsortiumMember.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsortiumMember value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsortiumMember read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsortiumMember given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsortiumMember + * @throws IOException if the JSON string is invalid with respect to ConsortiumMember + */ + public static ConsortiumMember fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsortiumMember.class); + } + + /** + * Convert an instance of ConsortiumMember to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Constants.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Constants.java new file mode 100644 index 00000000000..682317e6be5 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Constants.java @@ -0,0 +1,71 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Constants + */ +@JsonAdapter(Constants.Adapter.class) +public enum Constants { + + SocketIoConnectionPathV1("/api/v1/async/socket-io/connect"); + + private String value; + + Constants(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Constants fromValue(String value) { + for (Constants b : Constants.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Constants enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Constants read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Constants.fromValue(value); + } + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java new file mode 100644 index 00000000000..ad7f6d604c0 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryRequestV1() { + } + + public DeleteKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to check the presence of on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = (DeleteKeychainEntryRequestV1) o; + return Objects.equals(this.key, deleteKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryRequestV1 is not found in the empty JSON string", DeleteKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static DeleteKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java new file mode 100644 index 00000000000..8ff202ba9ed --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryResponseV1() { + } + + public DeleteKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was deleted from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryResponseV1 deleteKeychainEntryResponseV1 = (DeleteKeychainEntryResponseV1) o; + return Objects.equals(this.key, deleteKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryResponseV1 is not found in the empty JSON string", DeleteKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static DeleteKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java new file mode 100644 index 00000000000..9e2afb09aa7 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetKeychainEntryRequestV1() { + } + + public GetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = (GetKeychainEntryRequestV1) o; + return Objects.equals(this.key, getKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryRequestV1 is not found in the empty JSON string", GetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryRequestV1 + */ + public static GetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of GetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java new file mode 100644 index 00000000000..90b29a92b6b --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetKeychainEntryResponseV1() { + } + + public GetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetKeychainEntryResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryResponseV1 getKeychainEntryResponseV1 = (GetKeychainEntryResponseV1) o; + return Objects.equals(this.key, getKeychainEntryResponseV1.key) && + Objects.equals(this.value, getKeychainEntryResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryResponseV1 is not found in the empty JSON string", GetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryResponseV1 + */ + public static GetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of GetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectRequestV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectRequestV1.java new file mode 100644 index 00000000000..fd6d0f95ae8 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetObjectRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetObjectRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetObjectRequestV1() { + } + + public GetObjectRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetObjectRequestV1 getObjectRequestV1 = (GetObjectRequestV1) o; + return Objects.equals(this.key, getObjectRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetObjectRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetObjectRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetObjectRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetObjectRequestV1 is not found in the empty JSON string", GetObjectRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetObjectRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetObjectRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetObjectRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetObjectRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetObjectRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetObjectRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetObjectRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetObjectRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetObjectRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetObjectRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetObjectRequestV1 + */ + public static GetObjectRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetObjectRequestV1.class); + } + + /** + * Convert an instance of GetObjectRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectResponseV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectResponseV1.java new file mode 100644 index 00000000000..6a6d55ba3eb --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetObjectResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetObjectResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetObjectResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetObjectResponseV1() { + } + + public GetObjectResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetObjectResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key in the object store as a string. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetObjectResponseV1 getObjectResponseV1 = (GetObjectResponseV1) o; + return Objects.equals(this.key, getObjectResponseV1.key) && + Objects.equals(this.value, getObjectResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetObjectResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetObjectResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetObjectResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetObjectResponseV1 is not found in the empty JSON string", GetObjectResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetObjectResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetObjectResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetObjectResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetObjectResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetObjectResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetObjectResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetObjectResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetObjectResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetObjectResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetObjectResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetObjectResponseV1 + */ + public static GetObjectResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetObjectResponseV1.class); + } + + /** + * Convert an instance of GetObjectResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java new file mode 100644 index 00000000000..53400d85323 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasKeychainEntryRequestV1() { + } + + public HasKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = (HasKeychainEntryRequestV1) o; + return Objects.equals(this.key, hasKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryRequestV1 is not found in the empty JSON string", HasKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryRequestV1 + */ + public static HasKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of HasKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java new file mode 100644 index 00000000000..d9fedf6298d --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasKeychainEntryResponseV1() { + } + + public HasKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the entry store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasKeychainEntryResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasKeychainEntryResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an entry under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryResponseV1 hasKeychainEntryResponseV1 = (HasKeychainEntryResponseV1) o; + return Objects.equals(this.key, hasKeychainEntryResponseV1.key) && + Objects.equals(this.checkedAt, hasKeychainEntryResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasKeychainEntryResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryResponseV1 is not found in the empty JSON string", HasKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryResponseV1 + */ + public static HasKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of HasKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectRequestV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectRequestV1.java new file mode 100644 index 00000000000..b8b5a4abee5 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasObjectRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasObjectRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasObjectRequestV1() { + } + + public HasObjectRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasObjectRequestV1 hasObjectRequestV1 = (HasObjectRequestV1) o; + return Objects.equals(this.key, hasObjectRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasObjectRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasObjectRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasObjectRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasObjectRequestV1 is not found in the empty JSON string", HasObjectRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasObjectRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasObjectRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasObjectRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasObjectRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasObjectRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasObjectRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasObjectRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasObjectRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasObjectRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasObjectRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasObjectRequestV1 + */ + public static HasObjectRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasObjectRequestV1.class); + } + + /** + * Convert an instance of HasObjectRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectResponseV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectResponseV1.java new file mode 100644 index 00000000000..54fa499a59c --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasObjectResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasObjectResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasObjectResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasObjectResponseV1() { + } + + public HasObjectResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasObjectResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasObjectResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an object under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasObjectResponseV1 hasObjectResponseV1 = (HasObjectResponseV1) o; + return Objects.equals(this.key, hasObjectResponseV1.key) && + Objects.equals(this.checkedAt, hasObjectResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasObjectResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasObjectResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasObjectResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasObjectResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasObjectResponseV1 is not found in the empty JSON string", HasObjectResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasObjectResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasObjectResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasObjectResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasObjectResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasObjectResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasObjectResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasObjectResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasObjectResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasObjectResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasObjectResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasObjectResponseV1 + */ + public static HasObjectResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasObjectResponseV1.class); + } + + /** + * Convert an instance of HasObjectResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSGeneral.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSGeneral.java new file mode 100644 index 00000000000..b5e29028581 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSGeneral.java @@ -0,0 +1,266 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.JWSRecipient; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * JWSGeneral + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JWSGeneral { + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private String payload; + + public static final String SERIALIZED_NAME_SIGNATURES = "signatures"; + @SerializedName(SERIALIZED_NAME_SIGNATURES) + private List signatures = new ArrayList<>(); + + public JWSGeneral() { + } + + public JWSGeneral payload(String payload) { + + this.payload = payload; + return this; + } + + /** + * Get payload + * @return payload + **/ + @javax.annotation.Nonnull + public String getPayload() { + return payload; + } + + + public void setPayload(String payload) { + this.payload = payload; + } + + + public JWSGeneral signatures(List signatures) { + + this.signatures = signatures; + return this; + } + + public JWSGeneral addSignaturesItem(JWSRecipient signaturesItem) { + if (this.signatures == null) { + this.signatures = new ArrayList<>(); + } + this.signatures.add(signaturesItem); + return this; + } + + /** + * Get signatures + * @return signatures + **/ + @javax.annotation.Nonnull + public List getSignatures() { + return signatures; + } + + + public void setSignatures(List signatures) { + this.signatures = signatures; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JWSGeneral jwSGeneral = (JWSGeneral) o; + return Objects.equals(this.payload, jwSGeneral.payload) && + Objects.equals(this.signatures, jwSGeneral.signatures); + } + + @Override + public int hashCode() { + return Objects.hash(payload, signatures); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JWSGeneral {\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append(" signatures: ").append(toIndentedString(signatures)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("payload"); + openapiFields.add("signatures"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("payload"); + openapiRequiredFields.add("signatures"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JWSGeneral + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!JWSGeneral.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JWSGeneral is not found in the empty JSON string", JWSGeneral.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JWSGeneral.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JWSGeneral` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JWSGeneral.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("payload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payload").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("signatures").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `signatures` to be an array in the JSON string but got `%s`", jsonObj.get("signatures").toString())); + } + + JsonArray jsonArraysignatures = jsonObj.getAsJsonArray("signatures"); + // validate the required field `signatures` (array) + for (int i = 0; i < jsonArraysignatures.size(); i++) { + JWSRecipient.validateJsonObject(jsonArraysignatures.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JWSGeneral.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JWSGeneral' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JWSGeneral.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JWSGeneral value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JWSGeneral read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JWSGeneral given an JSON string + * + * @param jsonString JSON string + * @return An instance of JWSGeneral + * @throws IOException if the JSON string is invalid with respect to JWSGeneral + */ + public static JWSGeneral fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JWSGeneral.class); + } + + /** + * Convert an instance of JWSGeneral to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSRecipient.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSRecipient.java new file mode 100644 index 00000000000..9ee8d91ad10 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSRecipient.java @@ -0,0 +1,285 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515 for info about standard. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JWSRecipient { + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_PROTECTED = "protected"; + @SerializedName(SERIALIZED_NAME_PROTECTED) + private String protected; + + public static final String SERIALIZED_NAME_HEADER = "header"; + @SerializedName(SERIALIZED_NAME_HEADER) + private Map header = new HashMap<>(); + + public JWSRecipient() { + } + + public JWSRecipient signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public JWSRecipient protected(String protected) { + + this.protected = protected; + return this; + } + + /** + * Get protected + * @return protected + **/ + @javax.annotation.Nullable + public String getProtected() { + return protected; + } + + + public void setProtected(String protected) { + this.protected = protected; + } + + + public JWSRecipient header(Map header) { + + this.header = header; + return this; + } + + public JWSRecipient putHeaderItem(String key, Object headerItem) { + if (this.header == null) { + this.header = new HashMap<>(); + } + this.header.put(key, headerItem); + return this; + } + + /** + * Get header + * @return header + **/ + @javax.annotation.Nullable + public Map getHeader() { + return header; + } + + + public void setHeader(Map header) { + this.header = header; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JWSRecipient jwSRecipient = (JWSRecipient) o; + return Objects.equals(this.signature, jwSRecipient.signature) && + Objects.equals(this.protected, jwSRecipient.protected) && + Objects.equals(this.header, jwSRecipient.header); + } + + @Override + public int hashCode() { + return Objects.hash(signature, protected, header); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JWSRecipient {\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" protected: ").append(toIndentedString(protected)).append("\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("signature"); + openapiFields.add("protected"); + openapiFields.add("header"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JWSRecipient + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!JWSRecipient.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JWSRecipient is not found in the empty JSON string", JWSRecipient.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JWSRecipient.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JWSRecipient` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JWSRecipient.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if ((jsonObj.get("protected") != null && !jsonObj.get("protected").isJsonNull()) && !jsonObj.get("protected").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `protected` to be a primitive type in the JSON string but got `%s`", jsonObj.get("protected").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JWSRecipient.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JWSRecipient' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JWSRecipient.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JWSRecipient value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JWSRecipient read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JWSRecipient given an JSON string + * + * @param jsonString JSON string + * @return An instance of JWSRecipient + * @throws IOException if the JSON string is invalid with respect to JWSRecipient + */ + public static JWSRecipient fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JWSRecipient.class); + } + + /** + * Convert an instance of JWSRecipient to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Ledger.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Ledger.java new file mode 100644 index 00000000000..71e4461fe6c --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Ledger.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.LedgerType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Ledger + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Ledger { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_LEDGER_TYPE = "ledgerType"; + @SerializedName(SERIALIZED_NAME_LEDGER_TYPE) + private LedgerType ledgerType; + + public static final String SERIALIZED_NAME_CONSORTIUM_MEMBER_ID = "consortiumMemberId"; + @SerializedName(SERIALIZED_NAME_CONSORTIUM_MEMBER_ID) + private String consortiumMemberId; + + public Ledger() { + } + + public Ledger id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public Ledger ledgerType(LedgerType ledgerType) { + + this.ledgerType = ledgerType; + return this; + } + + /** + * Get ledgerType + * @return ledgerType + **/ + @javax.annotation.Nonnull + public LedgerType getLedgerType() { + return ledgerType; + } + + + public void setLedgerType(LedgerType ledgerType) { + this.ledgerType = ledgerType; + } + + + public Ledger consortiumMemberId(String consortiumMemberId) { + + this.consortiumMemberId = consortiumMemberId; + return this; + } + + /** + * Get consortiumMemberId + * @return consortiumMemberId + **/ + @javax.annotation.Nullable + public String getConsortiumMemberId() { + return consortiumMemberId; + } + + + public void setConsortiumMemberId(String consortiumMemberId) { + this.consortiumMemberId = consortiumMemberId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Ledger ledger = (Ledger) o; + return Objects.equals(this.id, ledger.id) && + Objects.equals(this.ledgerType, ledger.ledgerType) && + Objects.equals(this.consortiumMemberId, ledger.consortiumMemberId); + } + + @Override + public int hashCode() { + return Objects.hash(id, ledgerType, consortiumMemberId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Ledger {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" ledgerType: ").append(toIndentedString(ledgerType)).append("\n"); + sb.append(" consortiumMemberId: ").append(toIndentedString(consortiumMemberId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("ledgerType"); + openapiFields.add("consortiumMemberId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("ledgerType"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Ledger + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Ledger.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Ledger is not found in the empty JSON string", Ledger.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Ledger.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Ledger` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Ledger.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("consortiumMemberId") != null && !jsonObj.get("consortiumMemberId").isJsonNull()) && !jsonObj.get("consortiumMemberId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `consortiumMemberId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("consortiumMemberId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Ledger.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Ledger' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Ledger.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Ledger value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Ledger read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Ledger given an JSON string + * + * @param jsonString JSON string + * @return An instance of Ledger + * @throws IOException if the JSON string is invalid with respect to Ledger + */ + public static Ledger fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Ledger.class); + } + + /** + * Convert an instance of Ledger to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LedgerType.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LedgerType.java new file mode 100644 index 00000000000..ea31441dda6 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LedgerType.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates the different ledger vendors and their major versions encoded within the name of the LedgerType. For example \"BESU_1X\" involves all of the [1.0.0;2.0.0) where 1.0.0 is included and anything up until, but not 2.0.0. See: https://stackoverflow.com/a/4396303/698470 for further explanation. + */ +@JsonAdapter(LedgerType.Adapter.class) +public enum LedgerType { + + BESU_1X("BESU_1X"), + + BESU_2X("BESU_2X"), + + BURROW_0X("BURROW_0X"), + + CORDA_4X("CORDA_4X"), + + FABRIC_14X("FABRIC_14X"), + + FABRIC_2("FABRIC_2"), + + QUORUM_2X("QUORUM_2X"), + + SAWTOOTH_1X("SAWTOOTH_1X"); + + private String value; + + LedgerType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LedgerType fromValue(String value) { + for (LedgerType b : LedgerType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LedgerType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LedgerType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LedgerType.fromValue(value); + } + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImport.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImport.java new file mode 100644 index 00000000000..d4251a203ef --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImport.java @@ -0,0 +1,316 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.PluginImportAction; +import org.openapitools.client.model.PluginImportType; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * PluginImport + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PluginImport { + public static final String SERIALIZED_NAME_PACKAGE_NAME = "packageName"; + @SerializedName(SERIALIZED_NAME_PACKAGE_NAME) + private String packageName; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private PluginImportType type; + + public static final String SERIALIZED_NAME_ACTION = "action"; + @SerializedName(SERIALIZED_NAME_ACTION) + private PluginImportAction action; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + @SerializedName(SERIALIZED_NAME_OPTIONS) + private Object options = null; + + public PluginImport() { + } + + public PluginImport packageName(String packageName) { + + this.packageName = packageName; + return this; + } + + /** + * Get packageName + * @return packageName + **/ + @javax.annotation.Nonnull + public String getPackageName() { + return packageName; + } + + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + + public PluginImport type(PluginImportType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public PluginImportType getType() { + return type; + } + + + public void setType(PluginImportType type) { + this.type = type; + } + + + public PluginImport action(PluginImportAction action) { + + this.action = action; + return this; + } + + /** + * Get action + * @return action + **/ + @javax.annotation.Nonnull + public PluginImportAction getAction() { + return action; + } + + + public void setAction(PluginImportAction action) { + this.action = action; + } + + + public PluginImport options(Object options) { + + this.options = options; + return this; + } + + /** + * Get options + * @return options + **/ + @javax.annotation.Nullable + public Object getOptions() { + return options; + } + + + public void setOptions(Object options) { + this.options = options; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PluginImport pluginImport = (PluginImport) o; + return Objects.equals(this.packageName, pluginImport.packageName) && + Objects.equals(this.type, pluginImport.type) && + Objects.equals(this.action, pluginImport.action) && + Objects.equals(this.options, pluginImport.options); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(packageName, type, action, options); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PluginImport {\n"); + sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("packageName"); + openapiFields.add("type"); + openapiFields.add("action"); + openapiFields.add("options"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("packageName"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("action"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PluginImport + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PluginImport.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PluginImport is not found in the empty JSON string", PluginImport.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PluginImport.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PluginImport` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PluginImport.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("packageName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `packageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("packageName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PluginImport.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PluginImport' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PluginImport.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PluginImport value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PluginImport read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PluginImport given an JSON string + * + * @param jsonString JSON string + * @return An instance of PluginImport + * @throws IOException if the JSON string is invalid with respect to PluginImport + */ + public static PluginImport fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PluginImport.class); + } + + /** + * Convert an instance of PluginImport to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImportAction.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImportAction.java new file mode 100644 index 00000000000..8426680490a --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImportAction.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets PluginImportAction + */ +@JsonAdapter(PluginImportAction.Adapter.class) +public enum PluginImportAction { + + INSTANTIATE("org.hyperledger.cactus.plugin_import_action.INSTANTIATE"), + + INSTALL("org.hyperledger.cactus.plugin_import_action.INSTALL"); + + private String value; + + PluginImportAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PluginImportAction fromValue(String value) { + for (PluginImportAction b : PluginImportAction.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PluginImportAction enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PluginImportAction read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PluginImportAction.fromValue(value); + } + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImportType.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImportType.java new file mode 100644 index 00000000000..374e800b4bf --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginImportType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets PluginImportType + */ +@JsonAdapter(PluginImportType.Adapter.class) +public enum PluginImportType { + + LOCAL("org.hyperledger.cactus.plugin_import_type.LOCAL"), + + REMOTE("org.hyperledger.cactus.plugin_import_type.REMOTE"); + + private String value; + + PluginImportType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PluginImportType fromValue(String value) { + for (PluginImportType b : PluginImportType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PluginImportType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PluginImportType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PluginImportType.fromValue(value); + } + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginInstance.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginInstance.java new file mode 100644 index 00000000000..3b89bf2a12f --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PluginInstance.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * PluginInstance + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PluginInstance { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_PACKAGE_NAME = "packageName"; + @SerializedName(SERIALIZED_NAME_PACKAGE_NAME) + private String packageName; + + public PluginInstance() { + } + + public PluginInstance id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public PluginInstance packageName(String packageName) { + + this.packageName = packageName; + return this; + } + + /** + * Get packageName + * @return packageName + **/ + @javax.annotation.Nonnull + public String getPackageName() { + return packageName; + } + + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PluginInstance pluginInstance = (PluginInstance) o; + return Objects.equals(this.id, pluginInstance.id) && + Objects.equals(this.packageName, pluginInstance.packageName); + } + + @Override + public int hashCode() { + return Objects.hash(id, packageName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PluginInstance {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" packageName: ").append(toIndentedString(packageName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("packageName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("packageName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PluginInstance + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PluginInstance.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PluginInstance is not found in the empty JSON string", PluginInstance.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PluginInstance.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PluginInstance` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PluginInstance.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("packageName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `packageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("packageName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PluginInstance.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PluginInstance' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PluginInstance.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PluginInstance value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PluginInstance read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PluginInstance given an JSON string + * + * @param jsonString JSON string + * @return An instance of PluginInstance + * @throws IOException if the JSON string is invalid with respect to PluginInstance + */ + public static PluginInstance fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PluginInstance.class); + } + + /** + * Convert an instance of PluginInstance to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java new file mode 100644 index 00000000000..17a4beac2f7 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetKeychainEntryRequestV1() { + } + + public SetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetKeychainEntryRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = (SetKeychainEntryRequestV1) o; + return Objects.equals(this.key, setKeychainEntryRequestV1.key) && + Objects.equals(this.value, setKeychainEntryRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryRequestV1 is not found in the empty JSON string", SetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryRequestV1 + */ + public static SetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of SetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java new file mode 100644 index 00000000000..01673dbd794 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetKeychainEntryResponseV1() { + } + + public SetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryResponseV1 setKeychainEntryResponseV1 = (SetKeychainEntryResponseV1) o; + return Objects.equals(this.key, setKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryResponseV1 is not found in the empty JSON string", SetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryResponseV1 + */ + public static SetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of SetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectRequestV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectRequestV1.java new file mode 100644 index 00000000000..e9d9c5887ca --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetObjectRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetObjectRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetObjectRequestV1() { + } + + public SetObjectRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set in the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetObjectRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key in the object store. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetObjectRequestV1 setObjectRequestV1 = (SetObjectRequestV1) o; + return Objects.equals(this.key, setObjectRequestV1.key) && + Objects.equals(this.value, setObjectRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetObjectRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetObjectRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetObjectRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetObjectRequestV1 is not found in the empty JSON string", SetObjectRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetObjectRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetObjectRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetObjectRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetObjectRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetObjectRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetObjectRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetObjectRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetObjectRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetObjectRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetObjectRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetObjectRequestV1 + */ + public static SetObjectRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetObjectRequestV1.class); + } + + /** + * Convert an instance of SetObjectRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectResponseV1.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectResponseV1.java new file mode 100644 index 00000000000..27e9bfe36f3 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetObjectResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetObjectResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetObjectResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetObjectResponseV1() { + } + + public SetObjectResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value in the object store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetObjectResponseV1 setObjectResponseV1 = (SetObjectResponseV1) o; + return Objects.equals(this.key, setObjectResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetObjectResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetObjectResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetObjectResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetObjectResponseV1 is not found in the empty JSON string", SetObjectResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetObjectResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetObjectResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetObjectResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetObjectResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetObjectResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetObjectResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetObjectResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetObjectResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetObjectResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetObjectResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetObjectResponseV1 + */ + public static SetObjectResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetObjectResponseV1.class); + } + + /** + * Convert an instance of SetObjectResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeAllOfTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeAllOfTest.java new file mode 100644 index 00000000000..3aa9da86683 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeAllOfTest.java @@ -0,0 +1,82 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CactusNodeAllOf + */ +public class CactusNodeAllOfTest { + private final CactusNodeAllOf model = new CactusNodeAllOf(); + + /** + * Model tests for CactusNodeAllOf + */ + @Test + public void testCactusNodeAllOf() { + // TODO: test CactusNodeAllOf + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'consortiumId' + */ + @Test + public void consortiumIdTest() { + // TODO: test consortiumId + } + + /** + * Test the property 'memberId' + */ + @Test + public void memberIdTest() { + // TODO: test memberId + } + + /** + * Test the property 'ledgerIds' + */ + @Test + public void ledgerIdsTest() { + // TODO: test ledgerIds + } + + /** + * Test the property 'pluginInstanceIds' + */ + @Test + public void pluginInstanceIdsTest() { + // TODO: test pluginInstanceIds + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeMetaTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeMetaTest.java new file mode 100644 index 00000000000..f22f40c73f6 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeMetaTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CactusNodeMeta + */ +public class CactusNodeMetaTest { + private final CactusNodeMeta model = new CactusNodeMeta(); + + /** + * Model tests for CactusNodeMeta + */ + @Test + public void testCactusNodeMeta() { + // TODO: test CactusNodeMeta + } + + /** + * Test the property 'nodeApiHost' + */ + @Test + public void nodeApiHostTest() { + // TODO: test nodeApiHost + } + + /** + * Test the property 'publicKeyPem' + */ + @Test + public void publicKeyPemTest() { + // TODO: test publicKeyPem + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeTest.java new file mode 100644 index 00000000000..4df2a953fca --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactusNodeTest.java @@ -0,0 +1,98 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CactusNode + */ +public class CactusNodeTest { + private final CactusNode model = new CactusNode(); + + /** + * Model tests for CactusNode + */ + @Test + public void testCactusNode() { + // TODO: test CactusNode + } + + /** + * Test the property 'nodeApiHost' + */ + @Test + public void nodeApiHostTest() { + // TODO: test nodeApiHost + } + + /** + * Test the property 'publicKeyPem' + */ + @Test + public void publicKeyPemTest() { + // TODO: test publicKeyPem + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'consortiumId' + */ + @Test + public void consortiumIdTest() { + // TODO: test consortiumId + } + + /** + * Test the property 'memberId' + */ + @Test + public void memberIdTest() { + // TODO: test memberId + } + + /** + * Test the property 'ledgerIds' + */ + @Test + public void ledgerIdsTest() { + // TODO: test ledgerIds + } + + /** + * Test the property 'pluginInstanceIds' + */ + @Test + public void pluginInstanceIdsTest() { + // TODO: test pluginInstanceIds + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinalityTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinalityTest.java new file mode 100644 index 00000000000..f0f390420b2 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithOutTxFinalityTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConsensusAlgorithmFamiliesWithOutTxFinality + */ +public class ConsensusAlgorithmFamiliesWithOutTxFinalityTest { + /** + * Model tests for ConsensusAlgorithmFamiliesWithOutTxFinality + */ + @Test + public void testConsensusAlgorithmFamiliesWithOutTxFinality() { + // TODO: test ConsensusAlgorithmFamiliesWithOutTxFinality + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinalityTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinalityTest.java new file mode 100644 index 00000000000..de16796d4c1 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamiliesWithTxFinalityTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConsensusAlgorithmFamiliesWithTxFinality + */ +public class ConsensusAlgorithmFamiliesWithTxFinalityTest { + /** + * Model tests for ConsensusAlgorithmFamiliesWithTxFinality + */ + @Test + public void testConsensusAlgorithmFamiliesWithTxFinality() { + // TODO: test ConsensusAlgorithmFamiliesWithTxFinality + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamilyTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamilyTest.java new file mode 100644 index 00000000000..1b91a4fd78f --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsensusAlgorithmFamilyTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConsensusAlgorithmFamily + */ +public class ConsensusAlgorithmFamilyTest { + /** + * Model tests for ConsensusAlgorithmFamily + */ + @Test + public void testConsensusAlgorithmFamily() { + // TODO: test ConsensusAlgorithmFamily + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumDatabaseTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumDatabaseTest.java new file mode 100644 index 00000000000..8a237b613e8 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumDatabaseTest.java @@ -0,0 +1,87 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.CactusNode; +import org.openapitools.client.model.Consortium; +import org.openapitools.client.model.ConsortiumMember; +import org.openapitools.client.model.Ledger; +import org.openapitools.client.model.PluginInstance; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConsortiumDatabase + */ +public class ConsortiumDatabaseTest { + private final ConsortiumDatabase model = new ConsortiumDatabase(); + + /** + * Model tests for ConsortiumDatabase + */ + @Test + public void testConsortiumDatabase() { + // TODO: test ConsortiumDatabase + } + + /** + * Test the property 'consortium' + */ + @Test + public void consortiumTest() { + // TODO: test consortium + } + + /** + * Test the property 'ledger' + */ + @Test + public void ledgerTest() { + // TODO: test ledger + } + + /** + * Test the property 'consortiumMember' + */ + @Test + public void consortiumMemberTest() { + // TODO: test consortiumMember + } + + /** + * Test the property 'cactusNode' + */ + @Test + public void cactusNodeTest() { + // TODO: test cactusNode + } + + /** + * Test the property 'pluginInstance' + */ + @Test + public void pluginInstanceTest() { + // TODO: test pluginInstance + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumMemberTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumMemberTest.java new file mode 100644 index 00000000000..43f201103f5 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumMemberTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConsortiumMember + */ +public class ConsortiumMemberTest { + private final ConsortiumMember model = new ConsortiumMember(); + + /** + * Model tests for ConsortiumMember + */ + @Test + public void testConsortiumMember() { + // TODO: test ConsortiumMember + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'nodeIds' + */ + @Test + public void nodeIdsTest() { + // TODO: test nodeIds + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumTest.java new file mode 100644 index 00000000000..1d96dfdea70 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsortiumTest.java @@ -0,0 +1,74 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Consortium + */ +public class ConsortiumTest { + private final Consortium model = new Consortium(); + + /** + * Model tests for Consortium + */ + @Test + public void testConsortium() { + // TODO: test Consortium + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'mainApiHost' + */ + @Test + public void mainApiHostTest() { + // TODO: test mainApiHost + } + + /** + * Test the property 'memberIds' + */ + @Test + public void memberIdsTest() { + // TODO: test memberIds + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConstantsTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConstantsTest.java new file mode 100644 index 00000000000..445d318c981 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConstantsTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Constants + */ +public class ConstantsTest { + /** + * Model tests for Constants + */ + @Test + public void testConstants() { + // TODO: test Constants + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..46022460135 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryRequestV1 + */ +public class DeleteKeychainEntryRequestV1Test { + private final DeleteKeychainEntryRequestV1 model = new DeleteKeychainEntryRequestV1(); + + /** + * Model tests for DeleteKeychainEntryRequestV1 + */ + @Test + public void testDeleteKeychainEntryRequestV1() { + // TODO: test DeleteKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..43175993188 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryResponseV1 + */ +public class DeleteKeychainEntryResponseV1Test { + private final DeleteKeychainEntryResponseV1 model = new DeleteKeychainEntryResponseV1(); + + /** + * Model tests for DeleteKeychainEntryResponseV1 + */ + @Test + public void testDeleteKeychainEntryResponseV1() { + // TODO: test DeleteKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..101ac181a3c --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryRequestV1 + */ +public class GetKeychainEntryRequestV1Test { + private final GetKeychainEntryRequestV1 model = new GetKeychainEntryRequestV1(); + + /** + * Model tests for GetKeychainEntryRequestV1 + */ + @Test + public void testGetKeychainEntryRequestV1() { + // TODO: test GetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..1b8e4eef793 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryResponseV1 + */ +public class GetKeychainEntryResponseV1Test { + private final GetKeychainEntryResponseV1 model = new GetKeychainEntryResponseV1(); + + /** + * Model tests for GetKeychainEntryResponseV1 + */ + @Test + public void testGetKeychainEntryResponseV1() { + // TODO: test GetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectRequestV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectRequestV1Test.java new file mode 100644 index 00000000000..e259b1cbe85 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetObjectRequestV1 + */ +public class GetObjectRequestV1Test { + private final GetObjectRequestV1 model = new GetObjectRequestV1(); + + /** + * Model tests for GetObjectRequestV1 + */ + @Test + public void testGetObjectRequestV1() { + // TODO: test GetObjectRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectResponseV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectResponseV1Test.java new file mode 100644 index 00000000000..5dc943fea2b --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetObjectResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetObjectResponseV1 + */ +public class GetObjectResponseV1Test { + private final GetObjectResponseV1 model = new GetObjectResponseV1(); + + /** + * Model tests for GetObjectResponseV1 + */ + @Test + public void testGetObjectResponseV1() { + // TODO: test GetObjectResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..cd69c9b6b13 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryRequestV1 + */ +public class HasKeychainEntryRequestV1Test { + private final HasKeychainEntryRequestV1 model = new HasKeychainEntryRequestV1(); + + /** + * Model tests for HasKeychainEntryRequestV1 + */ + @Test + public void testHasKeychainEntryRequestV1() { + // TODO: test HasKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..372cdaa02cf --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryResponseV1 + */ +public class HasKeychainEntryResponseV1Test { + private final HasKeychainEntryResponseV1 model = new HasKeychainEntryResponseV1(); + + /** + * Model tests for HasKeychainEntryResponseV1 + */ + @Test + public void testHasKeychainEntryResponseV1() { + // TODO: test HasKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectRequestV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectRequestV1Test.java new file mode 100644 index 00000000000..a0ec21b5663 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasObjectRequestV1 + */ +public class HasObjectRequestV1Test { + private final HasObjectRequestV1 model = new HasObjectRequestV1(); + + /** + * Model tests for HasObjectRequestV1 + */ + @Test + public void testHasObjectRequestV1() { + // TODO: test HasObjectRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectResponseV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectResponseV1Test.java new file mode 100644 index 00000000000..e0592300ed4 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasObjectResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasObjectResponseV1 + */ +public class HasObjectResponseV1Test { + private final HasObjectResponseV1 model = new HasObjectResponseV1(); + + /** + * Model tests for HasObjectResponseV1 + */ + @Test + public void testHasObjectResponseV1() { + // TODO: test HasObjectResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSGeneralTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSGeneralTest.java new file mode 100644 index 00000000000..b8b287872a7 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSGeneralTest.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.JWSRecipient; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for JWSGeneral + */ +public class JWSGeneralTest { + private final JWSGeneral model = new JWSGeneral(); + + /** + * Model tests for JWSGeneral + */ + @Test + public void testJWSGeneral() { + // TODO: test JWSGeneral + } + + /** + * Test the property 'payload' + */ + @Test + public void payloadTest() { + // TODO: test payload + } + + /** + * Test the property 'signatures' + */ + @Test + public void signaturesTest() { + // TODO: test signatures + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSRecipientTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSRecipientTest.java new file mode 100644 index 00000000000..b978cd385fb --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSRecipientTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for JWSRecipient + */ +public class JWSRecipientTest { + private final JWSRecipient model = new JWSRecipient(); + + /** + * Model tests for JWSRecipient + */ + @Test + public void testJWSRecipient() { + // TODO: test JWSRecipient + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'protected' + */ + @Test + public void protectedTest() { + // TODO: test protected + } + + /** + * Test the property 'header' + */ + @Test + public void headerTest() { + // TODO: test header + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LedgerTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LedgerTest.java new file mode 100644 index 00000000000..bd8dd7fbb5a --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LedgerTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.LedgerType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Ledger + */ +public class LedgerTest { + private final Ledger model = new Ledger(); + + /** + * Model tests for Ledger + */ + @Test + public void testLedger() { + // TODO: test Ledger + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'ledgerType' + */ + @Test + public void ledgerTypeTest() { + // TODO: test ledgerType + } + + /** + * Test the property 'consortiumMemberId' + */ + @Test + public void consortiumMemberIdTest() { + // TODO: test consortiumMemberId + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LedgerTypeTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LedgerTypeTest.java new file mode 100644 index 00000000000..0e6bdafe205 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LedgerTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for LedgerType + */ +public class LedgerTypeTest { + /** + * Model tests for LedgerType + */ + @Test + public void testLedgerType() { + // TODO: test LedgerType + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportActionTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportActionTest.java new file mode 100644 index 00000000000..7b6a5d231ec --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportActionTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for PluginImportAction + */ +public class PluginImportActionTest { + /** + * Model tests for PluginImportAction + */ + @Test + public void testPluginImportAction() { + // TODO: test PluginImportAction + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportTest.java new file mode 100644 index 00000000000..42b6fde37f0 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.PluginImportAction; +import org.openapitools.client.model.PluginImportType; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for PluginImport + */ +public class PluginImportTest { + private final PluginImport model = new PluginImport(); + + /** + * Model tests for PluginImport + */ + @Test + public void testPluginImport() { + // TODO: test PluginImport + } + + /** + * Test the property 'packageName' + */ + @Test + public void packageNameTest() { + // TODO: test packageName + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'action' + */ + @Test + public void actionTest() { + // TODO: test action + } + + /** + * Test the property 'options' + */ + @Test + public void optionsTest() { + // TODO: test options + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportTypeTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportTypeTest.java new file mode 100644 index 00000000000..f59d14c4960 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginImportTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for PluginImportType + */ +public class PluginImportTypeTest { + /** + * Model tests for PluginImportType + */ + @Test + public void testPluginImportType() { + // TODO: test PluginImportType + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginInstanceTest.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginInstanceTest.java new file mode 100644 index 00000000000..9b294b49038 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PluginInstanceTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for PluginInstance + */ +public class PluginInstanceTest { + private final PluginInstance model = new PluginInstance(); + + /** + * Model tests for PluginInstance + */ + @Test + public void testPluginInstance() { + // TODO: test PluginInstance + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'packageName' + */ + @Test + public void packageNameTest() { + // TODO: test packageName + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..9d944341d7b --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryRequestV1 + */ +public class SetKeychainEntryRequestV1Test { + private final SetKeychainEntryRequestV1 model = new SetKeychainEntryRequestV1(); + + /** + * Model tests for SetKeychainEntryRequestV1 + */ + @Test + public void testSetKeychainEntryRequestV1() { + // TODO: test SetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..1b71e9eab9b --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryResponseV1 + */ +public class SetKeychainEntryResponseV1Test { + private final SetKeychainEntryResponseV1 model = new SetKeychainEntryResponseV1(); + + /** + * Model tests for SetKeychainEntryResponseV1 + */ + @Test + public void testSetKeychainEntryResponseV1() { + // TODO: test SetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectRequestV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectRequestV1Test.java new file mode 100644 index 00000000000..1ecb4981bdf --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetObjectRequestV1 + */ +public class SetObjectRequestV1Test { + private final SetObjectRequestV1 model = new SetObjectRequestV1(); + + /** + * Model tests for SetObjectRequestV1 + */ + @Test + public void testSetObjectRequestV1() { + // TODO: test SetObjectRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectResponseV1Test.java b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectResponseV1Test.java new file mode 100644 index 00000000000..7944012a3e6 --- /dev/null +++ b/packages/cactus-core-api/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetObjectResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Core API + * Contains/describes the core API types for Cactus. Does not describe actual endpoints on its own as this is left to the implementing plugins who can import and re-use commonly needed type definitions from this specification. One example of said commonly used type definitions would be the types related to consortium management, cactus nodes, ledgers, etc.. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetObjectResponseV1 + */ +public class SetObjectResponseV1Test { + private final SetObjectResponseV1 model = new SetObjectResponseV1(); + + /** + * Model tests for SetObjectResponseV1 + */ + @Test + public void testSetObjectResponseV1() { + // TODO: test SetObjectResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-consortium-manual/package.json b/packages/cactus-plugin-consortium-manual/package.json index a390919712d..3e79a8b6ce9 100644 --- a/packages/cactus-plugin-consortium-manual/package.json +++ b/packages/cactus-plugin-consortium-manual/package.json @@ -48,6 +48,8 @@ "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..9d98f1f4079 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,15 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_get_consortium_jws_response.go +model_get_node_jws_response.go +model_jws_general.go +model_jws_recipient.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..6b3ced8e5ef --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,117 @@ +# Go API client for cactus-plugin-consortium-manual + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-consortium-manual "github.com/hyperledger/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-consortium-manual.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-consortium-manual.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-consortium-manual.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-consortium-manual.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetConsortiumJwsV1**](docs/DefaultApi.md#getconsortiumjwsv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws | Retrieves a consortium JWS +*DefaultApi* | [**GetNodeJwsV1**](docs/DefaultApi.md#getnodejwsv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws | Retrieves the JWT of a Cactus Node +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics | Get the Prometheus Metrics + + +## Documentation For Models + + - [GetConsortiumJwsResponse](docs/GetConsortiumJwsResponse.md) + - [GetNodeJwsResponse](docs/GetNodeJwsResponse.md) + - [JWSGeneral](docs/JWSGeneral.md) + - [JWSRecipient](docs/JWSRecipient.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..9c08dc9d084 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,166 @@ +openapi: 3.0.3 +info: + description: Manage a Cactus consortium through the APIs. Needs administrative privileges. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Consortium Web Service + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws: + post: + description: The JWS asserting the consortium metadata (pub keys and hosts of + nodes) + operationId: getConsortiumJwsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetConsortiumJwsRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetConsortiumJwsResponse' + description: OK + summary: Retrieves a consortium JWS + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws + /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws: + post: + operationId: getNodeJwsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetNodeJwsRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetNodeJwsResponse' + description: OK + summary: Retrieves the JWT of a Cactus Node + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws + /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics +components: + schemas: + GetNodeJwsResponse: + example: + jws: + payload: payload + signatures: + - protected: protected + signature: signature + header: + key: "" + - protected: protected + signature: signature + header: + key: "" + properties: + jws: + $ref: '#/components/schemas/JWSGeneral' + required: + - jws + type: object + GetConsortiumJwsResponse: + example: + jws: + payload: payload + signatures: + - protected: protected + signature: signature + header: + key: "" + - protected: protected + signature: signature + header: + key: "" + properties: + jws: + $ref: '#/components/schemas/JWSGeneral' + required: + - jws + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetNodeJwsRequest: + additionalProperties: false + properties: {} + type: object + GetConsortiumJwsRequest: + additionalProperties: false + properties: {} + type: object + JWSGeneral: + example: + payload: payload + signatures: + - protected: protected + signature: signature + header: + key: "" + - protected: protected + signature: signature + header: + key: "" + properties: + payload: + maxLength: 65535 + minLength: 1 + type: string + signatures: + items: + $ref: '#/components/schemas/JWSRecipient' + type: array + required: + - payload + - signatures + type: object + JWSRecipient: + description: "A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515\ + \ for info about standard." + example: + protected: protected + signature: signature + header: + key: "" + properties: + signature: + type: string + protected: + type: string + header: + additionalProperties: true + type: object + required: + - signature + type: object diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..e24f82767bb --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,332 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGetConsortiumJwsV1Request struct { + ctx context.Context + ApiService *DefaultApiService + body *map[string]interface{} +} + +func (r ApiGetConsortiumJwsV1Request) Body(body map[string]interface{}) ApiGetConsortiumJwsV1Request { + r.body = &body + return r +} + +func (r ApiGetConsortiumJwsV1Request) Execute() (*GetConsortiumJwsResponse, *http.Response, error) { + return r.ApiService.GetConsortiumJwsV1Execute(r) +} + +/* +GetConsortiumJwsV1 Retrieves a consortium JWS + +The JWS asserting the consortium metadata (pub keys and hosts of nodes) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetConsortiumJwsV1Request +*/ +func (a *DefaultApiService) GetConsortiumJwsV1(ctx context.Context) ApiGetConsortiumJwsV1Request { + return ApiGetConsortiumJwsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetConsortiumJwsResponse +func (a *DefaultApiService) GetConsortiumJwsV1Execute(r ApiGetConsortiumJwsV1Request) (*GetConsortiumJwsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetConsortiumJwsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetConsortiumJwsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetNodeJwsV1Request struct { + ctx context.Context + ApiService *DefaultApiService + body *map[string]interface{} +} + +func (r ApiGetNodeJwsV1Request) Body(body map[string]interface{}) ApiGetNodeJwsV1Request { + r.body = &body + return r +} + +func (r ApiGetNodeJwsV1Request) Execute() (*GetNodeJwsResponse, *http.Response, error) { + return r.ApiService.GetNodeJwsV1Execute(r) +} + +/* +GetNodeJwsV1 Retrieves the JWT of a Cactus Node + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetNodeJwsV1Request +*/ +func (a *DefaultApiService) GetNodeJwsV1(ctx context.Context) ApiGetNodeJwsV1Request { + return ApiGetNodeJwsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetNodeJwsResponse +func (a *DefaultApiService) GetNodeJwsV1Execute(r ApiGetNodeJwsV1Request) (*GetNodeJwsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetNodeJwsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetNodeJwsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..df8a7b32911 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Consortium Web Service API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..0735777cd48 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..cdf237b0ea1 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_get_consortium_jws_response.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_get_consortium_jws_response.go new file mode 100644 index 00000000000..b31d9789751 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_get_consortium_jws_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "encoding/json" +) + +// checks if the GetConsortiumJwsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetConsortiumJwsResponse{} + +// GetConsortiumJwsResponse struct for GetConsortiumJwsResponse +type GetConsortiumJwsResponse struct { + Jws JWSGeneral `json:"jws"` +} + +// NewGetConsortiumJwsResponse instantiates a new GetConsortiumJwsResponse 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 +// will change when the set of required properties is changed +func NewGetConsortiumJwsResponse(jws JWSGeneral) *GetConsortiumJwsResponse { + this := GetConsortiumJwsResponse{} + this.Jws = jws + return &this +} + +// NewGetConsortiumJwsResponseWithDefaults instantiates a new GetConsortiumJwsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetConsortiumJwsResponseWithDefaults() *GetConsortiumJwsResponse { + this := GetConsortiumJwsResponse{} + return &this +} + +// GetJws returns the Jws field value +func (o *GetConsortiumJwsResponse) GetJws() JWSGeneral { + if o == nil { + var ret JWSGeneral + return ret + } + + return o.Jws +} + +// GetJwsOk returns a tuple with the Jws field value +// and a boolean to check if the value has been set. +func (o *GetConsortiumJwsResponse) GetJwsOk() (*JWSGeneral, bool) { + if o == nil { + return nil, false + } + return &o.Jws, true +} + +// SetJws sets field value +func (o *GetConsortiumJwsResponse) SetJws(v JWSGeneral) { + o.Jws = v +} + +func (o GetConsortiumJwsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetConsortiumJwsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["jws"] = o.Jws + return toSerialize, nil +} + +type NullableGetConsortiumJwsResponse struct { + value *GetConsortiumJwsResponse + isSet bool +} + +func (v NullableGetConsortiumJwsResponse) Get() *GetConsortiumJwsResponse { + return v.value +} + +func (v *NullableGetConsortiumJwsResponse) Set(val *GetConsortiumJwsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetConsortiumJwsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetConsortiumJwsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetConsortiumJwsResponse(val *GetConsortiumJwsResponse) *NullableGetConsortiumJwsResponse { + return &NullableGetConsortiumJwsResponse{value: val, isSet: true} +} + +func (v NullableGetConsortiumJwsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetConsortiumJwsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_get_node_jws_response.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_get_node_jws_response.go new file mode 100644 index 00000000000..677ca3bc1ff --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_get_node_jws_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "encoding/json" +) + +// checks if the GetNodeJwsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetNodeJwsResponse{} + +// GetNodeJwsResponse struct for GetNodeJwsResponse +type GetNodeJwsResponse struct { + Jws JWSGeneral `json:"jws"` +} + +// NewGetNodeJwsResponse instantiates a new GetNodeJwsResponse 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 +// will change when the set of required properties is changed +func NewGetNodeJwsResponse(jws JWSGeneral) *GetNodeJwsResponse { + this := GetNodeJwsResponse{} + this.Jws = jws + return &this +} + +// NewGetNodeJwsResponseWithDefaults instantiates a new GetNodeJwsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetNodeJwsResponseWithDefaults() *GetNodeJwsResponse { + this := GetNodeJwsResponse{} + return &this +} + +// GetJws returns the Jws field value +func (o *GetNodeJwsResponse) GetJws() JWSGeneral { + if o == nil { + var ret JWSGeneral + return ret + } + + return o.Jws +} + +// GetJwsOk returns a tuple with the Jws field value +// and a boolean to check if the value has been set. +func (o *GetNodeJwsResponse) GetJwsOk() (*JWSGeneral, bool) { + if o == nil { + return nil, false + } + return &o.Jws, true +} + +// SetJws sets field value +func (o *GetNodeJwsResponse) SetJws(v JWSGeneral) { + o.Jws = v +} + +func (o GetNodeJwsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetNodeJwsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["jws"] = o.Jws + return toSerialize, nil +} + +type NullableGetNodeJwsResponse struct { + value *GetNodeJwsResponse + isSet bool +} + +func (v NullableGetNodeJwsResponse) Get() *GetNodeJwsResponse { + return v.value +} + +func (v *NullableGetNodeJwsResponse) Set(val *GetNodeJwsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetNodeJwsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetNodeJwsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetNodeJwsResponse(val *GetNodeJwsResponse) *NullableGetNodeJwsResponse { + return &NullableGetNodeJwsResponse{value: val, isSet: true} +} + +func (v NullableGetNodeJwsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetNodeJwsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_jws_general.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_jws_general.go new file mode 100644 index 00000000000..e7601bfc780 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_jws_general.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "encoding/json" +) + +// checks if the JWSGeneral type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JWSGeneral{} + +// JWSGeneral struct for JWSGeneral +type JWSGeneral struct { + Payload string `json:"payload"` + Signatures []JWSRecipient `json:"signatures"` +} + +// NewJWSGeneral instantiates a new JWSGeneral 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 +// will change when the set of required properties is changed +func NewJWSGeneral(payload string, signatures []JWSRecipient) *JWSGeneral { + this := JWSGeneral{} + this.Payload = payload + this.Signatures = signatures + return &this +} + +// NewJWSGeneralWithDefaults instantiates a new JWSGeneral object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJWSGeneralWithDefaults() *JWSGeneral { + this := JWSGeneral{} + return &this +} + +// GetPayload returns the Payload field value +func (o *JWSGeneral) GetPayload() string { + if o == nil { + var ret string + return ret + } + + return o.Payload +} + +// GetPayloadOk returns a tuple with the Payload field value +// and a boolean to check if the value has been set. +func (o *JWSGeneral) GetPayloadOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Payload, true +} + +// SetPayload sets field value +func (o *JWSGeneral) SetPayload(v string) { + o.Payload = v +} + +// GetSignatures returns the Signatures field value +func (o *JWSGeneral) GetSignatures() []JWSRecipient { + if o == nil { + var ret []JWSRecipient + return ret + } + + return o.Signatures +} + +// GetSignaturesOk returns a tuple with the Signatures field value +// and a boolean to check if the value has been set. +func (o *JWSGeneral) GetSignaturesOk() ([]JWSRecipient, bool) { + if o == nil { + return nil, false + } + return o.Signatures, true +} + +// SetSignatures sets field value +func (o *JWSGeneral) SetSignatures(v []JWSRecipient) { + o.Signatures = v +} + +func (o JWSGeneral) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JWSGeneral) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["payload"] = o.Payload + toSerialize["signatures"] = o.Signatures + return toSerialize, nil +} + +type NullableJWSGeneral struct { + value *JWSGeneral + isSet bool +} + +func (v NullableJWSGeneral) Get() *JWSGeneral { + return v.value +} + +func (v *NullableJWSGeneral) Set(val *JWSGeneral) { + v.value = val + v.isSet = true +} + +func (v NullableJWSGeneral) IsSet() bool { + return v.isSet +} + +func (v *NullableJWSGeneral) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJWSGeneral(val *JWSGeneral) *NullableJWSGeneral { + return &NullableJWSGeneral{value: val, isSet: true} +} + +func (v NullableJWSGeneral) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJWSGeneral) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_jws_recipient.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_jws_recipient.go new file mode 100644 index 00000000000..2eb04094654 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/model_jws_recipient.go @@ -0,0 +1,189 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "encoding/json" +) + +// checks if the JWSRecipient type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JWSRecipient{} + +// JWSRecipient A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515 for info about standard. +type JWSRecipient struct { + Signature string `json:"signature"` + Protected *string `json:"protected,omitempty"` + Header map[string]interface{} `json:"header,omitempty"` +} + +// NewJWSRecipient instantiates a new JWSRecipient 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 +// will change when the set of required properties is changed +func NewJWSRecipient(signature string) *JWSRecipient { + this := JWSRecipient{} + this.Signature = signature + return &this +} + +// NewJWSRecipientWithDefaults instantiates a new JWSRecipient object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJWSRecipientWithDefaults() *JWSRecipient { + this := JWSRecipient{} + return &this +} + +// GetSignature returns the Signature field value +func (o *JWSRecipient) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *JWSRecipient) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *JWSRecipient) SetSignature(v string) { + o.Signature = v +} + +// GetProtected returns the Protected field value if set, zero value otherwise. +func (o *JWSRecipient) GetProtected() string { + if o == nil || IsNil(o.Protected) { + var ret string + return ret + } + return *o.Protected +} + +// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JWSRecipient) GetProtectedOk() (*string, bool) { + if o == nil || IsNil(o.Protected) { + return nil, false + } + return o.Protected, true +} + +// HasProtected returns a boolean if a field has been set. +func (o *JWSRecipient) HasProtected() bool { + if o != nil && !IsNil(o.Protected) { + return true + } + + return false +} + +// SetProtected gets a reference to the given string and assigns it to the Protected field. +func (o *JWSRecipient) SetProtected(v string) { + o.Protected = &v +} + +// GetHeader returns the Header field value if set, zero value otherwise. +func (o *JWSRecipient) GetHeader() map[string]interface{} { + if o == nil || IsNil(o.Header) { + var ret map[string]interface{} + return ret + } + return o.Header +} + +// GetHeaderOk returns a tuple with the Header field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JWSRecipient) GetHeaderOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Header) { + return map[string]interface{}{}, false + } + return o.Header, true +} + +// HasHeader returns a boolean if a field has been set. +func (o *JWSRecipient) HasHeader() bool { + if o != nil && !IsNil(o.Header) { + return true + } + + return false +} + +// SetHeader gets a reference to the given map[string]interface{} and assigns it to the Header field. +func (o *JWSRecipient) SetHeader(v map[string]interface{}) { + o.Header = v +} + +func (o JWSRecipient) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JWSRecipient) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["signature"] = o.Signature + if !IsNil(o.Protected) { + toSerialize["protected"] = o.Protected + } + if !IsNil(o.Header) { + toSerialize["header"] = o.Header + } + return toSerialize, nil +} + +type NullableJWSRecipient struct { + value *JWSRecipient + isSet bool +} + +func (v NullableJWSRecipient) Get() *JWSRecipient { + return v.value +} + +func (v *NullableJWSRecipient) Set(val *JWSRecipient) { + v.value = val + v.isSet = true +} + +func (v NullableJWSRecipient) IsSet() bool { + return v.isSet +} + +func (v *NullableJWSRecipient) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJWSRecipient(val *JWSRecipient) *NullableJWSRecipient { + return &NullableJWSRecipient{value: val, isSet: true} +} + +func (v NullableJWSRecipient) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJWSRecipient) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..1de463fdce5 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..7d4d058051a --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,61 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-consortium-manual + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-consortium-manual_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService GetConsortiumJwsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetConsortiumJwsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetNodeJwsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetNodeJwsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPrometheusMetricsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPrometheusMetricsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..e49e8872bf1 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Consortium Web Service + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-consortium-manual + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..efc24373da3 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - Consortium Web Service + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..65ef8324777 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,40 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/GetConsortiumJwsResponse.java +src/main/java/org/openapitools/client/model/GetNodeJwsResponse.java +src/main/java/org/openapitools/client/model/JWSGeneral.java +src/main/java/org/openapitools/client/model/JWSRecipient.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/GetConsortiumJwsResponseTest.java +src/test/java/org/openapitools/client/model/GetNodeJwsResponseTest.java +src/test/java/org/openapitools/client/model/JWSGeneralTest.java +src/test/java/org/openapitools/client/model/JWSRecipientTest.java diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..697071987ab --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,142 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Consortium Web Service +- API version: v2.0.0-alpha.2 + +Manage a Cactus consortium through the APIs. Needs administrative privileges. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + Object body = null; // Object | + try { + GetConsortiumJwsResponse result = apiInstance.getConsortiumJwsV1(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getConsortiumJwsV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**getConsortiumJwsV1**](docs/DefaultApi.md#getConsortiumJwsV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws | Retrieves a consortium JWS +*DefaultApi* | [**getNodeJwsV1**](docs/DefaultApi.md#getNodeJwsV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws | Retrieves the JWT of a Cactus Node +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics | Get the Prometheus Metrics + + +## Documentation for Models + + - [GetConsortiumJwsResponse](docs/GetConsortiumJwsResponse.md) + - [GetNodeJwsResponse](docs/GetNodeJwsResponse.md) + - [JWSGeneral](docs/JWSGeneral.md) + - [JWSRecipient](docs/JWSRecipient.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..9829c313a71 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,172 @@ +openapi: 3.0.3 +info: + description: Manage a Cactus consortium through the APIs. Needs administrative privileges. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Consortium Web Service + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws: + post: + description: The JWS asserting the consortium metadata (pub keys and hosts of + nodes) + operationId: getConsortiumJwsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetConsortiumJwsRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetConsortiumJwsResponse' + description: OK + summary: Retrieves a consortium JWS + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws: + post: + operationId: getNodeJwsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetNodeJwsRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetNodeJwsResponse' + description: OK + summary: Retrieves the JWT of a Cactus Node + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics + x-accepts: text/plain +components: + schemas: + GetNodeJwsResponse: + example: + jws: + payload: payload + signatures: + - protected: protected + signature: signature + header: + key: "" + - protected: protected + signature: signature + header: + key: "" + properties: + jws: + $ref: '#/components/schemas/JWSGeneral' + required: + - jws + type: object + GetConsortiumJwsResponse: + example: + jws: + payload: payload + signatures: + - protected: protected + signature: signature + header: + key: "" + - protected: protected + signature: signature + header: + key: "" + properties: + jws: + $ref: '#/components/schemas/JWSGeneral' + required: + - jws + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetNodeJwsRequest: + additionalProperties: false + properties: {} + type: object + GetConsortiumJwsRequest: + additionalProperties: false + properties: {} + type: object + JWSGeneral: + example: + payload: payload + signatures: + - protected: protected + signature: signature + header: + key: "" + - protected: protected + signature: signature + header: + key: "" + properties: + payload: + maxLength: 65535 + minLength: 1 + type: string + signatures: + items: + $ref: '#/components/schemas/JWSRecipient' + type: array + required: + - payload + - signatures + type: object + JWSRecipient: + description: "A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515\ + \ for info about standard." + example: + protected: protected + signature: signature + header: + key: "" + properties: + signature: + type: string + protected: + type: string + header: + additionalProperties: true + type: object + required: + - signature + type: object + diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..d8b7dd88540 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..7fb63b907b2 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..cb081fb6404 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..0d41d587b13 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..4d5d3cf9ae9 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..48e540a43f5 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..29dd398b74c --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,404 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.GetConsortiumJwsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetNodeJwsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.JWSGeneral.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.JWSRecipient.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); + } + } + } + + /** + * 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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..99e2790b60e --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..45b49fe6f20 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..1970e4c3d2b --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..1e283bd3ea9 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..3435b3614ea --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,426 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.GetConsortiumJwsResponse; +import org.openapitools.client.model.GetNodeJwsResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 getConsortiumJwsV1 + * @param body (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getConsortiumJwsV1Call(Object body, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/consortium/jws"; + + 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 getConsortiumJwsV1ValidateBeforeCall(Object body, final ApiCallback _callback) throws ApiException { + return getConsortiumJwsV1Call(body, _callback); + + } + + /** + * Retrieves a consortium JWS + * The JWS asserting the consortium metadata (pub keys and hosts of nodes) + * @param body (optional) + * @return GetConsortiumJwsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetConsortiumJwsResponse getConsortiumJwsV1(Object body) throws ApiException { + ApiResponse localVarResp = getConsortiumJwsV1WithHttpInfo(body); + return localVarResp.getData(); + } + + /** + * Retrieves a consortium JWS + * The JWS asserting the consortium metadata (pub keys and hosts of nodes) + * @param body (optional) + * @return ApiResponse<GetConsortiumJwsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getConsortiumJwsV1WithHttpInfo(Object body) throws ApiException { + okhttp3.Call localVarCall = getConsortiumJwsV1ValidateBeforeCall(body, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves a consortium JWS (asynchronously) + * The JWS asserting the consortium metadata (pub keys and hosts of nodes) + * @param body (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getConsortiumJwsV1Async(Object body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getConsortiumJwsV1ValidateBeforeCall(body, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getNodeJwsV1 + * @param body (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getNodeJwsV1Call(Object body, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/node/jws"; + + 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 getNodeJwsV1ValidateBeforeCall(Object body, final ApiCallback _callback) throws ApiException { + return getNodeJwsV1Call(body, _callback); + + } + + /** + * Retrieves the JWT of a Cactus Node + * + * @param body (optional) + * @return GetNodeJwsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetNodeJwsResponse getNodeJwsV1(Object body) throws ApiException { + ApiResponse localVarResp = getNodeJwsV1WithHttpInfo(body); + return localVarResp.getData(); + } + + /** + * Retrieves the JWT of a Cactus Node + * + * @param body (optional) + * @return ApiResponse<GetNodeJwsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getNodeJwsV1WithHttpInfo(Object body) throws ApiException { + okhttp3.Call localVarCall = getNodeJwsV1ValidateBeforeCall(body, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the JWT of a Cactus Node (asynchronously) + * + * @param body (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getNodeJwsV1Async(Object body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getNodeJwsV1ValidateBeforeCall(body, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-consortium-manual/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + 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 getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..49cf82fd786 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..9f77145504a --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..113551d074c --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..730ec8e8f4d --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..d76ab94e6c6 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetConsortiumJwsResponse.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetConsortiumJwsResponse.java new file mode 100644 index 00000000000..a809df9afe3 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetConsortiumJwsResponse.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.JWSGeneral; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetConsortiumJwsResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetConsortiumJwsResponse { + public static final String SERIALIZED_NAME_JWS = "jws"; + @SerializedName(SERIALIZED_NAME_JWS) + private JWSGeneral jws; + + public GetConsortiumJwsResponse() { + } + + public GetConsortiumJwsResponse jws(JWSGeneral jws) { + + this.jws = jws; + return this; + } + + /** + * Get jws + * @return jws + **/ + @javax.annotation.Nonnull + public JWSGeneral getJws() { + return jws; + } + + + public void setJws(JWSGeneral jws) { + this.jws = jws; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetConsortiumJwsResponse getConsortiumJwsResponse = (GetConsortiumJwsResponse) o; + return Objects.equals(this.jws, getConsortiumJwsResponse.jws); + } + + @Override + public int hashCode() { + return Objects.hash(jws); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetConsortiumJwsResponse {\n"); + sb.append(" jws: ").append(toIndentedString(jws)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("jws"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("jws"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetConsortiumJwsResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetConsortiumJwsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetConsortiumJwsResponse is not found in the empty JSON string", GetConsortiumJwsResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetConsortiumJwsResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetConsortiumJwsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetConsortiumJwsResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `jws` + JWSGeneral.validateJsonObject(jsonObj.getAsJsonObject("jws")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetConsortiumJwsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetConsortiumJwsResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetConsortiumJwsResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetConsortiumJwsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetConsortiumJwsResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetConsortiumJwsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetConsortiumJwsResponse + * @throws IOException if the JSON string is invalid with respect to GetConsortiumJwsResponse + */ + public static GetConsortiumJwsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetConsortiumJwsResponse.class); + } + + /** + * Convert an instance of GetConsortiumJwsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetNodeJwsResponse.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetNodeJwsResponse.java new file mode 100644 index 00000000000..458542af722 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetNodeJwsResponse.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.JWSGeneral; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetNodeJwsResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetNodeJwsResponse { + public static final String SERIALIZED_NAME_JWS = "jws"; + @SerializedName(SERIALIZED_NAME_JWS) + private JWSGeneral jws; + + public GetNodeJwsResponse() { + } + + public GetNodeJwsResponse jws(JWSGeneral jws) { + + this.jws = jws; + return this; + } + + /** + * Get jws + * @return jws + **/ + @javax.annotation.Nonnull + public JWSGeneral getJws() { + return jws; + } + + + public void setJws(JWSGeneral jws) { + this.jws = jws; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetNodeJwsResponse getNodeJwsResponse = (GetNodeJwsResponse) o; + return Objects.equals(this.jws, getNodeJwsResponse.jws); + } + + @Override + public int hashCode() { + return Objects.hash(jws); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetNodeJwsResponse {\n"); + sb.append(" jws: ").append(toIndentedString(jws)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("jws"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("jws"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetNodeJwsResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetNodeJwsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetNodeJwsResponse is not found in the empty JSON string", GetNodeJwsResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetNodeJwsResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetNodeJwsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetNodeJwsResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `jws` + JWSGeneral.validateJsonObject(jsonObj.getAsJsonObject("jws")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetNodeJwsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetNodeJwsResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetNodeJwsResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetNodeJwsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetNodeJwsResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetNodeJwsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetNodeJwsResponse + * @throws IOException if the JSON string is invalid with respect to GetNodeJwsResponse + */ + public static GetNodeJwsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetNodeJwsResponse.class); + } + + /** + * Convert an instance of GetNodeJwsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSGeneral.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSGeneral.java new file mode 100644 index 00000000000..3b21d1e3150 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSGeneral.java @@ -0,0 +1,266 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.JWSRecipient; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * JWSGeneral + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JWSGeneral { + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private String payload; + + public static final String SERIALIZED_NAME_SIGNATURES = "signatures"; + @SerializedName(SERIALIZED_NAME_SIGNATURES) + private List signatures = new ArrayList<>(); + + public JWSGeneral() { + } + + public JWSGeneral payload(String payload) { + + this.payload = payload; + return this; + } + + /** + * Get payload + * @return payload + **/ + @javax.annotation.Nonnull + public String getPayload() { + return payload; + } + + + public void setPayload(String payload) { + this.payload = payload; + } + + + public JWSGeneral signatures(List signatures) { + + this.signatures = signatures; + return this; + } + + public JWSGeneral addSignaturesItem(JWSRecipient signaturesItem) { + if (this.signatures == null) { + this.signatures = new ArrayList<>(); + } + this.signatures.add(signaturesItem); + return this; + } + + /** + * Get signatures + * @return signatures + **/ + @javax.annotation.Nonnull + public List getSignatures() { + return signatures; + } + + + public void setSignatures(List signatures) { + this.signatures = signatures; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JWSGeneral jwSGeneral = (JWSGeneral) o; + return Objects.equals(this.payload, jwSGeneral.payload) && + Objects.equals(this.signatures, jwSGeneral.signatures); + } + + @Override + public int hashCode() { + return Objects.hash(payload, signatures); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JWSGeneral {\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append(" signatures: ").append(toIndentedString(signatures)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("payload"); + openapiFields.add("signatures"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("payload"); + openapiRequiredFields.add("signatures"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JWSGeneral + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!JWSGeneral.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JWSGeneral is not found in the empty JSON string", JWSGeneral.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JWSGeneral.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JWSGeneral` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JWSGeneral.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("payload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payload").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("signatures").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `signatures` to be an array in the JSON string but got `%s`", jsonObj.get("signatures").toString())); + } + + JsonArray jsonArraysignatures = jsonObj.getAsJsonArray("signatures"); + // validate the required field `signatures` (array) + for (int i = 0; i < jsonArraysignatures.size(); i++) { + JWSRecipient.validateJsonObject(jsonArraysignatures.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JWSGeneral.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JWSGeneral' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JWSGeneral.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JWSGeneral value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JWSGeneral read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JWSGeneral given an JSON string + * + * @param jsonString JSON string + * @return An instance of JWSGeneral + * @throws IOException if the JSON string is invalid with respect to JWSGeneral + */ + public static JWSGeneral fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JWSGeneral.class); + } + + /** + * Convert an instance of JWSGeneral to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSRecipient.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSRecipient.java new file mode 100644 index 00000000000..1bd501d557f --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JWSRecipient.java @@ -0,0 +1,285 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * A JSON Web Signature. See: https://tools.ietf.org/html/rfc7515 for info about standard. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JWSRecipient { + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_PROTECTED = "protected"; + @SerializedName(SERIALIZED_NAME_PROTECTED) + private String protected; + + public static final String SERIALIZED_NAME_HEADER = "header"; + @SerializedName(SERIALIZED_NAME_HEADER) + private Map header = new HashMap<>(); + + public JWSRecipient() { + } + + public JWSRecipient signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public JWSRecipient protected(String protected) { + + this.protected = protected; + return this; + } + + /** + * Get protected + * @return protected + **/ + @javax.annotation.Nullable + public String getProtected() { + return protected; + } + + + public void setProtected(String protected) { + this.protected = protected; + } + + + public JWSRecipient header(Map header) { + + this.header = header; + return this; + } + + public JWSRecipient putHeaderItem(String key, Object headerItem) { + if (this.header == null) { + this.header = new HashMap<>(); + } + this.header.put(key, headerItem); + return this; + } + + /** + * Get header + * @return header + **/ + @javax.annotation.Nullable + public Map getHeader() { + return header; + } + + + public void setHeader(Map header) { + this.header = header; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JWSRecipient jwSRecipient = (JWSRecipient) o; + return Objects.equals(this.signature, jwSRecipient.signature) && + Objects.equals(this.protected, jwSRecipient.protected) && + Objects.equals(this.header, jwSRecipient.header); + } + + @Override + public int hashCode() { + return Objects.hash(signature, protected, header); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JWSRecipient {\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" protected: ").append(toIndentedString(protected)).append("\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("signature"); + openapiFields.add("protected"); + openapiFields.add("header"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JWSRecipient + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!JWSRecipient.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JWSRecipient is not found in the empty JSON string", JWSRecipient.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JWSRecipient.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JWSRecipient` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JWSRecipient.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if ((jsonObj.get("protected") != null && !jsonObj.get("protected").isJsonNull()) && !jsonObj.get("protected").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `protected` to be a primitive type in the JSON string but got `%s`", jsonObj.get("protected").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JWSRecipient.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JWSRecipient' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JWSRecipient.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JWSRecipient value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JWSRecipient read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JWSRecipient given an JSON string + * + * @param jsonString JSON string + * @return An instance of JWSRecipient + * @throws IOException if the JSON string is invalid with respect to JWSRecipient + */ + public static JWSRecipient fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JWSRecipient.class); + } + + /** + * Convert an instance of JWSRecipient to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..d5728b368c4 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,72 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.GetConsortiumJwsResponse; +import org.openapitools.client.model.GetNodeJwsResponse; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Retrieves a consortium JWS + * + * The JWS asserting the consortium metadata (pub keys and hosts of nodes) + * + * @throws ApiException if the Api call fails + */ + @Test + public void getConsortiumJwsV1Test() throws ApiException { + Object body = null; + GetConsortiumJwsResponse response = api.getConsortiumJwsV1(body); + // TODO: test validations + } + + /** + * Retrieves the JWT of a Cactus Node + * + * @throws ApiException if the Api call fails + */ + @Test + public void getNodeJwsV1Test() throws ApiException { + Object body = null; + GetNodeJwsResponse response = api.getNodeJwsV1(body); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetConsortiumJwsResponseTest.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetConsortiumJwsResponseTest.java new file mode 100644 index 00000000000..81a6bf1f52b --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetConsortiumJwsResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.JWSGeneral; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetConsortiumJwsResponse + */ +public class GetConsortiumJwsResponseTest { + private final GetConsortiumJwsResponse model = new GetConsortiumJwsResponse(); + + /** + * Model tests for GetConsortiumJwsResponse + */ + @Test + public void testGetConsortiumJwsResponse() { + // TODO: test GetConsortiumJwsResponse + } + + /** + * Test the property 'jws' + */ + @Test + public void jwsTest() { + // TODO: test jws + } + +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetNodeJwsResponseTest.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetNodeJwsResponseTest.java new file mode 100644 index 00000000000..10a2e7134f1 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetNodeJwsResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.JWSGeneral; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetNodeJwsResponse + */ +public class GetNodeJwsResponseTest { + private final GetNodeJwsResponse model = new GetNodeJwsResponse(); + + /** + * Model tests for GetNodeJwsResponse + */ + @Test + public void testGetNodeJwsResponse() { + // TODO: test GetNodeJwsResponse + } + + /** + * Test the property 'jws' + */ + @Test + public void jwsTest() { + // TODO: test jws + } + +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSGeneralTest.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSGeneralTest.java new file mode 100644 index 00000000000..0c4a9e42227 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSGeneralTest.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.JWSRecipient; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for JWSGeneral + */ +public class JWSGeneralTest { + private final JWSGeneral model = new JWSGeneral(); + + /** + * Model tests for JWSGeneral + */ + @Test + public void testJWSGeneral() { + // TODO: test JWSGeneral + } + + /** + * Test the property 'payload' + */ + @Test + public void payloadTest() { + // TODO: test payload + } + + /** + * Test the property 'signatures' + */ + @Test + public void signaturesTest() { + // TODO: test signatures + } + +} diff --git a/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSRecipientTest.java b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSRecipientTest.java new file mode 100644 index 00000000000..7d3ca03e481 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JWSRecipientTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Consortium Web Service + * Manage a Cactus consortium through the APIs. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for JWSRecipient + */ +public class JWSRecipientTest { + private final JWSRecipient model = new JWSRecipient(); + + /** + * Model tests for JWSRecipient + */ + @Test + public void testJWSRecipient() { + // TODO: test JWSRecipient + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'protected' + */ + @Test + public void protectedTest() { + // TODO: test protected + } + + /** + * Test the property 'header' + */ + @Test + public void headerTest() { + // TODO: test header + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/package.json b/packages/cactus-plugin-htlc-eth-besu-erc20/package.json index 73f1ca3d52e..292c8855135 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/package.json +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/package.json @@ -53,6 +53,8 @@ "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..c7560138262 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,26 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_get_single_status_request.go +model_get_status_request.go +model_initialize_request.go +model_invoke_contract_v1_response.go +model_new_contract_request.go +model_new_contract_request_gas.go +model_refund_request.go +model_run_transaction_response.go +model_web3_signing_credential.go +model_web3_signing_credential_cactus_keychain_ref.go +model_web3_signing_credential_none.go +model_web3_signing_credential_private_key_hex.go +model_web3_signing_credential_type.go +model_web3_transaction_receipt.go +model_withdraw_request.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..443488ca2e3 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,131 @@ +# Go API client for cactus-plugin-htlc-eth-besu-erc20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-htlc-eth-besu-erc20 "github.com/hyperledger/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-eth-besu-erc20.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-eth-besu-erc20.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-eth-besu-erc20.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-htlc-eth-besu-erc20.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetSingleStatusV1**](docs/DefaultApi.md#getsinglestatusv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-single-status | +*DefaultApi* | [**GetStatusV1**](docs/DefaultApi.md#getstatusv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-status | +*DefaultApi* | [**InitializeV1**](docs/DefaultApi.md#initializev1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize | Initialize contract +*DefaultApi* | [**NewContractV1**](docs/DefaultApi.md#newcontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract | Create a new hashtimelock contract +*DefaultApi* | [**RefundV1**](docs/DefaultApi.md#refundv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/refund | Refund a hashtimelock contract +*DefaultApi* | [**WithdrawV1**](docs/DefaultApi.md#withdrawv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/withdraw | Withdraw a hashtimelock contract + + +## Documentation For Models + + - [GetSingleStatusRequest](docs/GetSingleStatusRequest.md) + - [GetStatusRequest](docs/GetStatusRequest.md) + - [InitializeRequest](docs/InitializeRequest.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [NewContractRequest](docs/NewContractRequest.md) + - [NewContractRequestGas](docs/NewContractRequestGas.md) + - [RefundRequest](docs/RefundRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + - [WithdrawRequest](docs/WithdrawRequest.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..199b7bb7306 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,575 @@ +openapi: 3.0.3 +info: + description: Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize: + post: + operationId: initializeV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InitializeRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + summary: Initialize contract + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/withdraw: + post: + operationId: withdrawV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WithdrawRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Withdraw a hashtimelock contract + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/withdraw + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-status: + post: + operationId: getStatusV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetStatusRequest' + responses: + "200": + content: + application/json: + schema: + items: + format: uint256 + type: integer + type: array + description: Array of status + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-status + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-single-status: + post: + operationId: getSingleStatusV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetSingleStatusRequest' + responses: + "200": + content: + application/json: + schema: + format: uint256 + type: integer + description: Status + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-single-status + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/refund: + post: + operationId: refundV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RefundRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Refund a hashtimelock contract + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/refund + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract: + post: + operationId: newContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NewContractRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Create a new hashtimelock contract + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract +components: + responses: + GetStatusResponse: + content: + application/json: + schema: + items: + format: uint256 + type: integer + type: array + description: Array of status + GetSingleStatusResponse: + content: + application/json: + schema: + format: uint256 + type: integer + description: Status + schemas: + NewContractRequest: + additionalProperties: false + example: + receiver: receiver + outputAmount: 6.027456183070403 + outputNetwork: outputNetwork + connectorId: connectorId + hashLock: hashLock + contractAddress: contractAddress + inputAmount: 0.8008281904610115 + tokenAddress: tokenAddress + outputAddress: outputAddress + keychainId: keychainId + gas: null + web3SigningCredential: + type: null + expiration: 1.4658129805029452 + properties: + contractAddress: + description: Contract address + nullable: false + type: string + inputAmount: + description: Input amount to lock + nullable: false + type: number + outputAmount: + description: Output amount to lock + nullable: false + type: number + expiration: + description: Timestamp to expire the contract + nullable: false + type: number + hashLock: + description: Hashlock needed to refund the amount + nullable: false + type: string + tokenAddress: + description: The token address + nullable: false + type: string + receiver: + description: The receiver address + nullable: false + type: string + outputNetwork: + description: The output network id + nullable: false + type: string + outputAddress: + description: The output address to receive the tokens + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychian plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractRequest_gas' + required: + - connectorId + - contractAddress + - expiration + - hashLock + - inputAmount + - keychainId + - outputAddress + - outputAmount + - outputNetwork + - receiver + - tokenAddress + - web3SigningCredential + type: object + RefundRequest: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + gas: null + web3SigningCredential: + type: null + id: id + properties: + id: + description: Contract htlc id for refund + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractRequest_gas' + required: + - connectorId + - id + - keychainId + - web3SigningCredential + type: object + WithdrawRequest: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + gas: null + web3SigningCredential: + type: null + id: id + secret: secret + properties: + id: + description: Contract locked id + nullable: false + type: string + secret: + description: Secret need to unlock the contract + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractRequest_gas' + required: + - connectorId + - id + - keychainId + - secret + - web3SigningCredential + type: object + GetStatusRequest: + additionalProperties: false + description: Defines the parameters for retrieving the status of the HTLC swap. + example: + keychainId: keychainId + connectorId: connectorId + ids: + - ids + - ids + web3SigningCredential: + type: null + properties: + ids: + items: + type: string + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + type: string + keychainId: + type: string + required: + - connectorId + - ids + - keychainId + - web3SigningCredential + type: object + GetSingleStatusRequest: + additionalProperties: false + description: Defines the parameters for retrieving the single status of the + HTLC swap. + example: + keychainId: keychainId + connectorId: connectorId + web3SigningCredential: + type: null + id: id + properties: + id: + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + type: string + keychainId: + type: string + required: + - connectorId + - id + - keychainId + - web3SigningCredential + type: object + InitializeRequest: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + constructorArgs: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + properties: + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + type: number + required: + - connectorId + - constructorArgs + - keychainId + - web3SigningCredential + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + NewContractRequest_gas: + oneOf: + - type: string + - type: number diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..6d027dedf12 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,653 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGetSingleStatusV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getSingleStatusRequest *GetSingleStatusRequest +} + +func (r ApiGetSingleStatusV1Request) GetSingleStatusRequest(getSingleStatusRequest GetSingleStatusRequest) ApiGetSingleStatusV1Request { + r.getSingleStatusRequest = &getSingleStatusRequest + return r +} + +func (r ApiGetSingleStatusV1Request) Execute() (int32, *http.Response, error) { + return r.ApiService.GetSingleStatusV1Execute(r) +} + +/* +GetSingleStatusV1 Method for GetSingleStatusV1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetSingleStatusV1Request +*/ +func (a *DefaultApiService) GetSingleStatusV1(ctx context.Context) ApiGetSingleStatusV1Request { + return ApiGetSingleStatusV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return int32 +func (a *DefaultApiService) GetSingleStatusV1Execute(r ApiGetSingleStatusV1Request) (int32, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue int32 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSingleStatusV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-single-status" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getSingleStatusRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetStatusV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getStatusRequest *GetStatusRequest +} + +func (r ApiGetStatusV1Request) GetStatusRequest(getStatusRequest GetStatusRequest) ApiGetStatusV1Request { + r.getStatusRequest = &getStatusRequest + return r +} + +func (r ApiGetStatusV1Request) Execute() ([]int32, *http.Response, error) { + return r.ApiService.GetStatusV1Execute(r) +} + +/* +GetStatusV1 Method for GetStatusV1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetStatusV1Request +*/ +func (a *DefaultApiService) GetStatusV1(ctx context.Context) ApiGetStatusV1Request { + return ApiGetStatusV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []int32 +func (a *DefaultApiService) GetStatusV1Execute(r ApiGetStatusV1Request) ([]int32, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []int32 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetStatusV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-status" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getStatusRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInitializeV1Request struct { + ctx context.Context + ApiService *DefaultApiService + initializeRequest *InitializeRequest +} + +func (r ApiInitializeV1Request) InitializeRequest(initializeRequest InitializeRequest) ApiInitializeV1Request { + r.initializeRequest = &initializeRequest + return r +} + +func (r ApiInitializeV1Request) Execute() (*RunTransactionResponse, *http.Response, error) { + return r.ApiService.InitializeV1Execute(r) +} + +/* +InitializeV1 Initialize contract + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInitializeV1Request +*/ +func (a *DefaultApiService) InitializeV1(ctx context.Context) ApiInitializeV1Request { + return ApiInitializeV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionResponse +func (a *DefaultApiService) InitializeV1Execute(r ApiInitializeV1Request) (*RunTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InitializeV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.initializeRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiNewContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + newContractRequest *NewContractRequest +} + +func (r ApiNewContractV1Request) NewContractRequest(newContractRequest NewContractRequest) ApiNewContractV1Request { + r.newContractRequest = &newContractRequest + return r +} + +func (r ApiNewContractV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.NewContractV1Execute(r) +} + +/* +NewContractV1 Create a new hashtimelock contract + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiNewContractV1Request +*/ +func (a *DefaultApiService) NewContractV1(ctx context.Context) ApiNewContractV1Request { + return ApiNewContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) NewContractV1Execute(r ApiNewContractV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.NewContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.newContractRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRefundV1Request struct { + ctx context.Context + ApiService *DefaultApiService + refundRequest *RefundRequest +} + +func (r ApiRefundV1Request) RefundRequest(refundRequest RefundRequest) ApiRefundV1Request { + r.refundRequest = &refundRequest + return r +} + +func (r ApiRefundV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.RefundV1Execute(r) +} + +/* +RefundV1 Refund a hashtimelock contract + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRefundV1Request +*/ +func (a *DefaultApiService) RefundV1(ctx context.Context) ApiRefundV1Request { + return ApiRefundV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) RefundV1Execute(r ApiRefundV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RefundV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/refund" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.refundRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWithdrawV1Request struct { + ctx context.Context + ApiService *DefaultApiService + withdrawRequest *WithdrawRequest +} + +func (r ApiWithdrawV1Request) WithdrawRequest(withdrawRequest WithdrawRequest) ApiWithdrawV1Request { + r.withdrawRequest = &withdrawRequest + return r +} + +func (r ApiWithdrawV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.WithdrawV1Execute(r) +} + +/* +WithdrawV1 Withdraw a hashtimelock contract + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWithdrawV1Request +*/ +func (a *DefaultApiService) WithdrawV1(ctx context.Context) ApiWithdrawV1Request { + return ApiWithdrawV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) WithdrawV1Execute(r ApiWithdrawV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.WithdrawV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/withdraw" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.withdrawRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..dd65d0c35b2 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..70ab904d70a --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..08190890c0e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_get_single_status_request.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_get_single_status_request.go new file mode 100644 index 00000000000..d71a6398e6a --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_get_single_status_request.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the GetSingleStatusRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetSingleStatusRequest{} + +// GetSingleStatusRequest Defines the parameters for retrieving the single status of the HTLC swap. +type GetSingleStatusRequest struct { + Id string `json:"id"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + ConnectorId string `json:"connectorId"` + KeychainId string `json:"keychainId"` +} + +// NewGetSingleStatusRequest instantiates a new GetSingleStatusRequest 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 +// will change when the set of required properties is changed +func NewGetSingleStatusRequest(id string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *GetSingleStatusRequest { + this := GetSingleStatusRequest{} + this.Id = id + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewGetSingleStatusRequestWithDefaults instantiates a new GetSingleStatusRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetSingleStatusRequestWithDefaults() *GetSingleStatusRequest { + this := GetSingleStatusRequest{} + return &this +} + +// GetId returns the Id field value +func (o *GetSingleStatusRequest) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *GetSingleStatusRequest) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetSingleStatusRequest) SetId(v string) { + o.Id = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *GetSingleStatusRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *GetSingleStatusRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *GetSingleStatusRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *GetSingleStatusRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *GetSingleStatusRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *GetSingleStatusRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *GetSingleStatusRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *GetSingleStatusRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *GetSingleStatusRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o GetSingleStatusRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetSingleStatusRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableGetSingleStatusRequest struct { + value *GetSingleStatusRequest + isSet bool +} + +func (v NullableGetSingleStatusRequest) Get() *GetSingleStatusRequest { + return v.value +} + +func (v *NullableGetSingleStatusRequest) Set(val *GetSingleStatusRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGetSingleStatusRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGetSingleStatusRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetSingleStatusRequest(val *GetSingleStatusRequest) *NullableGetSingleStatusRequest { + return &NullableGetSingleStatusRequest{value: val, isSet: true} +} + +func (v NullableGetSingleStatusRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetSingleStatusRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_get_status_request.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_get_status_request.go new file mode 100644 index 00000000000..87ea63e115c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_get_status_request.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the GetStatusRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetStatusRequest{} + +// GetStatusRequest Defines the parameters for retrieving the status of the HTLC swap. +type GetStatusRequest struct { + Ids []string `json:"ids"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + ConnectorId string `json:"connectorId"` + KeychainId string `json:"keychainId"` +} + +// NewGetStatusRequest instantiates a new GetStatusRequest 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 +// will change when the set of required properties is changed +func NewGetStatusRequest(ids []string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *GetStatusRequest { + this := GetStatusRequest{} + this.Ids = ids + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewGetStatusRequestWithDefaults instantiates a new GetStatusRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetStatusRequestWithDefaults() *GetStatusRequest { + this := GetStatusRequest{} + return &this +} + +// GetIds returns the Ids field value +func (o *GetStatusRequest) GetIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.Ids +} + +// GetIdsOk returns a tuple with the Ids field value +// and a boolean to check if the value has been set. +func (o *GetStatusRequest) GetIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Ids, true +} + +// SetIds sets field value +func (o *GetStatusRequest) SetIds(v []string) { + o.Ids = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *GetStatusRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *GetStatusRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *GetStatusRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *GetStatusRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *GetStatusRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *GetStatusRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *GetStatusRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *GetStatusRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *GetStatusRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o GetStatusRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetStatusRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["ids"] = o.Ids + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableGetStatusRequest struct { + value *GetStatusRequest + isSet bool +} + +func (v NullableGetStatusRequest) Get() *GetStatusRequest { + return v.value +} + +func (v *NullableGetStatusRequest) Set(val *GetStatusRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGetStatusRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGetStatusRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetStatusRequest(val *GetStatusRequest) *NullableGetStatusRequest { + return &NullableGetStatusRequest{value: val, isSet: true} +} + +func (v NullableGetStatusRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetStatusRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_initialize_request.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_initialize_request.go new file mode 100644 index 00000000000..ebf5ac71633 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_initialize_request.go @@ -0,0 +1,236 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the InitializeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InitializeRequest{} + +// InitializeRequest struct for InitializeRequest +type InitializeRequest struct { + // connectorId for the connector besu plugin + ConnectorId string `json:"connectorId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + ConstructorArgs []interface{} `json:"constructorArgs"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + Gas *float32 `json:"gas,omitempty"` +} + +// NewInitializeRequest instantiates a new InitializeRequest 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 +// will change when the set of required properties is changed +func NewInitializeRequest(connectorId string, keychainId string, constructorArgs []interface{}, web3SigningCredential Web3SigningCredential) *InitializeRequest { + this := InitializeRequest{} + this.ConnectorId = connectorId + this.KeychainId = keychainId + this.ConstructorArgs = constructorArgs + this.Web3SigningCredential = web3SigningCredential + return &this +} + +// NewInitializeRequestWithDefaults instantiates a new InitializeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInitializeRequestWithDefaults() *InitializeRequest { + this := InitializeRequest{} + return &this +} + +// GetConnectorId returns the ConnectorId field value +func (o *InitializeRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *InitializeRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *InitializeRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *InitializeRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetConstructorArgs returns the ConstructorArgs field value +func (o *InitializeRequest) GetConstructorArgs() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ConstructorArgs, true +} + +// SetConstructorArgs sets field value +func (o *InitializeRequest) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *InitializeRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *InitializeRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *InitializeRequest) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *InitializeRequest) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *InitializeRequest) SetGas(v float32) { + o.Gas = &v +} + +func (o InitializeRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InitializeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + toSerialize["constructorArgs"] = o.ConstructorArgs + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableInitializeRequest struct { + value *InitializeRequest + isSet bool +} + +func (v NullableInitializeRequest) Get() *InitializeRequest { + return v.value +} + +func (v *NullableInitializeRequest) Set(val *InitializeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInitializeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInitializeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInitializeRequest(val *InitializeRequest) *NullableInitializeRequest { + return &NullableInitializeRequest{value: val, isSet: true} +} + +func (v NullableInitializeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInitializeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go new file mode 100644 index 00000000000..934b9ee31bf --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go @@ -0,0 +1,190 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Response{} + +// InvokeContractV1Response struct for InvokeContractV1Response +type InvokeContractV1Response struct { + TransactionReceipt *Web3TransactionReceipt `json:"transactionReceipt,omitempty"` + CallOutput interface{} `json:"callOutput,omitempty"` + Success bool `json:"success"` +} + +// NewInvokeContractV1Response instantiates a new InvokeContractV1Response 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 +// will change when the set of required properties is changed +func NewInvokeContractV1Response(success bool) *InvokeContractV1Response { + this := InvokeContractV1Response{} + this.Success = success + return &this +} + +// NewInvokeContractV1ResponseWithDefaults instantiates a new InvokeContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1ResponseWithDefaults() *InvokeContractV1Response { + this := InvokeContractV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value if set, zero value otherwise. +func (o *InvokeContractV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil || IsNil(o.TransactionReceipt) { + var ret Web3TransactionReceipt + return ret + } + return *o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil || IsNil(o.TransactionReceipt) { + return nil, false + } + return o.TransactionReceipt, true +} + +// HasTransactionReceipt returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasTransactionReceipt() bool { + if o != nil && !IsNil(o.TransactionReceipt) { + return true + } + + return false +} + +// SetTransactionReceipt gets a reference to the given Web3TransactionReceipt and assigns it to the TransactionReceipt field. +func (o *InvokeContractV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = &v +} + +// GetCallOutput returns the CallOutput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeContractV1Response) GetCallOutput() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.CallOutput +} + +// GetCallOutputOk returns a tuple with the CallOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeContractV1Response) GetCallOutputOk() (*interface{}, bool) { + if o == nil || IsNil(o.CallOutput) { + return nil, false + } + return &o.CallOutput, true +} + +// HasCallOutput returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasCallOutput() bool { + if o != nil && IsNil(o.CallOutput) { + return true + } + + return false +} + +// SetCallOutput gets a reference to the given interface{} and assigns it to the CallOutput field. +func (o *InvokeContractV1Response) SetCallOutput(v interface{}) { + o.CallOutput = v +} + +// GetSuccess returns the Success field value +func (o *InvokeContractV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *InvokeContractV1Response) SetSuccess(v bool) { + o.Success = v +} + +func (o InvokeContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TransactionReceipt) { + toSerialize["transactionReceipt"] = o.TransactionReceipt + } + if o.CallOutput != nil { + toSerialize["callOutput"] = o.CallOutput + } + toSerialize["success"] = o.Success + return toSerialize, nil +} + +type NullableInvokeContractV1Response struct { + value *InvokeContractV1Response + isSet bool +} + +func (v NullableInvokeContractV1Response) Get() *InvokeContractV1Response { + return v.value +} + +func (v *NullableInvokeContractV1Response) Set(val *InvokeContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Response(val *InvokeContractV1Response) *NullableInvokeContractV1Response { + return &NullableInvokeContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_new_contract_request.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_new_contract_request.go new file mode 100644 index 00000000000..e1b85e5e932 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_new_contract_request.go @@ -0,0 +1,461 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the NewContractRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NewContractRequest{} + +// NewContractRequest struct for NewContractRequest +type NewContractRequest struct { + // Contract address + ContractAddress string `json:"contractAddress"` + // Input amount to lock + InputAmount float32 `json:"inputAmount"` + // Output amount to lock + OutputAmount float32 `json:"outputAmount"` + // Timestamp to expire the contract + Expiration float32 `json:"expiration"` + // Hashlock needed to refund the amount + HashLock string `json:"hashLock"` + // The token address + TokenAddress string `json:"tokenAddress"` + // The receiver address + Receiver string `json:"receiver"` + // The output network id + OutputNetwork string `json:"outputNetwork"` + // The output address to receive the tokens + OutputAddress string `json:"outputAddress"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // connectorId for the connector besu plugin + ConnectorId string `json:"connectorId"` + // keychainId for the keychian plugin + KeychainId string `json:"keychainId"` + Gas *NewContractRequestGas `json:"gas,omitempty"` +} + +// NewNewContractRequest instantiates a new NewContractRequest 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 +// will change when the set of required properties is changed +func NewNewContractRequest(contractAddress string, inputAmount float32, outputAmount float32, expiration float32, hashLock string, tokenAddress string, receiver string, outputNetwork string, outputAddress string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *NewContractRequest { + this := NewContractRequest{} + this.ContractAddress = contractAddress + this.InputAmount = inputAmount + this.OutputAmount = outputAmount + this.Expiration = expiration + this.HashLock = hashLock + this.TokenAddress = tokenAddress + this.Receiver = receiver + this.OutputNetwork = outputNetwork + this.OutputAddress = outputAddress + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewNewContractRequestWithDefaults instantiates a new NewContractRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNewContractRequestWithDefaults() *NewContractRequest { + this := NewContractRequest{} + return &this +} + +// GetContractAddress returns the ContractAddress field value +func (o *NewContractRequest) GetContractAddress() string { + if o == nil { + var ret string + return ret + } + + return o.ContractAddress +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractAddress, true +} + +// SetContractAddress sets field value +func (o *NewContractRequest) SetContractAddress(v string) { + o.ContractAddress = v +} + +// GetInputAmount returns the InputAmount field value +func (o *NewContractRequest) GetInputAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.InputAmount +} + +// GetInputAmountOk returns a tuple with the InputAmount field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetInputAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.InputAmount, true +} + +// SetInputAmount sets field value +func (o *NewContractRequest) SetInputAmount(v float32) { + o.InputAmount = v +} + +// GetOutputAmount returns the OutputAmount field value +func (o *NewContractRequest) GetOutputAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.OutputAmount +} + +// GetOutputAmountOk returns a tuple with the OutputAmount field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetOutputAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.OutputAmount, true +} + +// SetOutputAmount sets field value +func (o *NewContractRequest) SetOutputAmount(v float32) { + o.OutputAmount = v +} + +// GetExpiration returns the Expiration field value +func (o *NewContractRequest) GetExpiration() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Expiration +} + +// GetExpirationOk returns a tuple with the Expiration field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetExpirationOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Expiration, true +} + +// SetExpiration sets field value +func (o *NewContractRequest) SetExpiration(v float32) { + o.Expiration = v +} + +// GetHashLock returns the HashLock field value +func (o *NewContractRequest) GetHashLock() string { + if o == nil { + var ret string + return ret + } + + return o.HashLock +} + +// GetHashLockOk returns a tuple with the HashLock field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetHashLockOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashLock, true +} + +// SetHashLock sets field value +func (o *NewContractRequest) SetHashLock(v string) { + o.HashLock = v +} + +// GetTokenAddress returns the TokenAddress field value +func (o *NewContractRequest) GetTokenAddress() string { + if o == nil { + var ret string + return ret + } + + return o.TokenAddress +} + +// GetTokenAddressOk returns a tuple with the TokenAddress field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetTokenAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TokenAddress, true +} + +// SetTokenAddress sets field value +func (o *NewContractRequest) SetTokenAddress(v string) { + o.TokenAddress = v +} + +// GetReceiver returns the Receiver field value +func (o *NewContractRequest) GetReceiver() string { + if o == nil { + var ret string + return ret + } + + return o.Receiver +} + +// GetReceiverOk returns a tuple with the Receiver field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetReceiverOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Receiver, true +} + +// SetReceiver sets field value +func (o *NewContractRequest) SetReceiver(v string) { + o.Receiver = v +} + +// GetOutputNetwork returns the OutputNetwork field value +func (o *NewContractRequest) GetOutputNetwork() string { + if o == nil { + var ret string + return ret + } + + return o.OutputNetwork +} + +// GetOutputNetworkOk returns a tuple with the OutputNetwork field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetOutputNetworkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OutputNetwork, true +} + +// SetOutputNetwork sets field value +func (o *NewContractRequest) SetOutputNetwork(v string) { + o.OutputNetwork = v +} + +// GetOutputAddress returns the OutputAddress field value +func (o *NewContractRequest) GetOutputAddress() string { + if o == nil { + var ret string + return ret + } + + return o.OutputAddress +} + +// GetOutputAddressOk returns a tuple with the OutputAddress field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetOutputAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OutputAddress, true +} + +// SetOutputAddress sets field value +func (o *NewContractRequest) SetOutputAddress(v string) { + o.OutputAddress = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *NewContractRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *NewContractRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *NewContractRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *NewContractRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *NewContractRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *NewContractRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *NewContractRequest) GetGas() NewContractRequestGas { + if o == nil || IsNil(o.Gas) { + var ret NewContractRequestGas + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NewContractRequest) GetGasOk() (*NewContractRequestGas, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *NewContractRequest) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given NewContractRequestGas and assigns it to the Gas field. +func (o *NewContractRequest) SetGas(v NewContractRequestGas) { + o.Gas = &v +} + +func (o NewContractRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NewContractRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractAddress"] = o.ContractAddress + toSerialize["inputAmount"] = o.InputAmount + toSerialize["outputAmount"] = o.OutputAmount + toSerialize["expiration"] = o.Expiration + toSerialize["hashLock"] = o.HashLock + toSerialize["tokenAddress"] = o.TokenAddress + toSerialize["receiver"] = o.Receiver + toSerialize["outputNetwork"] = o.OutputNetwork + toSerialize["outputAddress"] = o.OutputAddress + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableNewContractRequest struct { + value *NewContractRequest + isSet bool +} + +func (v NullableNewContractRequest) Get() *NewContractRequest { + return v.value +} + +func (v *NullableNewContractRequest) Set(val *NewContractRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNewContractRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNewContractRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNewContractRequest(val *NewContractRequest) *NullableNewContractRequest { + return &NullableNewContractRequest{value: val, isSet: true} +} + +func (v NullableNewContractRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNewContractRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_new_contract_request_gas.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_new_contract_request_gas.go new file mode 100644 index 00000000000..27201056271 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_new_contract_request_gas.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" + "fmt" +) + +// NewContractRequestGas - struct for NewContractRequestGas +type NewContractRequestGas struct { + Float32 *float32 + String *string +} + +// float32AsNewContractRequestGas is a convenience function that returns float32 wrapped in NewContractRequestGas +func Float32AsNewContractRequestGas(v *float32) NewContractRequestGas { + return NewContractRequestGas{ + Float32: v, + } +} + +// stringAsNewContractRequestGas is a convenience function that returns string wrapped in NewContractRequestGas +func StringAsNewContractRequestGas(v *string) NewContractRequestGas { + return NewContractRequestGas{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *NewContractRequestGas) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Float32 + err = newStrictDecoder(data).Decode(&dst.Float32) + if err == nil { + jsonFloat32, _ := json.Marshal(dst.Float32) + if string(jsonFloat32) == "{}" { // empty struct + dst.Float32 = nil + } else { + match++ + } + } else { + dst.Float32 = nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Float32 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(NewContractRequestGas)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(NewContractRequestGas)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src NewContractRequestGas) MarshalJSON() ([]byte, error) { + if src.Float32 != nil { + return json.Marshal(&src.Float32) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *NewContractRequestGas) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Float32 != nil { + return obj.Float32 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableNewContractRequestGas struct { + value *NewContractRequestGas + isSet bool +} + +func (v NullableNewContractRequestGas) Get() *NewContractRequestGas { + return v.value +} + +func (v *NullableNewContractRequestGas) Set(val *NewContractRequestGas) { + v.value = val + v.isSet = true +} + +func (v NullableNewContractRequestGas) IsSet() bool { + return v.isSet +} + +func (v *NullableNewContractRequestGas) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNewContractRequestGas(val *NewContractRequestGas) *NullableNewContractRequestGas { + return &NullableNewContractRequestGas{value: val, isSet: true} +} + +func (v NullableNewContractRequestGas) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNewContractRequestGas) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_refund_request.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_refund_request.go new file mode 100644 index 00000000000..73e087e4903 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_refund_request.go @@ -0,0 +1,237 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the RefundRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RefundRequest{} + +// RefundRequest struct for RefundRequest +type RefundRequest struct { + // Contract htlc id for refund + Id string `json:"id"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // connectorId for the connector besu plugin + ConnectorId string `json:"connectorId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + Gas *NewContractRequestGas `json:"gas,omitempty"` +} + +// NewRefundRequest instantiates a new RefundRequest 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 +// will change when the set of required properties is changed +func NewRefundRequest(id string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *RefundRequest { + this := RefundRequest{} + this.Id = id + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewRefundRequestWithDefaults instantiates a new RefundRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRefundRequestWithDefaults() *RefundRequest { + this := RefundRequest{} + return &this +} + +// GetId returns the Id field value +func (o *RefundRequest) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RefundRequest) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RefundRequest) SetId(v string) { + o.Id = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *RefundRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *RefundRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *RefundRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *RefundRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *RefundRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *RefundRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *RefundRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *RefundRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *RefundRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *RefundRequest) GetGas() NewContractRequestGas { + if o == nil || IsNil(o.Gas) { + var ret NewContractRequestGas + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RefundRequest) GetGasOk() (*NewContractRequestGas, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *RefundRequest) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given NewContractRequestGas and assigns it to the Gas field. +func (o *RefundRequest) SetGas(v NewContractRequestGas) { + o.Gas = &v +} + +func (o RefundRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RefundRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableRefundRequest struct { + value *RefundRequest + isSet bool +} + +func (v NullableRefundRequest) Get() *RefundRequest { + return v.value +} + +func (v *NullableRefundRequest) Set(val *RefundRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRefundRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRefundRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRefundRequest(val *RefundRequest) *NullableRefundRequest { + return &NullableRefundRequest{value: val, isSet: true} +} + +func (v NullableRefundRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRefundRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_run_transaction_response.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_run_transaction_response.go new file mode 100644 index 00000000000..9fc98f030e1 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_run_transaction_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the RunTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionResponse{} + +// RunTransactionResponse struct for RunTransactionResponse +type RunTransactionResponse struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewRunTransactionResponse instantiates a new RunTransactionResponse 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 +// will change when the set of required properties is changed +func NewRunTransactionResponse(transactionReceipt Web3TransactionReceipt) *RunTransactionResponse { + this := RunTransactionResponse{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewRunTransactionResponseWithDefaults instantiates a new RunTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionResponseWithDefaults() *RunTransactionResponse { + this := RunTransactionResponse{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *RunTransactionResponse) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *RunTransactionResponse) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *RunTransactionResponse) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o RunTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableRunTransactionResponse struct { + value *RunTransactionResponse + isSet bool +} + +func (v NullableRunTransactionResponse) Get() *RunTransactionResponse { + return v.value +} + +func (v *NullableRunTransactionResponse) Set(val *RunTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionResponse(val *RunTransactionResponse) *NullableRunTransactionResponse { + return &NullableRunTransactionResponse{value: val, isSet: true} +} + +func (v NullableRunTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go new file mode 100644 index 00000000000..415867dc9b3 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go @@ -0,0 +1,178 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredential - struct for Web3SigningCredential +type Web3SigningCredential struct { + Web3SigningCredentialCactusKeychainRef *Web3SigningCredentialCactusKeychainRef + Web3SigningCredentialNone *Web3SigningCredentialNone + Web3SigningCredentialPrivateKeyHex *Web3SigningCredentialPrivateKeyHex +} + +// Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialCactusKeychainRef wrapped in Web3SigningCredential +func Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential(v *Web3SigningCredentialCactusKeychainRef) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialCactusKeychainRef: v, + } +} + +// Web3SigningCredentialNoneAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialNone wrapped in Web3SigningCredential +func Web3SigningCredentialNoneAsWeb3SigningCredential(v *Web3SigningCredentialNone) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialNone: v, + } +} + +// Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialPrivateKeyHex wrapped in Web3SigningCredential +func Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential(v *Web3SigningCredentialPrivateKeyHex) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialPrivateKeyHex: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Web3SigningCredential) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Web3SigningCredentialCactusKeychainRef + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialCactusKeychainRef) + if err == nil { + jsonWeb3SigningCredentialCactusKeychainRef, _ := json.Marshal(dst.Web3SigningCredentialCactusKeychainRef) + if string(jsonWeb3SigningCredentialCactusKeychainRef) == "{}" { // empty struct + dst.Web3SigningCredentialCactusKeychainRef = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialCactusKeychainRef = nil + } + + // try to unmarshal data into Web3SigningCredentialNone + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialNone) + if err == nil { + jsonWeb3SigningCredentialNone, _ := json.Marshal(dst.Web3SigningCredentialNone) + if string(jsonWeb3SigningCredentialNone) == "{}" { // empty struct + dst.Web3SigningCredentialNone = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialNone = nil + } + + // try to unmarshal data into Web3SigningCredentialPrivateKeyHex + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialPrivateKeyHex) + if err == nil { + jsonWeb3SigningCredentialPrivateKeyHex, _ := json.Marshal(dst.Web3SigningCredentialPrivateKeyHex) + if string(jsonWeb3SigningCredentialPrivateKeyHex) == "{}" { // empty struct + dst.Web3SigningCredentialPrivateKeyHex = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialPrivateKeyHex = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Web3SigningCredentialCactusKeychainRef = nil + dst.Web3SigningCredentialNone = nil + dst.Web3SigningCredentialPrivateKeyHex = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Web3SigningCredential)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Web3SigningCredential)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Web3SigningCredential) MarshalJSON() ([]byte, error) { + if src.Web3SigningCredentialCactusKeychainRef != nil { + return json.Marshal(&src.Web3SigningCredentialCactusKeychainRef) + } + + if src.Web3SigningCredentialNone != nil { + return json.Marshal(&src.Web3SigningCredentialNone) + } + + if src.Web3SigningCredentialPrivateKeyHex != nil { + return json.Marshal(&src.Web3SigningCredentialPrivateKeyHex) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Web3SigningCredential) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Web3SigningCredentialCactusKeychainRef != nil { + return obj.Web3SigningCredentialCactusKeychainRef + } + + if obj.Web3SigningCredentialNone != nil { + return obj.Web3SigningCredentialNone + } + + if obj.Web3SigningCredentialPrivateKeyHex != nil { + return obj.Web3SigningCredentialPrivateKeyHex + } + + // all schemas are nil + return nil +} + +type NullableWeb3SigningCredential struct { + value *Web3SigningCredential + isSet bool +} + +func (v NullableWeb3SigningCredential) Get() *Web3SigningCredential { + return v.value +} + +func (v *NullableWeb3SigningCredential) Set(val *Web3SigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredential(val *Web3SigningCredential) *NullableWeb3SigningCredential { + return &NullableWeb3SigningCredential{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go new file mode 100644 index 00000000000..ea955ed805a --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go @@ -0,0 +1,201 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialCactusKeychainRef type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialCactusKeychainRef{} + +// Web3SigningCredentialCactusKeychainRef struct for Web3SigningCredentialCactusKeychainRef +type Web3SigningCredentialCactusKeychainRef struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + KeychainEntryKey string `json:"keychainEntryKey"` + // The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + KeychainId string `json:"keychainId"` +} + +// NewWeb3SigningCredentialCactusKeychainRef instantiates a new Web3SigningCredentialCactusKeychainRef 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialCactusKeychainRef(type_ Web3SigningCredentialType, ethAccount string, keychainEntryKey string, keychainId string) *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + this.Type = type_ + this.EthAccount = ethAccount + this.KeychainEntryKey = keychainEntryKey + this.KeychainId = keychainId + return &this +} + +// NewWeb3SigningCredentialCactusKeychainRefWithDefaults instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialCactusKeychainRefWithDefaults() *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialCactusKeychainRef) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetKeychainEntryKey returns the KeychainEntryKey field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKey() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainEntryKey +} + +// GetKeychainEntryKeyOk returns a tuple with the KeychainEntryKey field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainEntryKey, true +} + +// SetKeychainEntryKey sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainEntryKey(v string) { + o.KeychainEntryKey = v +} + +// GetKeychainId returns the KeychainId field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o Web3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialCactusKeychainRef) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["keychainEntryKey"] = o.KeychainEntryKey + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableWeb3SigningCredentialCactusKeychainRef struct { + value *Web3SigningCredentialCactusKeychainRef + isSet bool +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) Get() *Web3SigningCredentialCactusKeychainRef { + return v.value +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Set(val *Web3SigningCredentialCactusKeychainRef) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialCactusKeychainRef(val *Web3SigningCredentialCactusKeychainRef) *NullableWeb3SigningCredentialCactusKeychainRef { + return &NullableWeb3SigningCredentialCactusKeychainRef{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go new file mode 100644 index 00000000000..d424a07d62c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialNone type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialNone{} + +// Web3SigningCredentialNone Using this denotes that there is no signing required because the transaction is pre-signed. +type Web3SigningCredentialNone struct { + Type Web3SigningCredentialType `json:"type"` +} + +// NewWeb3SigningCredentialNone instantiates a new Web3SigningCredentialNone 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialNone(type_ Web3SigningCredentialType) *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + this.Type = type_ + return &this +} + +// NewWeb3SigningCredentialNoneWithDefaults instantiates a new Web3SigningCredentialNone object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialNoneWithDefaults() *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialNone) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialNone) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialNone) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +func (o Web3SigningCredentialNone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialNone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableWeb3SigningCredentialNone struct { + value *Web3SigningCredentialNone + isSet bool +} + +func (v NullableWeb3SigningCredentialNone) Get() *Web3SigningCredentialNone { + return v.value +} + +func (v *NullableWeb3SigningCredentialNone) Set(val *Web3SigningCredentialNone) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialNone) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialNone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialNone(val *Web3SigningCredentialNone) *NullableWeb3SigningCredentialNone { + return &NullableWeb3SigningCredentialNone{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialNone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialNone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go new file mode 100644 index 00000000000..298a53bd640 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialPrivateKeyHex type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialPrivateKeyHex{} + +// Web3SigningCredentialPrivateKeyHex struct for Web3SigningCredentialPrivateKeyHex +type Web3SigningCredentialPrivateKeyHex struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The HEX encoded private key of an eth account. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialPrivateKeyHex instantiates a new Web3SigningCredentialPrivateKeyHex 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialPrivateKeyHex(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialPrivateKeyHexWithDefaults instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialPrivateKeyHexWithDefaults() *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialPrivateKeyHex) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialPrivateKeyHex) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialPrivateKeyHex) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialPrivateKeyHex struct { + value *Web3SigningCredentialPrivateKeyHex + isSet bool +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) Get() *Web3SigningCredentialPrivateKeyHex { + return v.value +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Set(val *Web3SigningCredentialPrivateKeyHex) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialPrivateKeyHex(val *Web3SigningCredentialPrivateKeyHex) *NullableWeb3SigningCredentialPrivateKeyHex { + return &NullableWeb3SigningCredentialPrivateKeyHex{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go new file mode 100644 index 00000000000..05d7180035d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredentialType the model 'Web3SigningCredentialType' +type Web3SigningCredentialType string + +// List of Web3SigningCredentialType +const ( + CACTUS_KEYCHAIN_REF Web3SigningCredentialType = "CACTUS_KEYCHAIN_REF" + GETH_KEYCHAIN_PASSWORD Web3SigningCredentialType = "GETH_KEYCHAIN_PASSWORD" + PRIVATE_KEY_HEX Web3SigningCredentialType = "PRIVATE_KEY_HEX" + NONE Web3SigningCredentialType = "NONE" +) + +// All allowed values of Web3SigningCredentialType enum +var AllowedWeb3SigningCredentialTypeEnumValues = []Web3SigningCredentialType{ + "CACTUS_KEYCHAIN_REF", + "GETH_KEYCHAIN_PASSWORD", + "PRIVATE_KEY_HEX", + "NONE", +} + +func (v *Web3SigningCredentialType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Web3SigningCredentialType(value) + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Web3SigningCredentialType", value) +} + +// NewWeb3SigningCredentialTypeFromValue returns a pointer to a valid Web3SigningCredentialType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWeb3SigningCredentialTypeFromValue(v string) (*Web3SigningCredentialType, error) { + ev := Web3SigningCredentialType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Web3SigningCredentialType: valid values are %v", v, AllowedWeb3SigningCredentialTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Web3SigningCredentialType) IsValid() bool { + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Web3SigningCredentialType value +func (v Web3SigningCredentialType) Ptr() *Web3SigningCredentialType { + return &v +} + +type NullableWeb3SigningCredentialType struct { + value *Web3SigningCredentialType + isSet bool +} + +func (v NullableWeb3SigningCredentialType) Get() *Web3SigningCredentialType { + return v.value +} + +func (v *NullableWeb3SigningCredentialType) Set(val *Web3SigningCredentialType) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialType) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialType(val *Web3SigningCredentialType) *NullableWeb3SigningCredentialType { + return &NullableWeb3SigningCredentialType{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go new file mode 100644 index 00000000000..eea7877e0ea --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go @@ -0,0 +1,385 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the Web3TransactionReceipt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3TransactionReceipt{} + +// Web3TransactionReceipt struct for Web3TransactionReceipt +type Web3TransactionReceipt struct { + Status bool `json:"status"` + TransactionHash string `json:"transactionHash"` + TransactionIndex float32 `json:"transactionIndex"` + BlockHash string `json:"blockHash"` + BlockNumber float32 `json:"blockNumber"` + GasUsed float32 `json:"gasUsed"` + ContractAddress NullableString `json:"contractAddress,omitempty"` + From string `json:"from"` + To string `json:"to"` + AdditionalProperties map[string]interface{} +} + +type _Web3TransactionReceipt Web3TransactionReceipt + +// NewWeb3TransactionReceipt instantiates a new Web3TransactionReceipt 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 +// will change when the set of required properties is changed +func NewWeb3TransactionReceipt(status bool, transactionHash string, transactionIndex float32, blockHash string, blockNumber float32, gasUsed float32, from string, to string) *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + this.Status = status + this.TransactionHash = transactionHash + this.TransactionIndex = transactionIndex + this.BlockHash = blockHash + this.BlockNumber = blockNumber + this.GasUsed = gasUsed + this.From = from + this.To = to + return &this +} + +// NewWeb3TransactionReceiptWithDefaults instantiates a new Web3TransactionReceipt object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3TransactionReceiptWithDefaults() *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + return &this +} + +// GetStatus returns the Status field value +func (o *Web3TransactionReceipt) GetStatus() bool { + if o == nil { + var ret bool + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetStatusOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Web3TransactionReceipt) SetStatus(v bool) { + o.Status = v +} + +// GetTransactionHash returns the TransactionHash field value +func (o *Web3TransactionReceipt) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *Web3TransactionReceipt) SetTransactionHash(v string) { + o.TransactionHash = v +} + +// GetTransactionIndex returns the TransactionIndex field value +func (o *Web3TransactionReceipt) GetTransactionIndex() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TransactionIndex, true +} + +// SetTransactionIndex sets field value +func (o *Web3TransactionReceipt) SetTransactionIndex(v float32) { + o.TransactionIndex = v +} + +// GetBlockHash returns the BlockHash field value +func (o *Web3TransactionReceipt) GetBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *Web3TransactionReceipt) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetBlockNumber returns the BlockNumber field value +func (o *Web3TransactionReceipt) GetBlockNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *Web3TransactionReceipt) SetBlockNumber(v float32) { + o.BlockNumber = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3TransactionReceipt) GetGasUsed() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetGasUsedOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3TransactionReceipt) SetGasUsed(v float32) { + o.GasUsed = v +} + +// GetContractAddress returns the ContractAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Web3TransactionReceipt) GetContractAddress() string { + if o == nil || IsNil(o.ContractAddress.Get()) { + var ret string + return ret + } + return *o.ContractAddress.Get() +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3TransactionReceipt) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ContractAddress.Get(), o.ContractAddress.IsSet() +} + +// HasContractAddress returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasContractAddress() bool { + if o != nil && o.ContractAddress.IsSet() { + return true + } + + return false +} + +// SetContractAddress gets a reference to the given NullableString and assigns it to the ContractAddress field. +func (o *Web3TransactionReceipt) SetContractAddress(v string) { + o.ContractAddress.Set(&v) +} +// SetContractAddressNil sets the value for ContractAddress to be an explicit nil +func (o *Web3TransactionReceipt) SetContractAddressNil() { + o.ContractAddress.Set(nil) +} + +// UnsetContractAddress ensures that no value is present for ContractAddress, not even an explicit nil +func (o *Web3TransactionReceipt) UnsetContractAddress() { + o.ContractAddress.Unset() +} + +// GetFrom returns the From field value +func (o *Web3TransactionReceipt) GetFrom() string { + if o == nil { + var ret string + return ret + } + + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value +func (o *Web3TransactionReceipt) SetFrom(v string) { + o.From = v +} + +// GetTo returns the To field value +func (o *Web3TransactionReceipt) GetTo() string { + if o == nil { + var ret string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *Web3TransactionReceipt) SetTo(v string) { + o.To = v +} + +func (o Web3TransactionReceipt) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3TransactionReceipt) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + toSerialize["transactionHash"] = o.TransactionHash + toSerialize["transactionIndex"] = o.TransactionIndex + toSerialize["blockHash"] = o.BlockHash + toSerialize["blockNumber"] = o.BlockNumber + toSerialize["gasUsed"] = o.GasUsed + if o.ContractAddress.IsSet() { + toSerialize["contractAddress"] = o.ContractAddress.Get() + } + toSerialize["from"] = o.From + toSerialize["to"] = o.To + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Web3TransactionReceipt) UnmarshalJSON(bytes []byte) (err error) { + varWeb3TransactionReceipt := _Web3TransactionReceipt{} + + if err = json.Unmarshal(bytes, &varWeb3TransactionReceipt); err == nil { + *o = Web3TransactionReceipt(varWeb3TransactionReceipt) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "status") + delete(additionalProperties, "transactionHash") + delete(additionalProperties, "transactionIndex") + delete(additionalProperties, "blockHash") + delete(additionalProperties, "blockNumber") + delete(additionalProperties, "gasUsed") + delete(additionalProperties, "contractAddress") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWeb3TransactionReceipt struct { + value *Web3TransactionReceipt + isSet bool +} + +func (v NullableWeb3TransactionReceipt) Get() *Web3TransactionReceipt { + return v.value +} + +func (v *NullableWeb3TransactionReceipt) Set(val *Web3TransactionReceipt) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3TransactionReceipt) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3TransactionReceipt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3TransactionReceipt(val *Web3TransactionReceipt) *NullableWeb3TransactionReceipt { + return &NullableWeb3TransactionReceipt{value: val, isSet: true} +} + +func (v NullableWeb3TransactionReceipt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3TransactionReceipt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_withdraw_request.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_withdraw_request.go new file mode 100644 index 00000000000..30164b46886 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/model_withdraw_request.go @@ -0,0 +1,265 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" +) + +// checks if the WithdrawRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WithdrawRequest{} + +// WithdrawRequest struct for WithdrawRequest +type WithdrawRequest struct { + // Contract locked id + Id string `json:"id"` + // Secret need to unlock the contract + Secret string `json:"secret"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // connectorId for the connector besu plugin + ConnectorId string `json:"connectorId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + Gas *NewContractRequestGas `json:"gas,omitempty"` +} + +// NewWithdrawRequest instantiates a new WithdrawRequest 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 +// will change when the set of required properties is changed +func NewWithdrawRequest(id string, secret string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *WithdrawRequest { + this := WithdrawRequest{} + this.Id = id + this.Secret = secret + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewWithdrawRequestWithDefaults instantiates a new WithdrawRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWithdrawRequestWithDefaults() *WithdrawRequest { + this := WithdrawRequest{} + return &this +} + +// GetId returns the Id field value +func (o *WithdrawRequest) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WithdrawRequest) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WithdrawRequest) SetId(v string) { + o.Id = v +} + +// GetSecret returns the Secret field value +func (o *WithdrawRequest) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *WithdrawRequest) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *WithdrawRequest) SetSecret(v string) { + o.Secret = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *WithdrawRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *WithdrawRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *WithdrawRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *WithdrawRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *WithdrawRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *WithdrawRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *WithdrawRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *WithdrawRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *WithdrawRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *WithdrawRequest) GetGas() NewContractRequestGas { + if o == nil || IsNil(o.Gas) { + var ret NewContractRequestGas + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WithdrawRequest) GetGasOk() (*NewContractRequestGas, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *WithdrawRequest) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given NewContractRequestGas and assigns it to the Gas field. +func (o *WithdrawRequest) SetGas(v NewContractRequestGas) { + o.Gas = &v +} + +func (o WithdrawRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WithdrawRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["secret"] = o.Secret + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableWithdrawRequest struct { + value *WithdrawRequest + isSet bool +} + +func (v NullableWithdrawRequest) Get() *WithdrawRequest { + return v.value +} + +func (v *NullableWithdrawRequest) Set(val *WithdrawRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWithdrawRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWithdrawRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWithdrawRequest(val *WithdrawRequest) *NullableWithdrawRequest { + return &NullableWithdrawRequest{value: val, isSet: true} +} + +func (v NullableWithdrawRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWithdrawRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..86fc5c2e153 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..917ea3ad32f --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,97 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-htlc-eth-besu-erc20_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService GetSingleStatusV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetSingleStatusV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetStatusV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetStatusV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InitializeV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InitializeV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService NewContractV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.NewContractV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RefundV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.RefundV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService WithdrawV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.WithdrawV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..06580af40d0 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu-erc20 + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..a0b92e03039 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..f9c184d6492 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,62 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java +src/main/java/org/openapitools/client/model/GetStatusRequest.java +src/main/java/org/openapitools/client/model/InitializeRequest.java +src/main/java/org/openapitools/client/model/InvokeContractV1Response.java +src/main/java/org/openapitools/client/model/NewContractRequest.java +src/main/java/org/openapitools/client/model/NewContractRequestGas.java +src/main/java/org/openapitools/client/model/RefundRequest.java +src/main/java/org/openapitools/client/model/RunTransactionResponse.java +src/main/java/org/openapitools/client/model/Web3SigningCredential.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java +src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java +src/main/java/org/openapitools/client/model/WithdrawRequest.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/GetSingleStatusRequestTest.java +src/test/java/org/openapitools/client/model/GetStatusRequestTest.java +src/test/java/org/openapitools/client/model/InitializeRequestTest.java +src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java +src/test/java/org/openapitools/client/model/NewContractRequestGasTest.java +src/test/java/org/openapitools/client/model/NewContractRequestTest.java +src/test/java/org/openapitools/client/model/RefundRequestTest.java +src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java +src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java +src/test/java/org/openapitools/client/model/WithdrawRequestTest.java diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..41e48d6ac81 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,156 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 +- API version: v2.0.0-alpha.2 + +Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + GetSingleStatusRequest getSingleStatusRequest = new GetSingleStatusRequest(); // GetSingleStatusRequest | + try { + Integer result = apiInstance.getSingleStatusV1(getSingleStatusRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getSingleStatusV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**getSingleStatusV1**](docs/DefaultApi.md#getSingleStatusV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-single-status | +*DefaultApi* | [**getStatusV1**](docs/DefaultApi.md#getStatusV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-status | +*DefaultApi* | [**initializeV1**](docs/DefaultApi.md#initializeV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize | Initialize contract +*DefaultApi* | [**newContractV1**](docs/DefaultApi.md#newContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract | Create a new hashtimelock contract +*DefaultApi* | [**refundV1**](docs/DefaultApi.md#refundV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/refund | Refund a hashtimelock contract +*DefaultApi* | [**withdrawV1**](docs/DefaultApi.md#withdrawV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/withdraw | Withdraw a hashtimelock contract + + +## Documentation for Models + + - [GetSingleStatusRequest](docs/GetSingleStatusRequest.md) + - [GetStatusRequest](docs/GetStatusRequest.md) + - [InitializeRequest](docs/InitializeRequest.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [NewContractRequest](docs/NewContractRequest.md) + - [NewContractRequestGas](docs/NewContractRequestGas.md) + - [RefundRequest](docs/RefundRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + - [WithdrawRequest](docs/WithdrawRequest.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..d55ecc21562 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,588 @@ +openapi: 3.0.3 +info: + description: Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize: + post: + operationId: initializeV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InitializeRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + summary: Initialize contract + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/withdraw: + post: + operationId: withdrawV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WithdrawRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Withdraw a hashtimelock contract + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/withdraw + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-status: + post: + operationId: getStatusV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetStatusRequest' + responses: + "200": + content: + application/json: + schema: + items: + format: uint256 + type: integer + type: array + description: Array of status + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-status + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-single-status: + post: + operationId: getSingleStatusV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetSingleStatusRequest' + responses: + "200": + content: + application/json: + schema: + format: uint256 + type: integer + description: Status + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-single-status + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/refund: + post: + operationId: refundV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RefundRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Refund a hashtimelock contract + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/refund + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract: + post: + operationId: newContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NewContractRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Create a new hashtimelock contract + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract + x-content-type: application/json + x-accepts: application/json +components: + responses: + GetStatusResponse: + content: + application/json: + schema: + items: + format: uint256 + type: integer + type: array + description: Array of status + GetSingleStatusResponse: + content: + application/json: + schema: + format: uint256 + type: integer + description: Status + schemas: + NewContractRequest: + additionalProperties: false + example: + receiver: receiver + outputAmount: 6.027456183070403 + outputNetwork: outputNetwork + connectorId: connectorId + hashLock: hashLock + contractAddress: contractAddress + inputAmount: 0.8008281904610115 + tokenAddress: tokenAddress + outputAddress: outputAddress + keychainId: keychainId + gas: null + web3SigningCredential: + type: null + expiration: 1.4658129805029452 + properties: + contractAddress: + description: Contract address + nullable: false + type: string + inputAmount: + description: Input amount to lock + nullable: false + type: number + outputAmount: + description: Output amount to lock + nullable: false + type: number + expiration: + description: Timestamp to expire the contract + nullable: false + type: number + hashLock: + description: Hashlock needed to refund the amount + nullable: false + type: string + tokenAddress: + description: The token address + nullable: false + type: string + receiver: + description: The receiver address + nullable: false + type: string + outputNetwork: + description: The output network id + nullable: false + type: string + outputAddress: + description: The output address to receive the tokens + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychian plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractRequest_gas' + required: + - connectorId + - contractAddress + - expiration + - hashLock + - inputAmount + - keychainId + - outputAddress + - outputAmount + - outputNetwork + - receiver + - tokenAddress + - web3SigningCredential + type: object + RefundRequest: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + gas: null + web3SigningCredential: + type: null + id: id + properties: + id: + description: Contract htlc id for refund + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractRequest_gas' + required: + - connectorId + - id + - keychainId + - web3SigningCredential + type: object + WithdrawRequest: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + gas: null + web3SigningCredential: + type: null + id: id + secret: secret + properties: + id: + description: Contract locked id + nullable: false + type: string + secret: + description: Secret need to unlock the contract + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractRequest_gas' + required: + - connectorId + - id + - keychainId + - secret + - web3SigningCredential + type: object + GetStatusRequest: + additionalProperties: false + description: Defines the parameters for retrieving the status of the HTLC swap. + example: + keychainId: keychainId + connectorId: connectorId + ids: + - ids + - ids + web3SigningCredential: + type: null + properties: + ids: + items: + type: string + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + type: string + keychainId: + type: string + required: + - connectorId + - ids + - keychainId + - web3SigningCredential + type: object + GetSingleStatusRequest: + additionalProperties: false + description: Defines the parameters for retrieving the single status of the + HTLC swap. + example: + keychainId: keychainId + connectorId: connectorId + web3SigningCredential: + type: null + id: id + properties: + id: + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + type: string + keychainId: + type: string + required: + - connectorId + - id + - keychainId + - web3SigningCredential + type: object + InitializeRequest: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + constructorArgs: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + properties: + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + type: number + required: + - connectorId + - constructorArgs + - keychainId + - web3SigningCredential + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + NewContractRequest_gas: + oneOf: + - type: string + - type: number + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..b99e9f77a7f --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..6b66af27458 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..3b79ee08cd0 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..b40d00e087f --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..7a7e81d1bcf --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..759eb4c324f --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..0acbc93c446 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,426 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(org.openapitools.client.model.Web3SigningCredential.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Web3SigningCredentialCactusKeychainRef", org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.class); + classByDiscriminatorValue.put("Web3SigningCredentialNone", org.openapitools.client.model.Web3SigningCredentialNone.class); + classByDiscriminatorValue.put("Web3SigningCredentialPrivateKeyHex", org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.class); + classByDiscriminatorValue.put("Web3SigningCredential", org.openapitools.client.model.Web3SigningCredential.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) + ; + 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; + } + + { + 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.GetSingleStatusRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetStatusRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InitializeRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NewContractRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NewContractRequestGas.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RefundRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialNone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3TransactionReceipt.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WithdrawRequest.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); + } + } + } + + /** + * 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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..afc60ff4601 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..61e894e88bb --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..e41170310c3 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..0baaec6ee83 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..30e9cc0fcb2 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,791 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.GetSingleStatusRequest; +import org.openapitools.client.model.GetStatusRequest; +import org.openapitools.client.model.InitializeRequest; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.NewContractRequest; +import org.openapitools.client.model.RefundRequest; +import org.openapitools.client.model.RunTransactionResponse; +import org.openapitools.client.model.WithdrawRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 getSingleStatusV1 + * @param getSingleStatusRequest (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 + + + +
Status Code Description Response Headers
200 Status -
+ */ + public okhttp3.Call getSingleStatusV1Call(GetSingleStatusRequest getSingleStatusRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getSingleStatusRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-single-status"; + + 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 getSingleStatusV1ValidateBeforeCall(GetSingleStatusRequest getSingleStatusRequest, final ApiCallback _callback) throws ApiException { + return getSingleStatusV1Call(getSingleStatusRequest, _callback); + + } + + /** + * + * + * @param getSingleStatusRequest (optional) + * @return Integer + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Status -
+ */ + public Integer getSingleStatusV1(GetSingleStatusRequest getSingleStatusRequest) throws ApiException { + ApiResponse localVarResp = getSingleStatusV1WithHttpInfo(getSingleStatusRequest); + return localVarResp.getData(); + } + + /** + * + * + * @param getSingleStatusRequest (optional) + * @return ApiResponse<Integer> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Status -
+ */ + public ApiResponse getSingleStatusV1WithHttpInfo(GetSingleStatusRequest getSingleStatusRequest) throws ApiException { + okhttp3.Call localVarCall = getSingleStatusV1ValidateBeforeCall(getSingleStatusRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param getSingleStatusRequest (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 + + + +
Status Code Description Response Headers
200 Status -
+ */ + public okhttp3.Call getSingleStatusV1Async(GetSingleStatusRequest getSingleStatusRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSingleStatusV1ValidateBeforeCall(getSingleStatusRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getStatusV1 + * @param getStatusRequest (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 + + + +
Status Code Description Response Headers
200 Array of status -
+ */ + public okhttp3.Call getStatusV1Call(GetStatusRequest getStatusRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getStatusRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/get-status"; + + 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 getStatusV1ValidateBeforeCall(GetStatusRequest getStatusRequest, final ApiCallback _callback) throws ApiException { + return getStatusV1Call(getStatusRequest, _callback); + + } + + /** + * + * + * @param getStatusRequest (optional) + * @return List<Integer> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Array of status -
+ */ + public List getStatusV1(GetStatusRequest getStatusRequest) throws ApiException { + ApiResponse> localVarResp = getStatusV1WithHttpInfo(getStatusRequest); + return localVarResp.getData(); + } + + /** + * + * + * @param getStatusRequest (optional) + * @return ApiResponse<List<Integer>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Array of status -
+ */ + public ApiResponse> getStatusV1WithHttpInfo(GetStatusRequest getStatusRequest) throws ApiException { + okhttp3.Call localVarCall = getStatusV1ValidateBeforeCall(getStatusRequest, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param getStatusRequest (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 + + + +
Status Code Description Response Headers
200 Array of status -
+ */ + public okhttp3.Call getStatusV1Async(GetStatusRequest getStatusRequest, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getStatusV1ValidateBeforeCall(getStatusRequest, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for initializeV1 + * @param initializeRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call initializeV1Call(InitializeRequest initializeRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = initializeRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/initialize"; + + 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 initializeV1ValidateBeforeCall(InitializeRequest initializeRequest, final ApiCallback _callback) throws ApiException { + return initializeV1Call(initializeRequest, _callback); + + } + + /** + * Initialize contract + * + * @param initializeRequest (optional) + * @return RunTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public RunTransactionResponse initializeV1(InitializeRequest initializeRequest) throws ApiException { + ApiResponse localVarResp = initializeV1WithHttpInfo(initializeRequest); + return localVarResp.getData(); + } + + /** + * Initialize contract + * + * @param initializeRequest (optional) + * @return ApiResponse<RunTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse initializeV1WithHttpInfo(InitializeRequest initializeRequest) throws ApiException { + okhttp3.Call localVarCall = initializeV1ValidateBeforeCall(initializeRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Initialize contract (asynchronously) + * + * @param initializeRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call initializeV1Async(InitializeRequest initializeRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = initializeV1ValidateBeforeCall(initializeRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for newContractV1 + * @param newContractRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call newContractV1Call(NewContractRequest newContractRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = newContractRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/new-contract"; + + 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 newContractV1ValidateBeforeCall(NewContractRequest newContractRequest, final ApiCallback _callback) throws ApiException { + return newContractV1Call(newContractRequest, _callback); + + } + + /** + * Create a new hashtimelock contract + * + * @param newContractRequest (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response newContractV1(NewContractRequest newContractRequest) throws ApiException { + ApiResponse localVarResp = newContractV1WithHttpInfo(newContractRequest); + return localVarResp.getData(); + } + + /** + * Create a new hashtimelock contract + * + * @param newContractRequest (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse newContractV1WithHttpInfo(NewContractRequest newContractRequest) throws ApiException { + okhttp3.Call localVarCall = newContractV1ValidateBeforeCall(newContractRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a new hashtimelock contract (asynchronously) + * + * @param newContractRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call newContractV1Async(NewContractRequest newContractRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = newContractV1ValidateBeforeCall(newContractRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for refundV1 + * @param refundRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call refundV1Call(RefundRequest refundRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = refundRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/refund"; + + 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 refundV1ValidateBeforeCall(RefundRequest refundRequest, final ApiCallback _callback) throws ApiException { + return refundV1Call(refundRequest, _callback); + + } + + /** + * Refund a hashtimelock contract + * + * @param refundRequest (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response refundV1(RefundRequest refundRequest) throws ApiException { + ApiResponse localVarResp = refundV1WithHttpInfo(refundRequest); + return localVarResp.getData(); + } + + /** + * Refund a hashtimelock contract + * + * @param refundRequest (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse refundV1WithHttpInfo(RefundRequest refundRequest) throws ApiException { + okhttp3.Call localVarCall = refundV1ValidateBeforeCall(refundRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Refund a hashtimelock contract (asynchronously) + * + * @param refundRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call refundV1Async(RefundRequest refundRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = refundV1ValidateBeforeCall(refundRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for withdrawV1 + * @param withdrawRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call withdrawV1Call(WithdrawRequest withdrawRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = withdrawRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu-erc20/withdraw"; + + 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 withdrawV1ValidateBeforeCall(WithdrawRequest withdrawRequest, final ApiCallback _callback) throws ApiException { + return withdrawV1Call(withdrawRequest, _callback); + + } + + /** + * Withdraw a hashtimelock contract + * + * @param withdrawRequest (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response withdrawV1(WithdrawRequest withdrawRequest) throws ApiException { + ApiResponse localVarResp = withdrawV1WithHttpInfo(withdrawRequest); + return localVarResp.getData(); + } + + /** + * Withdraw a hashtimelock contract + * + * @param withdrawRequest (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse withdrawV1WithHttpInfo(WithdrawRequest withdrawRequest) throws ApiException { + okhttp3.Call localVarCall = withdrawV1ValidateBeforeCall(withdrawRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Withdraw a hashtimelock contract (asynchronously) + * + * @param withdrawRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call withdrawV1Async(WithdrawRequest withdrawRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = withdrawV1ValidateBeforeCall(withdrawRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..07130f5ff2f --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..3e75f81b313 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..aac4589d2a7 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..969901cc7b8 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..9374353e5e3 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java new file mode 100644 index 00000000000..c21ca85cfef --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java @@ -0,0 +1,312 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Defines the parameters for retrieving the single status of the HTLC swap. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSingleStatusRequest { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public GetSingleStatusRequest() { + } + + public GetSingleStatusRequest id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public GetSingleStatusRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public GetSingleStatusRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * Get connectorId + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public GetSingleStatusRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * Get keychainId + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSingleStatusRequest getSingleStatusRequest = (GetSingleStatusRequest) o; + return Objects.equals(this.id, getSingleStatusRequest.id) && + Objects.equals(this.web3SigningCredential, getSingleStatusRequest.web3SigningCredential) && + Objects.equals(this.connectorId, getSingleStatusRequest.connectorId) && + Objects.equals(this.keychainId, getSingleStatusRequest.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(id, web3SigningCredential, connectorId, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSingleStatusRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetSingleStatusRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSingleStatusRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetSingleStatusRequest is not found in the empty JSON string", GetSingleStatusRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSingleStatusRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSingleStatusRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetSingleStatusRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSingleStatusRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSingleStatusRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetSingleStatusRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSingleStatusRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSingleStatusRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetSingleStatusRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSingleStatusRequest + * @throws IOException if the JSON string is invalid with respect to GetSingleStatusRequest + */ + public static GetSingleStatusRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSingleStatusRequest.class); + } + + /** + * Convert an instance of GetSingleStatusRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetStatusRequest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetStatusRequest.java new file mode 100644 index 00000000000..a52dbe1bb7c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetStatusRequest.java @@ -0,0 +1,325 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Defines the parameters for retrieving the status of the HTLC swap. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetStatusRequest { + public static final String SERIALIZED_NAME_IDS = "ids"; + @SerializedName(SERIALIZED_NAME_IDS) + private List ids = new ArrayList<>(); + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public GetStatusRequest() { + } + + public GetStatusRequest ids(List ids) { + + this.ids = ids; + return this; + } + + public GetStatusRequest addIdsItem(String idsItem) { + if (this.ids == null) { + this.ids = new ArrayList<>(); + } + this.ids.add(idsItem); + return this; + } + + /** + * Get ids + * @return ids + **/ + @javax.annotation.Nonnull + public List getIds() { + return ids; + } + + + public void setIds(List ids) { + this.ids = ids; + } + + + public GetStatusRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public GetStatusRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * Get connectorId + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public GetStatusRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * Get keychainId + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetStatusRequest getStatusRequest = (GetStatusRequest) o; + return Objects.equals(this.ids, getStatusRequest.ids) && + Objects.equals(this.web3SigningCredential, getStatusRequest.web3SigningCredential) && + Objects.equals(this.connectorId, getStatusRequest.connectorId) && + Objects.equals(this.keychainId, getStatusRequest.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(ids, web3SigningCredential, connectorId, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetStatusRequest {\n"); + sb.append(" ids: ").append(toIndentedString(ids)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ids"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ids"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetStatusRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetStatusRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetStatusRequest is not found in the empty JSON string", GetStatusRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetStatusRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetStatusRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetStatusRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("ids") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("ids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ids` to be an array in the JSON string but got `%s`", jsonObj.get("ids").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetStatusRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetStatusRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetStatusRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetStatusRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetStatusRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetStatusRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetStatusRequest + * @throws IOException if the JSON string is invalid with respect to GetStatusRequest + */ + public static GetStatusRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetStatusRequest.class); + } + + /** + * Convert an instance of GetStatusRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InitializeRequest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InitializeRequest.java new file mode 100644 index 00000000000..dcf8d2a632d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InitializeRequest.java @@ -0,0 +1,354 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InitializeRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InitializeRequest { + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public InitializeRequest() { + } + + public InitializeRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * connectorId for the connector besu plugin + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public InitializeRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public InitializeRequest constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public InitializeRequest addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * Get constructorArgs + * @return constructorArgs + **/ + @javax.annotation.Nonnull + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public InitializeRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InitializeRequest gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InitializeRequest initializeRequest = (InitializeRequest) o; + return Objects.equals(this.connectorId, initializeRequest.connectorId) && + Objects.equals(this.keychainId, initializeRequest.keychainId) && + Objects.equals(this.constructorArgs, initializeRequest.constructorArgs) && + Objects.equals(this.web3SigningCredential, initializeRequest.web3SigningCredential) && + Objects.equals(this.gas, initializeRequest.gas); + } + + @Override + public int hashCode() { + return Objects.hash(connectorId, keychainId, constructorArgs, web3SigningCredential, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InitializeRequest {\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + openapiFields.add("constructorArgs"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + openapiRequiredFields.add("constructorArgs"); + openapiRequiredFields.add("web3SigningCredential"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InitializeRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InitializeRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InitializeRequest is not found in the empty JSON string", InitializeRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InitializeRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InitializeRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InitializeRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // ensure the required json array is present + if (jsonObj.get("constructorArgs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InitializeRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InitializeRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InitializeRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InitializeRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InitializeRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InitializeRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of InitializeRequest + * @throws IOException if the JSON string is invalid with respect to InitializeRequest + */ + public static InitializeRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InitializeRequest.class); + } + + /** + * Convert an instance of InitializeRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java new file mode 100644 index 00000000000..2fc100b2fa2 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java @@ -0,0 +1,282 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public static final String SERIALIZED_NAME_CALL_OUTPUT = "callOutput"; + @SerializedName(SERIALIZED_NAME_CALL_OUTPUT) + private Object callOutput = null; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public InvokeContractV1Response() { + } + + public InvokeContractV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nullable + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + public InvokeContractV1Response callOutput(Object callOutput) { + + this.callOutput = callOutput; + return this; + } + + /** + * Get callOutput + * @return callOutput + **/ + @javax.annotation.Nullable + public Object getCallOutput() { + return callOutput; + } + + + public void setCallOutput(Object callOutput) { + this.callOutput = callOutput; + } + + + public InvokeContractV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Response invokeContractV1Response = (InvokeContractV1Response) o; + return Objects.equals(this.transactionReceipt, invokeContractV1Response.transactionReceipt) && + Objects.equals(this.callOutput, invokeContractV1Response.callOutput) && + Objects.equals(this.success, invokeContractV1Response.success); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt, callOutput, success); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append(" callOutput: ").append(toIndentedString(callOutput)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + openapiFields.add("callOutput"); + openapiFields.add("success"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Response is not found in the empty JSON string", InvokeContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Response + */ + public static InvokeContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Response.class); + } + + /** + * Convert an instance of InvokeContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractRequest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractRequest.java new file mode 100644 index 00000000000..b99ca636424 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractRequest.java @@ -0,0 +1,593 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.NewContractRequestGas; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * NewContractRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NewContractRequest { + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_INPUT_AMOUNT = "inputAmount"; + @SerializedName(SERIALIZED_NAME_INPUT_AMOUNT) + private BigDecimal inputAmount; + + public static final String SERIALIZED_NAME_OUTPUT_AMOUNT = "outputAmount"; + @SerializedName(SERIALIZED_NAME_OUTPUT_AMOUNT) + private BigDecimal outputAmount; + + public static final String SERIALIZED_NAME_EXPIRATION = "expiration"; + @SerializedName(SERIALIZED_NAME_EXPIRATION) + private BigDecimal expiration; + + public static final String SERIALIZED_NAME_HASH_LOCK = "hashLock"; + @SerializedName(SERIALIZED_NAME_HASH_LOCK) + private String hashLock; + + public static final String SERIALIZED_NAME_TOKEN_ADDRESS = "tokenAddress"; + @SerializedName(SERIALIZED_NAME_TOKEN_ADDRESS) + private String tokenAddress; + + public static final String SERIALIZED_NAME_RECEIVER = "receiver"; + @SerializedName(SERIALIZED_NAME_RECEIVER) + private String receiver; + + public static final String SERIALIZED_NAME_OUTPUT_NETWORK = "outputNetwork"; + @SerializedName(SERIALIZED_NAME_OUTPUT_NETWORK) + private String outputNetwork; + + public static final String SERIALIZED_NAME_OUTPUT_ADDRESS = "outputAddress"; + @SerializedName(SERIALIZED_NAME_OUTPUT_ADDRESS) + private String outputAddress; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private NewContractRequestGas gas; + + public NewContractRequest() { + } + + public NewContractRequest contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Contract address + * @return contractAddress + **/ + @javax.annotation.Nonnull + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public NewContractRequest inputAmount(BigDecimal inputAmount) { + + this.inputAmount = inputAmount; + return this; + } + + /** + * Input amount to lock + * @return inputAmount + **/ + @javax.annotation.Nonnull + public BigDecimal getInputAmount() { + return inputAmount; + } + + + public void setInputAmount(BigDecimal inputAmount) { + this.inputAmount = inputAmount; + } + + + public NewContractRequest outputAmount(BigDecimal outputAmount) { + + this.outputAmount = outputAmount; + return this; + } + + /** + * Output amount to lock + * @return outputAmount + **/ + @javax.annotation.Nonnull + public BigDecimal getOutputAmount() { + return outputAmount; + } + + + public void setOutputAmount(BigDecimal outputAmount) { + this.outputAmount = outputAmount; + } + + + public NewContractRequest expiration(BigDecimal expiration) { + + this.expiration = expiration; + return this; + } + + /** + * Timestamp to expire the contract + * @return expiration + **/ + @javax.annotation.Nonnull + public BigDecimal getExpiration() { + return expiration; + } + + + public void setExpiration(BigDecimal expiration) { + this.expiration = expiration; + } + + + public NewContractRequest hashLock(String hashLock) { + + this.hashLock = hashLock; + return this; + } + + /** + * Hashlock needed to refund the amount + * @return hashLock + **/ + @javax.annotation.Nonnull + public String getHashLock() { + return hashLock; + } + + + public void setHashLock(String hashLock) { + this.hashLock = hashLock; + } + + + public NewContractRequest tokenAddress(String tokenAddress) { + + this.tokenAddress = tokenAddress; + return this; + } + + /** + * The token address + * @return tokenAddress + **/ + @javax.annotation.Nonnull + public String getTokenAddress() { + return tokenAddress; + } + + + public void setTokenAddress(String tokenAddress) { + this.tokenAddress = tokenAddress; + } + + + public NewContractRequest receiver(String receiver) { + + this.receiver = receiver; + return this; + } + + /** + * The receiver address + * @return receiver + **/ + @javax.annotation.Nonnull + public String getReceiver() { + return receiver; + } + + + public void setReceiver(String receiver) { + this.receiver = receiver; + } + + + public NewContractRequest outputNetwork(String outputNetwork) { + + this.outputNetwork = outputNetwork; + return this; + } + + /** + * The output network id + * @return outputNetwork + **/ + @javax.annotation.Nonnull + public String getOutputNetwork() { + return outputNetwork; + } + + + public void setOutputNetwork(String outputNetwork) { + this.outputNetwork = outputNetwork; + } + + + public NewContractRequest outputAddress(String outputAddress) { + + this.outputAddress = outputAddress; + return this; + } + + /** + * The output address to receive the tokens + * @return outputAddress + **/ + @javax.annotation.Nonnull + public String getOutputAddress() { + return outputAddress; + } + + + public void setOutputAddress(String outputAddress) { + this.outputAddress = outputAddress; + } + + + public NewContractRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public NewContractRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * connectorId for the connector besu plugin + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public NewContractRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychian plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public NewContractRequest gas(NewContractRequestGas gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public NewContractRequestGas getGas() { + return gas; + } + + + public void setGas(NewContractRequestGas gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewContractRequest newContractRequest = (NewContractRequest) o; + return Objects.equals(this.contractAddress, newContractRequest.contractAddress) && + Objects.equals(this.inputAmount, newContractRequest.inputAmount) && + Objects.equals(this.outputAmount, newContractRequest.outputAmount) && + Objects.equals(this.expiration, newContractRequest.expiration) && + Objects.equals(this.hashLock, newContractRequest.hashLock) && + Objects.equals(this.tokenAddress, newContractRequest.tokenAddress) && + Objects.equals(this.receiver, newContractRequest.receiver) && + Objects.equals(this.outputNetwork, newContractRequest.outputNetwork) && + Objects.equals(this.outputAddress, newContractRequest.outputAddress) && + Objects.equals(this.web3SigningCredential, newContractRequest.web3SigningCredential) && + Objects.equals(this.connectorId, newContractRequest.connectorId) && + Objects.equals(this.keychainId, newContractRequest.keychainId) && + Objects.equals(this.gas, newContractRequest.gas); + } + + @Override + public int hashCode() { + return Objects.hash(contractAddress, inputAmount, outputAmount, expiration, hashLock, tokenAddress, receiver, outputNetwork, outputAddress, web3SigningCredential, connectorId, keychainId, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewContractRequest {\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" inputAmount: ").append(toIndentedString(inputAmount)).append("\n"); + sb.append(" outputAmount: ").append(toIndentedString(outputAmount)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" hashLock: ").append(toIndentedString(hashLock)).append("\n"); + sb.append(" tokenAddress: ").append(toIndentedString(tokenAddress)).append("\n"); + sb.append(" receiver: ").append(toIndentedString(receiver)).append("\n"); + sb.append(" outputNetwork: ").append(toIndentedString(outputNetwork)).append("\n"); + sb.append(" outputAddress: ").append(toIndentedString(outputAddress)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractAddress"); + openapiFields.add("inputAmount"); + openapiFields.add("outputAmount"); + openapiFields.add("expiration"); + openapiFields.add("hashLock"); + openapiFields.add("tokenAddress"); + openapiFields.add("receiver"); + openapiFields.add("outputNetwork"); + openapiFields.add("outputAddress"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractAddress"); + openapiRequiredFields.add("inputAmount"); + openapiRequiredFields.add("outputAmount"); + openapiRequiredFields.add("expiration"); + openapiRequiredFields.add("hashLock"); + openapiRequiredFields.add("tokenAddress"); + openapiRequiredFields.add("receiver"); + openapiRequiredFields.add("outputNetwork"); + openapiRequiredFields.add("outputAddress"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NewContractRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!NewContractRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewContractRequest is not found in the empty JSON string", NewContractRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NewContractRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewContractRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewContractRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if (!jsonObj.get("hashLock").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashLock` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashLock").toString())); + } + if (!jsonObj.get("tokenAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tokenAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenAddress").toString())); + } + if (!jsonObj.get("receiver").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `receiver` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiver").toString())); + } + if (!jsonObj.get("outputNetwork").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `outputNetwork` to be a primitive type in the JSON string but got `%s`", jsonObj.get("outputNetwork").toString())); + } + if (!jsonObj.get("outputAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `outputAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("outputAddress").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + NewContractRequestGas.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewContractRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewContractRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewContractRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewContractRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewContractRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewContractRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewContractRequest + * @throws IOException if the JSON string is invalid with respect to NewContractRequest + */ + public static NewContractRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewContractRequest.class); + } + + /** + * Convert an instance of NewContractRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractRequestGas.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractRequestGas.java new file mode 100644 index 00000000000..a784ac856e5 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractRequestGas.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import java.math.BigDecimal; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NewContractRequestGas extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(NewContractRequestGas.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewContractRequestGas.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewContractRequestGas' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewContractRequestGas value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonObject obj = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, String"); + } + + @Override + public NewContractRequestGas read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + BigDecimal.validateJsonObject(jsonObject); + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + NewContractRequestGas ret = new NewContractRequestGas(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for NewContractRequestGas: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public NewContractRequestGas() { + super("oneOf", Boolean.FALSE); + } + + public NewContractRequestGas(BigDecimal o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public NewContractRequestGas(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BigDecimal", new GenericType() { + }); + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return NewContractRequestGas.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, String"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, String + * + * @return The actual instance (BigDecimal, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NewContractRequestGas + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with BigDecimal + try { + BigDecimal.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for NewContractRequestGas with oneOf schemas: BigDecimal, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of NewContractRequestGas given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewContractRequestGas + * @throws IOException if the JSON string is invalid with respect to NewContractRequestGas + */ + public static NewContractRequestGas fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewContractRequestGas.class); + } + + /** + * Convert an instance of NewContractRequestGas to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RefundRequest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RefundRequest.java new file mode 100644 index 00000000000..9e0218cd219 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RefundRequest.java @@ -0,0 +1,345 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.NewContractRequestGas; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RefundRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RefundRequest { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private NewContractRequestGas gas; + + public RefundRequest() { + } + + public RefundRequest id(String id) { + + this.id = id; + return this; + } + + /** + * Contract htlc id for refund + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public RefundRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public RefundRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * connectorId for the connector besu plugin + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public RefundRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public RefundRequest gas(NewContractRequestGas gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public NewContractRequestGas getGas() { + return gas; + } + + + public void setGas(NewContractRequestGas gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RefundRequest refundRequest = (RefundRequest) o; + return Objects.equals(this.id, refundRequest.id) && + Objects.equals(this.web3SigningCredential, refundRequest.web3SigningCredential) && + Objects.equals(this.connectorId, refundRequest.connectorId) && + Objects.equals(this.keychainId, refundRequest.keychainId) && + Objects.equals(this.gas, refundRequest.gas); + } + + @Override + public int hashCode() { + return Objects.hash(id, web3SigningCredential, connectorId, keychainId, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RefundRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RefundRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RefundRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RefundRequest is not found in the empty JSON string", RefundRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RefundRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RefundRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RefundRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + NewContractRequestGas.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RefundRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RefundRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RefundRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RefundRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RefundRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RefundRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RefundRequest + * @throws IOException if the JSON string is invalid with respect to RefundRequest + */ + public static RefundRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RefundRequest.class); + } + + /** + * Convert an instance of RefundRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java new file mode 100644 index 00000000000..823866c3a4d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionResponse { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public RunTransactionResponse() { + } + + public RunTransactionResponse transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionResponse runTransactionResponse = (RunTransactionResponse) o; + return Objects.equals(this.transactionReceipt, runTransactionResponse.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionResponse {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionResponse is not found in the empty JSON string", RunTransactionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionResponse + * @throws IOException if the JSON string is invalid with respect to RunTransactionResponse + */ + public static RunTransactionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionResponse.class); + } + + /** + * Convert an instance of RunTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java new file mode 100644 index 00000000000..8ae8ada589d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java @@ -0,0 +1,338 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredential extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Web3SigningCredential.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWeb3SigningCredentialCactusKeychainRef = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + final TypeAdapter adapterWeb3SigningCredentialNone = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + final TypeAdapter adapterWeb3SigningCredentialPrivateKeyHex = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredential value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialCactusKeychainRef` + if (value.getActualInstance() instanceof Web3SigningCredentialCactusKeychainRef) { + JsonObject obj = adapterWeb3SigningCredentialCactusKeychainRef.toJsonTree((Web3SigningCredentialCactusKeychainRef)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialNone` + if (value.getActualInstance() instanceof Web3SigningCredentialNone) { + JsonObject obj = adapterWeb3SigningCredentialNone.toJsonTree((Web3SigningCredentialNone)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialPrivateKeyHex` + if (value.getActualInstance() instanceof Web3SigningCredentialPrivateKeyHex) { + JsonObject obj = adapterWeb3SigningCredentialPrivateKeyHex.toJsonTree((Web3SigningCredentialPrivateKeyHex)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + @Override + public Web3SigningCredential read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Web3SigningCredentialCactusKeychainRef + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialCactusKeychainRef; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialCactusKeychainRef'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialCactusKeychainRef'", e); + } + + // deserialize Web3SigningCredentialNone + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialNone.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialNone; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialNone'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialNone'", e); + } + + // deserialize Web3SigningCredentialPrivateKeyHex + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialPrivateKeyHex; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialPrivateKeyHex'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialPrivateKeyHex'", e); + } + + if (match == 1) { + Web3SigningCredential ret = new Web3SigningCredential(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Web3SigningCredential: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Web3SigningCredential() { + super("oneOf", Boolean.FALSE); + } + + public Web3SigningCredential(Web3SigningCredentialCactusKeychainRef o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialNone o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialPrivateKeyHex o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Web3SigningCredentialCactusKeychainRef", new GenericType() { + }); + schemas.put("Web3SigningCredentialNone", new GenericType() { + }); + schemas.put("Web3SigningCredentialPrivateKeyHex", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Web3SigningCredential.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Web3SigningCredentialCactusKeychainRef) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialNone) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialPrivateKeyHex) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + /** + * Get the actual instance, which can be the following: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * @return The actual instance (Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialCactusKeychainRef`. If the actual instance is not `Web3SigningCredentialCactusKeychainRef`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialCactusKeychainRef` + * @throws ClassCastException if the instance is not `Web3SigningCredentialCactusKeychainRef` + */ + public Web3SigningCredentialCactusKeychainRef getWeb3SigningCredentialCactusKeychainRef() throws ClassCastException { + return (Web3SigningCredentialCactusKeychainRef)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialNone`. If the actual instance is not `Web3SigningCredentialNone`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialNone` + * @throws ClassCastException if the instance is not `Web3SigningCredentialNone` + */ + public Web3SigningCredentialNone getWeb3SigningCredentialNone() throws ClassCastException { + return (Web3SigningCredentialNone)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialPrivateKeyHex`. If the actual instance is not `Web3SigningCredentialPrivateKeyHex`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialPrivateKeyHex` + * @throws ClassCastException if the instance is not `Web3SigningCredentialPrivateKeyHex` + */ + public Web3SigningCredentialPrivateKeyHex getWeb3SigningCredentialPrivateKeyHex() throws ClassCastException { + return (Web3SigningCredentialPrivateKeyHex)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Web3SigningCredentialCactusKeychainRef + try { + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialNone + try { + Web3SigningCredentialNone.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialPrivateKeyHex + try { + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Web3SigningCredential with oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Web3SigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredential + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredential + */ + public static Web3SigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredential.class); + } + + /** + * Convert an instance of Web3SigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java new file mode 100644 index 00000000000..0220b7c0104 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java @@ -0,0 +1,310 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialCactusKeychainRef + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialCactusKeychainRef { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY = "keychainEntryKey"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY) + private String keychainEntryKey; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public Web3SigningCredentialCactusKeychainRef() { + } + + public Web3SigningCredentialCactusKeychainRef type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialCactusKeychainRef ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialCactusKeychainRef keychainEntryKey(String keychainEntryKey) { + + this.keychainEntryKey = keychainEntryKey; + return this; + } + + /** + * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + * @return keychainEntryKey + **/ + @javax.annotation.Nonnull + public String getKeychainEntryKey() { + return keychainEntryKey; + } + + + public void setKeychainEntryKey(String keychainEntryKey) { + this.keychainEntryKey = keychainEntryKey; + } + + + public Web3SigningCredentialCactusKeychainRef keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialCactusKeychainRef web3SigningCredentialCactusKeychainRef = (Web3SigningCredentialCactusKeychainRef) o; + return Objects.equals(this.type, web3SigningCredentialCactusKeychainRef.type) && + Objects.equals(this.ethAccount, web3SigningCredentialCactusKeychainRef.ethAccount) && + Objects.equals(this.keychainEntryKey, web3SigningCredentialCactusKeychainRef.keychainEntryKey) && + Objects.equals(this.keychainId, web3SigningCredentialCactusKeychainRef.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, keychainEntryKey, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialCactusKeychainRef {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" keychainEntryKey: ").append(toIndentedString(keychainEntryKey)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("keychainEntryKey"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("keychainEntryKey"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialCactusKeychainRef is not found in the empty JSON string", Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialCactusKeychainRef.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialCactusKeychainRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialCactusKeychainRef.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("keychainEntryKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainEntryKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainEntryKey").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialCactusKeychainRef.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialCactusKeychainRef' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialCactusKeychainRef value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialCactusKeychainRef read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialCactusKeychainRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialCactusKeychainRef + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static Web3SigningCredentialCactusKeychainRef fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialCactusKeychainRef.class); + } + + /** + * Convert an instance of Web3SigningCredentialCactusKeychainRef to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java new file mode 100644 index 00000000000..9d2f768501c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Using this denotes that there is no signing required because the transaction is pre-signed. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialNone { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public Web3SigningCredentialNone() { + } + + public Web3SigningCredentialNone type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialNone web3SigningCredentialNone = (Web3SigningCredentialNone) o; + return Objects.equals(this.type, web3SigningCredentialNone.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialNone {\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(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialNone + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialNone.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialNone is not found in the empty JSON string", Web3SigningCredentialNone.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialNone.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialNone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialNone.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialNone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialNone' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialNone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialNone read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialNone given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialNone + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialNone + */ + public static Web3SigningCredentialNone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialNone.class); + } + + /** + * Convert an instance of Web3SigningCredentialNone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java new file mode 100644 index 00000000000..4a09810493c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialPrivateKeyHex + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialPrivateKeyHex { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialPrivateKeyHex() { + } + + public Web3SigningCredentialPrivateKeyHex type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialPrivateKeyHex ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialPrivateKeyHex secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * The HEX encoded private key of an eth account. + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialPrivateKeyHex web3SigningCredentialPrivateKeyHex = (Web3SigningCredentialPrivateKeyHex) o; + return Objects.equals(this.type, web3SigningCredentialPrivateKeyHex.type) && + Objects.equals(this.ethAccount, web3SigningCredentialPrivateKeyHex.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialPrivateKeyHex.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialPrivateKeyHex {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialPrivateKeyHex is not found in the empty JSON string", Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialPrivateKeyHex.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialPrivateKeyHex` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialPrivateKeyHex.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialPrivateKeyHex.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialPrivateKeyHex' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialPrivateKeyHex value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialPrivateKeyHex read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialPrivateKeyHex given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialPrivateKeyHex + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static Web3SigningCredentialPrivateKeyHex fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialPrivateKeyHex.class); + } + + /** + * Convert an instance of Web3SigningCredentialPrivateKeyHex to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java new file mode 100644 index 00000000000..277db11bfa9 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Web3SigningCredentialType + */ +@JsonAdapter(Web3SigningCredentialType.Adapter.class) +public enum Web3SigningCredentialType { + + CACTUS_KEYCHAIN_REF("CACTUS_KEYCHAIN_REF"), + + GETH_KEYCHAIN_PASSWORD("GETH_KEYCHAIN_PASSWORD"), + + PRIVATE_KEY_HEX("PRIVATE_KEY_HEX"), + + NONE("NONE"); + + private String value; + + Web3SigningCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Web3SigningCredentialType fromValue(String value) { + for (Web3SigningCredentialType b : Web3SigningCredentialType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Web3SigningCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Web3SigningCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Web3SigningCredentialType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java new file mode 100644 index 00000000000..06ee8dfbfcd --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java @@ -0,0 +1,547 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3TransactionReceipt + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3TransactionReceipt { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Boolean status; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private BigDecimal transactionIndex; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private BigDecimal blockNumber; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private BigDecimal gasUsed; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public Web3TransactionReceipt() { + } + + public Web3TransactionReceipt status(Boolean status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public Boolean getStatus() { + return status; + } + + + public void setStatus(Boolean status) { + this.status = status; + } + + + public Web3TransactionReceipt transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nonnull + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + public Web3TransactionReceipt transactionIndex(BigDecimal transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nonnull + public BigDecimal getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(BigDecimal transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public Web3TransactionReceipt blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nonnull + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public Web3TransactionReceipt blockNumber(BigDecimal blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(BigDecimal blockNumber) { + this.blockNumber = blockNumber; + } + + + public Web3TransactionReceipt gasUsed(BigDecimal gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + public BigDecimal getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(BigDecimal gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3TransactionReceipt contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Get contractAddress + * @return contractAddress + **/ + @javax.annotation.Nullable + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public Web3TransactionReceipt from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nonnull + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public Web3TransactionReceipt to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nonnull + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Web3TransactionReceipt instance itself + */ + public Web3TransactionReceipt putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3TransactionReceipt web3TransactionReceipt = (Web3TransactionReceipt) o; + return Objects.equals(this.status, web3TransactionReceipt.status) && + Objects.equals(this.transactionHash, web3TransactionReceipt.transactionHash) && + Objects.equals(this.transactionIndex, web3TransactionReceipt.transactionIndex) && + Objects.equals(this.blockHash, web3TransactionReceipt.blockHash) && + Objects.equals(this.blockNumber, web3TransactionReceipt.blockNumber) && + Objects.equals(this.gasUsed, web3TransactionReceipt.gasUsed) && + Objects.equals(this.contractAddress, web3TransactionReceipt.contractAddress) && + Objects.equals(this.from, web3TransactionReceipt.from) && + Objects.equals(this.to, web3TransactionReceipt.to)&& + Objects.equals(this.additionalProperties, web3TransactionReceipt.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, transactionHash, transactionIndex, blockHash, blockNumber, gasUsed, contractAddress, from, to, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3TransactionReceipt {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("transactionHash"); + openapiFields.add("transactionIndex"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("gasUsed"); + openapiFields.add("contractAddress"); + openapiFields.add("from"); + openapiFields.add("to"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("transactionHash"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("blockNumber"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("to"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3TransactionReceipt + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3TransactionReceipt.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3TransactionReceipt is not found in the empty JSON string", Web3TransactionReceipt.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3TransactionReceipt.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if ((jsonObj.get("contractAddress") != null && !jsonObj.get("contractAddress").isJsonNull()) && !jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if (!jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if (!jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3TransactionReceipt.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3TransactionReceipt' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3TransactionReceipt.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3TransactionReceipt value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Web3TransactionReceipt read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Web3TransactionReceipt instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3TransactionReceipt given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3TransactionReceipt + * @throws IOException if the JSON string is invalid with respect to Web3TransactionReceipt + */ + public static Web3TransactionReceipt fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3TransactionReceipt.class); + } + + /** + * Convert an instance of Web3TransactionReceipt to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawRequest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawRequest.java new file mode 100644 index 00000000000..babddadf0cd --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawRequest.java @@ -0,0 +1,377 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.NewContractRequestGas; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WithdrawRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WithdrawRequest { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private NewContractRequestGas gas; + + public WithdrawRequest() { + } + + public WithdrawRequest id(String id) { + + this.id = id; + return this; + } + + /** + * Contract locked id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public WithdrawRequest secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * Secret need to unlock the contract + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + public WithdrawRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public WithdrawRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * connectorId for the connector besu plugin + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public WithdrawRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public WithdrawRequest gas(NewContractRequestGas gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public NewContractRequestGas getGas() { + return gas; + } + + + public void setGas(NewContractRequestGas gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WithdrawRequest withdrawRequest = (WithdrawRequest) o; + return Objects.equals(this.id, withdrawRequest.id) && + Objects.equals(this.secret, withdrawRequest.secret) && + Objects.equals(this.web3SigningCredential, withdrawRequest.web3SigningCredential) && + Objects.equals(this.connectorId, withdrawRequest.connectorId) && + Objects.equals(this.keychainId, withdrawRequest.keychainId) && + Objects.equals(this.gas, withdrawRequest.gas); + } + + @Override + public int hashCode() { + return Objects.hash(id, secret, web3SigningCredential, connectorId, keychainId, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WithdrawRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("secret"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("secret"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WithdrawRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WithdrawRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WithdrawRequest is not found in the empty JSON string", WithdrawRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WithdrawRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WithdrawRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WithdrawRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + NewContractRequestGas.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WithdrawRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WithdrawRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WithdrawRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WithdrawRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WithdrawRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WithdrawRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of WithdrawRequest + * @throws IOException if the JSON string is invalid with respect to WithdrawRequest + */ + public static WithdrawRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WithdrawRequest.class); + } + + /** + * Convert an instance of WithdrawRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..4893d9f8c6a --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,109 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.GetSingleStatusRequest; +import org.openapitools.client.model.GetStatusRequest; +import org.openapitools.client.model.InitializeRequest; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.NewContractRequest; +import org.openapitools.client.model.RefundRequest; +import org.openapitools.client.model.RunTransactionResponse; +import org.openapitools.client.model.WithdrawRequest; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getSingleStatusV1Test() throws ApiException { + GetSingleStatusRequest getSingleStatusRequest = null; + Integer response = api.getSingleStatusV1(getSingleStatusRequest); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getStatusV1Test() throws ApiException { + GetStatusRequest getStatusRequest = null; + List response = api.getStatusV1(getStatusRequest); + // TODO: test validations + } + + /** + * Initialize contract + * + * @throws ApiException if the Api call fails + */ + @Test + public void initializeV1Test() throws ApiException { + InitializeRequest initializeRequest = null; + RunTransactionResponse response = api.initializeV1(initializeRequest); + // TODO: test validations + } + + /** + * Create a new hashtimelock contract + * + * @throws ApiException if the Api call fails + */ + @Test + public void newContractV1Test() throws ApiException { + NewContractRequest newContractRequest = null; + InvokeContractV1Response response = api.newContractV1(newContractRequest); + // TODO: test validations + } + + /** + * Refund a hashtimelock contract + * + * @throws ApiException if the Api call fails + */ + @Test + public void refundV1Test() throws ApiException { + RefundRequest refundRequest = null; + InvokeContractV1Response response = api.refundV1(refundRequest); + // TODO: test validations + } + + /** + * Withdraw a hashtimelock contract + * + * @throws ApiException if the Api call fails + */ + @Test + public void withdrawV1Test() throws ApiException { + WithdrawRequest withdrawRequest = null; + InvokeContractV1Response response = api.withdrawV1(withdrawRequest); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSingleStatusRequestTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSingleStatusRequestTest.java new file mode 100644 index 00000000000..bdaf79b5347 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSingleStatusRequestTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetSingleStatusRequest + */ +public class GetSingleStatusRequestTest { + private final GetSingleStatusRequest model = new GetSingleStatusRequest(); + + /** + * Model tests for GetSingleStatusRequest + */ + @Test + public void testGetSingleStatusRequest() { + // TODO: test GetSingleStatusRequest + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetStatusRequestTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetStatusRequestTest.java new file mode 100644 index 00000000000..9fa57fc1c20 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetStatusRequestTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetStatusRequest + */ +public class GetStatusRequestTest { + private final GetStatusRequest model = new GetStatusRequest(); + + /** + * Model tests for GetStatusRequest + */ + @Test + public void testGetStatusRequest() { + // TODO: test GetStatusRequest + } + + /** + * Test the property 'ids' + */ + @Test + public void idsTest() { + // TODO: test ids + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InitializeRequestTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InitializeRequestTest.java new file mode 100644 index 00000000000..89cb5391c5c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InitializeRequestTest.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InitializeRequest + */ +public class InitializeRequestTest { + private final InitializeRequest model = new InitializeRequest(); + + /** + * Model tests for InitializeRequest + */ + @Test + public void testInitializeRequest() { + // TODO: test InitializeRequest + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java new file mode 100644 index 00000000000..e0acf185995 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Response + */ +public class InvokeContractV1ResponseTest { + private final InvokeContractV1Response model = new InvokeContractV1Response(); + + /** + * Model tests for InvokeContractV1Response + */ + @Test + public void testInvokeContractV1Response() { + // TODO: test InvokeContractV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + + /** + * Test the property 'callOutput' + */ + @Test + public void callOutputTest() { + // TODO: test callOutput + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractRequestGasTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractRequestGasTest.java new file mode 100644 index 00000000000..0bb873205d1 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractRequestGasTest.java @@ -0,0 +1,35 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NewContractRequestGas + */ +public class NewContractRequestGasTest { + private final NewContractRequestGas model = new NewContractRequestGas(); + + /** + * Model tests for NewContractRequestGas + */ + @Test + public void testNewContractRequestGas() { + // TODO: test NewContractRequestGas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractRequestTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractRequestTest.java new file mode 100644 index 00000000000..182c020e97d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractRequestTest.java @@ -0,0 +1,147 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.client.model.NewContractRequestGas; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NewContractRequest + */ +public class NewContractRequestTest { + private final NewContractRequest model = new NewContractRequest(); + + /** + * Model tests for NewContractRequest + */ + @Test + public void testNewContractRequest() { + // TODO: test NewContractRequest + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'inputAmount' + */ + @Test + public void inputAmountTest() { + // TODO: test inputAmount + } + + /** + * Test the property 'outputAmount' + */ + @Test + public void outputAmountTest() { + // TODO: test outputAmount + } + + /** + * Test the property 'expiration' + */ + @Test + public void expirationTest() { + // TODO: test expiration + } + + /** + * Test the property 'hashLock' + */ + @Test + public void hashLockTest() { + // TODO: test hashLock + } + + /** + * Test the property 'tokenAddress' + */ + @Test + public void tokenAddressTest() { + // TODO: test tokenAddress + } + + /** + * Test the property 'receiver' + */ + @Test + public void receiverTest() { + // TODO: test receiver + } + + /** + * Test the property 'outputNetwork' + */ + @Test + public void outputNetworkTest() { + // TODO: test outputNetwork + } + + /** + * Test the property 'outputAddress' + */ + @Test + public void outputAddressTest() { + // TODO: test outputAddress + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RefundRequestTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RefundRequestTest.java new file mode 100644 index 00000000000..fd48b47abfb --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RefundRequestTest.java @@ -0,0 +1,82 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.NewContractRequestGas; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RefundRequest + */ +public class RefundRequestTest { + private final RefundRequest model = new RefundRequest(); + + /** + * Model tests for RefundRequest + */ + @Test + public void testRefundRequest() { + // TODO: test RefundRequest + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java new file mode 100644 index 00000000000..a289f90e458 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionResponse + */ +public class RunTransactionResponseTest { + private final RunTransactionResponse model = new RunTransactionResponse(); + + /** + * Model tests for RunTransactionResponse + */ + @Test + public void testRunTransactionResponse() { + // TODO: test RunTransactionResponse + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java new file mode 100644 index 00000000000..b3ad3241706 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ +public class Web3SigningCredentialCactusKeychainRefTest { + private final Web3SigningCredentialCactusKeychainRef model = new Web3SigningCredentialCactusKeychainRef(); + + /** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ + @Test + public void testWeb3SigningCredentialCactusKeychainRef() { + // TODO: test Web3SigningCredentialCactusKeychainRef + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java new file mode 100644 index 00000000000..7981ba24717 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialNone + */ +public class Web3SigningCredentialNoneTest { + private final Web3SigningCredentialNone model = new Web3SigningCredentialNone(); + + /** + * Model tests for Web3SigningCredentialNone + */ + @Test + public void testWeb3SigningCredentialNone() { + // TODO: test Web3SigningCredentialNone + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java new file mode 100644 index 00000000000..301a505ba5d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ +public class Web3SigningCredentialPrivateKeyHexTest { + private final Web3SigningCredentialPrivateKeyHex model = new Web3SigningCredentialPrivateKeyHex(); + + /** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ + @Test + public void testWeb3SigningCredentialPrivateKeyHex() { + // TODO: test Web3SigningCredentialPrivateKeyHex + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java new file mode 100644 index 00000000000..9f2e0a69922 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredential + */ +public class Web3SigningCredentialTest { + private final Web3SigningCredential model = new Web3SigningCredential(); + + /** + * Model tests for Web3SigningCredential + */ + @Test + public void testWeb3SigningCredential() { + // TODO: test Web3SigningCredential + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java new file mode 100644 index 00000000000..bc52be8d97b --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialType + */ +public class Web3SigningCredentialTypeTest { + /** + * Model tests for Web3SigningCredentialType + */ + @Test + public void testWeb3SigningCredentialType() { + // TODO: test Web3SigningCredentialType + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java new file mode 100644 index 00000000000..30d1ba144a3 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java @@ -0,0 +1,114 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3TransactionReceipt + */ +public class Web3TransactionReceiptTest { + private final Web3TransactionReceipt model = new Web3TransactionReceipt(); + + /** + * Model tests for Web3TransactionReceipt + */ + @Test + public void testWeb3TransactionReceipt() { + // TODO: test Web3TransactionReceipt + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawRequestTest.java b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawRequestTest.java new file mode 100644 index 00000000000..599e9554903 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawRequestTest.java @@ -0,0 +1,90 @@ +/* + * Hyperledger Cactus Plugin - HTLC ETH BESU ERC20 + * Allows Cactus nodes to interact with HTLC contracts with ERC-20 Tokens + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.NewContractRequestGas; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WithdrawRequest + */ +public class WithdrawRequestTest { + private final WithdrawRequest model = new WithdrawRequest(); + + /** + * Model tests for WithdrawRequest + */ + @Test + public void testWithdrawRequest() { + // TODO: test WithdrawRequest + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/package.json b/packages/cactus-plugin-htlc-eth-besu/package.json index 04d5cad1017..628dea24ac9 100644 --- a/packages/cactus-plugin-htlc-eth-besu/package.json +++ b/packages/cactus-plugin-htlc-eth-besu/package.json @@ -58,6 +58,8 @@ "compile-contracts": "forge build", "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "lint": "solhint --fix", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..e7b4b9e4b40 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,26 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_get_single_status_request.go +model_get_status_request.go +model_initialize_request.go +model_invoke_contract_v1_response.go +model_new_contract_obj.go +model_new_contract_obj_gas.go +model_refund_req.go +model_run_transaction_response.go +model_web3_signing_credential.go +model_web3_signing_credential_cactus_keychain_ref.go +model_web3_signing_credential_none.go +model_web3_signing_credential_private_key_hex.go +model_web3_signing_credential_type.go +model_web3_transaction_receipt.go +model_withdraw_req.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..51a4694ddf4 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,131 @@ +# Go API client for cactus-plugin-htlc-eth-besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-htlc-eth-besu "github.com/hyperledger/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-eth-besu.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-eth-besu.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-htlc-eth-besu.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-htlc-eth-besu.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetSingleStatusV1**](docs/DefaultApi.md#getsinglestatusv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-single-status | +*DefaultApi* | [**GetStatusV1**](docs/DefaultApi.md#getstatusv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-status | +*DefaultApi* | [**InitializeV1**](docs/DefaultApi.md#initializev1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/initialize | +*DefaultApi* | [**NewContractV1**](docs/DefaultApi.md#newcontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/new-contract | +*DefaultApi* | [**RefundV1**](docs/DefaultApi.md#refundv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/refund | +*DefaultApi* | [**WithdrawV1**](docs/DefaultApi.md#withdrawv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/withdraw | + + +## Documentation For Models + + - [GetSingleStatusRequest](docs/GetSingleStatusRequest.md) + - [GetStatusRequest](docs/GetStatusRequest.md) + - [InitializeRequest](docs/InitializeRequest.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [NewContractObj](docs/NewContractObj.md) + - [NewContractObjGas](docs/NewContractObjGas.md) + - [RefundReq](docs/RefundReq.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + - [WithdrawReq](docs/WithdrawReq.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..53aaeb51efe --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,547 @@ +openapi: 3.0.3 +info: + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - HTLC-ETH Besu + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/new-contract: + post: + operationId: newContractV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NewContractObj' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/new-contract + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/withdraw: + post: + operationId: withdrawV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WithdrawReq' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/withdraw + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/refund: + post: + operationId: refundV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RefundReq' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/refund + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-status: + post: + operationId: getStatusV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetStatusRequest' + responses: + "200": + content: + application/json: + schema: + items: + format: uint256 + type: integer + type: array + description: Array of status + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-status + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-single-status: + post: + operationId: getSingleStatusV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetSingleStatusRequest' + responses: + "200": + content: + application/json: + schema: + format: uint256 + type: integer + description: Status + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-single-status + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/initialize: + post: + operationId: initializeV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InitializeRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/initialize +components: + responses: + GetStatusResponse: + content: + application/json: + schema: + items: + format: uint256 + type: integer + type: array + description: Array of status + GetSingleStatusResponse: + content: + application/json: + schema: + format: uint256 + type: integer + description: Status + schemas: + NewContractObj: + additionalProperties: false + example: + outputAddress: outputAddress + receiver: receiver + keychainId: keychainId + outputAmount: 6.027456183070403 + outputNetwork: outputNetwork + connectorId: connectorId + hashLock: hashLock + gas: null + contractAddress: contractAddress + web3SigningCredential: + type: null + inputAmount: 0.8008281904610115 + expiration: 1.4658129805029452 + properties: + contractAddress: + description: Contract address + nullable: false + type: string + inputAmount: + type: number + outputAmount: + type: number + expiration: + type: number + hashLock: + type: string + receiver: + type: string + outputNetwork: + nullable: false + type: string + outputAddress: + nullable: false + type: string + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + keychainId: + description: keychainId for the keychian plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractObj_gas' + required: + - connectorId + - contractAddress + - expiration + - hashLock + - keychainId + - outputAddress + - outputAmount + - outputNetwork + - web3SigningCredential + type: object + RefundReq: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + gas: null + web3SigningCredential: + type: null + id: id + properties: + id: + description: Contract htlc id for refund + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractObj_gas' + required: + - connectorId + - id + - keychainId + - web3SigningCredential + type: object + WithdrawReq: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + gas: null + web3SigningCredential: + type: null + id: id + secret: secret + properties: + id: + description: Contract locked id + nullable: false + type: string + secret: + description: Secret need to unlock the contract + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractObj_gas' + required: + - connectorId + - id + - keychainId + - secret + - web3SigningCredential + type: object + InitializeRequest: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + constructorArgs: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + properties: + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + type: number + required: + - connectorId + - constructorArgs + - keychainId + - web3SigningCredential + type: object + GetStatusRequest: + additionalProperties: false + description: Defines the parameters for retrieving the status of the HTLC swap. + example: + keychainId: keychainId + connectorId: connectorId + ids: + - ids + - ids + web3SigningCredential: + type: null + properties: + ids: + items: + type: string + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + type: string + keychainId: + type: string + required: + - connectorId + - ids + - keychainId + - web3SigningCredential + type: object + GetSingleStatusRequest: + additionalProperties: false + description: Defines the parameters for retrieving the single status of the + HTLC swap. + example: + keychainId: keychainId + connectorId: connectorId + web3SigningCredential: + type: null + id: id + properties: + id: + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + type: string + keychainId: + type: string + required: + - connectorId + - id + - keychainId + - web3SigningCredential + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + NewContractObj_gas: + oneOf: + - type: string + - type: number diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..faee24d23e4 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,653 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGetSingleStatusV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getSingleStatusRequest *GetSingleStatusRequest +} + +func (r ApiGetSingleStatusV1Request) GetSingleStatusRequest(getSingleStatusRequest GetSingleStatusRequest) ApiGetSingleStatusV1Request { + r.getSingleStatusRequest = &getSingleStatusRequest + return r +} + +func (r ApiGetSingleStatusV1Request) Execute() (int32, *http.Response, error) { + return r.ApiService.GetSingleStatusV1Execute(r) +} + +/* +GetSingleStatusV1 Method for GetSingleStatusV1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetSingleStatusV1Request +*/ +func (a *DefaultApiService) GetSingleStatusV1(ctx context.Context) ApiGetSingleStatusV1Request { + return ApiGetSingleStatusV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return int32 +func (a *DefaultApiService) GetSingleStatusV1Execute(r ApiGetSingleStatusV1Request) (int32, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue int32 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSingleStatusV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-single-status" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getSingleStatusRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetStatusV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getStatusRequest *GetStatusRequest +} + +func (r ApiGetStatusV1Request) GetStatusRequest(getStatusRequest GetStatusRequest) ApiGetStatusV1Request { + r.getStatusRequest = &getStatusRequest + return r +} + +func (r ApiGetStatusV1Request) Execute() ([]int32, *http.Response, error) { + return r.ApiService.GetStatusV1Execute(r) +} + +/* +GetStatusV1 Method for GetStatusV1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetStatusV1Request +*/ +func (a *DefaultApiService) GetStatusV1(ctx context.Context) ApiGetStatusV1Request { + return ApiGetStatusV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []int32 +func (a *DefaultApiService) GetStatusV1Execute(r ApiGetStatusV1Request) ([]int32, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []int32 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetStatusV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-status" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getStatusRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInitializeV1Request struct { + ctx context.Context + ApiService *DefaultApiService + initializeRequest *InitializeRequest +} + +func (r ApiInitializeV1Request) InitializeRequest(initializeRequest InitializeRequest) ApiInitializeV1Request { + r.initializeRequest = &initializeRequest + return r +} + +func (r ApiInitializeV1Request) Execute() (*RunTransactionResponse, *http.Response, error) { + return r.ApiService.InitializeV1Execute(r) +} + +/* +InitializeV1 Method for InitializeV1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInitializeV1Request +*/ +func (a *DefaultApiService) InitializeV1(ctx context.Context) ApiInitializeV1Request { + return ApiInitializeV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionResponse +func (a *DefaultApiService) InitializeV1Execute(r ApiInitializeV1Request) (*RunTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InitializeV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/initialize" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.initializeRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiNewContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + newContractObj *NewContractObj +} + +func (r ApiNewContractV1Request) NewContractObj(newContractObj NewContractObj) ApiNewContractV1Request { + r.newContractObj = &newContractObj + return r +} + +func (r ApiNewContractV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.NewContractV1Execute(r) +} + +/* +NewContractV1 Method for NewContractV1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiNewContractV1Request +*/ +func (a *DefaultApiService) NewContractV1(ctx context.Context) ApiNewContractV1Request { + return ApiNewContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) NewContractV1Execute(r ApiNewContractV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.NewContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/new-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.newContractObj + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRefundV1Request struct { + ctx context.Context + ApiService *DefaultApiService + refundReq *RefundReq +} + +func (r ApiRefundV1Request) RefundReq(refundReq RefundReq) ApiRefundV1Request { + r.refundReq = &refundReq + return r +} + +func (r ApiRefundV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.RefundV1Execute(r) +} + +/* +RefundV1 Method for RefundV1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRefundV1Request +*/ +func (a *DefaultApiService) RefundV1(ctx context.Context) ApiRefundV1Request { + return ApiRefundV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) RefundV1Execute(r ApiRefundV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RefundV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/refund" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.refundReq + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiWithdrawV1Request struct { + ctx context.Context + ApiService *DefaultApiService + withdrawReq *WithdrawReq +} + +func (r ApiWithdrawV1Request) WithdrawReq(withdrawReq WithdrawReq) ApiWithdrawV1Request { + r.withdrawReq = &withdrawReq + return r +} + +func (r ApiWithdrawV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.WithdrawV1Execute(r) +} + +/* +WithdrawV1 Method for WithdrawV1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiWithdrawV1Request +*/ +func (a *DefaultApiService) WithdrawV1(ctx context.Context) ApiWithdrawV1Request { + return ApiWithdrawV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) WithdrawV1Execute(r ApiWithdrawV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.WithdrawV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/withdraw" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.withdrawReq + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..31b70bf1949 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - HTLC-ETH Besu API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..8b7461c906d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..cb2f3464ec8 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_get_single_status_request.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_get_single_status_request.go new file mode 100644 index 00000000000..f0129c8c443 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_get_single_status_request.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the GetSingleStatusRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetSingleStatusRequest{} + +// GetSingleStatusRequest Defines the parameters for retrieving the single status of the HTLC swap. +type GetSingleStatusRequest struct { + Id string `json:"id"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + ConnectorId string `json:"connectorId"` + KeychainId string `json:"keychainId"` +} + +// NewGetSingleStatusRequest instantiates a new GetSingleStatusRequest 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 +// will change when the set of required properties is changed +func NewGetSingleStatusRequest(id string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *GetSingleStatusRequest { + this := GetSingleStatusRequest{} + this.Id = id + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewGetSingleStatusRequestWithDefaults instantiates a new GetSingleStatusRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetSingleStatusRequestWithDefaults() *GetSingleStatusRequest { + this := GetSingleStatusRequest{} + return &this +} + +// GetId returns the Id field value +func (o *GetSingleStatusRequest) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *GetSingleStatusRequest) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetSingleStatusRequest) SetId(v string) { + o.Id = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *GetSingleStatusRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *GetSingleStatusRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *GetSingleStatusRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *GetSingleStatusRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *GetSingleStatusRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *GetSingleStatusRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *GetSingleStatusRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *GetSingleStatusRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *GetSingleStatusRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o GetSingleStatusRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetSingleStatusRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableGetSingleStatusRequest struct { + value *GetSingleStatusRequest + isSet bool +} + +func (v NullableGetSingleStatusRequest) Get() *GetSingleStatusRequest { + return v.value +} + +func (v *NullableGetSingleStatusRequest) Set(val *GetSingleStatusRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGetSingleStatusRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGetSingleStatusRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetSingleStatusRequest(val *GetSingleStatusRequest) *NullableGetSingleStatusRequest { + return &NullableGetSingleStatusRequest{value: val, isSet: true} +} + +func (v NullableGetSingleStatusRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetSingleStatusRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_get_status_request.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_get_status_request.go new file mode 100644 index 00000000000..1f070d100b6 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_get_status_request.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the GetStatusRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetStatusRequest{} + +// GetStatusRequest Defines the parameters for retrieving the status of the HTLC swap. +type GetStatusRequest struct { + Ids []string `json:"ids"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + ConnectorId string `json:"connectorId"` + KeychainId string `json:"keychainId"` +} + +// NewGetStatusRequest instantiates a new GetStatusRequest 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 +// will change when the set of required properties is changed +func NewGetStatusRequest(ids []string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *GetStatusRequest { + this := GetStatusRequest{} + this.Ids = ids + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewGetStatusRequestWithDefaults instantiates a new GetStatusRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetStatusRequestWithDefaults() *GetStatusRequest { + this := GetStatusRequest{} + return &this +} + +// GetIds returns the Ids field value +func (o *GetStatusRequest) GetIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.Ids +} + +// GetIdsOk returns a tuple with the Ids field value +// and a boolean to check if the value has been set. +func (o *GetStatusRequest) GetIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Ids, true +} + +// SetIds sets field value +func (o *GetStatusRequest) SetIds(v []string) { + o.Ids = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *GetStatusRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *GetStatusRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *GetStatusRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *GetStatusRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *GetStatusRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *GetStatusRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *GetStatusRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *GetStatusRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *GetStatusRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o GetStatusRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetStatusRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["ids"] = o.Ids + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableGetStatusRequest struct { + value *GetStatusRequest + isSet bool +} + +func (v NullableGetStatusRequest) Get() *GetStatusRequest { + return v.value +} + +func (v *NullableGetStatusRequest) Set(val *GetStatusRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGetStatusRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGetStatusRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetStatusRequest(val *GetStatusRequest) *NullableGetStatusRequest { + return &NullableGetStatusRequest{value: val, isSet: true} +} + +func (v NullableGetStatusRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetStatusRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_initialize_request.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_initialize_request.go new file mode 100644 index 00000000000..40144a6e67d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_initialize_request.go @@ -0,0 +1,236 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the InitializeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InitializeRequest{} + +// InitializeRequest struct for InitializeRequest +type InitializeRequest struct { + // connectorId for the connector besu plugin + ConnectorId string `json:"connectorId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + ConstructorArgs []interface{} `json:"constructorArgs"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + Gas *float32 `json:"gas,omitempty"` +} + +// NewInitializeRequest instantiates a new InitializeRequest 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 +// will change when the set of required properties is changed +func NewInitializeRequest(connectorId string, keychainId string, constructorArgs []interface{}, web3SigningCredential Web3SigningCredential) *InitializeRequest { + this := InitializeRequest{} + this.ConnectorId = connectorId + this.KeychainId = keychainId + this.ConstructorArgs = constructorArgs + this.Web3SigningCredential = web3SigningCredential + return &this +} + +// NewInitializeRequestWithDefaults instantiates a new InitializeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInitializeRequestWithDefaults() *InitializeRequest { + this := InitializeRequest{} + return &this +} + +// GetConnectorId returns the ConnectorId field value +func (o *InitializeRequest) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *InitializeRequest) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *InitializeRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *InitializeRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetConstructorArgs returns the ConstructorArgs field value +func (o *InitializeRequest) GetConstructorArgs() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ConstructorArgs, true +} + +// SetConstructorArgs sets field value +func (o *InitializeRequest) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *InitializeRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *InitializeRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *InitializeRequest) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InitializeRequest) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *InitializeRequest) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *InitializeRequest) SetGas(v float32) { + o.Gas = &v +} + +func (o InitializeRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InitializeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + toSerialize["constructorArgs"] = o.ConstructorArgs + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableInitializeRequest struct { + value *InitializeRequest + isSet bool +} + +func (v NullableInitializeRequest) Get() *InitializeRequest { + return v.value +} + +func (v *NullableInitializeRequest) Set(val *InitializeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInitializeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInitializeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInitializeRequest(val *InitializeRequest) *NullableInitializeRequest { + return &NullableInitializeRequest{value: val, isSet: true} +} + +func (v NullableInitializeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInitializeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go new file mode 100644 index 00000000000..1331aa5753a --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go @@ -0,0 +1,190 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Response{} + +// InvokeContractV1Response struct for InvokeContractV1Response +type InvokeContractV1Response struct { + TransactionReceipt *Web3TransactionReceipt `json:"transactionReceipt,omitempty"` + CallOutput interface{} `json:"callOutput,omitempty"` + Success bool `json:"success"` +} + +// NewInvokeContractV1Response instantiates a new InvokeContractV1Response 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 +// will change when the set of required properties is changed +func NewInvokeContractV1Response(success bool) *InvokeContractV1Response { + this := InvokeContractV1Response{} + this.Success = success + return &this +} + +// NewInvokeContractV1ResponseWithDefaults instantiates a new InvokeContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1ResponseWithDefaults() *InvokeContractV1Response { + this := InvokeContractV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value if set, zero value otherwise. +func (o *InvokeContractV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil || IsNil(o.TransactionReceipt) { + var ret Web3TransactionReceipt + return ret + } + return *o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil || IsNil(o.TransactionReceipt) { + return nil, false + } + return o.TransactionReceipt, true +} + +// HasTransactionReceipt returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasTransactionReceipt() bool { + if o != nil && !IsNil(o.TransactionReceipt) { + return true + } + + return false +} + +// SetTransactionReceipt gets a reference to the given Web3TransactionReceipt and assigns it to the TransactionReceipt field. +func (o *InvokeContractV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = &v +} + +// GetCallOutput returns the CallOutput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeContractV1Response) GetCallOutput() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.CallOutput +} + +// GetCallOutputOk returns a tuple with the CallOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeContractV1Response) GetCallOutputOk() (*interface{}, bool) { + if o == nil || IsNil(o.CallOutput) { + return nil, false + } + return &o.CallOutput, true +} + +// HasCallOutput returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasCallOutput() bool { + if o != nil && IsNil(o.CallOutput) { + return true + } + + return false +} + +// SetCallOutput gets a reference to the given interface{} and assigns it to the CallOutput field. +func (o *InvokeContractV1Response) SetCallOutput(v interface{}) { + o.CallOutput = v +} + +// GetSuccess returns the Success field value +func (o *InvokeContractV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *InvokeContractV1Response) SetSuccess(v bool) { + o.Success = v +} + +func (o InvokeContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TransactionReceipt) { + toSerialize["transactionReceipt"] = o.TransactionReceipt + } + if o.CallOutput != nil { + toSerialize["callOutput"] = o.CallOutput + } + toSerialize["success"] = o.Success + return toSerialize, nil +} + +type NullableInvokeContractV1Response struct { + value *InvokeContractV1Response + isSet bool +} + +func (v NullableInvokeContractV1Response) Get() *InvokeContractV1Response { + return v.value +} + +func (v *NullableInvokeContractV1Response) Set(val *InvokeContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Response(val *InvokeContractV1Response) *NullableInvokeContractV1Response { + return &NullableInvokeContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_new_contract_obj.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_new_contract_obj.go new file mode 100644 index 00000000000..3314eb61551 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_new_contract_obj.go @@ -0,0 +1,444 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the NewContractObj type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NewContractObj{} + +// NewContractObj struct for NewContractObj +type NewContractObj struct { + // Contract address + ContractAddress string `json:"contractAddress"` + InputAmount *float32 `json:"inputAmount,omitempty"` + OutputAmount float32 `json:"outputAmount"` + Expiration float32 `json:"expiration"` + HashLock string `json:"hashLock"` + Receiver *string `json:"receiver,omitempty"` + OutputNetwork string `json:"outputNetwork"` + OutputAddress string `json:"outputAddress"` + // connectorId for the connector besu plugin + ConnectorId string `json:"connectorId"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // keychainId for the keychian plugin + KeychainId string `json:"keychainId"` + Gas *NewContractObjGas `json:"gas,omitempty"` +} + +// NewNewContractObj instantiates a new NewContractObj 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 +// will change when the set of required properties is changed +func NewNewContractObj(contractAddress string, outputAmount float32, expiration float32, hashLock string, outputNetwork string, outputAddress string, connectorId string, web3SigningCredential Web3SigningCredential, keychainId string) *NewContractObj { + this := NewContractObj{} + this.ContractAddress = contractAddress + this.OutputAmount = outputAmount + this.Expiration = expiration + this.HashLock = hashLock + this.OutputNetwork = outputNetwork + this.OutputAddress = outputAddress + this.ConnectorId = connectorId + this.Web3SigningCredential = web3SigningCredential + this.KeychainId = keychainId + return &this +} + +// NewNewContractObjWithDefaults instantiates a new NewContractObj object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNewContractObjWithDefaults() *NewContractObj { + this := NewContractObj{} + return &this +} + +// GetContractAddress returns the ContractAddress field value +func (o *NewContractObj) GetContractAddress() string { + if o == nil { + var ret string + return ret + } + + return o.ContractAddress +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractAddress, true +} + +// SetContractAddress sets field value +func (o *NewContractObj) SetContractAddress(v string) { + o.ContractAddress = v +} + +// GetInputAmount returns the InputAmount field value if set, zero value otherwise. +func (o *NewContractObj) GetInputAmount() float32 { + if o == nil || IsNil(o.InputAmount) { + var ret float32 + return ret + } + return *o.InputAmount +} + +// GetInputAmountOk returns a tuple with the InputAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetInputAmountOk() (*float32, bool) { + if o == nil || IsNil(o.InputAmount) { + return nil, false + } + return o.InputAmount, true +} + +// HasInputAmount returns a boolean if a field has been set. +func (o *NewContractObj) HasInputAmount() bool { + if o != nil && !IsNil(o.InputAmount) { + return true + } + + return false +} + +// SetInputAmount gets a reference to the given float32 and assigns it to the InputAmount field. +func (o *NewContractObj) SetInputAmount(v float32) { + o.InputAmount = &v +} + +// GetOutputAmount returns the OutputAmount field value +func (o *NewContractObj) GetOutputAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.OutputAmount +} + +// GetOutputAmountOk returns a tuple with the OutputAmount field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetOutputAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.OutputAmount, true +} + +// SetOutputAmount sets field value +func (o *NewContractObj) SetOutputAmount(v float32) { + o.OutputAmount = v +} + +// GetExpiration returns the Expiration field value +func (o *NewContractObj) GetExpiration() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Expiration +} + +// GetExpirationOk returns a tuple with the Expiration field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetExpirationOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Expiration, true +} + +// SetExpiration sets field value +func (o *NewContractObj) SetExpiration(v float32) { + o.Expiration = v +} + +// GetHashLock returns the HashLock field value +func (o *NewContractObj) GetHashLock() string { + if o == nil { + var ret string + return ret + } + + return o.HashLock +} + +// GetHashLockOk returns a tuple with the HashLock field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetHashLockOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashLock, true +} + +// SetHashLock sets field value +func (o *NewContractObj) SetHashLock(v string) { + o.HashLock = v +} + +// GetReceiver returns the Receiver field value if set, zero value otherwise. +func (o *NewContractObj) GetReceiver() string { + if o == nil || IsNil(o.Receiver) { + var ret string + return ret + } + return *o.Receiver +} + +// GetReceiverOk returns a tuple with the Receiver field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetReceiverOk() (*string, bool) { + if o == nil || IsNil(o.Receiver) { + return nil, false + } + return o.Receiver, true +} + +// HasReceiver returns a boolean if a field has been set. +func (o *NewContractObj) HasReceiver() bool { + if o != nil && !IsNil(o.Receiver) { + return true + } + + return false +} + +// SetReceiver gets a reference to the given string and assigns it to the Receiver field. +func (o *NewContractObj) SetReceiver(v string) { + o.Receiver = &v +} + +// GetOutputNetwork returns the OutputNetwork field value +func (o *NewContractObj) GetOutputNetwork() string { + if o == nil { + var ret string + return ret + } + + return o.OutputNetwork +} + +// GetOutputNetworkOk returns a tuple with the OutputNetwork field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetOutputNetworkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OutputNetwork, true +} + +// SetOutputNetwork sets field value +func (o *NewContractObj) SetOutputNetwork(v string) { + o.OutputNetwork = v +} + +// GetOutputAddress returns the OutputAddress field value +func (o *NewContractObj) GetOutputAddress() string { + if o == nil { + var ret string + return ret + } + + return o.OutputAddress +} + +// GetOutputAddressOk returns a tuple with the OutputAddress field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetOutputAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OutputAddress, true +} + +// SetOutputAddress sets field value +func (o *NewContractObj) SetOutputAddress(v string) { + o.OutputAddress = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *NewContractObj) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *NewContractObj) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *NewContractObj) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *NewContractObj) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetKeychainId returns the KeychainId field value +func (o *NewContractObj) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *NewContractObj) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *NewContractObj) GetGas() NewContractObjGas { + if o == nil || IsNil(o.Gas) { + var ret NewContractObjGas + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NewContractObj) GetGasOk() (*NewContractObjGas, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *NewContractObj) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given NewContractObjGas and assigns it to the Gas field. +func (o *NewContractObj) SetGas(v NewContractObjGas) { + o.Gas = &v +} + +func (o NewContractObj) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NewContractObj) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractAddress"] = o.ContractAddress + if !IsNil(o.InputAmount) { + toSerialize["inputAmount"] = o.InputAmount + } + toSerialize["outputAmount"] = o.OutputAmount + toSerialize["expiration"] = o.Expiration + toSerialize["hashLock"] = o.HashLock + if !IsNil(o.Receiver) { + toSerialize["receiver"] = o.Receiver + } + toSerialize["outputNetwork"] = o.OutputNetwork + toSerialize["outputAddress"] = o.OutputAddress + toSerialize["connectorId"] = o.ConnectorId + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableNewContractObj struct { + value *NewContractObj + isSet bool +} + +func (v NullableNewContractObj) Get() *NewContractObj { + return v.value +} + +func (v *NullableNewContractObj) Set(val *NewContractObj) { + v.value = val + v.isSet = true +} + +func (v NullableNewContractObj) IsSet() bool { + return v.isSet +} + +func (v *NullableNewContractObj) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNewContractObj(val *NewContractObj) *NullableNewContractObj { + return &NullableNewContractObj{value: val, isSet: true} +} + +func (v NullableNewContractObj) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNewContractObj) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_new_contract_obj_gas.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_new_contract_obj_gas.go new file mode 100644 index 00000000000..70a08c0e8e3 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_new_contract_obj_gas.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" + "fmt" +) + +// NewContractObjGas - struct for NewContractObjGas +type NewContractObjGas struct { + Float32 *float32 + String *string +} + +// float32AsNewContractObjGas is a convenience function that returns float32 wrapped in NewContractObjGas +func Float32AsNewContractObjGas(v *float32) NewContractObjGas { + return NewContractObjGas{ + Float32: v, + } +} + +// stringAsNewContractObjGas is a convenience function that returns string wrapped in NewContractObjGas +func StringAsNewContractObjGas(v *string) NewContractObjGas { + return NewContractObjGas{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *NewContractObjGas) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Float32 + err = newStrictDecoder(data).Decode(&dst.Float32) + if err == nil { + jsonFloat32, _ := json.Marshal(dst.Float32) + if string(jsonFloat32) == "{}" { // empty struct + dst.Float32 = nil + } else { + match++ + } + } else { + dst.Float32 = nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Float32 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(NewContractObjGas)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(NewContractObjGas)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src NewContractObjGas) MarshalJSON() ([]byte, error) { + if src.Float32 != nil { + return json.Marshal(&src.Float32) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *NewContractObjGas) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Float32 != nil { + return obj.Float32 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableNewContractObjGas struct { + value *NewContractObjGas + isSet bool +} + +func (v NullableNewContractObjGas) Get() *NewContractObjGas { + return v.value +} + +func (v *NullableNewContractObjGas) Set(val *NewContractObjGas) { + v.value = val + v.isSet = true +} + +func (v NullableNewContractObjGas) IsSet() bool { + return v.isSet +} + +func (v *NullableNewContractObjGas) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNewContractObjGas(val *NewContractObjGas) *NullableNewContractObjGas { + return &NullableNewContractObjGas{value: val, isSet: true} +} + +func (v NullableNewContractObjGas) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNewContractObjGas) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_refund_req.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_refund_req.go new file mode 100644 index 00000000000..55c623587c2 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_refund_req.go @@ -0,0 +1,237 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the RefundReq type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RefundReq{} + +// RefundReq struct for RefundReq +type RefundReq struct { + // Contract htlc id for refund + Id string `json:"id"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // connectorId for the connector besu plugin + ConnectorId string `json:"connectorId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + Gas *NewContractObjGas `json:"gas,omitempty"` +} + +// NewRefundReq instantiates a new RefundReq 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 +// will change when the set of required properties is changed +func NewRefundReq(id string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *RefundReq { + this := RefundReq{} + this.Id = id + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewRefundReqWithDefaults instantiates a new RefundReq object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRefundReqWithDefaults() *RefundReq { + this := RefundReq{} + return &this +} + +// GetId returns the Id field value +func (o *RefundReq) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RefundReq) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RefundReq) SetId(v string) { + o.Id = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *RefundReq) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *RefundReq) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *RefundReq) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *RefundReq) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *RefundReq) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *RefundReq) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *RefundReq) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *RefundReq) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *RefundReq) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *RefundReq) GetGas() NewContractObjGas { + if o == nil || IsNil(o.Gas) { + var ret NewContractObjGas + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RefundReq) GetGasOk() (*NewContractObjGas, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *RefundReq) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given NewContractObjGas and assigns it to the Gas field. +func (o *RefundReq) SetGas(v NewContractObjGas) { + o.Gas = &v +} + +func (o RefundReq) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RefundReq) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableRefundReq struct { + value *RefundReq + isSet bool +} + +func (v NullableRefundReq) Get() *RefundReq { + return v.value +} + +func (v *NullableRefundReq) Set(val *RefundReq) { + v.value = val + v.isSet = true +} + +func (v NullableRefundReq) IsSet() bool { + return v.isSet +} + +func (v *NullableRefundReq) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRefundReq(val *RefundReq) *NullableRefundReq { + return &NullableRefundReq{value: val, isSet: true} +} + +func (v NullableRefundReq) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRefundReq) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_run_transaction_response.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_run_transaction_response.go new file mode 100644 index 00000000000..febbca74a20 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_run_transaction_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the RunTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionResponse{} + +// RunTransactionResponse struct for RunTransactionResponse +type RunTransactionResponse struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewRunTransactionResponse instantiates a new RunTransactionResponse 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 +// will change when the set of required properties is changed +func NewRunTransactionResponse(transactionReceipt Web3TransactionReceipt) *RunTransactionResponse { + this := RunTransactionResponse{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewRunTransactionResponseWithDefaults instantiates a new RunTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionResponseWithDefaults() *RunTransactionResponse { + this := RunTransactionResponse{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *RunTransactionResponse) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *RunTransactionResponse) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *RunTransactionResponse) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o RunTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableRunTransactionResponse struct { + value *RunTransactionResponse + isSet bool +} + +func (v NullableRunTransactionResponse) Get() *RunTransactionResponse { + return v.value +} + +func (v *NullableRunTransactionResponse) Set(val *RunTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionResponse(val *RunTransactionResponse) *NullableRunTransactionResponse { + return &NullableRunTransactionResponse{value: val, isSet: true} +} + +func (v NullableRunTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go new file mode 100644 index 00000000000..06850f15b7c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go @@ -0,0 +1,178 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredential - struct for Web3SigningCredential +type Web3SigningCredential struct { + Web3SigningCredentialCactusKeychainRef *Web3SigningCredentialCactusKeychainRef + Web3SigningCredentialNone *Web3SigningCredentialNone + Web3SigningCredentialPrivateKeyHex *Web3SigningCredentialPrivateKeyHex +} + +// Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialCactusKeychainRef wrapped in Web3SigningCredential +func Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential(v *Web3SigningCredentialCactusKeychainRef) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialCactusKeychainRef: v, + } +} + +// Web3SigningCredentialNoneAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialNone wrapped in Web3SigningCredential +func Web3SigningCredentialNoneAsWeb3SigningCredential(v *Web3SigningCredentialNone) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialNone: v, + } +} + +// Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialPrivateKeyHex wrapped in Web3SigningCredential +func Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential(v *Web3SigningCredentialPrivateKeyHex) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialPrivateKeyHex: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Web3SigningCredential) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Web3SigningCredentialCactusKeychainRef + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialCactusKeychainRef) + if err == nil { + jsonWeb3SigningCredentialCactusKeychainRef, _ := json.Marshal(dst.Web3SigningCredentialCactusKeychainRef) + if string(jsonWeb3SigningCredentialCactusKeychainRef) == "{}" { // empty struct + dst.Web3SigningCredentialCactusKeychainRef = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialCactusKeychainRef = nil + } + + // try to unmarshal data into Web3SigningCredentialNone + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialNone) + if err == nil { + jsonWeb3SigningCredentialNone, _ := json.Marshal(dst.Web3SigningCredentialNone) + if string(jsonWeb3SigningCredentialNone) == "{}" { // empty struct + dst.Web3SigningCredentialNone = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialNone = nil + } + + // try to unmarshal data into Web3SigningCredentialPrivateKeyHex + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialPrivateKeyHex) + if err == nil { + jsonWeb3SigningCredentialPrivateKeyHex, _ := json.Marshal(dst.Web3SigningCredentialPrivateKeyHex) + if string(jsonWeb3SigningCredentialPrivateKeyHex) == "{}" { // empty struct + dst.Web3SigningCredentialPrivateKeyHex = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialPrivateKeyHex = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Web3SigningCredentialCactusKeychainRef = nil + dst.Web3SigningCredentialNone = nil + dst.Web3SigningCredentialPrivateKeyHex = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Web3SigningCredential)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Web3SigningCredential)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Web3SigningCredential) MarshalJSON() ([]byte, error) { + if src.Web3SigningCredentialCactusKeychainRef != nil { + return json.Marshal(&src.Web3SigningCredentialCactusKeychainRef) + } + + if src.Web3SigningCredentialNone != nil { + return json.Marshal(&src.Web3SigningCredentialNone) + } + + if src.Web3SigningCredentialPrivateKeyHex != nil { + return json.Marshal(&src.Web3SigningCredentialPrivateKeyHex) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Web3SigningCredential) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Web3SigningCredentialCactusKeychainRef != nil { + return obj.Web3SigningCredentialCactusKeychainRef + } + + if obj.Web3SigningCredentialNone != nil { + return obj.Web3SigningCredentialNone + } + + if obj.Web3SigningCredentialPrivateKeyHex != nil { + return obj.Web3SigningCredentialPrivateKeyHex + } + + // all schemas are nil + return nil +} + +type NullableWeb3SigningCredential struct { + value *Web3SigningCredential + isSet bool +} + +func (v NullableWeb3SigningCredential) Get() *Web3SigningCredential { + return v.value +} + +func (v *NullableWeb3SigningCredential) Set(val *Web3SigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredential(val *Web3SigningCredential) *NullableWeb3SigningCredential { + return &NullableWeb3SigningCredential{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go new file mode 100644 index 00000000000..b7de5d309c7 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go @@ -0,0 +1,201 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialCactusKeychainRef type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialCactusKeychainRef{} + +// Web3SigningCredentialCactusKeychainRef struct for Web3SigningCredentialCactusKeychainRef +type Web3SigningCredentialCactusKeychainRef struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + KeychainEntryKey string `json:"keychainEntryKey"` + // The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + KeychainId string `json:"keychainId"` +} + +// NewWeb3SigningCredentialCactusKeychainRef instantiates a new Web3SigningCredentialCactusKeychainRef 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialCactusKeychainRef(type_ Web3SigningCredentialType, ethAccount string, keychainEntryKey string, keychainId string) *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + this.Type = type_ + this.EthAccount = ethAccount + this.KeychainEntryKey = keychainEntryKey + this.KeychainId = keychainId + return &this +} + +// NewWeb3SigningCredentialCactusKeychainRefWithDefaults instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialCactusKeychainRefWithDefaults() *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialCactusKeychainRef) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetKeychainEntryKey returns the KeychainEntryKey field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKey() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainEntryKey +} + +// GetKeychainEntryKeyOk returns a tuple with the KeychainEntryKey field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainEntryKey, true +} + +// SetKeychainEntryKey sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainEntryKey(v string) { + o.KeychainEntryKey = v +} + +// GetKeychainId returns the KeychainId field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o Web3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialCactusKeychainRef) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["keychainEntryKey"] = o.KeychainEntryKey + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableWeb3SigningCredentialCactusKeychainRef struct { + value *Web3SigningCredentialCactusKeychainRef + isSet bool +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) Get() *Web3SigningCredentialCactusKeychainRef { + return v.value +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Set(val *Web3SigningCredentialCactusKeychainRef) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialCactusKeychainRef(val *Web3SigningCredentialCactusKeychainRef) *NullableWeb3SigningCredentialCactusKeychainRef { + return &NullableWeb3SigningCredentialCactusKeychainRef{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go new file mode 100644 index 00000000000..5c362c5fd5b --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialNone type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialNone{} + +// Web3SigningCredentialNone Using this denotes that there is no signing required because the transaction is pre-signed. +type Web3SigningCredentialNone struct { + Type Web3SigningCredentialType `json:"type"` +} + +// NewWeb3SigningCredentialNone instantiates a new Web3SigningCredentialNone 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialNone(type_ Web3SigningCredentialType) *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + this.Type = type_ + return &this +} + +// NewWeb3SigningCredentialNoneWithDefaults instantiates a new Web3SigningCredentialNone object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialNoneWithDefaults() *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialNone) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialNone) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialNone) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +func (o Web3SigningCredentialNone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialNone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableWeb3SigningCredentialNone struct { + value *Web3SigningCredentialNone + isSet bool +} + +func (v NullableWeb3SigningCredentialNone) Get() *Web3SigningCredentialNone { + return v.value +} + +func (v *NullableWeb3SigningCredentialNone) Set(val *Web3SigningCredentialNone) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialNone) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialNone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialNone(val *Web3SigningCredentialNone) *NullableWeb3SigningCredentialNone { + return &NullableWeb3SigningCredentialNone{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialNone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialNone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go new file mode 100644 index 00000000000..d995cb9b5ac --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialPrivateKeyHex type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialPrivateKeyHex{} + +// Web3SigningCredentialPrivateKeyHex struct for Web3SigningCredentialPrivateKeyHex +type Web3SigningCredentialPrivateKeyHex struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The HEX encoded private key of an eth account. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialPrivateKeyHex instantiates a new Web3SigningCredentialPrivateKeyHex 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialPrivateKeyHex(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialPrivateKeyHexWithDefaults instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialPrivateKeyHexWithDefaults() *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialPrivateKeyHex) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialPrivateKeyHex) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialPrivateKeyHex) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialPrivateKeyHex struct { + value *Web3SigningCredentialPrivateKeyHex + isSet bool +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) Get() *Web3SigningCredentialPrivateKeyHex { + return v.value +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Set(val *Web3SigningCredentialPrivateKeyHex) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialPrivateKeyHex(val *Web3SigningCredentialPrivateKeyHex) *NullableWeb3SigningCredentialPrivateKeyHex { + return &NullableWeb3SigningCredentialPrivateKeyHex{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go new file mode 100644 index 00000000000..0a9060e1bbc --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredentialType the model 'Web3SigningCredentialType' +type Web3SigningCredentialType string + +// List of Web3SigningCredentialType +const ( + CACTUS_KEYCHAIN_REF Web3SigningCredentialType = "CACTUS_KEYCHAIN_REF" + GETH_KEYCHAIN_PASSWORD Web3SigningCredentialType = "GETH_KEYCHAIN_PASSWORD" + PRIVATE_KEY_HEX Web3SigningCredentialType = "PRIVATE_KEY_HEX" + NONE Web3SigningCredentialType = "NONE" +) + +// All allowed values of Web3SigningCredentialType enum +var AllowedWeb3SigningCredentialTypeEnumValues = []Web3SigningCredentialType{ + "CACTUS_KEYCHAIN_REF", + "GETH_KEYCHAIN_PASSWORD", + "PRIVATE_KEY_HEX", + "NONE", +} + +func (v *Web3SigningCredentialType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Web3SigningCredentialType(value) + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Web3SigningCredentialType", value) +} + +// NewWeb3SigningCredentialTypeFromValue returns a pointer to a valid Web3SigningCredentialType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWeb3SigningCredentialTypeFromValue(v string) (*Web3SigningCredentialType, error) { + ev := Web3SigningCredentialType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Web3SigningCredentialType: valid values are %v", v, AllowedWeb3SigningCredentialTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Web3SigningCredentialType) IsValid() bool { + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Web3SigningCredentialType value +func (v Web3SigningCredentialType) Ptr() *Web3SigningCredentialType { + return &v +} + +type NullableWeb3SigningCredentialType struct { + value *Web3SigningCredentialType + isSet bool +} + +func (v NullableWeb3SigningCredentialType) Get() *Web3SigningCredentialType { + return v.value +} + +func (v *NullableWeb3SigningCredentialType) Set(val *Web3SigningCredentialType) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialType) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialType(val *Web3SigningCredentialType) *NullableWeb3SigningCredentialType { + return &NullableWeb3SigningCredentialType{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go new file mode 100644 index 00000000000..2c919e39b9c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go @@ -0,0 +1,385 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the Web3TransactionReceipt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3TransactionReceipt{} + +// Web3TransactionReceipt struct for Web3TransactionReceipt +type Web3TransactionReceipt struct { + Status bool `json:"status"` + TransactionHash string `json:"transactionHash"` + TransactionIndex float32 `json:"transactionIndex"` + BlockHash string `json:"blockHash"` + BlockNumber float32 `json:"blockNumber"` + GasUsed float32 `json:"gasUsed"` + ContractAddress NullableString `json:"contractAddress,omitempty"` + From string `json:"from"` + To string `json:"to"` + AdditionalProperties map[string]interface{} +} + +type _Web3TransactionReceipt Web3TransactionReceipt + +// NewWeb3TransactionReceipt instantiates a new Web3TransactionReceipt 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 +// will change when the set of required properties is changed +func NewWeb3TransactionReceipt(status bool, transactionHash string, transactionIndex float32, blockHash string, blockNumber float32, gasUsed float32, from string, to string) *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + this.Status = status + this.TransactionHash = transactionHash + this.TransactionIndex = transactionIndex + this.BlockHash = blockHash + this.BlockNumber = blockNumber + this.GasUsed = gasUsed + this.From = from + this.To = to + return &this +} + +// NewWeb3TransactionReceiptWithDefaults instantiates a new Web3TransactionReceipt object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3TransactionReceiptWithDefaults() *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + return &this +} + +// GetStatus returns the Status field value +func (o *Web3TransactionReceipt) GetStatus() bool { + if o == nil { + var ret bool + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetStatusOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Web3TransactionReceipt) SetStatus(v bool) { + o.Status = v +} + +// GetTransactionHash returns the TransactionHash field value +func (o *Web3TransactionReceipt) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *Web3TransactionReceipt) SetTransactionHash(v string) { + o.TransactionHash = v +} + +// GetTransactionIndex returns the TransactionIndex field value +func (o *Web3TransactionReceipt) GetTransactionIndex() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TransactionIndex, true +} + +// SetTransactionIndex sets field value +func (o *Web3TransactionReceipt) SetTransactionIndex(v float32) { + o.TransactionIndex = v +} + +// GetBlockHash returns the BlockHash field value +func (o *Web3TransactionReceipt) GetBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *Web3TransactionReceipt) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetBlockNumber returns the BlockNumber field value +func (o *Web3TransactionReceipt) GetBlockNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *Web3TransactionReceipt) SetBlockNumber(v float32) { + o.BlockNumber = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3TransactionReceipt) GetGasUsed() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetGasUsedOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3TransactionReceipt) SetGasUsed(v float32) { + o.GasUsed = v +} + +// GetContractAddress returns the ContractAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Web3TransactionReceipt) GetContractAddress() string { + if o == nil || IsNil(o.ContractAddress.Get()) { + var ret string + return ret + } + return *o.ContractAddress.Get() +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3TransactionReceipt) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ContractAddress.Get(), o.ContractAddress.IsSet() +} + +// HasContractAddress returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasContractAddress() bool { + if o != nil && o.ContractAddress.IsSet() { + return true + } + + return false +} + +// SetContractAddress gets a reference to the given NullableString and assigns it to the ContractAddress field. +func (o *Web3TransactionReceipt) SetContractAddress(v string) { + o.ContractAddress.Set(&v) +} +// SetContractAddressNil sets the value for ContractAddress to be an explicit nil +func (o *Web3TransactionReceipt) SetContractAddressNil() { + o.ContractAddress.Set(nil) +} + +// UnsetContractAddress ensures that no value is present for ContractAddress, not even an explicit nil +func (o *Web3TransactionReceipt) UnsetContractAddress() { + o.ContractAddress.Unset() +} + +// GetFrom returns the From field value +func (o *Web3TransactionReceipt) GetFrom() string { + if o == nil { + var ret string + return ret + } + + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value +func (o *Web3TransactionReceipt) SetFrom(v string) { + o.From = v +} + +// GetTo returns the To field value +func (o *Web3TransactionReceipt) GetTo() string { + if o == nil { + var ret string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *Web3TransactionReceipt) SetTo(v string) { + o.To = v +} + +func (o Web3TransactionReceipt) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3TransactionReceipt) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + toSerialize["transactionHash"] = o.TransactionHash + toSerialize["transactionIndex"] = o.TransactionIndex + toSerialize["blockHash"] = o.BlockHash + toSerialize["blockNumber"] = o.BlockNumber + toSerialize["gasUsed"] = o.GasUsed + if o.ContractAddress.IsSet() { + toSerialize["contractAddress"] = o.ContractAddress.Get() + } + toSerialize["from"] = o.From + toSerialize["to"] = o.To + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Web3TransactionReceipt) UnmarshalJSON(bytes []byte) (err error) { + varWeb3TransactionReceipt := _Web3TransactionReceipt{} + + if err = json.Unmarshal(bytes, &varWeb3TransactionReceipt); err == nil { + *o = Web3TransactionReceipt(varWeb3TransactionReceipt) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "status") + delete(additionalProperties, "transactionHash") + delete(additionalProperties, "transactionIndex") + delete(additionalProperties, "blockHash") + delete(additionalProperties, "blockNumber") + delete(additionalProperties, "gasUsed") + delete(additionalProperties, "contractAddress") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWeb3TransactionReceipt struct { + value *Web3TransactionReceipt + isSet bool +} + +func (v NullableWeb3TransactionReceipt) Get() *Web3TransactionReceipt { + return v.value +} + +func (v *NullableWeb3TransactionReceipt) Set(val *Web3TransactionReceipt) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3TransactionReceipt) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3TransactionReceipt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3TransactionReceipt(val *Web3TransactionReceipt) *NullableWeb3TransactionReceipt { + return &NullableWeb3TransactionReceipt{value: val, isSet: true} +} + +func (v NullableWeb3TransactionReceipt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3TransactionReceipt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_withdraw_req.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_withdraw_req.go new file mode 100644 index 00000000000..0e8e98dc087 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/model_withdraw_req.go @@ -0,0 +1,265 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" +) + +// checks if the WithdrawReq type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WithdrawReq{} + +// WithdrawReq struct for WithdrawReq +type WithdrawReq struct { + // Contract locked id + Id string `json:"id"` + // Secret need to unlock the contract + Secret string `json:"secret"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // connectorId for the connector besu plugin + ConnectorId string `json:"connectorId"` + // keychainId for the keychain plugin + KeychainId string `json:"keychainId"` + Gas *NewContractObjGas `json:"gas,omitempty"` +} + +// NewWithdrawReq instantiates a new WithdrawReq 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 +// will change when the set of required properties is changed +func NewWithdrawReq(id string, secret string, web3SigningCredential Web3SigningCredential, connectorId string, keychainId string) *WithdrawReq { + this := WithdrawReq{} + this.Id = id + this.Secret = secret + this.Web3SigningCredential = web3SigningCredential + this.ConnectorId = connectorId + this.KeychainId = keychainId + return &this +} + +// NewWithdrawReqWithDefaults instantiates a new WithdrawReq object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWithdrawReqWithDefaults() *WithdrawReq { + this := WithdrawReq{} + return &this +} + +// GetId returns the Id field value +func (o *WithdrawReq) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WithdrawReq) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WithdrawReq) SetId(v string) { + o.Id = v +} + +// GetSecret returns the Secret field value +func (o *WithdrawReq) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *WithdrawReq) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *WithdrawReq) SetSecret(v string) { + o.Secret = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *WithdrawReq) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *WithdrawReq) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *WithdrawReq) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetConnectorId returns the ConnectorId field value +func (o *WithdrawReq) GetConnectorId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectorId +} + +// GetConnectorIdOk returns a tuple with the ConnectorId field value +// and a boolean to check if the value has been set. +func (o *WithdrawReq) GetConnectorIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorId, true +} + +// SetConnectorId sets field value +func (o *WithdrawReq) SetConnectorId(v string) { + o.ConnectorId = v +} + +// GetKeychainId returns the KeychainId field value +func (o *WithdrawReq) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *WithdrawReq) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *WithdrawReq) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *WithdrawReq) GetGas() NewContractObjGas { + if o == nil || IsNil(o.Gas) { + var ret NewContractObjGas + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WithdrawReq) GetGasOk() (*NewContractObjGas, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *WithdrawReq) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given NewContractObjGas and assigns it to the Gas field. +func (o *WithdrawReq) SetGas(v NewContractObjGas) { + o.Gas = &v +} + +func (o WithdrawReq) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WithdrawReq) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["secret"] = o.Secret + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["connectorId"] = o.ConnectorId + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + return toSerialize, nil +} + +type NullableWithdrawReq struct { + value *WithdrawReq + isSet bool +} + +func (v NullableWithdrawReq) Get() *WithdrawReq { + return v.value +} + +func (v *NullableWithdrawReq) Set(val *WithdrawReq) { + v.value = val + v.isSet = true +} + +func (v NullableWithdrawReq) IsSet() bool { + return v.isSet +} + +func (v *NullableWithdrawReq) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWithdrawReq(val *WithdrawReq) *NullableWithdrawReq { + return &NullableWithdrawReq{value: val, isSet: true} +} + +func (v NullableWithdrawReq) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWithdrawReq) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..63adb80e443 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..48d38b538b1 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,97 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-htlc-eth-besu + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-htlc-eth-besu_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService GetSingleStatusV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetSingleStatusV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetStatusV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetStatusV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InitializeV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InitializeV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService NewContractV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.NewContractV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RefundV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.RefundV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService WithdrawV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.WithdrawV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..ae20fb237f6 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - HTLC-ETH Besu + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-htlc-eth-besu + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..23404d4bf1e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - HTLC-ETH Besu + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..e1f00bd05da --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,62 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java +src/main/java/org/openapitools/client/model/GetStatusRequest.java +src/main/java/org/openapitools/client/model/InitializeRequest.java +src/main/java/org/openapitools/client/model/InvokeContractV1Response.java +src/main/java/org/openapitools/client/model/NewContractObj.java +src/main/java/org/openapitools/client/model/NewContractObjGas.java +src/main/java/org/openapitools/client/model/RefundReq.java +src/main/java/org/openapitools/client/model/RunTransactionResponse.java +src/main/java/org/openapitools/client/model/Web3SigningCredential.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java +src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java +src/main/java/org/openapitools/client/model/WithdrawReq.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/GetSingleStatusRequestTest.java +src/test/java/org/openapitools/client/model/GetStatusRequestTest.java +src/test/java/org/openapitools/client/model/InitializeRequestTest.java +src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java +src/test/java/org/openapitools/client/model/NewContractObjGasTest.java +src/test/java/org/openapitools/client/model/NewContractObjTest.java +src/test/java/org/openapitools/client/model/RefundReqTest.java +src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java +src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java +src/test/java/org/openapitools/client/model/WithdrawReqTest.java diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..ac146f67242 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,156 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - HTLC-ETH Besu +- API version: v2.0.0-alpha.2 + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + GetSingleStatusRequest getSingleStatusRequest = new GetSingleStatusRequest(); // GetSingleStatusRequest | + try { + Integer result = apiInstance.getSingleStatusV1(getSingleStatusRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getSingleStatusV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**getSingleStatusV1**](docs/DefaultApi.md#getSingleStatusV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-single-status | +*DefaultApi* | [**getStatusV1**](docs/DefaultApi.md#getStatusV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-status | +*DefaultApi* | [**initializeV1**](docs/DefaultApi.md#initializeV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/initialize | +*DefaultApi* | [**newContractV1**](docs/DefaultApi.md#newContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/new-contract | +*DefaultApi* | [**refundV1**](docs/DefaultApi.md#refundV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/refund | +*DefaultApi* | [**withdrawV1**](docs/DefaultApi.md#withdrawV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/withdraw | + + +## Documentation for Models + + - [GetSingleStatusRequest](docs/GetSingleStatusRequest.md) + - [GetStatusRequest](docs/GetStatusRequest.md) + - [InitializeRequest](docs/InitializeRequest.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [NewContractObj](docs/NewContractObj.md) + - [NewContractObjGas](docs/NewContractObjGas.md) + - [RefundReq](docs/RefundReq.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + - [WithdrawReq](docs/WithdrawReq.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..e4b9081f8f2 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,560 @@ +openapi: 3.0.3 +info: + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - HTLC-ETH Besu + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/new-contract: + post: + operationId: newContractV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NewContractObj' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/new-contract + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/withdraw: + post: + operationId: withdrawV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WithdrawReq' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/withdraw + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/refund: + post: + operationId: refundV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RefundReq' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/refund + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-status: + post: + operationId: getStatusV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetStatusRequest' + responses: + "200": + content: + application/json: + schema: + items: + format: uint256 + type: integer + type: array + description: Array of status + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-status + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-single-status: + post: + operationId: getSingleStatusV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetSingleStatusRequest' + responses: + "200": + content: + application/json: + schema: + format: uint256 + type: integer + description: Status + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-single-status + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/initialize: + post: + operationId: initializeV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InitializeRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/initialize + x-content-type: application/json + x-accepts: application/json +components: + responses: + GetStatusResponse: + content: + application/json: + schema: + items: + format: uint256 + type: integer + type: array + description: Array of status + GetSingleStatusResponse: + content: + application/json: + schema: + format: uint256 + type: integer + description: Status + schemas: + NewContractObj: + additionalProperties: false + example: + outputAddress: outputAddress + receiver: receiver + keychainId: keychainId + outputAmount: 6.027456183070403 + outputNetwork: outputNetwork + connectorId: connectorId + hashLock: hashLock + gas: null + contractAddress: contractAddress + web3SigningCredential: + type: null + inputAmount: 0.8008281904610115 + expiration: 1.4658129805029452 + properties: + contractAddress: + description: Contract address + nullable: false + type: string + inputAmount: + type: number + outputAmount: + type: number + expiration: + type: number + hashLock: + type: string + receiver: + type: string + outputNetwork: + nullable: false + type: string + outputAddress: + nullable: false + type: string + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + keychainId: + description: keychainId for the keychian plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractObj_gas' + required: + - connectorId + - contractAddress + - expiration + - hashLock + - keychainId + - outputAddress + - outputAmount + - outputNetwork + - web3SigningCredential + type: object + RefundReq: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + gas: null + web3SigningCredential: + type: null + id: id + properties: + id: + description: Contract htlc id for refund + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractObj_gas' + required: + - connectorId + - id + - keychainId + - web3SigningCredential + type: object + WithdrawReq: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + gas: null + web3SigningCredential: + type: null + id: id + secret: secret + properties: + id: + description: Contract locked id + nullable: false + type: string + secret: + description: Secret need to unlock the contract + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + gas: + $ref: '#/components/schemas/NewContractObj_gas' + required: + - connectorId + - id + - keychainId + - secret + - web3SigningCredential + type: object + InitializeRequest: + additionalProperties: false + example: + keychainId: keychainId + connectorId: connectorId + constructorArgs: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + properties: + connectorId: + description: connectorId for the connector besu plugin + nullable: false + type: string + keychainId: + description: keychainId for the keychain plugin + nullable: false + type: string + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + type: number + required: + - connectorId + - constructorArgs + - keychainId + - web3SigningCredential + type: object + GetStatusRequest: + additionalProperties: false + description: Defines the parameters for retrieving the status of the HTLC swap. + example: + keychainId: keychainId + connectorId: connectorId + ids: + - ids + - ids + web3SigningCredential: + type: null + properties: + ids: + items: + type: string + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + type: string + keychainId: + type: string + required: + - connectorId + - ids + - keychainId + - web3SigningCredential + type: object + GetSingleStatusRequest: + additionalProperties: false + description: Defines the parameters for retrieving the single status of the + HTLC swap. + example: + keychainId: keychainId + connectorId: connectorId + web3SigningCredential: + type: null + id: id + properties: + id: + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + connectorId: + type: string + keychainId: + type: string + required: + - connectorId + - id + - keychainId + - web3SigningCredential + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + NewContractObj_gas: + oneOf: + - type: string + - type: number + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..ed15be7a4de --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..bc4d3521d9e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..2eef64dc856 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..1379eda1f5d --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..fa3a86e1d0a --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..f63b385533e --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..da459fd5609 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,426 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(org.openapitools.client.model.Web3SigningCredential.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Web3SigningCredentialCactusKeychainRef", org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.class); + classByDiscriminatorValue.put("Web3SigningCredentialNone", org.openapitools.client.model.Web3SigningCredentialNone.class); + classByDiscriminatorValue.put("Web3SigningCredentialPrivateKeyHex", org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.class); + classByDiscriminatorValue.put("Web3SigningCredential", org.openapitools.client.model.Web3SigningCredential.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) + ; + 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; + } + + { + 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.GetSingleStatusRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetStatusRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InitializeRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NewContractObj.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NewContractObjGas.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RefundReq.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialNone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3TransactionReceipt.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WithdrawReq.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); + } + } + } + + /** + * 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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..13128c10785 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..88c48cc39d4 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..c9f238d31f5 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..f549a0fa86f --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..d1031718460 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,791 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.GetSingleStatusRequest; +import org.openapitools.client.model.GetStatusRequest; +import org.openapitools.client.model.InitializeRequest; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.NewContractObj; +import org.openapitools.client.model.RefundReq; +import org.openapitools.client.model.RunTransactionResponse; +import org.openapitools.client.model.WithdrawReq; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 getSingleStatusV1 + * @param getSingleStatusRequest (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 + + + +
Status Code Description Response Headers
200 Status -
+ */ + public okhttp3.Call getSingleStatusV1Call(GetSingleStatusRequest getSingleStatusRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getSingleStatusRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-single-status"; + + 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 getSingleStatusV1ValidateBeforeCall(GetSingleStatusRequest getSingleStatusRequest, final ApiCallback _callback) throws ApiException { + return getSingleStatusV1Call(getSingleStatusRequest, _callback); + + } + + /** + * + * + * @param getSingleStatusRequest (optional) + * @return Integer + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Status -
+ */ + public Integer getSingleStatusV1(GetSingleStatusRequest getSingleStatusRequest) throws ApiException { + ApiResponse localVarResp = getSingleStatusV1WithHttpInfo(getSingleStatusRequest); + return localVarResp.getData(); + } + + /** + * + * + * @param getSingleStatusRequest (optional) + * @return ApiResponse<Integer> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Status -
+ */ + public ApiResponse getSingleStatusV1WithHttpInfo(GetSingleStatusRequest getSingleStatusRequest) throws ApiException { + okhttp3.Call localVarCall = getSingleStatusV1ValidateBeforeCall(getSingleStatusRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param getSingleStatusRequest (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 + + + +
Status Code Description Response Headers
200 Status -
+ */ + public okhttp3.Call getSingleStatusV1Async(GetSingleStatusRequest getSingleStatusRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSingleStatusV1ValidateBeforeCall(getSingleStatusRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getStatusV1 + * @param getStatusRequest (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 + + + +
Status Code Description Response Headers
200 Array of status -
+ */ + public okhttp3.Call getStatusV1Call(GetStatusRequest getStatusRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getStatusRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/get-status"; + + 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 getStatusV1ValidateBeforeCall(GetStatusRequest getStatusRequest, final ApiCallback _callback) throws ApiException { + return getStatusV1Call(getStatusRequest, _callback); + + } + + /** + * + * + * @param getStatusRequest (optional) + * @return List<Integer> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Array of status -
+ */ + public List getStatusV1(GetStatusRequest getStatusRequest) throws ApiException { + ApiResponse> localVarResp = getStatusV1WithHttpInfo(getStatusRequest); + return localVarResp.getData(); + } + + /** + * + * + * @param getStatusRequest (optional) + * @return ApiResponse<List<Integer>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Array of status -
+ */ + public ApiResponse> getStatusV1WithHttpInfo(GetStatusRequest getStatusRequest) throws ApiException { + okhttp3.Call localVarCall = getStatusV1ValidateBeforeCall(getStatusRequest, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param getStatusRequest (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 + + + +
Status Code Description Response Headers
200 Array of status -
+ */ + public okhttp3.Call getStatusV1Async(GetStatusRequest getStatusRequest, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getStatusV1ValidateBeforeCall(getStatusRequest, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for initializeV1 + * @param initializeRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call initializeV1Call(InitializeRequest initializeRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = initializeRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/initialize"; + + 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 initializeV1ValidateBeforeCall(InitializeRequest initializeRequest, final ApiCallback _callback) throws ApiException { + return initializeV1Call(initializeRequest, _callback); + + } + + /** + * + * + * @param initializeRequest (optional) + * @return RunTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public RunTransactionResponse initializeV1(InitializeRequest initializeRequest) throws ApiException { + ApiResponse localVarResp = initializeV1WithHttpInfo(initializeRequest); + return localVarResp.getData(); + } + + /** + * + * + * @param initializeRequest (optional) + * @return ApiResponse<RunTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse initializeV1WithHttpInfo(InitializeRequest initializeRequest) throws ApiException { + okhttp3.Call localVarCall = initializeV1ValidateBeforeCall(initializeRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param initializeRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call initializeV1Async(InitializeRequest initializeRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = initializeV1ValidateBeforeCall(initializeRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for newContractV1 + * @param newContractObj (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call newContractV1Call(NewContractObj newContractObj, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = newContractObj; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/new-contract"; + + 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 newContractV1ValidateBeforeCall(NewContractObj newContractObj, final ApiCallback _callback) throws ApiException { + return newContractV1Call(newContractObj, _callback); + + } + + /** + * + * + * @param newContractObj (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response newContractV1(NewContractObj newContractObj) throws ApiException { + ApiResponse localVarResp = newContractV1WithHttpInfo(newContractObj); + return localVarResp.getData(); + } + + /** + * + * + * @param newContractObj (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse newContractV1WithHttpInfo(NewContractObj newContractObj) throws ApiException { + okhttp3.Call localVarCall = newContractV1ValidateBeforeCall(newContractObj, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param newContractObj (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call newContractV1Async(NewContractObj newContractObj, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = newContractV1ValidateBeforeCall(newContractObj, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for refundV1 + * @param refundReq (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call refundV1Call(RefundReq refundReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = refundReq; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/refund"; + + 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 refundV1ValidateBeforeCall(RefundReq refundReq, final ApiCallback _callback) throws ApiException { + return refundV1Call(refundReq, _callback); + + } + + /** + * + * + * @param refundReq (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response refundV1(RefundReq refundReq) throws ApiException { + ApiResponse localVarResp = refundV1WithHttpInfo(refundReq); + return localVarResp.getData(); + } + + /** + * + * + * @param refundReq (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse refundV1WithHttpInfo(RefundReq refundReq) throws ApiException { + okhttp3.Call localVarCall = refundV1ValidateBeforeCall(refundReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param refundReq (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call refundV1Async(RefundReq refundReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = refundV1ValidateBeforeCall(refundReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for withdrawV1 + * @param withdrawReq (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call withdrawV1Call(WithdrawReq withdrawReq, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = withdrawReq; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-eth-besu/withdraw"; + + 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 withdrawV1ValidateBeforeCall(WithdrawReq withdrawReq, final ApiCallback _callback) throws ApiException { + return withdrawV1Call(withdrawReq, _callback); + + } + + /** + * + * + * @param withdrawReq (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response withdrawV1(WithdrawReq withdrawReq) throws ApiException { + ApiResponse localVarResp = withdrawV1WithHttpInfo(withdrawReq); + return localVarResp.getData(); + } + + /** + * + * + * @param withdrawReq (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse withdrawV1WithHttpInfo(WithdrawReq withdrawReq) throws ApiException { + okhttp3.Call localVarCall = withdrawV1ValidateBeforeCall(withdrawReq, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param withdrawReq (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call withdrawV1Async(WithdrawReq withdrawReq, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = withdrawV1ValidateBeforeCall(withdrawReq, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..716cf0c84dc --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..aff0dc06704 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..354620285ae --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..74d93fdf77b --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..c79db2a5e4c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java new file mode 100644 index 00000000000..fae8a243baa --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSingleStatusRequest.java @@ -0,0 +1,312 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Defines the parameters for retrieving the single status of the HTLC swap. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSingleStatusRequest { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public GetSingleStatusRequest() { + } + + public GetSingleStatusRequest id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public GetSingleStatusRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public GetSingleStatusRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * Get connectorId + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public GetSingleStatusRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * Get keychainId + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSingleStatusRequest getSingleStatusRequest = (GetSingleStatusRequest) o; + return Objects.equals(this.id, getSingleStatusRequest.id) && + Objects.equals(this.web3SigningCredential, getSingleStatusRequest.web3SigningCredential) && + Objects.equals(this.connectorId, getSingleStatusRequest.connectorId) && + Objects.equals(this.keychainId, getSingleStatusRequest.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(id, web3SigningCredential, connectorId, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSingleStatusRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetSingleStatusRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSingleStatusRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetSingleStatusRequest is not found in the empty JSON string", GetSingleStatusRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSingleStatusRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSingleStatusRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetSingleStatusRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSingleStatusRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSingleStatusRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetSingleStatusRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSingleStatusRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSingleStatusRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetSingleStatusRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSingleStatusRequest + * @throws IOException if the JSON string is invalid with respect to GetSingleStatusRequest + */ + public static GetSingleStatusRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSingleStatusRequest.class); + } + + /** + * Convert an instance of GetSingleStatusRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetStatusRequest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetStatusRequest.java new file mode 100644 index 00000000000..3e60dfa5d5f --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetStatusRequest.java @@ -0,0 +1,325 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Defines the parameters for retrieving the status of the HTLC swap. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetStatusRequest { + public static final String SERIALIZED_NAME_IDS = "ids"; + @SerializedName(SERIALIZED_NAME_IDS) + private List ids = new ArrayList<>(); + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public GetStatusRequest() { + } + + public GetStatusRequest ids(List ids) { + + this.ids = ids; + return this; + } + + public GetStatusRequest addIdsItem(String idsItem) { + if (this.ids == null) { + this.ids = new ArrayList<>(); + } + this.ids.add(idsItem); + return this; + } + + /** + * Get ids + * @return ids + **/ + @javax.annotation.Nonnull + public List getIds() { + return ids; + } + + + public void setIds(List ids) { + this.ids = ids; + } + + + public GetStatusRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public GetStatusRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * Get connectorId + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public GetStatusRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * Get keychainId + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetStatusRequest getStatusRequest = (GetStatusRequest) o; + return Objects.equals(this.ids, getStatusRequest.ids) && + Objects.equals(this.web3SigningCredential, getStatusRequest.web3SigningCredential) && + Objects.equals(this.connectorId, getStatusRequest.connectorId) && + Objects.equals(this.keychainId, getStatusRequest.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(ids, web3SigningCredential, connectorId, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetStatusRequest {\n"); + sb.append(" ids: ").append(toIndentedString(ids)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ids"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ids"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetStatusRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetStatusRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetStatusRequest is not found in the empty JSON string", GetStatusRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetStatusRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetStatusRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetStatusRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("ids") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("ids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ids` to be an array in the JSON string but got `%s`", jsonObj.get("ids").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetStatusRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetStatusRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetStatusRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetStatusRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetStatusRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetStatusRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetStatusRequest + * @throws IOException if the JSON string is invalid with respect to GetStatusRequest + */ + public static GetStatusRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetStatusRequest.class); + } + + /** + * Convert an instance of GetStatusRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InitializeRequest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InitializeRequest.java new file mode 100644 index 00000000000..c134a971b5f --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InitializeRequest.java @@ -0,0 +1,354 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InitializeRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InitializeRequest { + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public InitializeRequest() { + } + + public InitializeRequest connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * connectorId for the connector besu plugin + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public InitializeRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public InitializeRequest constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public InitializeRequest addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * Get constructorArgs + * @return constructorArgs + **/ + @javax.annotation.Nonnull + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public InitializeRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InitializeRequest gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InitializeRequest initializeRequest = (InitializeRequest) o; + return Objects.equals(this.connectorId, initializeRequest.connectorId) && + Objects.equals(this.keychainId, initializeRequest.keychainId) && + Objects.equals(this.constructorArgs, initializeRequest.constructorArgs) && + Objects.equals(this.web3SigningCredential, initializeRequest.web3SigningCredential) && + Objects.equals(this.gas, initializeRequest.gas); + } + + @Override + public int hashCode() { + return Objects.hash(connectorId, keychainId, constructorArgs, web3SigningCredential, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InitializeRequest {\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + openapiFields.add("constructorArgs"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + openapiRequiredFields.add("constructorArgs"); + openapiRequiredFields.add("web3SigningCredential"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InitializeRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InitializeRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InitializeRequest is not found in the empty JSON string", InitializeRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InitializeRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InitializeRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InitializeRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // ensure the required json array is present + if (jsonObj.get("constructorArgs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InitializeRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InitializeRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InitializeRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InitializeRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InitializeRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InitializeRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of InitializeRequest + * @throws IOException if the JSON string is invalid with respect to InitializeRequest + */ + public static InitializeRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InitializeRequest.class); + } + + /** + * Convert an instance of InitializeRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java new file mode 100644 index 00000000000..6cbd42c0abb --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java @@ -0,0 +1,282 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public static final String SERIALIZED_NAME_CALL_OUTPUT = "callOutput"; + @SerializedName(SERIALIZED_NAME_CALL_OUTPUT) + private Object callOutput = null; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public InvokeContractV1Response() { + } + + public InvokeContractV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nullable + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + public InvokeContractV1Response callOutput(Object callOutput) { + + this.callOutput = callOutput; + return this; + } + + /** + * Get callOutput + * @return callOutput + **/ + @javax.annotation.Nullable + public Object getCallOutput() { + return callOutput; + } + + + public void setCallOutput(Object callOutput) { + this.callOutput = callOutput; + } + + + public InvokeContractV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Response invokeContractV1Response = (InvokeContractV1Response) o; + return Objects.equals(this.transactionReceipt, invokeContractV1Response.transactionReceipt) && + Objects.equals(this.callOutput, invokeContractV1Response.callOutput) && + Objects.equals(this.success, invokeContractV1Response.success); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt, callOutput, success); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append(" callOutput: ").append(toIndentedString(callOutput)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + openapiFields.add("callOutput"); + openapiFields.add("success"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Response is not found in the empty JSON string", InvokeContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Response + */ + public static InvokeContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Response.class); + } + + /** + * Convert an instance of InvokeContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractObj.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractObj.java new file mode 100644 index 00000000000..6c81bfa3d9c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractObj.java @@ -0,0 +1,559 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.NewContractObjGas; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * NewContractObj + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NewContractObj { + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_INPUT_AMOUNT = "inputAmount"; + @SerializedName(SERIALIZED_NAME_INPUT_AMOUNT) + private BigDecimal inputAmount; + + public static final String SERIALIZED_NAME_OUTPUT_AMOUNT = "outputAmount"; + @SerializedName(SERIALIZED_NAME_OUTPUT_AMOUNT) + private BigDecimal outputAmount; + + public static final String SERIALIZED_NAME_EXPIRATION = "expiration"; + @SerializedName(SERIALIZED_NAME_EXPIRATION) + private BigDecimal expiration; + + public static final String SERIALIZED_NAME_HASH_LOCK = "hashLock"; + @SerializedName(SERIALIZED_NAME_HASH_LOCK) + private String hashLock; + + public static final String SERIALIZED_NAME_RECEIVER = "receiver"; + @SerializedName(SERIALIZED_NAME_RECEIVER) + private String receiver; + + public static final String SERIALIZED_NAME_OUTPUT_NETWORK = "outputNetwork"; + @SerializedName(SERIALIZED_NAME_OUTPUT_NETWORK) + private String outputNetwork; + + public static final String SERIALIZED_NAME_OUTPUT_ADDRESS = "outputAddress"; + @SerializedName(SERIALIZED_NAME_OUTPUT_ADDRESS) + private String outputAddress; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private NewContractObjGas gas; + + public NewContractObj() { + } + + public NewContractObj contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Contract address + * @return contractAddress + **/ + @javax.annotation.Nonnull + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public NewContractObj inputAmount(BigDecimal inputAmount) { + + this.inputAmount = inputAmount; + return this; + } + + /** + * Get inputAmount + * @return inputAmount + **/ + @javax.annotation.Nullable + public BigDecimal getInputAmount() { + return inputAmount; + } + + + public void setInputAmount(BigDecimal inputAmount) { + this.inputAmount = inputAmount; + } + + + public NewContractObj outputAmount(BigDecimal outputAmount) { + + this.outputAmount = outputAmount; + return this; + } + + /** + * Get outputAmount + * @return outputAmount + **/ + @javax.annotation.Nonnull + public BigDecimal getOutputAmount() { + return outputAmount; + } + + + public void setOutputAmount(BigDecimal outputAmount) { + this.outputAmount = outputAmount; + } + + + public NewContractObj expiration(BigDecimal expiration) { + + this.expiration = expiration; + return this; + } + + /** + * Get expiration + * @return expiration + **/ + @javax.annotation.Nonnull + public BigDecimal getExpiration() { + return expiration; + } + + + public void setExpiration(BigDecimal expiration) { + this.expiration = expiration; + } + + + public NewContractObj hashLock(String hashLock) { + + this.hashLock = hashLock; + return this; + } + + /** + * Get hashLock + * @return hashLock + **/ + @javax.annotation.Nonnull + public String getHashLock() { + return hashLock; + } + + + public void setHashLock(String hashLock) { + this.hashLock = hashLock; + } + + + public NewContractObj receiver(String receiver) { + + this.receiver = receiver; + return this; + } + + /** + * Get receiver + * @return receiver + **/ + @javax.annotation.Nullable + public String getReceiver() { + return receiver; + } + + + public void setReceiver(String receiver) { + this.receiver = receiver; + } + + + public NewContractObj outputNetwork(String outputNetwork) { + + this.outputNetwork = outputNetwork; + return this; + } + + /** + * Get outputNetwork + * @return outputNetwork + **/ + @javax.annotation.Nonnull + public String getOutputNetwork() { + return outputNetwork; + } + + + public void setOutputNetwork(String outputNetwork) { + this.outputNetwork = outputNetwork; + } + + + public NewContractObj outputAddress(String outputAddress) { + + this.outputAddress = outputAddress; + return this; + } + + /** + * Get outputAddress + * @return outputAddress + **/ + @javax.annotation.Nonnull + public String getOutputAddress() { + return outputAddress; + } + + + public void setOutputAddress(String outputAddress) { + this.outputAddress = outputAddress; + } + + + public NewContractObj connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * connectorId for the connector besu plugin + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public NewContractObj web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public NewContractObj keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychian plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public NewContractObj gas(NewContractObjGas gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public NewContractObjGas getGas() { + return gas; + } + + + public void setGas(NewContractObjGas gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewContractObj newContractObj = (NewContractObj) o; + return Objects.equals(this.contractAddress, newContractObj.contractAddress) && + Objects.equals(this.inputAmount, newContractObj.inputAmount) && + Objects.equals(this.outputAmount, newContractObj.outputAmount) && + Objects.equals(this.expiration, newContractObj.expiration) && + Objects.equals(this.hashLock, newContractObj.hashLock) && + Objects.equals(this.receiver, newContractObj.receiver) && + Objects.equals(this.outputNetwork, newContractObj.outputNetwork) && + Objects.equals(this.outputAddress, newContractObj.outputAddress) && + Objects.equals(this.connectorId, newContractObj.connectorId) && + Objects.equals(this.web3SigningCredential, newContractObj.web3SigningCredential) && + Objects.equals(this.keychainId, newContractObj.keychainId) && + Objects.equals(this.gas, newContractObj.gas); + } + + @Override + public int hashCode() { + return Objects.hash(contractAddress, inputAmount, outputAmount, expiration, hashLock, receiver, outputNetwork, outputAddress, connectorId, web3SigningCredential, keychainId, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewContractObj {\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" inputAmount: ").append(toIndentedString(inputAmount)).append("\n"); + sb.append(" outputAmount: ").append(toIndentedString(outputAmount)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" hashLock: ").append(toIndentedString(hashLock)).append("\n"); + sb.append(" receiver: ").append(toIndentedString(receiver)).append("\n"); + sb.append(" outputNetwork: ").append(toIndentedString(outputNetwork)).append("\n"); + sb.append(" outputAddress: ").append(toIndentedString(outputAddress)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractAddress"); + openapiFields.add("inputAmount"); + openapiFields.add("outputAmount"); + openapiFields.add("expiration"); + openapiFields.add("hashLock"); + openapiFields.add("receiver"); + openapiFields.add("outputNetwork"); + openapiFields.add("outputAddress"); + openapiFields.add("connectorId"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractAddress"); + openapiRequiredFields.add("outputAmount"); + openapiRequiredFields.add("expiration"); + openapiRequiredFields.add("hashLock"); + openapiRequiredFields.add("outputNetwork"); + openapiRequiredFields.add("outputAddress"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NewContractObj + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!NewContractObj.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewContractObj is not found in the empty JSON string", NewContractObj.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NewContractObj.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewContractObj` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewContractObj.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if (!jsonObj.get("hashLock").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashLock` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashLock").toString())); + } + if ((jsonObj.get("receiver") != null && !jsonObj.get("receiver").isJsonNull()) && !jsonObj.get("receiver").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `receiver` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiver").toString())); + } + if (!jsonObj.get("outputNetwork").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `outputNetwork` to be a primitive type in the JSON string but got `%s`", jsonObj.get("outputNetwork").toString())); + } + if (!jsonObj.get("outputAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `outputAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("outputAddress").toString())); + } + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + NewContractObjGas.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewContractObj.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewContractObj' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewContractObj.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewContractObj value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewContractObj read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewContractObj given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewContractObj + * @throws IOException if the JSON string is invalid with respect to NewContractObj + */ + public static NewContractObj fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewContractObj.class); + } + + /** + * Convert an instance of NewContractObj to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractObjGas.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractObjGas.java new file mode 100644 index 00000000000..9f3004204c5 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NewContractObjGas.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import java.math.BigDecimal; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NewContractObjGas extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(NewContractObjGas.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewContractObjGas.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewContractObjGas' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewContractObjGas value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonObject obj = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, String"); + } + + @Override + public NewContractObjGas read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + BigDecimal.validateJsonObject(jsonObject); + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + NewContractObjGas ret = new NewContractObjGas(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for NewContractObjGas: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public NewContractObjGas() { + super("oneOf", Boolean.FALSE); + } + + public NewContractObjGas(BigDecimal o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public NewContractObjGas(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BigDecimal", new GenericType() { + }); + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return NewContractObjGas.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, String"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, String + * + * @return The actual instance (BigDecimal, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NewContractObjGas + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with BigDecimal + try { + BigDecimal.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for NewContractObjGas with oneOf schemas: BigDecimal, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of NewContractObjGas given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewContractObjGas + * @throws IOException if the JSON string is invalid with respect to NewContractObjGas + */ + public static NewContractObjGas fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewContractObjGas.class); + } + + /** + * Convert an instance of NewContractObjGas to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RefundReq.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RefundReq.java new file mode 100644 index 00000000000..ed7dd5368e8 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RefundReq.java @@ -0,0 +1,345 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.NewContractObjGas; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RefundReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RefundReq { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private NewContractObjGas gas; + + public RefundReq() { + } + + public RefundReq id(String id) { + + this.id = id; + return this; + } + + /** + * Contract htlc id for refund + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public RefundReq web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public RefundReq connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * connectorId for the connector besu plugin + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public RefundReq keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public RefundReq gas(NewContractObjGas gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public NewContractObjGas getGas() { + return gas; + } + + + public void setGas(NewContractObjGas gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RefundReq refundReq = (RefundReq) o; + return Objects.equals(this.id, refundReq.id) && + Objects.equals(this.web3SigningCredential, refundReq.web3SigningCredential) && + Objects.equals(this.connectorId, refundReq.connectorId) && + Objects.equals(this.keychainId, refundReq.keychainId) && + Objects.equals(this.gas, refundReq.gas); + } + + @Override + public int hashCode() { + return Objects.hash(id, web3SigningCredential, connectorId, keychainId, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RefundReq {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RefundReq + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RefundReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RefundReq is not found in the empty JSON string", RefundReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RefundReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RefundReq` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RefundReq.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + NewContractObjGas.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RefundReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RefundReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RefundReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RefundReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RefundReq read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RefundReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of RefundReq + * @throws IOException if the JSON string is invalid with respect to RefundReq + */ + public static RefundReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RefundReq.class); + } + + /** + * Convert an instance of RefundReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java new file mode 100644 index 00000000000..9796f131025 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionResponse { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public RunTransactionResponse() { + } + + public RunTransactionResponse transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionResponse runTransactionResponse = (RunTransactionResponse) o; + return Objects.equals(this.transactionReceipt, runTransactionResponse.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionResponse {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionResponse is not found in the empty JSON string", RunTransactionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionResponse + * @throws IOException if the JSON string is invalid with respect to RunTransactionResponse + */ + public static RunTransactionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionResponse.class); + } + + /** + * Convert an instance of RunTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java new file mode 100644 index 00000000000..3da30279fd9 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java @@ -0,0 +1,338 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredential extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Web3SigningCredential.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWeb3SigningCredentialCactusKeychainRef = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + final TypeAdapter adapterWeb3SigningCredentialNone = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + final TypeAdapter adapterWeb3SigningCredentialPrivateKeyHex = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredential value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialCactusKeychainRef` + if (value.getActualInstance() instanceof Web3SigningCredentialCactusKeychainRef) { + JsonObject obj = adapterWeb3SigningCredentialCactusKeychainRef.toJsonTree((Web3SigningCredentialCactusKeychainRef)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialNone` + if (value.getActualInstance() instanceof Web3SigningCredentialNone) { + JsonObject obj = adapterWeb3SigningCredentialNone.toJsonTree((Web3SigningCredentialNone)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialPrivateKeyHex` + if (value.getActualInstance() instanceof Web3SigningCredentialPrivateKeyHex) { + JsonObject obj = adapterWeb3SigningCredentialPrivateKeyHex.toJsonTree((Web3SigningCredentialPrivateKeyHex)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + @Override + public Web3SigningCredential read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Web3SigningCredentialCactusKeychainRef + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialCactusKeychainRef; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialCactusKeychainRef'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialCactusKeychainRef'", e); + } + + // deserialize Web3SigningCredentialNone + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialNone.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialNone; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialNone'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialNone'", e); + } + + // deserialize Web3SigningCredentialPrivateKeyHex + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialPrivateKeyHex; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialPrivateKeyHex'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialPrivateKeyHex'", e); + } + + if (match == 1) { + Web3SigningCredential ret = new Web3SigningCredential(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Web3SigningCredential: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Web3SigningCredential() { + super("oneOf", Boolean.FALSE); + } + + public Web3SigningCredential(Web3SigningCredentialCactusKeychainRef o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialNone o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialPrivateKeyHex o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Web3SigningCredentialCactusKeychainRef", new GenericType() { + }); + schemas.put("Web3SigningCredentialNone", new GenericType() { + }); + schemas.put("Web3SigningCredentialPrivateKeyHex", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Web3SigningCredential.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Web3SigningCredentialCactusKeychainRef) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialNone) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialPrivateKeyHex) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + /** + * Get the actual instance, which can be the following: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * @return The actual instance (Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialCactusKeychainRef`. If the actual instance is not `Web3SigningCredentialCactusKeychainRef`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialCactusKeychainRef` + * @throws ClassCastException if the instance is not `Web3SigningCredentialCactusKeychainRef` + */ + public Web3SigningCredentialCactusKeychainRef getWeb3SigningCredentialCactusKeychainRef() throws ClassCastException { + return (Web3SigningCredentialCactusKeychainRef)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialNone`. If the actual instance is not `Web3SigningCredentialNone`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialNone` + * @throws ClassCastException if the instance is not `Web3SigningCredentialNone` + */ + public Web3SigningCredentialNone getWeb3SigningCredentialNone() throws ClassCastException { + return (Web3SigningCredentialNone)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialPrivateKeyHex`. If the actual instance is not `Web3SigningCredentialPrivateKeyHex`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialPrivateKeyHex` + * @throws ClassCastException if the instance is not `Web3SigningCredentialPrivateKeyHex` + */ + public Web3SigningCredentialPrivateKeyHex getWeb3SigningCredentialPrivateKeyHex() throws ClassCastException { + return (Web3SigningCredentialPrivateKeyHex)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Web3SigningCredentialCactusKeychainRef + try { + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialNone + try { + Web3SigningCredentialNone.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialPrivateKeyHex + try { + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Web3SigningCredential with oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Web3SigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredential + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredential + */ + public static Web3SigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredential.class); + } + + /** + * Convert an instance of Web3SigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java new file mode 100644 index 00000000000..b68050d018c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java @@ -0,0 +1,310 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialCactusKeychainRef + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialCactusKeychainRef { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY = "keychainEntryKey"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY) + private String keychainEntryKey; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public Web3SigningCredentialCactusKeychainRef() { + } + + public Web3SigningCredentialCactusKeychainRef type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialCactusKeychainRef ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialCactusKeychainRef keychainEntryKey(String keychainEntryKey) { + + this.keychainEntryKey = keychainEntryKey; + return this; + } + + /** + * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + * @return keychainEntryKey + **/ + @javax.annotation.Nonnull + public String getKeychainEntryKey() { + return keychainEntryKey; + } + + + public void setKeychainEntryKey(String keychainEntryKey) { + this.keychainEntryKey = keychainEntryKey; + } + + + public Web3SigningCredentialCactusKeychainRef keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialCactusKeychainRef web3SigningCredentialCactusKeychainRef = (Web3SigningCredentialCactusKeychainRef) o; + return Objects.equals(this.type, web3SigningCredentialCactusKeychainRef.type) && + Objects.equals(this.ethAccount, web3SigningCredentialCactusKeychainRef.ethAccount) && + Objects.equals(this.keychainEntryKey, web3SigningCredentialCactusKeychainRef.keychainEntryKey) && + Objects.equals(this.keychainId, web3SigningCredentialCactusKeychainRef.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, keychainEntryKey, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialCactusKeychainRef {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" keychainEntryKey: ").append(toIndentedString(keychainEntryKey)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("keychainEntryKey"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("keychainEntryKey"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialCactusKeychainRef is not found in the empty JSON string", Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialCactusKeychainRef.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialCactusKeychainRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialCactusKeychainRef.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("keychainEntryKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainEntryKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainEntryKey").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialCactusKeychainRef.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialCactusKeychainRef' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialCactusKeychainRef value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialCactusKeychainRef read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialCactusKeychainRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialCactusKeychainRef + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static Web3SigningCredentialCactusKeychainRef fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialCactusKeychainRef.class); + } + + /** + * Convert an instance of Web3SigningCredentialCactusKeychainRef to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java new file mode 100644 index 00000000000..0cf17d076e3 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Using this denotes that there is no signing required because the transaction is pre-signed. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialNone { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public Web3SigningCredentialNone() { + } + + public Web3SigningCredentialNone type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialNone web3SigningCredentialNone = (Web3SigningCredentialNone) o; + return Objects.equals(this.type, web3SigningCredentialNone.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialNone {\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(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialNone + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialNone.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialNone is not found in the empty JSON string", Web3SigningCredentialNone.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialNone.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialNone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialNone.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialNone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialNone' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialNone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialNone read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialNone given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialNone + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialNone + */ + public static Web3SigningCredentialNone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialNone.class); + } + + /** + * Convert an instance of Web3SigningCredentialNone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java new file mode 100644 index 00000000000..108fa1cc3e2 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialPrivateKeyHex + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialPrivateKeyHex { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialPrivateKeyHex() { + } + + public Web3SigningCredentialPrivateKeyHex type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialPrivateKeyHex ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialPrivateKeyHex secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * The HEX encoded private key of an eth account. + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialPrivateKeyHex web3SigningCredentialPrivateKeyHex = (Web3SigningCredentialPrivateKeyHex) o; + return Objects.equals(this.type, web3SigningCredentialPrivateKeyHex.type) && + Objects.equals(this.ethAccount, web3SigningCredentialPrivateKeyHex.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialPrivateKeyHex.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialPrivateKeyHex {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialPrivateKeyHex is not found in the empty JSON string", Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialPrivateKeyHex.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialPrivateKeyHex` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialPrivateKeyHex.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialPrivateKeyHex.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialPrivateKeyHex' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialPrivateKeyHex value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialPrivateKeyHex read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialPrivateKeyHex given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialPrivateKeyHex + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static Web3SigningCredentialPrivateKeyHex fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialPrivateKeyHex.class); + } + + /** + * Convert an instance of Web3SigningCredentialPrivateKeyHex to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java new file mode 100644 index 00000000000..1c53841c199 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Web3SigningCredentialType + */ +@JsonAdapter(Web3SigningCredentialType.Adapter.class) +public enum Web3SigningCredentialType { + + CACTUS_KEYCHAIN_REF("CACTUS_KEYCHAIN_REF"), + + GETH_KEYCHAIN_PASSWORD("GETH_KEYCHAIN_PASSWORD"), + + PRIVATE_KEY_HEX("PRIVATE_KEY_HEX"), + + NONE("NONE"); + + private String value; + + Web3SigningCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Web3SigningCredentialType fromValue(String value) { + for (Web3SigningCredentialType b : Web3SigningCredentialType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Web3SigningCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Web3SigningCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Web3SigningCredentialType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java new file mode 100644 index 00000000000..70856f30b72 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java @@ -0,0 +1,547 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3TransactionReceipt + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3TransactionReceipt { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Boolean status; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private BigDecimal transactionIndex; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private BigDecimal blockNumber; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private BigDecimal gasUsed; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public Web3TransactionReceipt() { + } + + public Web3TransactionReceipt status(Boolean status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public Boolean getStatus() { + return status; + } + + + public void setStatus(Boolean status) { + this.status = status; + } + + + public Web3TransactionReceipt transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nonnull + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + public Web3TransactionReceipt transactionIndex(BigDecimal transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nonnull + public BigDecimal getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(BigDecimal transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public Web3TransactionReceipt blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nonnull + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public Web3TransactionReceipt blockNumber(BigDecimal blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(BigDecimal blockNumber) { + this.blockNumber = blockNumber; + } + + + public Web3TransactionReceipt gasUsed(BigDecimal gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + public BigDecimal getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(BigDecimal gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3TransactionReceipt contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Get contractAddress + * @return contractAddress + **/ + @javax.annotation.Nullable + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public Web3TransactionReceipt from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nonnull + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public Web3TransactionReceipt to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nonnull + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Web3TransactionReceipt instance itself + */ + public Web3TransactionReceipt putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3TransactionReceipt web3TransactionReceipt = (Web3TransactionReceipt) o; + return Objects.equals(this.status, web3TransactionReceipt.status) && + Objects.equals(this.transactionHash, web3TransactionReceipt.transactionHash) && + Objects.equals(this.transactionIndex, web3TransactionReceipt.transactionIndex) && + Objects.equals(this.blockHash, web3TransactionReceipt.blockHash) && + Objects.equals(this.blockNumber, web3TransactionReceipt.blockNumber) && + Objects.equals(this.gasUsed, web3TransactionReceipt.gasUsed) && + Objects.equals(this.contractAddress, web3TransactionReceipt.contractAddress) && + Objects.equals(this.from, web3TransactionReceipt.from) && + Objects.equals(this.to, web3TransactionReceipt.to)&& + Objects.equals(this.additionalProperties, web3TransactionReceipt.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, transactionHash, transactionIndex, blockHash, blockNumber, gasUsed, contractAddress, from, to, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3TransactionReceipt {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("transactionHash"); + openapiFields.add("transactionIndex"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("gasUsed"); + openapiFields.add("contractAddress"); + openapiFields.add("from"); + openapiFields.add("to"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("transactionHash"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("blockNumber"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("to"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3TransactionReceipt + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3TransactionReceipt.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3TransactionReceipt is not found in the empty JSON string", Web3TransactionReceipt.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3TransactionReceipt.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if ((jsonObj.get("contractAddress") != null && !jsonObj.get("contractAddress").isJsonNull()) && !jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if (!jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if (!jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3TransactionReceipt.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3TransactionReceipt' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3TransactionReceipt.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3TransactionReceipt value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Web3TransactionReceipt read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Web3TransactionReceipt instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3TransactionReceipt given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3TransactionReceipt + * @throws IOException if the JSON string is invalid with respect to Web3TransactionReceipt + */ + public static Web3TransactionReceipt fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3TransactionReceipt.class); + } + + /** + * Convert an instance of Web3TransactionReceipt to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawReq.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawReq.java new file mode 100644 index 00000000000..6c6c5faa00b --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WithdrawReq.java @@ -0,0 +1,377 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.NewContractObjGas; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WithdrawReq + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WithdrawReq { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONNECTOR_ID = "connectorId"; + @SerializedName(SERIALIZED_NAME_CONNECTOR_ID) + private String connectorId; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private NewContractObjGas gas; + + public WithdrawReq() { + } + + public WithdrawReq id(String id) { + + this.id = id; + return this; + } + + /** + * Contract locked id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public WithdrawReq secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * Secret need to unlock the contract + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + public WithdrawReq web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public WithdrawReq connectorId(String connectorId) { + + this.connectorId = connectorId; + return this; + } + + /** + * connectorId for the connector besu plugin + * @return connectorId + **/ + @javax.annotation.Nonnull + public String getConnectorId() { + return connectorId; + } + + + public void setConnectorId(String connectorId) { + this.connectorId = connectorId; + } + + + public WithdrawReq keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * keychainId for the keychain plugin + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public WithdrawReq gas(NewContractObjGas gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public NewContractObjGas getGas() { + return gas; + } + + + public void setGas(NewContractObjGas gas) { + this.gas = gas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WithdrawReq withdrawReq = (WithdrawReq) o; + return Objects.equals(this.id, withdrawReq.id) && + Objects.equals(this.secret, withdrawReq.secret) && + Objects.equals(this.web3SigningCredential, withdrawReq.web3SigningCredential) && + Objects.equals(this.connectorId, withdrawReq.connectorId) && + Objects.equals(this.keychainId, withdrawReq.keychainId) && + Objects.equals(this.gas, withdrawReq.gas); + } + + @Override + public int hashCode() { + return Objects.hash(id, secret, web3SigningCredential, connectorId, keychainId, gas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WithdrawReq {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" connectorId: ").append(toIndentedString(connectorId)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("secret"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("connectorId"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("secret"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("connectorId"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WithdrawReq + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WithdrawReq.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WithdrawReq is not found in the empty JSON string", WithdrawReq.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WithdrawReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WithdrawReq` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WithdrawReq.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("connectorId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectorId").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + NewContractObjGas.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WithdrawReq.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WithdrawReq' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WithdrawReq.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WithdrawReq value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WithdrawReq read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WithdrawReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of WithdrawReq + * @throws IOException if the JSON string is invalid with respect to WithdrawReq + */ + public static WithdrawReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WithdrawReq.class); + } + + /** + * Convert an instance of WithdrawReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..437ce81cf06 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,101 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.GetSingleStatusRequest; +import org.openapitools.client.model.GetStatusRequest; +import org.openapitools.client.model.InitializeRequest; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.NewContractObj; +import org.openapitools.client.model.RefundReq; +import org.openapitools.client.model.RunTransactionResponse; +import org.openapitools.client.model.WithdrawReq; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getSingleStatusV1Test() throws ApiException { + GetSingleStatusRequest getSingleStatusRequest = null; + Integer response = api.getSingleStatusV1(getSingleStatusRequest); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getStatusV1Test() throws ApiException { + GetStatusRequest getStatusRequest = null; + List response = api.getStatusV1(getStatusRequest); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void initializeV1Test() throws ApiException { + InitializeRequest initializeRequest = null; + RunTransactionResponse response = api.initializeV1(initializeRequest); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void newContractV1Test() throws ApiException { + NewContractObj newContractObj = null; + InvokeContractV1Response response = api.newContractV1(newContractObj); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void refundV1Test() throws ApiException { + RefundReq refundReq = null; + InvokeContractV1Response response = api.refundV1(refundReq); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void withdrawV1Test() throws ApiException { + WithdrawReq withdrawReq = null; + InvokeContractV1Response response = api.withdrawV1(withdrawReq); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSingleStatusRequestTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSingleStatusRequestTest.java new file mode 100644 index 00000000000..39761032a40 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSingleStatusRequestTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetSingleStatusRequest + */ +public class GetSingleStatusRequestTest { + private final GetSingleStatusRequest model = new GetSingleStatusRequest(); + + /** + * Model tests for GetSingleStatusRequest + */ + @Test + public void testGetSingleStatusRequest() { + // TODO: test GetSingleStatusRequest + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetStatusRequestTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetStatusRequestTest.java new file mode 100644 index 00000000000..73f0bcff099 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetStatusRequestTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetStatusRequest + */ +public class GetStatusRequestTest { + private final GetStatusRequest model = new GetStatusRequest(); + + /** + * Model tests for GetStatusRequest + */ + @Test + public void testGetStatusRequest() { + // TODO: test GetStatusRequest + } + + /** + * Test the property 'ids' + */ + @Test + public void idsTest() { + // TODO: test ids + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InitializeRequestTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InitializeRequestTest.java new file mode 100644 index 00000000000..43cdea63eb4 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InitializeRequestTest.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InitializeRequest + */ +public class InitializeRequestTest { + private final InitializeRequest model = new InitializeRequest(); + + /** + * Model tests for InitializeRequest + */ + @Test + public void testInitializeRequest() { + // TODO: test InitializeRequest + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java new file mode 100644 index 00000000000..ca202e28b9c --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Response + */ +public class InvokeContractV1ResponseTest { + private final InvokeContractV1Response model = new InvokeContractV1Response(); + + /** + * Model tests for InvokeContractV1Response + */ + @Test + public void testInvokeContractV1Response() { + // TODO: test InvokeContractV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + + /** + * Test the property 'callOutput' + */ + @Test + public void callOutputTest() { + // TODO: test callOutput + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractObjGasTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractObjGasTest.java new file mode 100644 index 00000000000..e80f1a12655 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractObjGasTest.java @@ -0,0 +1,35 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NewContractObjGas + */ +public class NewContractObjGasTest { + private final NewContractObjGas model = new NewContractObjGas(); + + /** + * Model tests for NewContractObjGas + */ + @Test + public void testNewContractObjGas() { + // TODO: test NewContractObjGas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractObjTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractObjTest.java new file mode 100644 index 00000000000..ebf45d20fc1 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NewContractObjTest.java @@ -0,0 +1,139 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.client.model.NewContractObjGas; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NewContractObj + */ +public class NewContractObjTest { + private final NewContractObj model = new NewContractObj(); + + /** + * Model tests for NewContractObj + */ + @Test + public void testNewContractObj() { + // TODO: test NewContractObj + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'inputAmount' + */ + @Test + public void inputAmountTest() { + // TODO: test inputAmount + } + + /** + * Test the property 'outputAmount' + */ + @Test + public void outputAmountTest() { + // TODO: test outputAmount + } + + /** + * Test the property 'expiration' + */ + @Test + public void expirationTest() { + // TODO: test expiration + } + + /** + * Test the property 'hashLock' + */ + @Test + public void hashLockTest() { + // TODO: test hashLock + } + + /** + * Test the property 'receiver' + */ + @Test + public void receiverTest() { + // TODO: test receiver + } + + /** + * Test the property 'outputNetwork' + */ + @Test + public void outputNetworkTest() { + // TODO: test outputNetwork + } + + /** + * Test the property 'outputAddress' + */ + @Test + public void outputAddressTest() { + // TODO: test outputAddress + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RefundReqTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RefundReqTest.java new file mode 100644 index 00000000000..4ea0cf496e9 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RefundReqTest.java @@ -0,0 +1,82 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.NewContractObjGas; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RefundReq + */ +public class RefundReqTest { + private final RefundReq model = new RefundReq(); + + /** + * Model tests for RefundReq + */ + @Test + public void testRefundReq() { + // TODO: test RefundReq + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java new file mode 100644 index 00000000000..e0dc229e1dc --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionResponse + */ +public class RunTransactionResponseTest { + private final RunTransactionResponse model = new RunTransactionResponse(); + + /** + * Model tests for RunTransactionResponse + */ + @Test + public void testRunTransactionResponse() { + // TODO: test RunTransactionResponse + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java new file mode 100644 index 00000000000..7deca401bf2 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ +public class Web3SigningCredentialCactusKeychainRefTest { + private final Web3SigningCredentialCactusKeychainRef model = new Web3SigningCredentialCactusKeychainRef(); + + /** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ + @Test + public void testWeb3SigningCredentialCactusKeychainRef() { + // TODO: test Web3SigningCredentialCactusKeychainRef + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java new file mode 100644 index 00000000000..113d4b8d58f --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialNone + */ +public class Web3SigningCredentialNoneTest { + private final Web3SigningCredentialNone model = new Web3SigningCredentialNone(); + + /** + * Model tests for Web3SigningCredentialNone + */ + @Test + public void testWeb3SigningCredentialNone() { + // TODO: test Web3SigningCredentialNone + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java new file mode 100644 index 00000000000..18cb065055b --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ +public class Web3SigningCredentialPrivateKeyHexTest { + private final Web3SigningCredentialPrivateKeyHex model = new Web3SigningCredentialPrivateKeyHex(); + + /** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ + @Test + public void testWeb3SigningCredentialPrivateKeyHex() { + // TODO: test Web3SigningCredentialPrivateKeyHex + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java new file mode 100644 index 00000000000..76b3a312b04 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredential + */ +public class Web3SigningCredentialTest { + private final Web3SigningCredential model = new Web3SigningCredential(); + + /** + * Model tests for Web3SigningCredential + */ + @Test + public void testWeb3SigningCredential() { + // TODO: test Web3SigningCredential + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java new file mode 100644 index 00000000000..fd0acd55440 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialType + */ +public class Web3SigningCredentialTypeTest { + /** + * Model tests for Web3SigningCredentialType + */ + @Test + public void testWeb3SigningCredentialType() { + // TODO: test Web3SigningCredentialType + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java new file mode 100644 index 00000000000..030a2df3505 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java @@ -0,0 +1,114 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3TransactionReceipt + */ +public class Web3TransactionReceiptTest { + private final Web3TransactionReceipt model = new Web3TransactionReceipt(); + + /** + * Model tests for Web3TransactionReceipt + */ + @Test + public void testWeb3TransactionReceipt() { + // TODO: test Web3TransactionReceipt + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + +} diff --git a/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawReqTest.java b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawReqTest.java new file mode 100644 index 00000000000..4fdf9fb70e1 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WithdrawReqTest.java @@ -0,0 +1,90 @@ +/* + * Hyperledger Cactus Plugin - HTLC-ETH Besu + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.NewContractObjGas; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WithdrawReq + */ +public class WithdrawReqTest { + private final WithdrawReq model = new WithdrawReq(); + + /** + * Model tests for WithdrawReq + */ + @Test + public void testWithdrawReq() { + // TODO: test WithdrawReq + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'connectorId' + */ + @Test + public void connectorIdTest() { + // TODO: test connectorId + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/package.json b/packages/cactus-plugin-keychain-aws-sm/package.json index 91f162e9402..1498c7e3133 100644 --- a/packages/cactus-plugin-keychain-aws-sm/package.json +++ b/packages/cactus-plugin-keychain-aws-sm/package.json @@ -48,6 +48,8 @@ "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..cff88d4efaa --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,19 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_delete_keychain_entry_request_v1.go +model_delete_keychain_entry_response_v1.go +model_get_keychain_entry_request_v1.go +model_get_keychain_entry_response_v1.go +model_has_keychain_entry_request_v1.go +model_has_keychain_entry_response_v1.go +model_set_keychain_entry_request_v1.go +model_set_keychain_entry_response_v1.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..fa8a1b3ba9e --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,123 @@ +# Go API client for cactus-plugin-keychain-aws-sm + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-keychain-aws-sm "github.com/hyperledger/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-aws-sm.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-aws-sm.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-aws-sm.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-keychain-aws-sm.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeleteKeychainEntryV1**](docs/DefaultApi.md#deletekeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry | Deletes an entry under a key on the keychain backend. +*DefaultApi* | [**GetKeychainEntryV1**](docs/DefaultApi.md#getkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**HasKeychainEntryV1**](docs/DefaultApi.md#haskeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry | Checks that an entry exists under a key on the keychain backend +*DefaultApi* | [**SetKeychainEntryV1**](docs/DefaultApi.md#setkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation For Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..98e3e0cb5e3 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,364 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Keychain API types/paths for Hyperledger Cactus. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus - Keychain API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_delete_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Deletes an entry under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_has_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Checks that an entry exists under a key on the keychain backend + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-prometheus-exporter-metrics +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_delete_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_delete_entry_401: + description: Authorization information is missing or invalid. + keychain_delete_entry_500: + description: Unexpected error. + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + schemas: + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetSecretRequest: + additionalProperties: false + nullable: false + type: object + GetSecretResponse: + nullable: false + type: string + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..e6052dd2426 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,556 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeleteKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deleteKeychainEntryRequestV1 *DeleteKeychainEntryRequestV1 +} + +// Request body to delete a keychain entry via its key +func (r ApiDeleteKeychainEntryV1Request) DeleteKeychainEntryRequestV1(deleteKeychainEntryRequestV1 DeleteKeychainEntryRequestV1) ApiDeleteKeychainEntryV1Request { + r.deleteKeychainEntryRequestV1 = &deleteKeychainEntryRequestV1 + return r +} + +func (r ApiDeleteKeychainEntryV1Request) Execute() (*DeleteKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.DeleteKeychainEntryV1Execute(r) +} + +/* +DeleteKeychainEntryV1 Deletes an entry under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeleteKeychainEntryV1Request +*/ +func (a *DefaultApiService) DeleteKeychainEntryV1(ctx context.Context) ApiDeleteKeychainEntryV1Request { + return ApiDeleteKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeleteKeychainEntryResponseV1 +func (a *DefaultApiService) DeleteKeychainEntryV1Execute(r ApiDeleteKeychainEntryV1Request) (*DeleteKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deleteKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("deleteKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deleteKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getKeychainEntryRequestV1 *GetKeychainEntryRequestV1 +} + +// Request body to obtain a keychain entry via its key +func (r ApiGetKeychainEntryV1Request) GetKeychainEntryRequestV1(getKeychainEntryRequestV1 GetKeychainEntryRequestV1) ApiGetKeychainEntryV1Request { + r.getKeychainEntryRequestV1 = &getKeychainEntryRequestV1 + return r +} + +func (r ApiGetKeychainEntryV1Request) Execute() (*GetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.GetKeychainEntryV1Execute(r) +} + +/* +GetKeychainEntryV1 Retrieves the contents of a keychain entry from the backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetKeychainEntryV1Request +*/ +func (a *DefaultApiService) GetKeychainEntryV1(ctx context.Context) ApiGetKeychainEntryV1Request { + return ApiGetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetKeychainEntryResponseV1 +func (a *DefaultApiService) GetKeychainEntryV1Execute(r ApiGetKeychainEntryV1Request) (*GetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.getKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("getKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiHasKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + hasKeychainEntryRequestV1 *HasKeychainEntryRequestV1 +} + +// Request body for checking a keychain entry via its key +func (r ApiHasKeychainEntryV1Request) HasKeychainEntryRequestV1(hasKeychainEntryRequestV1 HasKeychainEntryRequestV1) ApiHasKeychainEntryV1Request { + r.hasKeychainEntryRequestV1 = &hasKeychainEntryRequestV1 + return r +} + +func (r ApiHasKeychainEntryV1Request) Execute() (*HasKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.HasKeychainEntryV1Execute(r) +} + +/* +HasKeychainEntryV1 Checks that an entry exists under a key on the keychain backend + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiHasKeychainEntryV1Request +*/ +func (a *DefaultApiService) HasKeychainEntryV1(ctx context.Context) ApiHasKeychainEntryV1Request { + return ApiHasKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return HasKeychainEntryResponseV1 +func (a *DefaultApiService) HasKeychainEntryV1Execute(r ApiHasKeychainEntryV1Request) (*HasKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HasKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.HasKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.hasKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("hasKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.hasKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + setKeychainEntryRequestV1 *SetKeychainEntryRequestV1 +} + +// Request body to write/update a keychain entry via its key +func (r ApiSetKeychainEntryV1Request) SetKeychainEntryRequestV1(setKeychainEntryRequestV1 SetKeychainEntryRequestV1) ApiSetKeychainEntryV1Request { + r.setKeychainEntryRequestV1 = &setKeychainEntryRequestV1 + return r +} + +func (r ApiSetKeychainEntryV1Request) Execute() (*SetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.SetKeychainEntryV1Execute(r) +} + +/* +SetKeychainEntryV1 Sets a value under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSetKeychainEntryV1Request +*/ +func (a *DefaultApiService) SetKeychainEntryV1(ctx context.Context) ApiSetKeychainEntryV1Request { + return ApiSetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SetKeychainEntryResponseV1 +func (a *DefaultApiService) SetKeychainEntryV1Execute(r ApiSetKeychainEntryV1Request) (*SetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.setKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("setKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..38c12362cb6 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus - Keychain API API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..d2f3294ea96 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..df401e58025 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go new file mode 100644 index 00000000000..4ec8aa08395 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryRequestV1{} + +// DeleteKeychainEntryRequestV1 struct for DeleteKeychainEntryRequestV1 +type DeleteKeychainEntryRequestV1 struct { + // The key for the entry to check the presence of on the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryRequestV1 instantiates a new DeleteKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewDeleteKeychainEntryRequestV1(key string) *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryRequestV1WithDefaults instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryRequestV1WithDefaults() *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryRequestV1 struct { + value *DeleteKeychainEntryRequestV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryRequestV1) Get() *DeleteKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryRequestV1) Set(val *DeleteKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryRequestV1(val *DeleteKeychainEntryRequestV1) *NullableDeleteKeychainEntryRequestV1 { + return &NullableDeleteKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go new file mode 100644 index 00000000000..e1accb55980 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryResponseV1{} + +// DeleteKeychainEntryResponseV1 struct for DeleteKeychainEntryResponseV1 +type DeleteKeychainEntryResponseV1 struct { + // The key that was deleted from the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryResponseV1 instantiates a new DeleteKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewDeleteKeychainEntryResponseV1(key string) *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryResponseV1WithDefaults instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryResponseV1WithDefaults() *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryResponseV1 struct { + value *DeleteKeychainEntryResponseV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryResponseV1) Get() *DeleteKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryResponseV1) Set(val *DeleteKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryResponseV1(val *DeleteKeychainEntryResponseV1) *NullableDeleteKeychainEntryResponseV1 { + return &NullableDeleteKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go new file mode 100644 index 00000000000..86010fd14b9 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryRequestV1{} + +// GetKeychainEntryRequestV1 struct for GetKeychainEntryRequestV1 +type GetKeychainEntryRequestV1 struct { + // The key for the entry to get from the keychain. + Key string `json:"key"` +} + +// NewGetKeychainEntryRequestV1 instantiates a new GetKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewGetKeychainEntryRequestV1(key string) *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewGetKeychainEntryRequestV1WithDefaults instantiates a new GetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryRequestV1WithDefaults() *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetKeychainEntryRequestV1 struct { + value *GetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableGetKeychainEntryRequestV1) Get() *GetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableGetKeychainEntryRequestV1) Set(val *GetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryRequestV1(val *GetKeychainEntryRequestV1) *NullableGetKeychainEntryRequestV1 { + return &NullableGetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go new file mode 100644 index 00000000000..05c07d29713 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryResponseV1{} + +// GetKeychainEntryResponseV1 struct for GetKeychainEntryResponseV1 +type GetKeychainEntryResponseV1 struct { + // The key that was used to retrieve the value from the keychain. + Key string `json:"key"` + // The value associated with the requested key on the keychain. + Value string `json:"value"` +} + +// NewGetKeychainEntryResponseV1 instantiates a new GetKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewGetKeychainEntryResponseV1(key string, value string) *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetKeychainEntryResponseV1WithDefaults instantiates a new GetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryResponseV1WithDefaults() *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetKeychainEntryResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetKeychainEntryResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetKeychainEntryResponseV1 struct { + value *GetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableGetKeychainEntryResponseV1) Get() *GetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableGetKeychainEntryResponseV1) Set(val *GetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryResponseV1(val *GetKeychainEntryResponseV1) *NullableGetKeychainEntryResponseV1 { + return &NullableGetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go new file mode 100644 index 00000000000..0db19b9bdf6 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryRequestV1{} + +// HasKeychainEntryRequestV1 struct for HasKeychainEntryRequestV1 +type HasKeychainEntryRequestV1 struct { + // The key to check for presence in the keychain. + Key string `json:"key"` +} + +// NewHasKeychainEntryRequestV1 instantiates a new HasKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewHasKeychainEntryRequestV1(key string) *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewHasKeychainEntryRequestV1WithDefaults instantiates a new HasKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryRequestV1WithDefaults() *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasKeychainEntryRequestV1 struct { + value *HasKeychainEntryRequestV1 + isSet bool +} + +func (v NullableHasKeychainEntryRequestV1) Get() *HasKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableHasKeychainEntryRequestV1) Set(val *HasKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryRequestV1(val *HasKeychainEntryRequestV1) *NullableHasKeychainEntryRequestV1 { + return &NullableHasKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go new file mode 100644 index 00000000000..213d5e37832 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryResponseV1{} + +// HasKeychainEntryResponseV1 struct for HasKeychainEntryResponseV1 +type HasKeychainEntryResponseV1 struct { + // The key that was used to check the presence of the value in the entry store. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an entry under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasKeychainEntryResponseV1 instantiates a new HasKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewHasKeychainEntryResponseV1(key string, checkedAt string, isPresent bool) *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasKeychainEntryResponseV1WithDefaults instantiates a new HasKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryResponseV1WithDefaults() *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasKeychainEntryResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasKeychainEntryResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasKeychainEntryResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasKeychainEntryResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasKeychainEntryResponseV1 struct { + value *HasKeychainEntryResponseV1 + isSet bool +} + +func (v NullableHasKeychainEntryResponseV1) Get() *HasKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableHasKeychainEntryResponseV1) Set(val *HasKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryResponseV1(val *HasKeychainEntryResponseV1) *NullableHasKeychainEntryResponseV1 { + return &NullableHasKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go new file mode 100644 index 00000000000..bd3f1994b17 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryRequestV1{} + +// SetKeychainEntryRequestV1 struct for SetKeychainEntryRequestV1 +type SetKeychainEntryRequestV1 struct { + // The key for the entry to set on the keychain. + Key string `json:"key"` + // The value that will be associated with the key on the keychain. + Value string `json:"value"` +} + +// NewSetKeychainEntryRequestV1 instantiates a new SetKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewSetKeychainEntryRequestV1(key string, value string) *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetKeychainEntryRequestV1WithDefaults instantiates a new SetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryRequestV1WithDefaults() *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetKeychainEntryRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetKeychainEntryRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetKeychainEntryRequestV1 struct { + value *SetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableSetKeychainEntryRequestV1) Get() *SetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableSetKeychainEntryRequestV1) Set(val *SetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryRequestV1(val *SetKeychainEntryRequestV1) *NullableSetKeychainEntryRequestV1 { + return &NullableSetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go new file mode 100644 index 00000000000..a7955dd8dd0 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryResponseV1{} + +// SetKeychainEntryResponseV1 struct for SetKeychainEntryResponseV1 +type SetKeychainEntryResponseV1 struct { + // The key that was used to set the value on the keychain. + Key string `json:"key"` +} + +// NewSetKeychainEntryResponseV1 instantiates a new SetKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewSetKeychainEntryResponseV1(key string) *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewSetKeychainEntryResponseV1WithDefaults instantiates a new SetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryResponseV1WithDefaults() *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetKeychainEntryResponseV1 struct { + value *SetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableSetKeychainEntryResponseV1) Get() *SetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableSetKeychainEntryResponseV1) Set(val *SetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryResponseV1(val *SetKeychainEntryResponseV1) *NullableSetKeychainEntryResponseV1 { + return &NullableSetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..efd9ffbcf4e --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..01cebac953e --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,85 @@ +/* +Hyperledger Cactus - Keychain API + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-keychain-aws-sm + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-keychain-aws-sm_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService DeleteKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeleteKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPrometheusMetricsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPrometheusMetricsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService HasKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.HasKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService SetKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.SetKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..c6f9390b046 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-aws-sm + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..a155899a355 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus - Keychain API + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..715e109d921 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,48 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..c26d926ece1 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,148 @@ +# openapi-java-client + +Hyperledger Cactus - Keychain API +- API version: v2.0.0-alpha.2 + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = new DeleteKeychainEntryRequestV1(); // DeleteKeychainEntryRequestV1 | Request body to delete a keychain entry via its key + try { + DeleteKeychainEntryResponseV1 result = apiInstance.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deleteKeychainEntryV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deleteKeychainEntryV1**](docs/DefaultApi.md#deleteKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry | Deletes an entry under a key on the keychain backend. +*DefaultApi* | [**getKeychainEntryV1**](docs/DefaultApi.md#getKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**hasKeychainEntryV1**](docs/DefaultApi.md#hasKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry | Checks that an entry exists under a key on the keychain backend +*DefaultApi* | [**setKeychainEntryV1**](docs/DefaultApi.md#setKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation for Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..f1f16de2ced --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,374 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Keychain API types/paths for Hyperledger Cactus. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus - Keychain API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_delete_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Deletes an entry under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_has_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Checks that an entry exists under a key on the keychain backend + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-prometheus-exporter-metrics + x-accepts: text/plain +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_delete_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_delete_entry_401: + description: Authorization information is missing or invalid. + keychain_delete_entry_500: + description: Unexpected error. + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + schemas: + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetSecretRequest: + additionalProperties: false + nullable: false + type: object + GetSecretResponse: + nullable: false + type: string + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..ae229a53715 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..3dffbd1bcb1 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..927f4e3634c --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..c4cc8894bc7 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..680d06d26b4 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..a47c9598eb7 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..41e529ec030 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,408 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.DeleteKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryResponseV1.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); + } + } + } + + /** + * 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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..beeba650d5a --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..a7b77588008 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..36a03a4ac8f --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..7c133060d80 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..174a1fe7fb1 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,740 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 deleteKeychainEntryV1 + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call deleteKeychainEntryV1Call(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deleteKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/delete-keychain-entry"; + + 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 deleteKeychainEntryV1ValidateBeforeCall(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'deleteKeychainEntryRequestV1' is set + if (deleteKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'deleteKeychainEntryRequestV1' when calling deleteKeychainEntryV1(Async)"); + } + + return deleteKeychainEntryV1Call(deleteKeychainEntryRequestV1, _callback); + + } + + /** + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return DeleteKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public DeleteKeychainEntryResponseV1 deleteKeychainEntryV1(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return ApiResponse<DeleteKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse deleteKeychainEntryV1WithHttpInfo(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deletes an entry under a key on the keychain backend. (asynchronously) + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call deleteKeychainEntryV1Async(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getKeychainEntryV1 + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Call(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-keychain-entry"; + + 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 getKeychainEntryV1ValidateBeforeCall(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'getKeychainEntryRequestV1' is set + if (getKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'getKeychainEntryRequestV1' when calling getKeychainEntryV1(Async)"); + } + + return getKeychainEntryV1Call(getKeychainEntryRequestV1, _callback); + + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return GetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public GetKeychainEntryResponseV1 getKeychainEntryV1(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return ApiResponse<GetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public ApiResponse getKeychainEntryV1WithHttpInfo(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the contents of a keychain entry from the backend. (asynchronously) + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Async(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + 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 getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasKeychainEntryV1 + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Call(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = hasKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/has-keychain-entry"; + + 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 hasKeychainEntryV1ValidateBeforeCall(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'hasKeychainEntryRequestV1' is set + if (hasKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'hasKeychainEntryRequestV1' when calling hasKeychainEntryV1(Async)"); + } + + return hasKeychainEntryV1Call(hasKeychainEntryRequestV1, _callback); + + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return HasKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public HasKeychainEntryResponseV1 hasKeychainEntryV1(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return ApiResponse<HasKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse hasKeychainEntryV1WithHttpInfo(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Checks that an entry exists under a key on the keychain backend (asynchronously) + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Async(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setKeychainEntryV1 + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Call(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = setKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-aws-sm/set-keychain-entry"; + + 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 setKeychainEntryV1ValidateBeforeCall(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'setKeychainEntryRequestV1' is set + if (setKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'setKeychainEntryRequestV1' when calling setKeychainEntryV1(Async)"); + } + + return setKeychainEntryV1Call(setKeychainEntryRequestV1, _callback); + + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return SetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public SetKeychainEntryResponseV1 setKeychainEntryV1(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return ApiResponse<SetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse setKeychainEntryV1WithHttpInfo(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Sets a value under a key on the keychain backend. (asynchronously) + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Async(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..9d478953d92 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..2896c25c21c --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..660312a6f53 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..07bda43db19 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..506c3d798e8 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java new file mode 100644 index 00000000000..d98aa2c197c --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryRequestV1() { + } + + public DeleteKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to check the presence of on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = (DeleteKeychainEntryRequestV1) o; + return Objects.equals(this.key, deleteKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryRequestV1 is not found in the empty JSON string", DeleteKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static DeleteKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java new file mode 100644 index 00000000000..7ab3d703384 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryResponseV1() { + } + + public DeleteKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was deleted from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryResponseV1 deleteKeychainEntryResponseV1 = (DeleteKeychainEntryResponseV1) o; + return Objects.equals(this.key, deleteKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryResponseV1 is not found in the empty JSON string", DeleteKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static DeleteKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java new file mode 100644 index 00000000000..697c441d6f8 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetKeychainEntryRequestV1() { + } + + public GetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = (GetKeychainEntryRequestV1) o; + return Objects.equals(this.key, getKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryRequestV1 is not found in the empty JSON string", GetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryRequestV1 + */ + public static GetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of GetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java new file mode 100644 index 00000000000..42041c99071 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetKeychainEntryResponseV1() { + } + + public GetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetKeychainEntryResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryResponseV1 getKeychainEntryResponseV1 = (GetKeychainEntryResponseV1) o; + return Objects.equals(this.key, getKeychainEntryResponseV1.key) && + Objects.equals(this.value, getKeychainEntryResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryResponseV1 is not found in the empty JSON string", GetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryResponseV1 + */ + public static GetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of GetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java new file mode 100644 index 00000000000..25e02ce2899 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasKeychainEntryRequestV1() { + } + + public HasKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = (HasKeychainEntryRequestV1) o; + return Objects.equals(this.key, hasKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryRequestV1 is not found in the empty JSON string", HasKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryRequestV1 + */ + public static HasKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of HasKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java new file mode 100644 index 00000000000..336e1b7c96d --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasKeychainEntryResponseV1() { + } + + public HasKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the entry store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasKeychainEntryResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasKeychainEntryResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an entry under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryResponseV1 hasKeychainEntryResponseV1 = (HasKeychainEntryResponseV1) o; + return Objects.equals(this.key, hasKeychainEntryResponseV1.key) && + Objects.equals(this.checkedAt, hasKeychainEntryResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasKeychainEntryResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryResponseV1 is not found in the empty JSON string", HasKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryResponseV1 + */ + public static HasKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of HasKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java new file mode 100644 index 00000000000..2c57c8999ce --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetKeychainEntryRequestV1() { + } + + public SetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetKeychainEntryRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = (SetKeychainEntryRequestV1) o; + return Objects.equals(this.key, setKeychainEntryRequestV1.key) && + Objects.equals(this.value, setKeychainEntryRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryRequestV1 is not found in the empty JSON string", SetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryRequestV1 + */ + public static SetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of SetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java new file mode 100644 index 00000000000..b0cde0e9aa1 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetKeychainEntryResponseV1() { + } + + public SetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryResponseV1 setKeychainEntryResponseV1 = (SetKeychainEntryResponseV1) o; + return Objects.equals(this.key, setKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryResponseV1 is not found in the empty JSON string", SetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryResponseV1 + */ + public static SetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of SetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..364958d0a09 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,100 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deletes an entry under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteKeychainEntryV1Test() throws ApiException { + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = null; + DeleteKeychainEntryResponseV1 response = api.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getKeychainEntryV1Test() throws ApiException { + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = null; + GetKeychainEntryResponseV1 response = api.getKeychainEntryV1(getKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasKeychainEntryV1Test() throws ApiException { + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = null; + HasKeychainEntryResponseV1 response = api.hasKeychainEntryV1(hasKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Sets a value under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void setKeychainEntryV1Test() throws ApiException { + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = null; + SetKeychainEntryResponseV1 response = api.setKeychainEntryV1(setKeychainEntryRequestV1); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..a0ea09b02b0 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryRequestV1 + */ +public class DeleteKeychainEntryRequestV1Test { + private final DeleteKeychainEntryRequestV1 model = new DeleteKeychainEntryRequestV1(); + + /** + * Model tests for DeleteKeychainEntryRequestV1 + */ + @Test + public void testDeleteKeychainEntryRequestV1() { + // TODO: test DeleteKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..d7a52b6063c --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryResponseV1 + */ +public class DeleteKeychainEntryResponseV1Test { + private final DeleteKeychainEntryResponseV1 model = new DeleteKeychainEntryResponseV1(); + + /** + * Model tests for DeleteKeychainEntryResponseV1 + */ + @Test + public void testDeleteKeychainEntryResponseV1() { + // TODO: test DeleteKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..717fa3097a7 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryRequestV1 + */ +public class GetKeychainEntryRequestV1Test { + private final GetKeychainEntryRequestV1 model = new GetKeychainEntryRequestV1(); + + /** + * Model tests for GetKeychainEntryRequestV1 + */ + @Test + public void testGetKeychainEntryRequestV1() { + // TODO: test GetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..b9128dc390b --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryResponseV1 + */ +public class GetKeychainEntryResponseV1Test { + private final GetKeychainEntryResponseV1 model = new GetKeychainEntryResponseV1(); + + /** + * Model tests for GetKeychainEntryResponseV1 + */ + @Test + public void testGetKeychainEntryResponseV1() { + // TODO: test GetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..807c27abc5b --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryRequestV1 + */ +public class HasKeychainEntryRequestV1Test { + private final HasKeychainEntryRequestV1 model = new HasKeychainEntryRequestV1(); + + /** + * Model tests for HasKeychainEntryRequestV1 + */ + @Test + public void testHasKeychainEntryRequestV1() { + // TODO: test HasKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..fb5162f240d --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryResponseV1 + */ +public class HasKeychainEntryResponseV1Test { + private final HasKeychainEntryResponseV1 model = new HasKeychainEntryResponseV1(); + + /** + * Model tests for HasKeychainEntryResponseV1 + */ + @Test + public void testHasKeychainEntryResponseV1() { + // TODO: test HasKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..b0ccc68cd6c --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryRequestV1 + */ +public class SetKeychainEntryRequestV1Test { + private final SetKeychainEntryRequestV1 model = new SetKeychainEntryRequestV1(); + + /** + * Model tests for SetKeychainEntryRequestV1 + */ + @Test + public void testSetKeychainEntryRequestV1() { + // TODO: test SetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..0543bd17835 --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryResponseV1 + */ +public class SetKeychainEntryResponseV1Test { + private final SetKeychainEntryResponseV1 model = new SetKeychainEntryResponseV1(); + + /** + * Model tests for SetKeychainEntryResponseV1 + */ + @Test + public void testSetKeychainEntryResponseV1() { + // TODO: test SetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/package.json b/packages/cactus-plugin-keychain-azure-kv/package.json index d36e6cb5c08..2758ae76167 100644 --- a/packages/cactus-plugin-keychain-azure-kv/package.json +++ b/packages/cactus-plugin-keychain-azure-kv/package.json @@ -53,6 +53,8 @@ "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..cff88d4efaa --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,19 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_delete_keychain_entry_request_v1.go +model_delete_keychain_entry_response_v1.go +model_get_keychain_entry_request_v1.go +model_get_keychain_entry_response_v1.go +model_has_keychain_entry_request_v1.go +model_has_keychain_entry_response_v1.go +model_set_keychain_entry_request_v1.go +model_set_keychain_entry_response_v1.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..e8918c6da13 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,122 @@ +# Go API client for cactus-plugin-keychain-azure-kv + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-keychain-azure-kv "github.com/hyperledger/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-azure-kv.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-azure-kv.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-azure-kv.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-keychain-azure-kv.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeleteKeychainEntryV1**](docs/DefaultApi.md#deletekeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/delete-keychain-entry | Deletes a value under a key on the keychain backend. +*DefaultApi* | [**GetKeychainEntryV1**](docs/DefaultApi.md#getkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**HasKeychainEntryV1**](docs/DefaultApi.md#haskeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/has-keychain-entry | Checks that an entry exists under a key on the keychain backend +*DefaultApi* | [**SetKeychainEntryV1**](docs/DefaultApi.md#setkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation For Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..0feefed120c --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,344 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Keychain API types/paths for Hyperledger Cactus. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus - Keychain API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_delete_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Deletes a value under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/delete-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_has_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Checks that an entry exists under a key on the keychain backend + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/has-keychain-entry + verbLowerCase: post +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_delete_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_delete_entry_401: + description: Authorization information is missing or invalid. + keychain_delete_entry_500: + description: Unexpected error. + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + schemas: + GetSecretRequest: + nullable: false + type: string + GetSecretResponse: + nullable: false + type: string + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..1466671c681 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,459 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeleteKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deleteKeychainEntryRequestV1 *DeleteKeychainEntryRequestV1 +} + +// Request body to delete a keychain entry via its key +func (r ApiDeleteKeychainEntryV1Request) DeleteKeychainEntryRequestV1(deleteKeychainEntryRequestV1 DeleteKeychainEntryRequestV1) ApiDeleteKeychainEntryV1Request { + r.deleteKeychainEntryRequestV1 = &deleteKeychainEntryRequestV1 + return r +} + +func (r ApiDeleteKeychainEntryV1Request) Execute() (*DeleteKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.DeleteKeychainEntryV1Execute(r) +} + +/* +DeleteKeychainEntryV1 Deletes a value under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeleteKeychainEntryV1Request +*/ +func (a *DefaultApiService) DeleteKeychainEntryV1(ctx context.Context) ApiDeleteKeychainEntryV1Request { + return ApiDeleteKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeleteKeychainEntryResponseV1 +func (a *DefaultApiService) DeleteKeychainEntryV1Execute(r ApiDeleteKeychainEntryV1Request) (*DeleteKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/delete-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deleteKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("deleteKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deleteKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getKeychainEntryRequestV1 *GetKeychainEntryRequestV1 +} + +// Request body to obtain a keychain entry via its key +func (r ApiGetKeychainEntryV1Request) GetKeychainEntryRequestV1(getKeychainEntryRequestV1 GetKeychainEntryRequestV1) ApiGetKeychainEntryV1Request { + r.getKeychainEntryRequestV1 = &getKeychainEntryRequestV1 + return r +} + +func (r ApiGetKeychainEntryV1Request) Execute() (*GetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.GetKeychainEntryV1Execute(r) +} + +/* +GetKeychainEntryV1 Retrieves the contents of a keychain entry from the backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetKeychainEntryV1Request +*/ +func (a *DefaultApiService) GetKeychainEntryV1(ctx context.Context) ApiGetKeychainEntryV1Request { + return ApiGetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetKeychainEntryResponseV1 +func (a *DefaultApiService) GetKeychainEntryV1Execute(r ApiGetKeychainEntryV1Request) (*GetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.getKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("getKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiHasKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + hasKeychainEntryRequestV1 *HasKeychainEntryRequestV1 +} + +// Request body for checking a keychain entry via its key +func (r ApiHasKeychainEntryV1Request) HasKeychainEntryRequestV1(hasKeychainEntryRequestV1 HasKeychainEntryRequestV1) ApiHasKeychainEntryV1Request { + r.hasKeychainEntryRequestV1 = &hasKeychainEntryRequestV1 + return r +} + +func (r ApiHasKeychainEntryV1Request) Execute() (*HasKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.HasKeychainEntryV1Execute(r) +} + +/* +HasKeychainEntryV1 Checks that an entry exists under a key on the keychain backend + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiHasKeychainEntryV1Request +*/ +func (a *DefaultApiService) HasKeychainEntryV1(ctx context.Context) ApiHasKeychainEntryV1Request { + return ApiHasKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return HasKeychainEntryResponseV1 +func (a *DefaultApiService) HasKeychainEntryV1Execute(r ApiHasKeychainEntryV1Request) (*HasKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HasKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.HasKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/has-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.hasKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("hasKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.hasKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + setKeychainEntryRequestV1 *SetKeychainEntryRequestV1 +} + +// Request body to write/update a keychain entry via its key +func (r ApiSetKeychainEntryV1Request) SetKeychainEntryRequestV1(setKeychainEntryRequestV1 SetKeychainEntryRequestV1) ApiSetKeychainEntryV1Request { + r.setKeychainEntryRequestV1 = &setKeychainEntryRequestV1 + return r +} + +func (r ApiSetKeychainEntryV1Request) Execute() (*SetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.SetKeychainEntryV1Execute(r) +} + +/* +SetKeychainEntryV1 Sets a value under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSetKeychainEntryV1Request +*/ +func (a *DefaultApiService) SetKeychainEntryV1(ctx context.Context) ApiSetKeychainEntryV1Request { + return ApiSetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SetKeychainEntryResponseV1 +func (a *DefaultApiService) SetKeychainEntryV1Execute(r ApiSetKeychainEntryV1Request) (*SetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.setKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("setKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..4222e31ca30 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus - Keychain API API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..ce8fd529d3a --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..f3e39b75dc5 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go new file mode 100644 index 00000000000..10cb26833a6 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryRequestV1{} + +// DeleteKeychainEntryRequestV1 struct for DeleteKeychainEntryRequestV1 +type DeleteKeychainEntryRequestV1 struct { + // The key for the entry to check the presence of on the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryRequestV1 instantiates a new DeleteKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewDeleteKeychainEntryRequestV1(key string) *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryRequestV1WithDefaults instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryRequestV1WithDefaults() *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryRequestV1 struct { + value *DeleteKeychainEntryRequestV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryRequestV1) Get() *DeleteKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryRequestV1) Set(val *DeleteKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryRequestV1(val *DeleteKeychainEntryRequestV1) *NullableDeleteKeychainEntryRequestV1 { + return &NullableDeleteKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go new file mode 100644 index 00000000000..25704ef7005 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryResponseV1{} + +// DeleteKeychainEntryResponseV1 struct for DeleteKeychainEntryResponseV1 +type DeleteKeychainEntryResponseV1 struct { + // The key that was deleted from the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryResponseV1 instantiates a new DeleteKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewDeleteKeychainEntryResponseV1(key string) *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryResponseV1WithDefaults instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryResponseV1WithDefaults() *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryResponseV1 struct { + value *DeleteKeychainEntryResponseV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryResponseV1) Get() *DeleteKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryResponseV1) Set(val *DeleteKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryResponseV1(val *DeleteKeychainEntryResponseV1) *NullableDeleteKeychainEntryResponseV1 { + return &NullableDeleteKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go new file mode 100644 index 00000000000..e828232161a --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryRequestV1{} + +// GetKeychainEntryRequestV1 struct for GetKeychainEntryRequestV1 +type GetKeychainEntryRequestV1 struct { + // The key for the entry to get from the keychain. + Key string `json:"key"` +} + +// NewGetKeychainEntryRequestV1 instantiates a new GetKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewGetKeychainEntryRequestV1(key string) *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewGetKeychainEntryRequestV1WithDefaults instantiates a new GetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryRequestV1WithDefaults() *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetKeychainEntryRequestV1 struct { + value *GetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableGetKeychainEntryRequestV1) Get() *GetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableGetKeychainEntryRequestV1) Set(val *GetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryRequestV1(val *GetKeychainEntryRequestV1) *NullableGetKeychainEntryRequestV1 { + return &NullableGetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go new file mode 100644 index 00000000000..e7587fcf5e3 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryResponseV1{} + +// GetKeychainEntryResponseV1 struct for GetKeychainEntryResponseV1 +type GetKeychainEntryResponseV1 struct { + // The key that was used to retrieve the value from the keychain. + Key string `json:"key"` + // The value associated with the requested key on the keychain. + Value string `json:"value"` +} + +// NewGetKeychainEntryResponseV1 instantiates a new GetKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewGetKeychainEntryResponseV1(key string, value string) *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetKeychainEntryResponseV1WithDefaults instantiates a new GetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryResponseV1WithDefaults() *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetKeychainEntryResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetKeychainEntryResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetKeychainEntryResponseV1 struct { + value *GetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableGetKeychainEntryResponseV1) Get() *GetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableGetKeychainEntryResponseV1) Set(val *GetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryResponseV1(val *GetKeychainEntryResponseV1) *NullableGetKeychainEntryResponseV1 { + return &NullableGetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go new file mode 100644 index 00000000000..3cf2080bd1e --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryRequestV1{} + +// HasKeychainEntryRequestV1 struct for HasKeychainEntryRequestV1 +type HasKeychainEntryRequestV1 struct { + // The key to check for presence in the keychain. + Key string `json:"key"` +} + +// NewHasKeychainEntryRequestV1 instantiates a new HasKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewHasKeychainEntryRequestV1(key string) *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewHasKeychainEntryRequestV1WithDefaults instantiates a new HasKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryRequestV1WithDefaults() *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasKeychainEntryRequestV1 struct { + value *HasKeychainEntryRequestV1 + isSet bool +} + +func (v NullableHasKeychainEntryRequestV1) Get() *HasKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableHasKeychainEntryRequestV1) Set(val *HasKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryRequestV1(val *HasKeychainEntryRequestV1) *NullableHasKeychainEntryRequestV1 { + return &NullableHasKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go new file mode 100644 index 00000000000..4d4cc5c4837 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryResponseV1{} + +// HasKeychainEntryResponseV1 struct for HasKeychainEntryResponseV1 +type HasKeychainEntryResponseV1 struct { + // The key that was used to check the presence of the value in the entry store. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an entry under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasKeychainEntryResponseV1 instantiates a new HasKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewHasKeychainEntryResponseV1(key string, checkedAt string, isPresent bool) *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasKeychainEntryResponseV1WithDefaults instantiates a new HasKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryResponseV1WithDefaults() *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasKeychainEntryResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasKeychainEntryResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasKeychainEntryResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasKeychainEntryResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasKeychainEntryResponseV1 struct { + value *HasKeychainEntryResponseV1 + isSet bool +} + +func (v NullableHasKeychainEntryResponseV1) Get() *HasKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableHasKeychainEntryResponseV1) Set(val *HasKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryResponseV1(val *HasKeychainEntryResponseV1) *NullableHasKeychainEntryResponseV1 { + return &NullableHasKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go new file mode 100644 index 00000000000..688f9631c44 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryRequestV1{} + +// SetKeychainEntryRequestV1 struct for SetKeychainEntryRequestV1 +type SetKeychainEntryRequestV1 struct { + // The key for the entry to set on the keychain. + Key string `json:"key"` + // The value that will be associated with the key on the keychain. + Value string `json:"value"` +} + +// NewSetKeychainEntryRequestV1 instantiates a new SetKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewSetKeychainEntryRequestV1(key string, value string) *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetKeychainEntryRequestV1WithDefaults instantiates a new SetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryRequestV1WithDefaults() *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetKeychainEntryRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetKeychainEntryRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetKeychainEntryRequestV1 struct { + value *SetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableSetKeychainEntryRequestV1) Get() *SetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableSetKeychainEntryRequestV1) Set(val *SetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryRequestV1(val *SetKeychainEntryRequestV1) *NullableSetKeychainEntryRequestV1 { + return &NullableSetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go new file mode 100644 index 00000000000..1a6ea4d7929 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryResponseV1{} + +// SetKeychainEntryResponseV1 struct for SetKeychainEntryResponseV1 +type SetKeychainEntryResponseV1 struct { + // The key that was used to set the value on the keychain. + Key string `json:"key"` +} + +// NewSetKeychainEntryResponseV1 instantiates a new SetKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewSetKeychainEntryResponseV1(key string) *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewSetKeychainEntryResponseV1WithDefaults instantiates a new SetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryResponseV1WithDefaults() *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetKeychainEntryResponseV1 struct { + value *SetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableSetKeychainEntryResponseV1) Get() *SetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableSetKeychainEntryResponseV1) Set(val *SetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryResponseV1(val *SetKeychainEntryResponseV1) *NullableSetKeychainEntryResponseV1 { + return &NullableSetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..b16f744b481 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..6933479ebbe --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,73 @@ +/* +Hyperledger Cactus - Keychain API + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-keychain-azure-kv + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-keychain-azure-kv_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService DeleteKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeleteKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService HasKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.HasKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService SetKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.SetKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..ad78b8e8497 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-azure-kv + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..a155899a355 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus - Keychain API + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..715e109d921 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,48 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..9ef341bddf9 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,147 @@ +# openapi-java-client + +Hyperledger Cactus - Keychain API +- API version: v2.0.0-alpha.2 + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = new DeleteKeychainEntryRequestV1(); // DeleteKeychainEntryRequestV1 | Request body to delete a keychain entry via its key + try { + DeleteKeychainEntryResponseV1 result = apiInstance.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deleteKeychainEntryV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deleteKeychainEntryV1**](docs/DefaultApi.md#deleteKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/delete-keychain-entry | Deletes a value under a key on the keychain backend. +*DefaultApi* | [**getKeychainEntryV1**](docs/DefaultApi.md#getKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**hasKeychainEntryV1**](docs/DefaultApi.md#hasKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/has-keychain-entry | Checks that an entry exists under a key on the keychain backend +*DefaultApi* | [**setKeychainEntryV1**](docs/DefaultApi.md#setKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation for Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..5419a976f0b --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,353 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Keychain API types/paths for Hyperledger Cactus. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus - Keychain API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_delete_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Deletes a value under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/delete-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_has_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Checks that an entry exists under a key on the keychain backend + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/has-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_delete_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_delete_entry_401: + description: Authorization information is missing or invalid. + keychain_delete_entry_500: + description: Unexpected error. + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + schemas: + GetSecretRequest: + nullable: false + type: string + GetSecretResponse: + nullable: false + type: string + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..ae229a53715 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..3dffbd1bcb1 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..927f4e3634c --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..c4cc8894bc7 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..680d06d26b4 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..a47c9598eb7 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..41e529ec030 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,408 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.DeleteKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryResponseV1.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); + } + } + } + + /** + * 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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..beeba650d5a --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..a7b77588008 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..36a03a4ac8f --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..7c133060d80 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..8d1f4ffff50 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,627 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 deleteKeychainEntryV1 + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call deleteKeychainEntryV1Call(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deleteKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/delete-keychain-entry"; + + 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 deleteKeychainEntryV1ValidateBeforeCall(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'deleteKeychainEntryRequestV1' is set + if (deleteKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'deleteKeychainEntryRequestV1' when calling deleteKeychainEntryV1(Async)"); + } + + return deleteKeychainEntryV1Call(deleteKeychainEntryRequestV1, _callback); + + } + + /** + * Deletes a value under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return DeleteKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public DeleteKeychainEntryResponseV1 deleteKeychainEntryV1(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Deletes a value under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return ApiResponse<DeleteKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse deleteKeychainEntryV1WithHttpInfo(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deletes a value under a key on the keychain backend. (asynchronously) + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call deleteKeychainEntryV1Async(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getKeychainEntryV1 + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Call(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/get-keychain-entry"; + + 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 getKeychainEntryV1ValidateBeforeCall(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'getKeychainEntryRequestV1' is set + if (getKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'getKeychainEntryRequestV1' when calling getKeychainEntryV1(Async)"); + } + + return getKeychainEntryV1Call(getKeychainEntryRequestV1, _callback); + + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return GetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public GetKeychainEntryResponseV1 getKeychainEntryV1(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return ApiResponse<GetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public ApiResponse getKeychainEntryV1WithHttpInfo(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the contents of a keychain entry from the backend. (asynchronously) + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Async(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasKeychainEntryV1 + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Call(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = hasKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/has-keychain-entry"; + + 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 hasKeychainEntryV1ValidateBeforeCall(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'hasKeychainEntryRequestV1' is set + if (hasKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'hasKeychainEntryRequestV1' when calling hasKeychainEntryV1(Async)"); + } + + return hasKeychainEntryV1Call(hasKeychainEntryRequestV1, _callback); + + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return HasKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public HasKeychainEntryResponseV1 hasKeychainEntryV1(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return ApiResponse<HasKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse hasKeychainEntryV1WithHttpInfo(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Checks that an entry exists under a key on the keychain backend (asynchronously) + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Async(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setKeychainEntryV1 + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Call(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = setKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-azure-kv/set-keychain-entry"; + + 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 setKeychainEntryV1ValidateBeforeCall(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'setKeychainEntryRequestV1' is set + if (setKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'setKeychainEntryRequestV1' when calling setKeychainEntryV1(Async)"); + } + + return setKeychainEntryV1Call(setKeychainEntryRequestV1, _callback); + + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return SetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public SetKeychainEntryResponseV1 setKeychainEntryV1(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return ApiResponse<SetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse setKeychainEntryV1WithHttpInfo(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Sets a value under a key on the keychain backend. (asynchronously) + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Async(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..9d478953d92 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..2896c25c21c --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..660312a6f53 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..07bda43db19 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..506c3d798e8 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java new file mode 100644 index 00000000000..d98aa2c197c --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryRequestV1() { + } + + public DeleteKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to check the presence of on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = (DeleteKeychainEntryRequestV1) o; + return Objects.equals(this.key, deleteKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryRequestV1 is not found in the empty JSON string", DeleteKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static DeleteKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java new file mode 100644 index 00000000000..7ab3d703384 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryResponseV1() { + } + + public DeleteKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was deleted from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryResponseV1 deleteKeychainEntryResponseV1 = (DeleteKeychainEntryResponseV1) o; + return Objects.equals(this.key, deleteKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryResponseV1 is not found in the empty JSON string", DeleteKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static DeleteKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java new file mode 100644 index 00000000000..697c441d6f8 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetKeychainEntryRequestV1() { + } + + public GetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = (GetKeychainEntryRequestV1) o; + return Objects.equals(this.key, getKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryRequestV1 is not found in the empty JSON string", GetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryRequestV1 + */ + public static GetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of GetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java new file mode 100644 index 00000000000..42041c99071 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetKeychainEntryResponseV1() { + } + + public GetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetKeychainEntryResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryResponseV1 getKeychainEntryResponseV1 = (GetKeychainEntryResponseV1) o; + return Objects.equals(this.key, getKeychainEntryResponseV1.key) && + Objects.equals(this.value, getKeychainEntryResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryResponseV1 is not found in the empty JSON string", GetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryResponseV1 + */ + public static GetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of GetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java new file mode 100644 index 00000000000..25e02ce2899 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasKeychainEntryRequestV1() { + } + + public HasKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = (HasKeychainEntryRequestV1) o; + return Objects.equals(this.key, hasKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryRequestV1 is not found in the empty JSON string", HasKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryRequestV1 + */ + public static HasKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of HasKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java new file mode 100644 index 00000000000..336e1b7c96d --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasKeychainEntryResponseV1() { + } + + public HasKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the entry store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasKeychainEntryResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasKeychainEntryResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an entry under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryResponseV1 hasKeychainEntryResponseV1 = (HasKeychainEntryResponseV1) o; + return Objects.equals(this.key, hasKeychainEntryResponseV1.key) && + Objects.equals(this.checkedAt, hasKeychainEntryResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasKeychainEntryResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryResponseV1 is not found in the empty JSON string", HasKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryResponseV1 + */ + public static HasKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of HasKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java new file mode 100644 index 00000000000..2c57c8999ce --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetKeychainEntryRequestV1() { + } + + public SetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetKeychainEntryRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = (SetKeychainEntryRequestV1) o; + return Objects.equals(this.key, setKeychainEntryRequestV1.key) && + Objects.equals(this.value, setKeychainEntryRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryRequestV1 is not found in the empty JSON string", SetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryRequestV1 + */ + public static SetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of SetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java new file mode 100644 index 00000000000..b0cde0e9aa1 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetKeychainEntryResponseV1() { + } + + public SetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryResponseV1 setKeychainEntryResponseV1 = (SetKeychainEntryResponseV1) o; + return Objects.equals(this.key, setKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryResponseV1 is not found in the empty JSON string", SetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryResponseV1 + */ + public static SetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of SetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..4e5deac0b1e --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,89 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deletes a value under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteKeychainEntryV1Test() throws ApiException { + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = null; + DeleteKeychainEntryResponseV1 response = api.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getKeychainEntryV1Test() throws ApiException { + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = null; + GetKeychainEntryResponseV1 response = api.getKeychainEntryV1(getKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasKeychainEntryV1Test() throws ApiException { + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = null; + HasKeychainEntryResponseV1 response = api.hasKeychainEntryV1(hasKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Sets a value under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void setKeychainEntryV1Test() throws ApiException { + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = null; + SetKeychainEntryResponseV1 response = api.setKeychainEntryV1(setKeychainEntryRequestV1); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..a0ea09b02b0 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryRequestV1 + */ +public class DeleteKeychainEntryRequestV1Test { + private final DeleteKeychainEntryRequestV1 model = new DeleteKeychainEntryRequestV1(); + + /** + * Model tests for DeleteKeychainEntryRequestV1 + */ + @Test + public void testDeleteKeychainEntryRequestV1() { + // TODO: test DeleteKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..d7a52b6063c --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryResponseV1 + */ +public class DeleteKeychainEntryResponseV1Test { + private final DeleteKeychainEntryResponseV1 model = new DeleteKeychainEntryResponseV1(); + + /** + * Model tests for DeleteKeychainEntryResponseV1 + */ + @Test + public void testDeleteKeychainEntryResponseV1() { + // TODO: test DeleteKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..717fa3097a7 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryRequestV1 + */ +public class GetKeychainEntryRequestV1Test { + private final GetKeychainEntryRequestV1 model = new GetKeychainEntryRequestV1(); + + /** + * Model tests for GetKeychainEntryRequestV1 + */ + @Test + public void testGetKeychainEntryRequestV1() { + // TODO: test GetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..b9128dc390b --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryResponseV1 + */ +public class GetKeychainEntryResponseV1Test { + private final GetKeychainEntryResponseV1 model = new GetKeychainEntryResponseV1(); + + /** + * Model tests for GetKeychainEntryResponseV1 + */ + @Test + public void testGetKeychainEntryResponseV1() { + // TODO: test GetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..807c27abc5b --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryRequestV1 + */ +public class HasKeychainEntryRequestV1Test { + private final HasKeychainEntryRequestV1 model = new HasKeychainEntryRequestV1(); + + /** + * Model tests for HasKeychainEntryRequestV1 + */ + @Test + public void testHasKeychainEntryRequestV1() { + // TODO: test HasKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..fb5162f240d --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryResponseV1 + */ +public class HasKeychainEntryResponseV1Test { + private final HasKeychainEntryResponseV1 model = new HasKeychainEntryResponseV1(); + + /** + * Model tests for HasKeychainEntryResponseV1 + */ + @Test + public void testHasKeychainEntryResponseV1() { + // TODO: test HasKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..b0ccc68cd6c --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryRequestV1 + */ +public class SetKeychainEntryRequestV1Test { + private final SetKeychainEntryRequestV1 model = new SetKeychainEntryRequestV1(); + + /** + * Model tests for SetKeychainEntryRequestV1 + */ + @Test + public void testSetKeychainEntryRequestV1() { + // TODO: test SetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..0543bd17835 --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryResponseV1 + */ +public class SetKeychainEntryResponseV1Test { + private final SetKeychainEntryResponseV1 model = new SetKeychainEntryResponseV1(); + + /** + * Model tests for SetKeychainEntryResponseV1 + */ + @Test + public void testSetKeychainEntryResponseV1() { + // TODO: test SetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/package.json b/packages/cactus-plugin-keychain-google-sm/package.json index cb45324ddb9..5a6206b4868 100644 --- a/packages/cactus-plugin-keychain-google-sm/package.json +++ b/packages/cactus-plugin-keychain-google-sm/package.json @@ -48,6 +48,8 @@ "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..cff88d4efaa --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,19 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_delete_keychain_entry_request_v1.go +model_delete_keychain_entry_response_v1.go +model_get_keychain_entry_request_v1.go +model_get_keychain_entry_response_v1.go +model_has_keychain_entry_request_v1.go +model_has_keychain_entry_response_v1.go +model_set_keychain_entry_request_v1.go +model_set_keychain_entry_response_v1.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..97156ab4a20 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,122 @@ +# Go API client for cactus-plugin-keychain-google-sm + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-keychain-google-sm "github.com/hyperledger/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-google-sm.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-google-sm.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-google-sm.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-keychain-google-sm.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeleteKeychainEntryV1**](docs/DefaultApi.md#deletekeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry | Deletes an entry under a key on the keychain backend. +*DefaultApi* | [**GetKeychainEntryV1**](docs/DefaultApi.md#getkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**HasKeychainEntryV1**](docs/DefaultApi.md#haskeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry | Checks that an entry exists under a key on the keychain backend. +*DefaultApi* | [**SetKeychainEntryV1**](docs/DefaultApi.md#setkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation For Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..7a3a1bcc059 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,324 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Keychain API types/paths for Hyperledger Cactus. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus - Keychain API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_delete_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + summary: Deletes an entry under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_has_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Checks that an entry exists under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry + verbLowerCase: post +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + schemas: + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..56cbaa1401b --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,459 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeleteKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deleteKeychainEntryRequestV1 *DeleteKeychainEntryRequestV1 +} + +// Request body to delete a keychain entry via its key +func (r ApiDeleteKeychainEntryV1Request) DeleteKeychainEntryRequestV1(deleteKeychainEntryRequestV1 DeleteKeychainEntryRequestV1) ApiDeleteKeychainEntryV1Request { + r.deleteKeychainEntryRequestV1 = &deleteKeychainEntryRequestV1 + return r +} + +func (r ApiDeleteKeychainEntryV1Request) Execute() (*DeleteKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.DeleteKeychainEntryV1Execute(r) +} + +/* +DeleteKeychainEntryV1 Deletes an entry under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeleteKeychainEntryV1Request +*/ +func (a *DefaultApiService) DeleteKeychainEntryV1(ctx context.Context) ApiDeleteKeychainEntryV1Request { + return ApiDeleteKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeleteKeychainEntryResponseV1 +func (a *DefaultApiService) DeleteKeychainEntryV1Execute(r ApiDeleteKeychainEntryV1Request) (*DeleteKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deleteKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("deleteKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deleteKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getKeychainEntryRequestV1 *GetKeychainEntryRequestV1 +} + +// Request body to obtain a keychain entry via its key +func (r ApiGetKeychainEntryV1Request) GetKeychainEntryRequestV1(getKeychainEntryRequestV1 GetKeychainEntryRequestV1) ApiGetKeychainEntryV1Request { + r.getKeychainEntryRequestV1 = &getKeychainEntryRequestV1 + return r +} + +func (r ApiGetKeychainEntryV1Request) Execute() (*GetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.GetKeychainEntryV1Execute(r) +} + +/* +GetKeychainEntryV1 Retrieves the contents of a keychain entry from the backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetKeychainEntryV1Request +*/ +func (a *DefaultApiService) GetKeychainEntryV1(ctx context.Context) ApiGetKeychainEntryV1Request { + return ApiGetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetKeychainEntryResponseV1 +func (a *DefaultApiService) GetKeychainEntryV1Execute(r ApiGetKeychainEntryV1Request) (*GetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.getKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("getKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiHasKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + hasKeychainEntryRequestV1 *HasKeychainEntryRequestV1 +} + +// Request body for checking a keychain entry via its key +func (r ApiHasKeychainEntryV1Request) HasKeychainEntryRequestV1(hasKeychainEntryRequestV1 HasKeychainEntryRequestV1) ApiHasKeychainEntryV1Request { + r.hasKeychainEntryRequestV1 = &hasKeychainEntryRequestV1 + return r +} + +func (r ApiHasKeychainEntryV1Request) Execute() (*HasKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.HasKeychainEntryV1Execute(r) +} + +/* +HasKeychainEntryV1 Checks that an entry exists under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiHasKeychainEntryV1Request +*/ +func (a *DefaultApiService) HasKeychainEntryV1(ctx context.Context) ApiHasKeychainEntryV1Request { + return ApiHasKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return HasKeychainEntryResponseV1 +func (a *DefaultApiService) HasKeychainEntryV1Execute(r ApiHasKeychainEntryV1Request) (*HasKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HasKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.HasKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.hasKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("hasKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.hasKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + setKeychainEntryRequestV1 *SetKeychainEntryRequestV1 +} + +// Request body to write/update a keychain entry via its key +func (r ApiSetKeychainEntryV1Request) SetKeychainEntryRequestV1(setKeychainEntryRequestV1 SetKeychainEntryRequestV1) ApiSetKeychainEntryV1Request { + r.setKeychainEntryRequestV1 = &setKeychainEntryRequestV1 + return r +} + +func (r ApiSetKeychainEntryV1Request) Execute() (*SetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.SetKeychainEntryV1Execute(r) +} + +/* +SetKeychainEntryV1 Sets a value under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSetKeychainEntryV1Request +*/ +func (a *DefaultApiService) SetKeychainEntryV1(ctx context.Context) ApiSetKeychainEntryV1Request { + return ApiSetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SetKeychainEntryResponseV1 +func (a *DefaultApiService) SetKeychainEntryV1Execute(r ApiSetKeychainEntryV1Request) (*SetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.setKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("setKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..77fb3c3e242 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus - Keychain API API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..d5be72e2e52 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..e0709f18c11 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go new file mode 100644 index 00000000000..ef9761f5c07 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryRequestV1{} + +// DeleteKeychainEntryRequestV1 struct for DeleteKeychainEntryRequestV1 +type DeleteKeychainEntryRequestV1 struct { + // The key for the entry to check the presence of on the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryRequestV1 instantiates a new DeleteKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewDeleteKeychainEntryRequestV1(key string) *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryRequestV1WithDefaults instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryRequestV1WithDefaults() *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryRequestV1 struct { + value *DeleteKeychainEntryRequestV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryRequestV1) Get() *DeleteKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryRequestV1) Set(val *DeleteKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryRequestV1(val *DeleteKeychainEntryRequestV1) *NullableDeleteKeychainEntryRequestV1 { + return &NullableDeleteKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go new file mode 100644 index 00000000000..e59e64f97ab --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryResponseV1{} + +// DeleteKeychainEntryResponseV1 struct for DeleteKeychainEntryResponseV1 +type DeleteKeychainEntryResponseV1 struct { + // The key that was deleted from the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryResponseV1 instantiates a new DeleteKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewDeleteKeychainEntryResponseV1(key string) *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryResponseV1WithDefaults instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryResponseV1WithDefaults() *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryResponseV1 struct { + value *DeleteKeychainEntryResponseV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryResponseV1) Get() *DeleteKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryResponseV1) Set(val *DeleteKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryResponseV1(val *DeleteKeychainEntryResponseV1) *NullableDeleteKeychainEntryResponseV1 { + return &NullableDeleteKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go new file mode 100644 index 00000000000..8b127a17218 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryRequestV1{} + +// GetKeychainEntryRequestV1 struct for GetKeychainEntryRequestV1 +type GetKeychainEntryRequestV1 struct { + // The key for the entry to get from the keychain. + Key string `json:"key"` +} + +// NewGetKeychainEntryRequestV1 instantiates a new GetKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewGetKeychainEntryRequestV1(key string) *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewGetKeychainEntryRequestV1WithDefaults instantiates a new GetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryRequestV1WithDefaults() *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetKeychainEntryRequestV1 struct { + value *GetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableGetKeychainEntryRequestV1) Get() *GetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableGetKeychainEntryRequestV1) Set(val *GetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryRequestV1(val *GetKeychainEntryRequestV1) *NullableGetKeychainEntryRequestV1 { + return &NullableGetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go new file mode 100644 index 00000000000..8080317b978 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryResponseV1{} + +// GetKeychainEntryResponseV1 struct for GetKeychainEntryResponseV1 +type GetKeychainEntryResponseV1 struct { + // The key that was used to retrieve the value from the keychain. + Key string `json:"key"` + // The value associated with the requested key on the keychain. + Value string `json:"value"` +} + +// NewGetKeychainEntryResponseV1 instantiates a new GetKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewGetKeychainEntryResponseV1(key string, value string) *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetKeychainEntryResponseV1WithDefaults instantiates a new GetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryResponseV1WithDefaults() *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetKeychainEntryResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetKeychainEntryResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetKeychainEntryResponseV1 struct { + value *GetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableGetKeychainEntryResponseV1) Get() *GetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableGetKeychainEntryResponseV1) Set(val *GetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryResponseV1(val *GetKeychainEntryResponseV1) *NullableGetKeychainEntryResponseV1 { + return &NullableGetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go new file mode 100644 index 00000000000..f3e80c64c35 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryRequestV1{} + +// HasKeychainEntryRequestV1 struct for HasKeychainEntryRequestV1 +type HasKeychainEntryRequestV1 struct { + // The key to check for presence in the keychain. + Key string `json:"key"` +} + +// NewHasKeychainEntryRequestV1 instantiates a new HasKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewHasKeychainEntryRequestV1(key string) *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewHasKeychainEntryRequestV1WithDefaults instantiates a new HasKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryRequestV1WithDefaults() *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasKeychainEntryRequestV1 struct { + value *HasKeychainEntryRequestV1 + isSet bool +} + +func (v NullableHasKeychainEntryRequestV1) Get() *HasKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableHasKeychainEntryRequestV1) Set(val *HasKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryRequestV1(val *HasKeychainEntryRequestV1) *NullableHasKeychainEntryRequestV1 { + return &NullableHasKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go new file mode 100644 index 00000000000..670e2041c38 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryResponseV1{} + +// HasKeychainEntryResponseV1 struct for HasKeychainEntryResponseV1 +type HasKeychainEntryResponseV1 struct { + // The key that was used to check the presence of the value in the entry store. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an entry under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasKeychainEntryResponseV1 instantiates a new HasKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewHasKeychainEntryResponseV1(key string, checkedAt string, isPresent bool) *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasKeychainEntryResponseV1WithDefaults instantiates a new HasKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryResponseV1WithDefaults() *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasKeychainEntryResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasKeychainEntryResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasKeychainEntryResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasKeychainEntryResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasKeychainEntryResponseV1 struct { + value *HasKeychainEntryResponseV1 + isSet bool +} + +func (v NullableHasKeychainEntryResponseV1) Get() *HasKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableHasKeychainEntryResponseV1) Set(val *HasKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryResponseV1(val *HasKeychainEntryResponseV1) *NullableHasKeychainEntryResponseV1 { + return &NullableHasKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go new file mode 100644 index 00000000000..45f6253542b --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryRequestV1{} + +// SetKeychainEntryRequestV1 struct for SetKeychainEntryRequestV1 +type SetKeychainEntryRequestV1 struct { + // The key for the entry to set on the keychain. + Key string `json:"key"` + // The value that will be associated with the key on the keychain. + Value string `json:"value"` +} + +// NewSetKeychainEntryRequestV1 instantiates a new SetKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewSetKeychainEntryRequestV1(key string, value string) *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetKeychainEntryRequestV1WithDefaults instantiates a new SetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryRequestV1WithDefaults() *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetKeychainEntryRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetKeychainEntryRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetKeychainEntryRequestV1 struct { + value *SetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableSetKeychainEntryRequestV1) Get() *SetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableSetKeychainEntryRequestV1) Set(val *SetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryRequestV1(val *SetKeychainEntryRequestV1) *NullableSetKeychainEntryRequestV1 { + return &NullableSetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go new file mode 100644 index 00000000000..2b974963484 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryResponseV1{} + +// SetKeychainEntryResponseV1 struct for SetKeychainEntryResponseV1 +type SetKeychainEntryResponseV1 struct { + // The key that was used to set the value on the keychain. + Key string `json:"key"` +} + +// NewSetKeychainEntryResponseV1 instantiates a new SetKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewSetKeychainEntryResponseV1(key string) *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewSetKeychainEntryResponseV1WithDefaults instantiates a new SetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryResponseV1WithDefaults() *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetKeychainEntryResponseV1 struct { + value *SetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableSetKeychainEntryResponseV1) Get() *SetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableSetKeychainEntryResponseV1) Set(val *SetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryResponseV1(val *SetKeychainEntryResponseV1) *NullableSetKeychainEntryResponseV1 { + return &NullableSetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..3a2add7097f --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..5d94c59dec0 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,73 @@ +/* +Hyperledger Cactus - Keychain API + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-keychain-google-sm + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-keychain-google-sm_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService DeleteKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeleteKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService HasKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.HasKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService SetKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.SetKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..df15f376c00 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-google-sm + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..a155899a355 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus - Keychain API + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..715e109d921 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,48 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..e221a1954f7 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,147 @@ +# openapi-java-client + +Hyperledger Cactus - Keychain API +- API version: v2.0.0-alpha.2 + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = new DeleteKeychainEntryRequestV1(); // DeleteKeychainEntryRequestV1 | Request body to delete a keychain entry via its key + try { + DeleteKeychainEntryResponseV1 result = apiInstance.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deleteKeychainEntryV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deleteKeychainEntryV1**](docs/DefaultApi.md#deleteKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry | Deletes an entry under a key on the keychain backend. +*DefaultApi* | [**getKeychainEntryV1**](docs/DefaultApi.md#getKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**hasKeychainEntryV1**](docs/DefaultApi.md#hasKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry | Checks that an entry exists under a key on the keychain backend. +*DefaultApi* | [**setKeychainEntryV1**](docs/DefaultApi.md#setKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation for Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..086ea12ca08 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,333 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Keychain API types/paths for Hyperledger Cactus. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus - Keychain API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_delete_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + summary: Deletes an entry under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_has_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Checks that an entry exists under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + schemas: + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..ae229a53715 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..3dffbd1bcb1 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..927f4e3634c --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..c4cc8894bc7 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..680d06d26b4 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..a47c9598eb7 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..41e529ec030 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,408 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.DeleteKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryResponseV1.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); + } + } + } + + /** + * 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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..beeba650d5a --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..a7b77588008 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..36a03a4ac8f --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..7c133060d80 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..d9d1f26f55f --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,615 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 deleteKeychainEntryV1 + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deleteKeychainEntryV1Call(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deleteKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/delete-keychain-entry"; + + 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 deleteKeychainEntryV1ValidateBeforeCall(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'deleteKeychainEntryRequestV1' is set + if (deleteKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'deleteKeychainEntryRequestV1' when calling deleteKeychainEntryV1(Async)"); + } + + return deleteKeychainEntryV1Call(deleteKeychainEntryRequestV1, _callback); + + } + + /** + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return DeleteKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DeleteKeychainEntryResponseV1 deleteKeychainEntryV1(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return ApiResponse<DeleteKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse deleteKeychainEntryV1WithHttpInfo(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deletes an entry under a key on the keychain backend. (asynchronously) + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deleteKeychainEntryV1Async(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getKeychainEntryV1 + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Call(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/get-keychain-entry"; + + 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 getKeychainEntryV1ValidateBeforeCall(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'getKeychainEntryRequestV1' is set + if (getKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'getKeychainEntryRequestV1' when calling getKeychainEntryV1(Async)"); + } + + return getKeychainEntryV1Call(getKeychainEntryRequestV1, _callback); + + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return GetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public GetKeychainEntryResponseV1 getKeychainEntryV1(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return ApiResponse<GetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public ApiResponse getKeychainEntryV1WithHttpInfo(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the contents of a keychain entry from the backend. (asynchronously) + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Async(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasKeychainEntryV1 + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Call(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = hasKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/has-keychain-entry"; + + 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 hasKeychainEntryV1ValidateBeforeCall(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'hasKeychainEntryRequestV1' is set + if (hasKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'hasKeychainEntryRequestV1' when calling hasKeychainEntryV1(Async)"); + } + + return hasKeychainEntryV1Call(hasKeychainEntryRequestV1, _callback); + + } + + /** + * Checks that an entry exists under a key on the keychain backend. + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return HasKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public HasKeychainEntryResponseV1 hasKeychainEntryV1(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Checks that an entry exists under a key on the keychain backend. + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return ApiResponse<HasKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse hasKeychainEntryV1WithHttpInfo(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Checks that an entry exists under a key on the keychain backend. (asynchronously) + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Async(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setKeychainEntryV1 + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Call(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = setKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-google-sm/set-keychain-entry"; + + 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 setKeychainEntryV1ValidateBeforeCall(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'setKeychainEntryRequestV1' is set + if (setKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'setKeychainEntryRequestV1' when calling setKeychainEntryV1(Async)"); + } + + return setKeychainEntryV1Call(setKeychainEntryRequestV1, _callback); + + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return SetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public SetKeychainEntryResponseV1 setKeychainEntryV1(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return ApiResponse<SetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse setKeychainEntryV1WithHttpInfo(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Sets a value under a key on the keychain backend. (asynchronously) + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Async(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..9d478953d92 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..2896c25c21c --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..660312a6f53 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..07bda43db19 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..506c3d798e8 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java new file mode 100644 index 00000000000..d98aa2c197c --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryRequestV1() { + } + + public DeleteKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to check the presence of on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = (DeleteKeychainEntryRequestV1) o; + return Objects.equals(this.key, deleteKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryRequestV1 is not found in the empty JSON string", DeleteKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static DeleteKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java new file mode 100644 index 00000000000..7ab3d703384 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryResponseV1() { + } + + public DeleteKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was deleted from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryResponseV1 deleteKeychainEntryResponseV1 = (DeleteKeychainEntryResponseV1) o; + return Objects.equals(this.key, deleteKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryResponseV1 is not found in the empty JSON string", DeleteKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static DeleteKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java new file mode 100644 index 00000000000..697c441d6f8 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetKeychainEntryRequestV1() { + } + + public GetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = (GetKeychainEntryRequestV1) o; + return Objects.equals(this.key, getKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryRequestV1 is not found in the empty JSON string", GetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryRequestV1 + */ + public static GetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of GetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java new file mode 100644 index 00000000000..42041c99071 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetKeychainEntryResponseV1() { + } + + public GetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetKeychainEntryResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryResponseV1 getKeychainEntryResponseV1 = (GetKeychainEntryResponseV1) o; + return Objects.equals(this.key, getKeychainEntryResponseV1.key) && + Objects.equals(this.value, getKeychainEntryResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryResponseV1 is not found in the empty JSON string", GetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryResponseV1 + */ + public static GetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of GetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java new file mode 100644 index 00000000000..25e02ce2899 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasKeychainEntryRequestV1() { + } + + public HasKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = (HasKeychainEntryRequestV1) o; + return Objects.equals(this.key, hasKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryRequestV1 is not found in the empty JSON string", HasKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryRequestV1 + */ + public static HasKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of HasKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java new file mode 100644 index 00000000000..336e1b7c96d --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasKeychainEntryResponseV1() { + } + + public HasKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the entry store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasKeychainEntryResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasKeychainEntryResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an entry under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryResponseV1 hasKeychainEntryResponseV1 = (HasKeychainEntryResponseV1) o; + return Objects.equals(this.key, hasKeychainEntryResponseV1.key) && + Objects.equals(this.checkedAt, hasKeychainEntryResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasKeychainEntryResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryResponseV1 is not found in the empty JSON string", HasKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryResponseV1 + */ + public static HasKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of HasKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java new file mode 100644 index 00000000000..2c57c8999ce --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetKeychainEntryRequestV1() { + } + + public SetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetKeychainEntryRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = (SetKeychainEntryRequestV1) o; + return Objects.equals(this.key, setKeychainEntryRequestV1.key) && + Objects.equals(this.value, setKeychainEntryRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryRequestV1 is not found in the empty JSON string", SetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryRequestV1 + */ + public static SetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of SetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java new file mode 100644 index 00000000000..b0cde0e9aa1 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetKeychainEntryResponseV1() { + } + + public SetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryResponseV1 setKeychainEntryResponseV1 = (SetKeychainEntryResponseV1) o; + return Objects.equals(this.key, setKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryResponseV1 is not found in the empty JSON string", SetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryResponseV1 + */ + public static SetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of SetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..d29a4f2ce67 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,89 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deletes an entry under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteKeychainEntryV1Test() throws ApiException { + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = null; + DeleteKeychainEntryResponseV1 response = api.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getKeychainEntryV1Test() throws ApiException { + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = null; + GetKeychainEntryResponseV1 response = api.getKeychainEntryV1(getKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Checks that an entry exists under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasKeychainEntryV1Test() throws ApiException { + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = null; + HasKeychainEntryResponseV1 response = api.hasKeychainEntryV1(hasKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Sets a value under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void setKeychainEntryV1Test() throws ApiException { + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = null; + SetKeychainEntryResponseV1 response = api.setKeychainEntryV1(setKeychainEntryRequestV1); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..a0ea09b02b0 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryRequestV1 + */ +public class DeleteKeychainEntryRequestV1Test { + private final DeleteKeychainEntryRequestV1 model = new DeleteKeychainEntryRequestV1(); + + /** + * Model tests for DeleteKeychainEntryRequestV1 + */ + @Test + public void testDeleteKeychainEntryRequestV1() { + // TODO: test DeleteKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..d7a52b6063c --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryResponseV1 + */ +public class DeleteKeychainEntryResponseV1Test { + private final DeleteKeychainEntryResponseV1 model = new DeleteKeychainEntryResponseV1(); + + /** + * Model tests for DeleteKeychainEntryResponseV1 + */ + @Test + public void testDeleteKeychainEntryResponseV1() { + // TODO: test DeleteKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..717fa3097a7 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryRequestV1 + */ +public class GetKeychainEntryRequestV1Test { + private final GetKeychainEntryRequestV1 model = new GetKeychainEntryRequestV1(); + + /** + * Model tests for GetKeychainEntryRequestV1 + */ + @Test + public void testGetKeychainEntryRequestV1() { + // TODO: test GetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..b9128dc390b --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryResponseV1 + */ +public class GetKeychainEntryResponseV1Test { + private final GetKeychainEntryResponseV1 model = new GetKeychainEntryResponseV1(); + + /** + * Model tests for GetKeychainEntryResponseV1 + */ + @Test + public void testGetKeychainEntryResponseV1() { + // TODO: test GetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..807c27abc5b --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryRequestV1 + */ +public class HasKeychainEntryRequestV1Test { + private final HasKeychainEntryRequestV1 model = new HasKeychainEntryRequestV1(); + + /** + * Model tests for HasKeychainEntryRequestV1 + */ + @Test + public void testHasKeychainEntryRequestV1() { + // TODO: test HasKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..fb5162f240d --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryResponseV1 + */ +public class HasKeychainEntryResponseV1Test { + private final HasKeychainEntryResponseV1 model = new HasKeychainEntryResponseV1(); + + /** + * Model tests for HasKeychainEntryResponseV1 + */ + @Test + public void testHasKeychainEntryResponseV1() { + // TODO: test HasKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..b0ccc68cd6c --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryRequestV1 + */ +public class SetKeychainEntryRequestV1Test { + private final SetKeychainEntryRequestV1 model = new SetKeychainEntryRequestV1(); + + /** + * Model tests for SetKeychainEntryRequestV1 + */ + @Test + public void testSetKeychainEntryRequestV1() { + // TODO: test SetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..0543bd17835 --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryResponseV1 + */ +public class SetKeychainEntryResponseV1Test { + private final SetKeychainEntryResponseV1 model = new SetKeychainEntryResponseV1(); + + /** + * Model tests for SetKeychainEntryResponseV1 + */ + @Test + public void testSetKeychainEntryResponseV1() { + // TODO: test SetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/package.json b/packages/cactus-plugin-keychain-memory-wasm/package.json index b60e973c682..d65d490c3b0 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/package.json +++ b/packages/cactus-plugin-keychain-memory-wasm/package.json @@ -51,6 +51,8 @@ "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "wasm-pack": "CARGO_TARGET_DIR=${PWD}/dist/target-rustc/ wasm-pack build src/main/rust/cactus-plugin-keychain-memory-wasm/ --release --scope=hyperledger --target=nodejs --out-dir=../../../../src/main/typescript/generated/wasm-pack/", "postwasm-pack": "run-s del-wasm-pack-project-files copy-wasm-bg", "watch": "npm-watch", diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..cff88d4efaa --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,19 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_delete_keychain_entry_request_v1.go +model_delete_keychain_entry_response_v1.go +model_get_keychain_entry_request_v1.go +model_get_keychain_entry_response_v1.go +model_has_keychain_entry_request_v1.go +model_has_keychain_entry_response_v1.go +model_set_keychain_entry_request_v1.go +model_set_keychain_entry_response_v1.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..2f2ccb3fd5d --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,122 @@ +# Go API client for cactus-plugin-keychain-memory-wasm + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-keychain-memory-wasm "github.com/hyperledger/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-memory-wasm.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-memory-wasm.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-memory-wasm.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-keychain-memory-wasm.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeleteKeychainEntryV1**](docs/DefaultApi.md#deletekeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/delete-keychain-entry | Deletes an entry under a key on the keychain backend. +*DefaultApi* | [**GetKeychainEntryV1**](docs/DefaultApi.md#getkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**HasKeychainEntryV1**](docs/DefaultApi.md#haskeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/has-keychain-entry | Checks that an entry exists under a key on the keychain backend +*DefaultApi* | [**SetKeychainEntryV1**](docs/DefaultApi.md#setkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation For Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..60a33b3bda9 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,340 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin + which is designed to help with testing and development and is implemented in Rust + instead of Typescript. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Keychain Memory WASM + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/set-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_delete_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Deletes an entry under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/delete-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_has_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Checks that an entry exists under a key on the keychain backend + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/has-keychain-entry + verbLowerCase: post +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_delete_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_delete_entry_401: + description: Authorization information is missing or invalid. + keychain_delete_entry_500: + description: Unexpected error. + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + schemas: + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..a283b63b992 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,459 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeleteKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deleteKeychainEntryRequestV1 *DeleteKeychainEntryRequestV1 +} + +// Request body to delete a keychain entry via its key +func (r ApiDeleteKeychainEntryV1Request) DeleteKeychainEntryRequestV1(deleteKeychainEntryRequestV1 DeleteKeychainEntryRequestV1) ApiDeleteKeychainEntryV1Request { + r.deleteKeychainEntryRequestV1 = &deleteKeychainEntryRequestV1 + return r +} + +func (r ApiDeleteKeychainEntryV1Request) Execute() (*DeleteKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.DeleteKeychainEntryV1Execute(r) +} + +/* +DeleteKeychainEntryV1 Deletes an entry under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeleteKeychainEntryV1Request +*/ +func (a *DefaultApiService) DeleteKeychainEntryV1(ctx context.Context) ApiDeleteKeychainEntryV1Request { + return ApiDeleteKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeleteKeychainEntryResponseV1 +func (a *DefaultApiService) DeleteKeychainEntryV1Execute(r ApiDeleteKeychainEntryV1Request) (*DeleteKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/delete-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deleteKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("deleteKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deleteKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getKeychainEntryRequestV1 *GetKeychainEntryRequestV1 +} + +// Request body to obtain a keychain entry via its key +func (r ApiGetKeychainEntryV1Request) GetKeychainEntryRequestV1(getKeychainEntryRequestV1 GetKeychainEntryRequestV1) ApiGetKeychainEntryV1Request { + r.getKeychainEntryRequestV1 = &getKeychainEntryRequestV1 + return r +} + +func (r ApiGetKeychainEntryV1Request) Execute() (*GetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.GetKeychainEntryV1Execute(r) +} + +/* +GetKeychainEntryV1 Retrieves the contents of a keychain entry from the backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetKeychainEntryV1Request +*/ +func (a *DefaultApiService) GetKeychainEntryV1(ctx context.Context) ApiGetKeychainEntryV1Request { + return ApiGetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetKeychainEntryResponseV1 +func (a *DefaultApiService) GetKeychainEntryV1Execute(r ApiGetKeychainEntryV1Request) (*GetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.getKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("getKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiHasKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + hasKeychainEntryRequestV1 *HasKeychainEntryRequestV1 +} + +// Request body for checking a keychain entry via its key +func (r ApiHasKeychainEntryV1Request) HasKeychainEntryRequestV1(hasKeychainEntryRequestV1 HasKeychainEntryRequestV1) ApiHasKeychainEntryV1Request { + r.hasKeychainEntryRequestV1 = &hasKeychainEntryRequestV1 + return r +} + +func (r ApiHasKeychainEntryV1Request) Execute() (*HasKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.HasKeychainEntryV1Execute(r) +} + +/* +HasKeychainEntryV1 Checks that an entry exists under a key on the keychain backend + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiHasKeychainEntryV1Request +*/ +func (a *DefaultApiService) HasKeychainEntryV1(ctx context.Context) ApiHasKeychainEntryV1Request { + return ApiHasKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return HasKeychainEntryResponseV1 +func (a *DefaultApiService) HasKeychainEntryV1Execute(r ApiHasKeychainEntryV1Request) (*HasKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HasKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.HasKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/has-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.hasKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("hasKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.hasKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + setKeychainEntryRequestV1 *SetKeychainEntryRequestV1 +} + +// Request body to write/update a keychain entry via its key +func (r ApiSetKeychainEntryV1Request) SetKeychainEntryRequestV1(setKeychainEntryRequestV1 SetKeychainEntryRequestV1) ApiSetKeychainEntryV1Request { + r.setKeychainEntryRequestV1 = &setKeychainEntryRequestV1 + return r +} + +func (r ApiSetKeychainEntryV1Request) Execute() (*SetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.SetKeychainEntryV1Execute(r) +} + +/* +SetKeychainEntryV1 Sets a value under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSetKeychainEntryV1Request +*/ +func (a *DefaultApiService) SetKeychainEntryV1(ctx context.Context) ApiSetKeychainEntryV1Request { + return ApiSetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SetKeychainEntryResponseV1 +func (a *DefaultApiService) SetKeychainEntryV1Execute(r ApiSetKeychainEntryV1Request) (*SetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/set-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.setKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("setKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..8869f654a0f --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Keychain Memory WASM API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..add58054a8b --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..2d7bbd85dca --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go new file mode 100644 index 00000000000..31ab7c7c1a8 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryRequestV1{} + +// DeleteKeychainEntryRequestV1 struct for DeleteKeychainEntryRequestV1 +type DeleteKeychainEntryRequestV1 struct { + // The key for the entry to check the presence of on the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryRequestV1 instantiates a new DeleteKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewDeleteKeychainEntryRequestV1(key string) *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryRequestV1WithDefaults instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryRequestV1WithDefaults() *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryRequestV1 struct { + value *DeleteKeychainEntryRequestV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryRequestV1) Get() *DeleteKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryRequestV1) Set(val *DeleteKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryRequestV1(val *DeleteKeychainEntryRequestV1) *NullableDeleteKeychainEntryRequestV1 { + return &NullableDeleteKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go new file mode 100644 index 00000000000..6c5916d0b98 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryResponseV1{} + +// DeleteKeychainEntryResponseV1 struct for DeleteKeychainEntryResponseV1 +type DeleteKeychainEntryResponseV1 struct { + // The key that was deleted from the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryResponseV1 instantiates a new DeleteKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewDeleteKeychainEntryResponseV1(key string) *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryResponseV1WithDefaults instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryResponseV1WithDefaults() *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryResponseV1 struct { + value *DeleteKeychainEntryResponseV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryResponseV1) Get() *DeleteKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryResponseV1) Set(val *DeleteKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryResponseV1(val *DeleteKeychainEntryResponseV1) *NullableDeleteKeychainEntryResponseV1 { + return &NullableDeleteKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go new file mode 100644 index 00000000000..408b729c24f --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryRequestV1{} + +// GetKeychainEntryRequestV1 struct for GetKeychainEntryRequestV1 +type GetKeychainEntryRequestV1 struct { + // The key for the entry to get from the keychain. + Key string `json:"key"` +} + +// NewGetKeychainEntryRequestV1 instantiates a new GetKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewGetKeychainEntryRequestV1(key string) *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewGetKeychainEntryRequestV1WithDefaults instantiates a new GetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryRequestV1WithDefaults() *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetKeychainEntryRequestV1 struct { + value *GetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableGetKeychainEntryRequestV1) Get() *GetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableGetKeychainEntryRequestV1) Set(val *GetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryRequestV1(val *GetKeychainEntryRequestV1) *NullableGetKeychainEntryRequestV1 { + return &NullableGetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go new file mode 100644 index 00000000000..462deda8987 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryResponseV1{} + +// GetKeychainEntryResponseV1 struct for GetKeychainEntryResponseV1 +type GetKeychainEntryResponseV1 struct { + // The key that was used to retrieve the value from the keychain. + Key string `json:"key"` + // The value associated with the requested key on the keychain. + Value string `json:"value"` +} + +// NewGetKeychainEntryResponseV1 instantiates a new GetKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewGetKeychainEntryResponseV1(key string, value string) *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetKeychainEntryResponseV1WithDefaults instantiates a new GetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryResponseV1WithDefaults() *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetKeychainEntryResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetKeychainEntryResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetKeychainEntryResponseV1 struct { + value *GetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableGetKeychainEntryResponseV1) Get() *GetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableGetKeychainEntryResponseV1) Set(val *GetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryResponseV1(val *GetKeychainEntryResponseV1) *NullableGetKeychainEntryResponseV1 { + return &NullableGetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go new file mode 100644 index 00000000000..3901bc8c89b --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryRequestV1{} + +// HasKeychainEntryRequestV1 struct for HasKeychainEntryRequestV1 +type HasKeychainEntryRequestV1 struct { + // The key to check for presence in the keychain. + Key string `json:"key"` +} + +// NewHasKeychainEntryRequestV1 instantiates a new HasKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewHasKeychainEntryRequestV1(key string) *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewHasKeychainEntryRequestV1WithDefaults instantiates a new HasKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryRequestV1WithDefaults() *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasKeychainEntryRequestV1 struct { + value *HasKeychainEntryRequestV1 + isSet bool +} + +func (v NullableHasKeychainEntryRequestV1) Get() *HasKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableHasKeychainEntryRequestV1) Set(val *HasKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryRequestV1(val *HasKeychainEntryRequestV1) *NullableHasKeychainEntryRequestV1 { + return &NullableHasKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go new file mode 100644 index 00000000000..afccdadcb73 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryResponseV1{} + +// HasKeychainEntryResponseV1 struct for HasKeychainEntryResponseV1 +type HasKeychainEntryResponseV1 struct { + // The key that was used to check the presence of the value in the entry store. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an entry under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasKeychainEntryResponseV1 instantiates a new HasKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewHasKeychainEntryResponseV1(key string, checkedAt string, isPresent bool) *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasKeychainEntryResponseV1WithDefaults instantiates a new HasKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryResponseV1WithDefaults() *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasKeychainEntryResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasKeychainEntryResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasKeychainEntryResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasKeychainEntryResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasKeychainEntryResponseV1 struct { + value *HasKeychainEntryResponseV1 + isSet bool +} + +func (v NullableHasKeychainEntryResponseV1) Get() *HasKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableHasKeychainEntryResponseV1) Set(val *HasKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryResponseV1(val *HasKeychainEntryResponseV1) *NullableHasKeychainEntryResponseV1 { + return &NullableHasKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go new file mode 100644 index 00000000000..f50a829332d --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryRequestV1{} + +// SetKeychainEntryRequestV1 struct for SetKeychainEntryRequestV1 +type SetKeychainEntryRequestV1 struct { + // The key for the entry to set on the keychain. + Key string `json:"key"` + // The value that will be associated with the key on the keychain. + Value string `json:"value"` +} + +// NewSetKeychainEntryRequestV1 instantiates a new SetKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewSetKeychainEntryRequestV1(key string, value string) *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetKeychainEntryRequestV1WithDefaults instantiates a new SetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryRequestV1WithDefaults() *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetKeychainEntryRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetKeychainEntryRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetKeychainEntryRequestV1 struct { + value *SetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableSetKeychainEntryRequestV1) Get() *SetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableSetKeychainEntryRequestV1) Set(val *SetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryRequestV1(val *SetKeychainEntryRequestV1) *NullableSetKeychainEntryRequestV1 { + return &NullableSetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go new file mode 100644 index 00000000000..1070d8c9bfc --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryResponseV1{} + +// SetKeychainEntryResponseV1 struct for SetKeychainEntryResponseV1 +type SetKeychainEntryResponseV1 struct { + // The key that was used to set the value on the keychain. + Key string `json:"key"` +} + +// NewSetKeychainEntryResponseV1 instantiates a new SetKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewSetKeychainEntryResponseV1(key string) *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewSetKeychainEntryResponseV1WithDefaults instantiates a new SetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryResponseV1WithDefaults() *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetKeychainEntryResponseV1 struct { + value *SetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableSetKeychainEntryResponseV1) Get() *SetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableSetKeychainEntryResponseV1) Set(val *SetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryResponseV1(val *SetKeychainEntryResponseV1) *NullableSetKeychainEntryResponseV1 { + return &NullableSetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..751a2daffce --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..6cc6dd021e2 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,73 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-keychain-memory-wasm + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-keychain-memory-wasm_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService DeleteKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeleteKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService HasKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.HasKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService SetKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.SetKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..28bcc5999ec --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory WASM + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory-wasm + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..3a20cb8a359 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - Keychain Memory WASM + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..715e109d921 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,48 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..8f2bc935d39 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,147 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Keychain Memory WASM +- API version: v2.0.0-alpha.2 + +Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = new DeleteKeychainEntryRequestV1(); // DeleteKeychainEntryRequestV1 | Request body to delete a keychain entry via its key + try { + DeleteKeychainEntryResponseV1 result = apiInstance.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deleteKeychainEntryV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deleteKeychainEntryV1**](docs/DefaultApi.md#deleteKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/delete-keychain-entry | Deletes an entry under a key on the keychain backend. +*DefaultApi* | [**getKeychainEntryV1**](docs/DefaultApi.md#getKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**hasKeychainEntryV1**](docs/DefaultApi.md#hasKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/has-keychain-entry | Checks that an entry exists under a key on the keychain backend +*DefaultApi* | [**setKeychainEntryV1**](docs/DefaultApi.md#setKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation for Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..e0a52e985ea --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,349 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin + which is designed to help with testing and development and is implemented in Rust + instead of Typescript. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Keychain Memory WASM + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/set-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_delete_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Deletes an entry under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/delete-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_has_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Checks that an entry exists under a key on the keychain backend + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/has-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_delete_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_delete_entry_401: + description: Authorization information is missing or invalid. + keychain_delete_entry_500: + description: Unexpected error. + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + schemas: + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..f8653f60fc4 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..d778f1ffe2d --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..5b078cd98fc --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..a2e75283aa0 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..853bd510eca --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..c0d94dcddc3 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..42ea1a7d5e1 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,408 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.DeleteKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryResponseV1.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); + } + } + } + + /** + * 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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..f842db5f5ae --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..15ae926aa21 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..ee97573b838 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..67258f9f07f --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..6fe19d82cbd --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,627 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 deleteKeychainEntryV1 + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call deleteKeychainEntryV1Call(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deleteKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/delete-keychain-entry"; + + 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 deleteKeychainEntryV1ValidateBeforeCall(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'deleteKeychainEntryRequestV1' is set + if (deleteKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'deleteKeychainEntryRequestV1' when calling deleteKeychainEntryV1(Async)"); + } + + return deleteKeychainEntryV1Call(deleteKeychainEntryRequestV1, _callback); + + } + + /** + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return DeleteKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public DeleteKeychainEntryResponseV1 deleteKeychainEntryV1(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return ApiResponse<DeleteKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse deleteKeychainEntryV1WithHttpInfo(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deletes an entry under a key on the keychain backend. (asynchronously) + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call deleteKeychainEntryV1Async(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getKeychainEntryV1 + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Call(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/get-keychain-entry"; + + 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 getKeychainEntryV1ValidateBeforeCall(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'getKeychainEntryRequestV1' is set + if (getKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'getKeychainEntryRequestV1' when calling getKeychainEntryV1(Async)"); + } + + return getKeychainEntryV1Call(getKeychainEntryRequestV1, _callback); + + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return GetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public GetKeychainEntryResponseV1 getKeychainEntryV1(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return ApiResponse<GetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public ApiResponse getKeychainEntryV1WithHttpInfo(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the contents of a keychain entry from the backend. (asynchronously) + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Async(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasKeychainEntryV1 + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Call(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = hasKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/has-keychain-entry"; + + 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 hasKeychainEntryV1ValidateBeforeCall(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'hasKeychainEntryRequestV1' is set + if (hasKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'hasKeychainEntryRequestV1' when calling hasKeychainEntryV1(Async)"); + } + + return hasKeychainEntryV1Call(hasKeychainEntryRequestV1, _callback); + + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return HasKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public HasKeychainEntryResponseV1 hasKeychainEntryV1(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return ApiResponse<HasKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse hasKeychainEntryV1WithHttpInfo(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Checks that an entry exists under a key on the keychain backend (asynchronously) + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Async(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setKeychainEntryV1 + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Call(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = setKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory-wasm/set-keychain-entry"; + + 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 setKeychainEntryV1ValidateBeforeCall(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'setKeychainEntryRequestV1' is set + if (setKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'setKeychainEntryRequestV1' when calling setKeychainEntryV1(Async)"); + } + + return setKeychainEntryV1Call(setKeychainEntryRequestV1, _callback); + + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return SetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public SetKeychainEntryResponseV1 setKeychainEntryV1(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return ApiResponse<SetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse setKeychainEntryV1WithHttpInfo(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Sets a value under a key on the keychain backend. (asynchronously) + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Async(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..b357a101777 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..ca934681bc5 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..a195e48a0df --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..db7ea904f52 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..4650c609e5c --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java new file mode 100644 index 00000000000..75d6e738918 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryRequestV1() { + } + + public DeleteKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to check the presence of on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = (DeleteKeychainEntryRequestV1) o; + return Objects.equals(this.key, deleteKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryRequestV1 is not found in the empty JSON string", DeleteKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static DeleteKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java new file mode 100644 index 00000000000..a44d2aa0575 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryResponseV1() { + } + + public DeleteKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was deleted from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryResponseV1 deleteKeychainEntryResponseV1 = (DeleteKeychainEntryResponseV1) o; + return Objects.equals(this.key, deleteKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryResponseV1 is not found in the empty JSON string", DeleteKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static DeleteKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java new file mode 100644 index 00000000000..1355cf4e0d7 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetKeychainEntryRequestV1() { + } + + public GetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = (GetKeychainEntryRequestV1) o; + return Objects.equals(this.key, getKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryRequestV1 is not found in the empty JSON string", GetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryRequestV1 + */ + public static GetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of GetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java new file mode 100644 index 00000000000..f7e4e814e42 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetKeychainEntryResponseV1() { + } + + public GetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetKeychainEntryResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryResponseV1 getKeychainEntryResponseV1 = (GetKeychainEntryResponseV1) o; + return Objects.equals(this.key, getKeychainEntryResponseV1.key) && + Objects.equals(this.value, getKeychainEntryResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryResponseV1 is not found in the empty JSON string", GetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryResponseV1 + */ + public static GetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of GetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java new file mode 100644 index 00000000000..0d1ed023645 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasKeychainEntryRequestV1() { + } + + public HasKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = (HasKeychainEntryRequestV1) o; + return Objects.equals(this.key, hasKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryRequestV1 is not found in the empty JSON string", HasKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryRequestV1 + */ + public static HasKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of HasKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java new file mode 100644 index 00000000000..646298da1b9 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasKeychainEntryResponseV1() { + } + + public HasKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the entry store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasKeychainEntryResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasKeychainEntryResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an entry under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryResponseV1 hasKeychainEntryResponseV1 = (HasKeychainEntryResponseV1) o; + return Objects.equals(this.key, hasKeychainEntryResponseV1.key) && + Objects.equals(this.checkedAt, hasKeychainEntryResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasKeychainEntryResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryResponseV1 is not found in the empty JSON string", HasKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryResponseV1 + */ + public static HasKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of HasKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java new file mode 100644 index 00000000000..88ff79491a8 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetKeychainEntryRequestV1() { + } + + public SetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetKeychainEntryRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = (SetKeychainEntryRequestV1) o; + return Objects.equals(this.key, setKeychainEntryRequestV1.key) && + Objects.equals(this.value, setKeychainEntryRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryRequestV1 is not found in the empty JSON string", SetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryRequestV1 + */ + public static SetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of SetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java new file mode 100644 index 00000000000..e7fcfc20b6f --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetKeychainEntryResponseV1() { + } + + public SetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryResponseV1 setKeychainEntryResponseV1 = (SetKeychainEntryResponseV1) o; + return Objects.equals(this.key, setKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryResponseV1 is not found in the empty JSON string", SetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryResponseV1 + */ + public static SetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of SetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..4c9331fe6b4 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,89 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deletes an entry under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteKeychainEntryV1Test() throws ApiException { + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = null; + DeleteKeychainEntryResponseV1 response = api.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getKeychainEntryV1Test() throws ApiException { + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = null; + GetKeychainEntryResponseV1 response = api.getKeychainEntryV1(getKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasKeychainEntryV1Test() throws ApiException { + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = null; + HasKeychainEntryResponseV1 response = api.hasKeychainEntryV1(hasKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Sets a value under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void setKeychainEntryV1Test() throws ApiException { + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = null; + SetKeychainEntryResponseV1 response = api.setKeychainEntryV1(setKeychainEntryRequestV1); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..d68de4b3262 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryRequestV1 + */ +public class DeleteKeychainEntryRequestV1Test { + private final DeleteKeychainEntryRequestV1 model = new DeleteKeychainEntryRequestV1(); + + /** + * Model tests for DeleteKeychainEntryRequestV1 + */ + @Test + public void testDeleteKeychainEntryRequestV1() { + // TODO: test DeleteKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..56cc4b57b47 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryResponseV1 + */ +public class DeleteKeychainEntryResponseV1Test { + private final DeleteKeychainEntryResponseV1 model = new DeleteKeychainEntryResponseV1(); + + /** + * Model tests for DeleteKeychainEntryResponseV1 + */ + @Test + public void testDeleteKeychainEntryResponseV1() { + // TODO: test DeleteKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..cfd59828539 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryRequestV1 + */ +public class GetKeychainEntryRequestV1Test { + private final GetKeychainEntryRequestV1 model = new GetKeychainEntryRequestV1(); + + /** + * Model tests for GetKeychainEntryRequestV1 + */ + @Test + public void testGetKeychainEntryRequestV1() { + // TODO: test GetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..1c58021a5d5 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryResponseV1 + */ +public class GetKeychainEntryResponseV1Test { + private final GetKeychainEntryResponseV1 model = new GetKeychainEntryResponseV1(); + + /** + * Model tests for GetKeychainEntryResponseV1 + */ + @Test + public void testGetKeychainEntryResponseV1() { + // TODO: test GetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..a18d6012384 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryRequestV1 + */ +public class HasKeychainEntryRequestV1Test { + private final HasKeychainEntryRequestV1 model = new HasKeychainEntryRequestV1(); + + /** + * Model tests for HasKeychainEntryRequestV1 + */ + @Test + public void testHasKeychainEntryRequestV1() { + // TODO: test HasKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..3eb1f571717 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryResponseV1 + */ +public class HasKeychainEntryResponseV1Test { + private final HasKeychainEntryResponseV1 model = new HasKeychainEntryResponseV1(); + + /** + * Model tests for HasKeychainEntryResponseV1 + */ + @Test + public void testHasKeychainEntryResponseV1() { + // TODO: test HasKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..41318abf2e9 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryRequestV1 + */ +public class SetKeychainEntryRequestV1Test { + private final SetKeychainEntryRequestV1 model = new SetKeychainEntryRequestV1(); + + /** + * Model tests for SetKeychainEntryRequestV1 + */ + @Test + public void testSetKeychainEntryRequestV1() { + // TODO: test SetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..48401913c3a --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory WASM + * Contains/describes the Hyperledger Cactus Keychain Memory WASM plugin which is designed to help with testing and development and is implemented in Rust instead of Typescript. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryResponseV1 + */ +public class SetKeychainEntryResponseV1Test { + private final SetKeychainEntryResponseV1 model = new SetKeychainEntryResponseV1(); + + /** + * Model tests for SetKeychainEntryResponseV1 + */ + @Test + public void testSetKeychainEntryResponseV1() { + // TODO: test SetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory/package.json b/packages/cactus-plugin-keychain-memory/package.json index ff555c4a6a6..ab551d729ff 100644 --- a/packages/cactus-plugin-keychain-memory/package.json +++ b/packages/cactus-plugin-keychain-memory/package.json @@ -48,6 +48,8 @@ "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..cff88d4efaa --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,19 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_delete_keychain_entry_request_v1.go +model_delete_keychain_entry_response_v1.go +model_get_keychain_entry_request_v1.go +model_get_keychain_entry_response_v1.go +model_has_keychain_entry_request_v1.go +model_has_keychain_entry_response_v1.go +model_set_keychain_entry_request_v1.go +model_set_keychain_entry_response_v1.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..5b3356b7f97 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,123 @@ +# Go API client for cactus-plugin-keychain-memory + +Contains/describes the Hyperledger Cacti Keychain Memory plugin. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-keychain-memory "github.com/hyperledger/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-memory.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-memory.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-memory.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-keychain-memory.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeleteKeychainEntryV1**](docs/DefaultApi.md#deletekeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/delete-keychain-entry | Deletes an entry under a key on the keychain backend. +*DefaultApi* | [**GetKeychainEntryV1**](docs/DefaultApi.md#getkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**HasKeychainEntryV1**](docs/DefaultApi.md#haskeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/has-keychain-entry | Checks that an entry exists under a key on the keychain backend +*DefaultApi* | [**SetKeychainEntryV1**](docs/DefaultApi.md#setkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation For Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..81c1007d785 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,357 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Hyperledger Cacti Keychain Memory plugin. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: 'Hyperledger Cactus Plugin - Keychain Memory ' + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/set-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_delete_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Deletes an entry under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/delete-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_has_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Checks that an entry exists under a key on the keychain backend + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/has-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-prometheus-exporter-metrics +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_delete_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_delete_entry_401: + description: Authorization information is missing or invalid. + keychain_delete_entry_500: + description: Unexpected error. + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + schemas: + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..748176f7424 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,556 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cacti Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeleteKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deleteKeychainEntryRequestV1 *DeleteKeychainEntryRequestV1 +} + +// Request body to delete a keychain entry via its key +func (r ApiDeleteKeychainEntryV1Request) DeleteKeychainEntryRequestV1(deleteKeychainEntryRequestV1 DeleteKeychainEntryRequestV1) ApiDeleteKeychainEntryV1Request { + r.deleteKeychainEntryRequestV1 = &deleteKeychainEntryRequestV1 + return r +} + +func (r ApiDeleteKeychainEntryV1Request) Execute() (*DeleteKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.DeleteKeychainEntryV1Execute(r) +} + +/* +DeleteKeychainEntryV1 Deletes an entry under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeleteKeychainEntryV1Request +*/ +func (a *DefaultApiService) DeleteKeychainEntryV1(ctx context.Context) ApiDeleteKeychainEntryV1Request { + return ApiDeleteKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeleteKeychainEntryResponseV1 +func (a *DefaultApiService) DeleteKeychainEntryV1Execute(r ApiDeleteKeychainEntryV1Request) (*DeleteKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/delete-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deleteKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("deleteKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deleteKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getKeychainEntryRequestV1 *GetKeychainEntryRequestV1 +} + +// Request body to obtain a keychain entry via its key +func (r ApiGetKeychainEntryV1Request) GetKeychainEntryRequestV1(getKeychainEntryRequestV1 GetKeychainEntryRequestV1) ApiGetKeychainEntryV1Request { + r.getKeychainEntryRequestV1 = &getKeychainEntryRequestV1 + return r +} + +func (r ApiGetKeychainEntryV1Request) Execute() (*GetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.GetKeychainEntryV1Execute(r) +} + +/* +GetKeychainEntryV1 Retrieves the contents of a keychain entry from the backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetKeychainEntryV1Request +*/ +func (a *DefaultApiService) GetKeychainEntryV1(ctx context.Context) ApiGetKeychainEntryV1Request { + return ApiGetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetKeychainEntryResponseV1 +func (a *DefaultApiService) GetKeychainEntryV1Execute(r ApiGetKeychainEntryV1Request) (*GetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.getKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("getKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiHasKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + hasKeychainEntryRequestV1 *HasKeychainEntryRequestV1 +} + +// Request body for checking a keychain entry via its key +func (r ApiHasKeychainEntryV1Request) HasKeychainEntryRequestV1(hasKeychainEntryRequestV1 HasKeychainEntryRequestV1) ApiHasKeychainEntryV1Request { + r.hasKeychainEntryRequestV1 = &hasKeychainEntryRequestV1 + return r +} + +func (r ApiHasKeychainEntryV1Request) Execute() (*HasKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.HasKeychainEntryV1Execute(r) +} + +/* +HasKeychainEntryV1 Checks that an entry exists under a key on the keychain backend + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiHasKeychainEntryV1Request +*/ +func (a *DefaultApiService) HasKeychainEntryV1(ctx context.Context) ApiHasKeychainEntryV1Request { + return ApiHasKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return HasKeychainEntryResponseV1 +func (a *DefaultApiService) HasKeychainEntryV1Execute(r ApiHasKeychainEntryV1Request) (*HasKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HasKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.HasKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/has-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.hasKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("hasKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.hasKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + setKeychainEntryRequestV1 *SetKeychainEntryRequestV1 +} + +// Request body to write/update a keychain entry via its key +func (r ApiSetKeychainEntryV1Request) SetKeychainEntryRequestV1(setKeychainEntryRequestV1 SetKeychainEntryRequestV1) ApiSetKeychainEntryV1Request { + r.setKeychainEntryRequestV1 = &setKeychainEntryRequestV1 + return r +} + +func (r ApiSetKeychainEntryV1Request) Execute() (*SetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.SetKeychainEntryV1Execute(r) +} + +/* +SetKeychainEntryV1 Sets a value under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSetKeychainEntryV1Request +*/ +func (a *DefaultApiService) SetKeychainEntryV1(ctx context.Context) ApiSetKeychainEntryV1Request { + return ApiSetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SetKeychainEntryResponseV1 +func (a *DefaultApiService) SetKeychainEntryV1Execute(r ApiSetKeychainEntryV1Request) (*SetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/set-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.setKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("setKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..60368fac5a3 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cacti Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Keychain Memory API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..ff1d4d0f4c4 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cacti Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..00a696dcdd7 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go new file mode 100644 index 00000000000..06bb1e78a7b --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cacti Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryRequestV1{} + +// DeleteKeychainEntryRequestV1 struct for DeleteKeychainEntryRequestV1 +type DeleteKeychainEntryRequestV1 struct { + // The key for the entry to check the presence of on the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryRequestV1 instantiates a new DeleteKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewDeleteKeychainEntryRequestV1(key string) *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryRequestV1WithDefaults instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryRequestV1WithDefaults() *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryRequestV1 struct { + value *DeleteKeychainEntryRequestV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryRequestV1) Get() *DeleteKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryRequestV1) Set(val *DeleteKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryRequestV1(val *DeleteKeychainEntryRequestV1) *NullableDeleteKeychainEntryRequestV1 { + return &NullableDeleteKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go new file mode 100644 index 00000000000..fff5a76d9dc --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cacti Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryResponseV1{} + +// DeleteKeychainEntryResponseV1 struct for DeleteKeychainEntryResponseV1 +type DeleteKeychainEntryResponseV1 struct { + // The key that was deleted from the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryResponseV1 instantiates a new DeleteKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewDeleteKeychainEntryResponseV1(key string) *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryResponseV1WithDefaults instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryResponseV1WithDefaults() *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryResponseV1 struct { + value *DeleteKeychainEntryResponseV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryResponseV1) Get() *DeleteKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryResponseV1) Set(val *DeleteKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryResponseV1(val *DeleteKeychainEntryResponseV1) *NullableDeleteKeychainEntryResponseV1 { + return &NullableDeleteKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go new file mode 100644 index 00000000000..da625b8fdab --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cacti Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryRequestV1{} + +// GetKeychainEntryRequestV1 struct for GetKeychainEntryRequestV1 +type GetKeychainEntryRequestV1 struct { + // The key for the entry to get from the keychain. + Key string `json:"key"` +} + +// NewGetKeychainEntryRequestV1 instantiates a new GetKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewGetKeychainEntryRequestV1(key string) *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewGetKeychainEntryRequestV1WithDefaults instantiates a new GetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryRequestV1WithDefaults() *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetKeychainEntryRequestV1 struct { + value *GetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableGetKeychainEntryRequestV1) Get() *GetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableGetKeychainEntryRequestV1) Set(val *GetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryRequestV1(val *GetKeychainEntryRequestV1) *NullableGetKeychainEntryRequestV1 { + return &NullableGetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go new file mode 100644 index 00000000000..7be1f3a26a4 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cacti Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryResponseV1{} + +// GetKeychainEntryResponseV1 struct for GetKeychainEntryResponseV1 +type GetKeychainEntryResponseV1 struct { + // The key that was used to retrieve the value from the keychain. + Key string `json:"key"` + // The value associated with the requested key on the keychain. + Value string `json:"value"` +} + +// NewGetKeychainEntryResponseV1 instantiates a new GetKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewGetKeychainEntryResponseV1(key string, value string) *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetKeychainEntryResponseV1WithDefaults instantiates a new GetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryResponseV1WithDefaults() *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetKeychainEntryResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetKeychainEntryResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetKeychainEntryResponseV1 struct { + value *GetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableGetKeychainEntryResponseV1) Get() *GetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableGetKeychainEntryResponseV1) Set(val *GetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryResponseV1(val *GetKeychainEntryResponseV1) *NullableGetKeychainEntryResponseV1 { + return &NullableGetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go new file mode 100644 index 00000000000..7eb7e96de66 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cacti Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryRequestV1{} + +// HasKeychainEntryRequestV1 struct for HasKeychainEntryRequestV1 +type HasKeychainEntryRequestV1 struct { + // The key to check for presence in the keychain. + Key string `json:"key"` +} + +// NewHasKeychainEntryRequestV1 instantiates a new HasKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewHasKeychainEntryRequestV1(key string) *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewHasKeychainEntryRequestV1WithDefaults instantiates a new HasKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryRequestV1WithDefaults() *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasKeychainEntryRequestV1 struct { + value *HasKeychainEntryRequestV1 + isSet bool +} + +func (v NullableHasKeychainEntryRequestV1) Get() *HasKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableHasKeychainEntryRequestV1) Set(val *HasKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryRequestV1(val *HasKeychainEntryRequestV1) *NullableHasKeychainEntryRequestV1 { + return &NullableHasKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go new file mode 100644 index 00000000000..ef231362ce0 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cacti Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryResponseV1{} + +// HasKeychainEntryResponseV1 struct for HasKeychainEntryResponseV1 +type HasKeychainEntryResponseV1 struct { + // The key that was used to check the presence of the value in the entry store. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an entry under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasKeychainEntryResponseV1 instantiates a new HasKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewHasKeychainEntryResponseV1(key string, checkedAt string, isPresent bool) *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasKeychainEntryResponseV1WithDefaults instantiates a new HasKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryResponseV1WithDefaults() *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasKeychainEntryResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasKeychainEntryResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasKeychainEntryResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasKeychainEntryResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasKeychainEntryResponseV1 struct { + value *HasKeychainEntryResponseV1 + isSet bool +} + +func (v NullableHasKeychainEntryResponseV1) Get() *HasKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableHasKeychainEntryResponseV1) Set(val *HasKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryResponseV1(val *HasKeychainEntryResponseV1) *NullableHasKeychainEntryResponseV1 { + return &NullableHasKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go new file mode 100644 index 00000000000..0664d6c1c82 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cacti Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryRequestV1{} + +// SetKeychainEntryRequestV1 struct for SetKeychainEntryRequestV1 +type SetKeychainEntryRequestV1 struct { + // The key for the entry to set on the keychain. + Key string `json:"key"` + // The value that will be associated with the key on the keychain. + Value string `json:"value"` +} + +// NewSetKeychainEntryRequestV1 instantiates a new SetKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewSetKeychainEntryRequestV1(key string, value string) *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetKeychainEntryRequestV1WithDefaults instantiates a new SetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryRequestV1WithDefaults() *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetKeychainEntryRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetKeychainEntryRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetKeychainEntryRequestV1 struct { + value *SetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableSetKeychainEntryRequestV1) Get() *SetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableSetKeychainEntryRequestV1) Set(val *SetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryRequestV1(val *SetKeychainEntryRequestV1) *NullableSetKeychainEntryRequestV1 { + return &NullableSetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go new file mode 100644 index 00000000000..e373d3db8a7 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cacti Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryResponseV1{} + +// SetKeychainEntryResponseV1 struct for SetKeychainEntryResponseV1 +type SetKeychainEntryResponseV1 struct { + // The key that was used to set the value on the keychain. + Key string `json:"key"` +} + +// NewSetKeychainEntryResponseV1 instantiates a new SetKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewSetKeychainEntryResponseV1(key string) *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewSetKeychainEntryResponseV1WithDefaults instantiates a new SetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryResponseV1WithDefaults() *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetKeychainEntryResponseV1 struct { + value *SetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableSetKeychainEntryResponseV1) Get() *SetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableSetKeychainEntryResponseV1) Set(val *SetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryResponseV1(val *SetKeychainEntryResponseV1) *NullableSetKeychainEntryResponseV1 { + return &NullableSetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..dc3341531a8 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cacti Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..1c39df87569 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,85 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-keychain-memory + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-keychain-memory_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService DeleteKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeleteKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPrometheusMetricsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPrometheusMetricsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService HasKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.HasKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService SetKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.SetKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..262107b77d3 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Keychain Memory + +Contains/describes the Hyperledger Cacti Keychain Memory plugin. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-memory + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..26e642136d9 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - Keychain Memory + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..715e109d921 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,48 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..c66dc218b2b --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,148 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Keychain Memory +- API version: v2.0.0-alpha.2 + +Contains/describes the Hyperledger Cacti Keychain Memory plugin. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = new DeleteKeychainEntryRequestV1(); // DeleteKeychainEntryRequestV1 | Request body to delete a keychain entry via its key + try { + DeleteKeychainEntryResponseV1 result = apiInstance.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deleteKeychainEntryV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deleteKeychainEntryV1**](docs/DefaultApi.md#deleteKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/delete-keychain-entry | Deletes an entry under a key on the keychain backend. +*DefaultApi* | [**getKeychainEntryV1**](docs/DefaultApi.md#getKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**hasKeychainEntryV1**](docs/DefaultApi.md#hasKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/has-keychain-entry | Checks that an entry exists under a key on the keychain backend +*DefaultApi* | [**setKeychainEntryV1**](docs/DefaultApi.md#setKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation for Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..1a4a4390ebf --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,367 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Hyperledger Cacti Keychain Memory plugin. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: 'Hyperledger Cactus Plugin - Keychain Memory ' + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/set-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_delete_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Deletes an entry under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/delete-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_has_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Checks that an entry exists under a key on the keychain backend + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/has-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-prometheus-exporter-metrics + x-accepts: text/plain +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + keychain_delete_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + description: Request body to delete a keychain entry via its key + required: true + keychain_has_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + description: Request body for checking a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + keychain_delete_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + keychain_delete_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_delete_entry_401: + description: Authorization information is missing or invalid. + keychain_delete_entry_500: + description: Unexpected error. + keychain_has_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + keychain_has_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_has_entry_401: + description: Authorization information is missing or invalid. + keychain_has_entry_500: + description: Unexpected error. + schemas: + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to check the presence of on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the entry store. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..83bcdc09a99 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..c6c469e3588 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..bf2d58aac22 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..a278bde8f31 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..ccc170dcbff --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..054da4c7dd8 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..3495c1b644b --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,408 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.DeleteKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryResponseV1.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); + } + } + } + + /** + * 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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..8be9644b823 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..9d4d3b546f9 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..d7255f8c677 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..0d9ac93bed6 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..091e747bfdd --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,740 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 deleteKeychainEntryV1 + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call deleteKeychainEntryV1Call(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deleteKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/delete-keychain-entry"; + + 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 deleteKeychainEntryV1ValidateBeforeCall(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'deleteKeychainEntryRequestV1' is set + if (deleteKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'deleteKeychainEntryRequestV1' when calling deleteKeychainEntryV1(Async)"); + } + + return deleteKeychainEntryV1Call(deleteKeychainEntryRequestV1, _callback); + + } + + /** + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return DeleteKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public DeleteKeychainEntryResponseV1 deleteKeychainEntryV1(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Deletes an entry under a key on the keychain backend. + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @return ApiResponse<DeleteKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse deleteKeychainEntryV1WithHttpInfo(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deletes an entry under a key on the keychain backend. (asynchronously) + * + * @param deleteKeychainEntryRequestV1 Request body to delete a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call deleteKeychainEntryV1Async(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getKeychainEntryV1 + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Call(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-keychain-entry"; + + 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 getKeychainEntryV1ValidateBeforeCall(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'getKeychainEntryRequestV1' is set + if (getKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'getKeychainEntryRequestV1' when calling getKeychainEntryV1(Async)"); + } + + return getKeychainEntryV1Call(getKeychainEntryRequestV1, _callback); + + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return GetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public GetKeychainEntryResponseV1 getKeychainEntryV1(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return ApiResponse<GetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public ApiResponse getKeychainEntryV1WithHttpInfo(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the contents of a keychain entry from the backend. (asynchronously) + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Async(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + 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 getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasKeychainEntryV1 + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Call(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = hasKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/has-keychain-entry"; + + 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 hasKeychainEntryV1ValidateBeforeCall(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'hasKeychainEntryRequestV1' is set + if (hasKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'hasKeychainEntryRequestV1' when calling hasKeychainEntryV1(Async)"); + } + + return hasKeychainEntryV1Call(hasKeychainEntryRequestV1, _callback); + + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return HasKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public HasKeychainEntryResponseV1 hasKeychainEntryV1(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @return ApiResponse<HasKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse hasKeychainEntryV1WithHttpInfo(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Checks that an entry exists under a key on the keychain backend (asynchronously) + * + * @param hasKeychainEntryRequestV1 Request body for checking a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call hasKeychainEntryV1Async(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setKeychainEntryV1 + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Call(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = setKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-memory/set-keychain-entry"; + + 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 setKeychainEntryV1ValidateBeforeCall(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'setKeychainEntryRequestV1' is set + if (setKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'setKeychainEntryRequestV1' when calling setKeychainEntryV1(Async)"); + } + + return setKeychainEntryV1Call(setKeychainEntryRequestV1, _callback); + + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return SetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public SetKeychainEntryResponseV1 setKeychainEntryV1(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return ApiResponse<SetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse setKeychainEntryV1WithHttpInfo(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Sets a value under a key on the keychain backend. (asynchronously) + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Async(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..12936c6b5f7 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..2170b1bf956 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..f124b5767ae --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..8b05b41c7f8 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..3602d7df941 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java new file mode 100644 index 00000000000..efbd9a9e1d1 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryRequestV1() { + } + + public DeleteKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to check the presence of on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = (DeleteKeychainEntryRequestV1) o; + return Objects.equals(this.key, deleteKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryRequestV1 is not found in the empty JSON string", DeleteKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static DeleteKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java new file mode 100644 index 00000000000..8512fe7357c --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryResponseV1() { + } + + public DeleteKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was deleted from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryResponseV1 deleteKeychainEntryResponseV1 = (DeleteKeychainEntryResponseV1) o; + return Objects.equals(this.key, deleteKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryResponseV1 is not found in the empty JSON string", DeleteKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static DeleteKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java new file mode 100644 index 00000000000..e1fb837bbfc --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetKeychainEntryRequestV1() { + } + + public GetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = (GetKeychainEntryRequestV1) o; + return Objects.equals(this.key, getKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryRequestV1 is not found in the empty JSON string", GetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryRequestV1 + */ + public static GetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of GetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java new file mode 100644 index 00000000000..18a494d986d --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetKeychainEntryResponseV1() { + } + + public GetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetKeychainEntryResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryResponseV1 getKeychainEntryResponseV1 = (GetKeychainEntryResponseV1) o; + return Objects.equals(this.key, getKeychainEntryResponseV1.key) && + Objects.equals(this.value, getKeychainEntryResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryResponseV1 is not found in the empty JSON string", GetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryResponseV1 + */ + public static GetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of GetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java new file mode 100644 index 00000000000..2c3e2e0faa6 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasKeychainEntryRequestV1() { + } + + public HasKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = (HasKeychainEntryRequestV1) o; + return Objects.equals(this.key, hasKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryRequestV1 is not found in the empty JSON string", HasKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryRequestV1 + */ + public static HasKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of HasKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java new file mode 100644 index 00000000000..af1ea51d923 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasKeychainEntryResponseV1() { + } + + public HasKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the entry store. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasKeychainEntryResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasKeychainEntryResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an entry under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryResponseV1 hasKeychainEntryResponseV1 = (HasKeychainEntryResponseV1) o; + return Objects.equals(this.key, hasKeychainEntryResponseV1.key) && + Objects.equals(this.checkedAt, hasKeychainEntryResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasKeychainEntryResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryResponseV1 is not found in the empty JSON string", HasKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryResponseV1 + */ + public static HasKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of HasKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java new file mode 100644 index 00000000000..510f8b3b8a8 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetKeychainEntryRequestV1() { + } + + public SetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetKeychainEntryRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = (SetKeychainEntryRequestV1) o; + return Objects.equals(this.key, setKeychainEntryRequestV1.key) && + Objects.equals(this.value, setKeychainEntryRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryRequestV1 is not found in the empty JSON string", SetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryRequestV1 + */ + public static SetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of SetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java new file mode 100644 index 00000000000..d72cbfa3834 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetKeychainEntryResponseV1() { + } + + public SetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryResponseV1 setKeychainEntryResponseV1 = (SetKeychainEntryResponseV1) o; + return Objects.equals(this.key, setKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryResponseV1 is not found in the empty JSON string", SetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryResponseV1 + */ + public static SetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of SetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..5630926b001 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,100 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deletes an entry under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteKeychainEntryV1Test() throws ApiException { + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = null; + DeleteKeychainEntryResponseV1 response = api.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getKeychainEntryV1Test() throws ApiException { + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = null; + GetKeychainEntryResponseV1 response = api.getKeychainEntryV1(getKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Checks that an entry exists under a key on the keychain backend + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasKeychainEntryV1Test() throws ApiException { + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = null; + HasKeychainEntryResponseV1 response = api.hasKeychainEntryV1(hasKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Sets a value under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void setKeychainEntryV1Test() throws ApiException { + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = null; + SetKeychainEntryResponseV1 response = api.setKeychainEntryV1(setKeychainEntryRequestV1); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..a4da9fc389d --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryRequestV1 + */ +public class DeleteKeychainEntryRequestV1Test { + private final DeleteKeychainEntryRequestV1 model = new DeleteKeychainEntryRequestV1(); + + /** + * Model tests for DeleteKeychainEntryRequestV1 + */ + @Test + public void testDeleteKeychainEntryRequestV1() { + // TODO: test DeleteKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..6aa56b09a8b --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryResponseV1 + */ +public class DeleteKeychainEntryResponseV1Test { + private final DeleteKeychainEntryResponseV1 model = new DeleteKeychainEntryResponseV1(); + + /** + * Model tests for DeleteKeychainEntryResponseV1 + */ + @Test + public void testDeleteKeychainEntryResponseV1() { + // TODO: test DeleteKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..c349cc42d5d --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryRequestV1 + */ +public class GetKeychainEntryRequestV1Test { + private final GetKeychainEntryRequestV1 model = new GetKeychainEntryRequestV1(); + + /** + * Model tests for GetKeychainEntryRequestV1 + */ + @Test + public void testGetKeychainEntryRequestV1() { + // TODO: test GetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..781e16358d1 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryResponseV1 + */ +public class GetKeychainEntryResponseV1Test { + private final GetKeychainEntryResponseV1 model = new GetKeychainEntryResponseV1(); + + /** + * Model tests for GetKeychainEntryResponseV1 + */ + @Test + public void testGetKeychainEntryResponseV1() { + // TODO: test GetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..9594644c075 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryRequestV1 + */ +public class HasKeychainEntryRequestV1Test { + private final HasKeychainEntryRequestV1 model = new HasKeychainEntryRequestV1(); + + /** + * Model tests for HasKeychainEntryRequestV1 + */ + @Test + public void testHasKeychainEntryRequestV1() { + // TODO: test HasKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..c93d8180979 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryResponseV1 + */ +public class HasKeychainEntryResponseV1Test { + private final HasKeychainEntryResponseV1 model = new HasKeychainEntryResponseV1(); + + /** + * Model tests for HasKeychainEntryResponseV1 + */ + @Test + public void testHasKeychainEntryResponseV1() { + // TODO: test HasKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..bf5bc2117b9 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryRequestV1 + */ +public class SetKeychainEntryRequestV1Test { + private final SetKeychainEntryRequestV1 model = new SetKeychainEntryRequestV1(); + + /** + * Model tests for SetKeychainEntryRequestV1 + */ + @Test + public void testSetKeychainEntryRequestV1() { + // TODO: test SetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..26062a96de0 --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Keychain Memory + * Contains/describes the Hyperledger Cacti Keychain Memory plugin. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryResponseV1 + */ +public class SetKeychainEntryResponseV1Test { + private final SetKeychainEntryResponseV1 model = new SetKeychainEntryResponseV1(); + + /** + * Model tests for SetKeychainEntryResponseV1 + */ + @Test + public void testSetKeychainEntryResponseV1() { + // TODO: test SetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-vault/package.json b/packages/cactus-plugin-keychain-vault/package.json index 14a45bcf844..eada55151d9 100644 --- a/packages/cactus-plugin-keychain-vault/package.json +++ b/packages/cactus-plugin-keychain-vault/package.json @@ -48,6 +48,8 @@ "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..cff88d4efaa --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,19 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_delete_keychain_entry_request_v1.go +model_delete_keychain_entry_response_v1.go +model_get_keychain_entry_request_v1.go +model_get_keychain_entry_response_v1.go +model_has_keychain_entry_request_v1.go +model_has_keychain_entry_response_v1.go +model_set_keychain_entry_request_v1.go +model_set_keychain_entry_response_v1.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..1c35d996929 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,123 @@ +# Go API client for cactus-plugin-keychain-vault + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-keychain-vault "github.com/hyperledger/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-vault.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-vault.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-keychain-vault.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-keychain-vault.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeleteKeychainEntryV1**](docs/DefaultApi.md#deletekeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/delete-keychain-entry | Deletes an entry from the keychain stored under the provided key. +*DefaultApi* | [**GetKeychainEntryV1**](docs/DefaultApi.md#getkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**HasKeychainEntryV1**](docs/DefaultApi.md#haskeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/has-keychain-entry | Retrieves the information regarding a key being present on the keychain or not. +*DefaultApi* | [**SetKeychainEntryV1**](docs/DefaultApi.md#setkeychainentryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation For Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..8072a656bd1 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,310 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Keychain API types/paths for Hyperledger Cactus. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus - Keychain API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + summary: Deletes an entry from the keychain stored under the provided key. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/delete-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + summary: Retrieves the information regarding a key being present on the keychain + or not. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/has-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/set-keychain-entry + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-prometheus-exporter-metrics +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + schemas: + PrometheusExporterMetricsResponse: + nullable: false + type: string + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key of the entry to delete from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key of the entry that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..1f0766578dd --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,548 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeleteKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deleteKeychainEntryRequestV1 *DeleteKeychainEntryRequestV1 +} + +func (r ApiDeleteKeychainEntryV1Request) DeleteKeychainEntryRequestV1(deleteKeychainEntryRequestV1 DeleteKeychainEntryRequestV1) ApiDeleteKeychainEntryV1Request { + r.deleteKeychainEntryRequestV1 = &deleteKeychainEntryRequestV1 + return r +} + +func (r ApiDeleteKeychainEntryV1Request) Execute() (*DeleteKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.DeleteKeychainEntryV1Execute(r) +} + +/* +DeleteKeychainEntryV1 Deletes an entry from the keychain stored under the provided key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeleteKeychainEntryV1Request +*/ +func (a *DefaultApiService) DeleteKeychainEntryV1(ctx context.Context) ApiDeleteKeychainEntryV1Request { + return ApiDeleteKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeleteKeychainEntryResponseV1 +func (a *DefaultApiService) DeleteKeychainEntryV1Execute(r ApiDeleteKeychainEntryV1Request) (*DeleteKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/delete-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deleteKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getKeychainEntryRequestV1 *GetKeychainEntryRequestV1 +} + +// Request body to obtain a keychain entry via its key +func (r ApiGetKeychainEntryV1Request) GetKeychainEntryRequestV1(getKeychainEntryRequestV1 GetKeychainEntryRequestV1) ApiGetKeychainEntryV1Request { + r.getKeychainEntryRequestV1 = &getKeychainEntryRequestV1 + return r +} + +func (r ApiGetKeychainEntryV1Request) Execute() (*GetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.GetKeychainEntryV1Execute(r) +} + +/* +GetKeychainEntryV1 Retrieves the contents of a keychain entry from the backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetKeychainEntryV1Request +*/ +func (a *DefaultApiService) GetKeychainEntryV1(ctx context.Context) ApiGetKeychainEntryV1Request { + return ApiGetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetKeychainEntryResponseV1 +func (a *DefaultApiService) GetKeychainEntryV1Execute(r ApiGetKeychainEntryV1Request) (*GetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.getKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("getKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiHasKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + hasKeychainEntryRequestV1 *HasKeychainEntryRequestV1 +} + +func (r ApiHasKeychainEntryV1Request) HasKeychainEntryRequestV1(hasKeychainEntryRequestV1 HasKeychainEntryRequestV1) ApiHasKeychainEntryV1Request { + r.hasKeychainEntryRequestV1 = &hasKeychainEntryRequestV1 + return r +} + +func (r ApiHasKeychainEntryV1Request) Execute() (*HasKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.HasKeychainEntryV1Execute(r) +} + +/* +HasKeychainEntryV1 Retrieves the information regarding a key being present on the keychain or not. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiHasKeychainEntryV1Request +*/ +func (a *DefaultApiService) HasKeychainEntryV1(ctx context.Context) ApiHasKeychainEntryV1Request { + return ApiHasKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return HasKeychainEntryResponseV1 +func (a *DefaultApiService) HasKeychainEntryV1Execute(r ApiHasKeychainEntryV1Request) (*HasKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HasKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.HasKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/has-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.hasKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSetKeychainEntryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + setKeychainEntryRequestV1 *SetKeychainEntryRequestV1 +} + +// Request body to write/update a keychain entry via its key +func (r ApiSetKeychainEntryV1Request) SetKeychainEntryRequestV1(setKeychainEntryRequestV1 SetKeychainEntryRequestV1) ApiSetKeychainEntryV1Request { + r.setKeychainEntryRequestV1 = &setKeychainEntryRequestV1 + return r +} + +func (r ApiSetKeychainEntryV1Request) Execute() (*SetKeychainEntryResponseV1, *http.Response, error) { + return r.ApiService.SetKeychainEntryV1Execute(r) +} + +/* +SetKeychainEntryV1 Sets a value under a key on the keychain backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSetKeychainEntryV1Request +*/ +func (a *DefaultApiService) SetKeychainEntryV1(ctx context.Context) ApiSetKeychainEntryV1Request { + return ApiSetKeychainEntryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SetKeychainEntryResponseV1 +func (a *DefaultApiService) SetKeychainEntryV1Execute(r ApiSetKeychainEntryV1Request) (*SetKeychainEntryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SetKeychainEntryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SetKeychainEntryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/set-keychain-entry" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.setKeychainEntryRequestV1 == nil { + return localVarReturnValue, nil, reportError("setKeychainEntryRequestV1 is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setKeychainEntryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..e4d95c6610f --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus - Keychain API API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..6915584e46b --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..ea23cb82602 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go new file mode 100644 index 00000000000..805dc1c7608 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryRequestV1{} + +// DeleteKeychainEntryRequestV1 struct for DeleteKeychainEntryRequestV1 +type DeleteKeychainEntryRequestV1 struct { + // The key of the entry to delete from the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryRequestV1 instantiates a new DeleteKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewDeleteKeychainEntryRequestV1(key string) *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryRequestV1WithDefaults instantiates a new DeleteKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryRequestV1WithDefaults() *DeleteKeychainEntryRequestV1 { + this := DeleteKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryRequestV1 struct { + value *DeleteKeychainEntryRequestV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryRequestV1) Get() *DeleteKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryRequestV1) Set(val *DeleteKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryRequestV1(val *DeleteKeychainEntryRequestV1) *NullableDeleteKeychainEntryRequestV1 { + return &NullableDeleteKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go new file mode 100644 index 00000000000..77aecb3225f --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_delete_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" +) + +// checks if the DeleteKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteKeychainEntryResponseV1{} + +// DeleteKeychainEntryResponseV1 struct for DeleteKeychainEntryResponseV1 +type DeleteKeychainEntryResponseV1 struct { + // The key of the entry that was deleted from the keychain. + Key string `json:"key"` +} + +// NewDeleteKeychainEntryResponseV1 instantiates a new DeleteKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewDeleteKeychainEntryResponseV1(key string) *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewDeleteKeychainEntryResponseV1WithDefaults instantiates a new DeleteKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeleteKeychainEntryResponseV1WithDefaults() *DeleteKeychainEntryResponseV1 { + this := DeleteKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *DeleteKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *DeleteKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *DeleteKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o DeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableDeleteKeychainEntryResponseV1 struct { + value *DeleteKeychainEntryResponseV1 + isSet bool +} + +func (v NullableDeleteKeychainEntryResponseV1) Get() *DeleteKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableDeleteKeychainEntryResponseV1) Set(val *DeleteKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteKeychainEntryResponseV1(val *DeleteKeychainEntryResponseV1) *NullableDeleteKeychainEntryResponseV1 { + return &NullableDeleteKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableDeleteKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go new file mode 100644 index 00000000000..45c8381107b --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_get_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryRequestV1{} + +// GetKeychainEntryRequestV1 struct for GetKeychainEntryRequestV1 +type GetKeychainEntryRequestV1 struct { + // The key for the entry to get from the keychain. + Key string `json:"key"` +} + +// NewGetKeychainEntryRequestV1 instantiates a new GetKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewGetKeychainEntryRequestV1(key string) *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewGetKeychainEntryRequestV1WithDefaults instantiates a new GetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryRequestV1WithDefaults() *GetKeychainEntryRequestV1 { + this := GetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o GetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableGetKeychainEntryRequestV1 struct { + value *GetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableGetKeychainEntryRequestV1) Get() *GetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableGetKeychainEntryRequestV1) Set(val *GetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryRequestV1(val *GetKeychainEntryRequestV1) *NullableGetKeychainEntryRequestV1 { + return &NullableGetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go new file mode 100644 index 00000000000..3bcef9072ee --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_get_keychain_entry_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" +) + +// checks if the GetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetKeychainEntryResponseV1{} + +// GetKeychainEntryResponseV1 struct for GetKeychainEntryResponseV1 +type GetKeychainEntryResponseV1 struct { + // The key that was used to retrieve the value from the keychain. + Key string `json:"key"` + // The value associated with the requested key on the keychain. + Value string `json:"value"` +} + +// NewGetKeychainEntryResponseV1 instantiates a new GetKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewGetKeychainEntryResponseV1(key string, value string) *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + this.Key = key + this.Value = value + return &this +} + +// NewGetKeychainEntryResponseV1WithDefaults instantiates a new GetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetKeychainEntryResponseV1WithDefaults() *GetKeychainEntryResponseV1 { + this := GetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *GetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *GetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *GetKeychainEntryResponseV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *GetKeychainEntryResponseV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *GetKeychainEntryResponseV1) SetValue(v string) { + o.Value = v +} + +func (o GetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableGetKeychainEntryResponseV1 struct { + value *GetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableGetKeychainEntryResponseV1) Get() *GetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableGetKeychainEntryResponseV1) Set(val *GetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetKeychainEntryResponseV1(val *GetKeychainEntryResponseV1) *NullableGetKeychainEntryResponseV1 { + return &NullableGetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableGetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go new file mode 100644 index 00000000000..ce085956115 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_has_keychain_entry_request_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryRequestV1{} + +// HasKeychainEntryRequestV1 struct for HasKeychainEntryRequestV1 +type HasKeychainEntryRequestV1 struct { + // The key to check for presence in the keychain. + Key string `json:"key"` +} + +// NewHasKeychainEntryRequestV1 instantiates a new HasKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewHasKeychainEntryRequestV1(key string) *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + this.Key = key + return &this +} + +// NewHasKeychainEntryRequestV1WithDefaults instantiates a new HasKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryRequestV1WithDefaults() *HasKeychainEntryRequestV1 { + this := HasKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +func (o HasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableHasKeychainEntryRequestV1 struct { + value *HasKeychainEntryRequestV1 + isSet bool +} + +func (v NullableHasKeychainEntryRequestV1) Get() *HasKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableHasKeychainEntryRequestV1) Set(val *HasKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryRequestV1(val *HasKeychainEntryRequestV1) *NullableHasKeychainEntryRequestV1 { + return &NullableHasKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go new file mode 100644 index 00000000000..ae67581f2da --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_has_keychain_entry_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" +) + +// checks if the HasKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HasKeychainEntryResponseV1{} + +// HasKeychainEntryResponseV1 struct for HasKeychainEntryResponseV1 +type HasKeychainEntryResponseV1 struct { + // The key that was used to check the presence of the value in the keychain. + Key string `json:"key"` + // Date and time encoded as JSON when the presence check was performed by the plugin backend. + CheckedAt string `json:"checkedAt"` + // The boolean true or false indicating the presence or absence of an entry under 'key'. + IsPresent bool `json:"isPresent"` +} + +// NewHasKeychainEntryResponseV1 instantiates a new HasKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewHasKeychainEntryResponseV1(key string, checkedAt string, isPresent bool) *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + this.Key = key + this.CheckedAt = checkedAt + this.IsPresent = isPresent + return &this +} + +// NewHasKeychainEntryResponseV1WithDefaults instantiates a new HasKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasKeychainEntryResponseV1WithDefaults() *HasKeychainEntryResponseV1 { + this := HasKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *HasKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *HasKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +// GetCheckedAt returns the CheckedAt field value +func (o *HasKeychainEntryResponseV1) GetCheckedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CheckedAt +} + +// GetCheckedAtOk returns a tuple with the CheckedAt field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetCheckedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CheckedAt, true +} + +// SetCheckedAt sets field value +func (o *HasKeychainEntryResponseV1) SetCheckedAt(v string) { + o.CheckedAt = v +} + +// GetIsPresent returns the IsPresent field value +func (o *HasKeychainEntryResponseV1) GetIsPresent() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPresent +} + +// GetIsPresentOk returns a tuple with the IsPresent field value +// and a boolean to check if the value has been set. +func (o *HasKeychainEntryResponseV1) GetIsPresentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPresent, true +} + +// SetIsPresent sets field value +func (o *HasKeychainEntryResponseV1) SetIsPresent(v bool) { + o.IsPresent = v +} + +func (o HasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HasKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["checkedAt"] = o.CheckedAt + toSerialize["isPresent"] = o.IsPresent + return toSerialize, nil +} + +type NullableHasKeychainEntryResponseV1 struct { + value *HasKeychainEntryResponseV1 + isSet bool +} + +func (v NullableHasKeychainEntryResponseV1) Get() *HasKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableHasKeychainEntryResponseV1) Set(val *HasKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableHasKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableHasKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasKeychainEntryResponseV1(val *HasKeychainEntryResponseV1) *NullableHasKeychainEntryResponseV1 { + return &NullableHasKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableHasKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go new file mode 100644 index 00000000000..f0818d58637 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_set_keychain_entry_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryRequestV1{} + +// SetKeychainEntryRequestV1 struct for SetKeychainEntryRequestV1 +type SetKeychainEntryRequestV1 struct { + // The key for the entry to set on the keychain. + Key string `json:"key"` + // The value that will be associated with the key on the keychain. + Value string `json:"value"` +} + +// NewSetKeychainEntryRequestV1 instantiates a new SetKeychainEntryRequestV1 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 +// will change when the set of required properties is changed +func NewSetKeychainEntryRequestV1(key string, value string) *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + this.Key = key + this.Value = value + return &this +} + +// NewSetKeychainEntryRequestV1WithDefaults instantiates a new SetKeychainEntryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryRequestV1WithDefaults() *SetKeychainEntryRequestV1 { + this := SetKeychainEntryRequestV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryRequestV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryRequestV1) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetKeychainEntryRequestV1) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryRequestV1) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetKeychainEntryRequestV1) SetValue(v string) { + o.Value = v +} + +func (o SetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetKeychainEntryRequestV1 struct { + value *SetKeychainEntryRequestV1 + isSet bool +} + +func (v NullableSetKeychainEntryRequestV1) Get() *SetKeychainEntryRequestV1 { + return v.value +} + +func (v *NullableSetKeychainEntryRequestV1) Set(val *SetKeychainEntryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryRequestV1(val *SetKeychainEntryRequestV1) *NullableSetKeychainEntryRequestV1 { + return &NullableSetKeychainEntryRequestV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go new file mode 100644 index 00000000000..fb6dea7a806 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/model_set_keychain_entry_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" +) + +// checks if the SetKeychainEntryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetKeychainEntryResponseV1{} + +// SetKeychainEntryResponseV1 struct for SetKeychainEntryResponseV1 +type SetKeychainEntryResponseV1 struct { + // The key that was used to set the value on the keychain. + Key string `json:"key"` +} + +// NewSetKeychainEntryResponseV1 instantiates a new SetKeychainEntryResponseV1 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 +// will change when the set of required properties is changed +func NewSetKeychainEntryResponseV1(key string) *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + this.Key = key + return &this +} + +// NewSetKeychainEntryResponseV1WithDefaults instantiates a new SetKeychainEntryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetKeychainEntryResponseV1WithDefaults() *SetKeychainEntryResponseV1 { + this := SetKeychainEntryResponseV1{} + return &this +} + +// GetKey returns the Key field value +func (o *SetKeychainEntryResponseV1) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetKeychainEntryResponseV1) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetKeychainEntryResponseV1) SetKey(v string) { + o.Key = v +} + +func (o SetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetKeychainEntryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + return toSerialize, nil +} + +type NullableSetKeychainEntryResponseV1 struct { + value *SetKeychainEntryResponseV1 + isSet bool +} + +func (v NullableSetKeychainEntryResponseV1) Get() *SetKeychainEntryResponseV1 { + return v.value +} + +func (v *NullableSetKeychainEntryResponseV1) Set(val *SetKeychainEntryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSetKeychainEntryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSetKeychainEntryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetKeychainEntryResponseV1(val *SetKeychainEntryResponseV1) *NullableSetKeychainEntryResponseV1 { + return &NullableSetKeychainEntryResponseV1{value: val, isSet: true} +} + +func (v NullableSetKeychainEntryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetKeychainEntryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..38092760447 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..9406f12e36a --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,85 @@ +/* +Hyperledger Cactus - Keychain API + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-keychain-vault + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-keychain-vault_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService DeleteKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeleteKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPrometheusMetricsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPrometheusMetricsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService HasKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.HasKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService SetKeychainEntryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.SetKeychainEntryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..b056566c392 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus - Keychain API + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-keychain-vault + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..a155899a355 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus - Keychain API + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..715e109d921 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,48 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java +src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java +src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java +src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..7f276f3786b --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,148 @@ +# openapi-java-client + +Hyperledger Cactus - Keychain API +- API version: v2.0.0-alpha.2 + +Contains/describes the Keychain API types/paths for Hyperledger Cactus. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = new DeleteKeychainEntryRequestV1(); // DeleteKeychainEntryRequestV1 | + try { + DeleteKeychainEntryResponseV1 result = apiInstance.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deleteKeychainEntryV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deleteKeychainEntryV1**](docs/DefaultApi.md#deleteKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/delete-keychain-entry | Deletes an entry from the keychain stored under the provided key. +*DefaultApi* | [**getKeychainEntryV1**](docs/DefaultApi.md#getKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry | Retrieves the contents of a keychain entry from the backend. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**hasKeychainEntryV1**](docs/DefaultApi.md#hasKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/has-keychain-entry | Retrieves the information regarding a key being present on the keychain or not. +*DefaultApi* | [**setKeychainEntryV1**](docs/DefaultApi.md#setKeychainEntryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/set-keychain-entry | Sets a value under a key on the keychain backend. + + +## Documentation for Models + + - [DeleteKeychainEntryRequestV1](docs/DeleteKeychainEntryRequestV1.md) + - [DeleteKeychainEntryResponseV1](docs/DeleteKeychainEntryResponseV1.md) + - [GetKeychainEntryRequestV1](docs/GetKeychainEntryRequestV1.md) + - [GetKeychainEntryResponseV1](docs/GetKeychainEntryResponseV1.md) + - [HasKeychainEntryRequestV1](docs/HasKeychainEntryRequestV1.md) + - [HasKeychainEntryResponseV1](docs/HasKeychainEntryResponseV1.md) + - [SetKeychainEntryRequestV1](docs/SetKeychainEntryRequestV1.md) + - [SetKeychainEntryResponseV1](docs/SetKeychainEntryResponseV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..a29fb0d6b49 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,320 @@ +openapi: 3.0.3 +info: + description: Contains/describes the Keychain API types/paths for Hyperledger Cactus. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus - Keychain API + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry: + post: + operationId: getKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_get_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "404": + description: A keychain item with the specified key was not found. + "500": + description: Unexpected error. + summary: Retrieves the contents of a keychain entry from the backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/delete-keychain-entry: + post: + operationId: deleteKeychainEntryV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteKeychainEntryResponseV1' + description: OK + summary: Deletes an entry from the keychain stored under the provided key. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/delete-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/has-keychain-entry: + post: + operationId: hasKeychainEntryV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HasKeychainEntryResponseV1' + description: OK + summary: Retrieves the information regarding a key being present on the keychain + or not. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/has-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/set-keychain-entry: + post: + operationId: setKeychainEntryV1 + parameters: [] + requestBody: + $ref: '#/components/requestBodies/keychain_set_entry_request_body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + "400": + description: "Bad request. Key must be a string and longer than 0, shorter\ + \ than 1024 characters." + "401": + description: Authorization information is missing or invalid. + "500": + description: Unexpected error. + summary: Sets a value under a key on the keychain backend. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/set-keychain-entry + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-prometheus-exporter-metrics + x-accepts: text/plain +components: + requestBodies: + keychain_get_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryRequestV1' + description: Request body to obtain a keychain entry via its key + required: true + keychain_set_entry_request_body: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryRequestV1' + description: Request body to write/update a keychain entry via its key + required: true + responses: + keychain_get_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/GetKeychainEntryResponseV1' + description: OK + keychain_get_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_get_entry_401: + description: Authorization information is missing or invalid. + keychain_get_entry_404: + description: A keychain item with the specified key was not found. + keychain_get_entry_500: + description: Unexpected error. + keychain_set_entry_200: + content: + application/json: + schema: + $ref: '#/components/schemas/SetKeychainEntryResponseV1' + description: OK + keychain_set_entry_400: + description: "Bad request. Key must be a string and longer than 0, shorter than\ + \ 1024 characters." + keychain_set_entry_401: + description: Authorization information is missing or invalid. + keychain_set_entry_500: + description: Unexpected error. + schemas: + PrometheusExporterMetricsResponse: + nullable: false + type: string + HasKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key to check for presence in the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + HasKeychainEntryResponseV1: + example: + checkedAt: checkedAt + isPresent: true + key: key + properties: + key: + description: The key that was used to check the presence of the value in + the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + checkedAt: + description: Date and time encoded as JSON when the presence check was performed + by the plugin backend. + nullable: false + type: string + isPresent: + description: The boolean true or false indicating the presence or absence + of an entry under 'key'. + nullable: false + type: boolean + required: + - checkedAt + - isPresent + - key + type: object + DeleteKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key of the entry to delete from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + DeleteKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key of the entry that was deleted from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryRequestV1: + additionalProperties: false + example: + key: key + properties: + key: + description: The key for the entry to get from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + GetKeychainEntryResponseV1: + example: + value: value + key: key + properties: + key: + description: The key that was used to retrieve the value from the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value associated with the requested key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryRequestV1: + additionalProperties: false + example: + value: value + key: key + properties: + key: + description: The key for the entry to set on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + value: + description: The value that will be associated with the key on the keychain. + maxLength: 10485760 + minLength: 0 + nullable: false + type: string + required: + - key + - value + type: object + SetKeychainEntryResponseV1: + example: + key: key + properties: + key: + description: The key that was used to set the value on the keychain. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - key + type: object + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..ae229a53715 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..3dffbd1bcb1 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..927f4e3634c --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..c4cc8894bc7 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..680d06d26b4 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..a47c9598eb7 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..41e529ec030 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,408 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.DeleteKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeleteKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HasKeychainEntryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetKeychainEntryResponseV1.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); + } + } + } + + /** + * 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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..beeba650d5a --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..a7b77588008 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..36a03a4ac8f --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..7c133060d80 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..4aed56103d5 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,706 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 deleteKeychainEntryV1 + * @param deleteKeychainEntryRequestV1 (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deleteKeychainEntryV1Call(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deleteKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/delete-keychain-entry"; + + 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 deleteKeychainEntryV1ValidateBeforeCall(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + return deleteKeychainEntryV1Call(deleteKeychainEntryRequestV1, _callback); + + } + + /** + * Deletes an entry from the keychain stored under the provided key. + * + * @param deleteKeychainEntryRequestV1 (optional) + * @return DeleteKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DeleteKeychainEntryResponseV1 deleteKeychainEntryV1(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = deleteKeychainEntryV1WithHttpInfo(deleteKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Deletes an entry from the keychain stored under the provided key. + * + * @param deleteKeychainEntryRequestV1 (optional) + * @return ApiResponse<DeleteKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse deleteKeychainEntryV1WithHttpInfo(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deletes an entry from the keychain stored under the provided key. (asynchronously) + * + * @param deleteKeychainEntryRequestV1 (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deleteKeychainEntryV1Async(DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteKeychainEntryV1ValidateBeforeCall(deleteKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getKeychainEntryV1 + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Call(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-keychain-entry"; + + 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 getKeychainEntryV1ValidateBeforeCall(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'getKeychainEntryRequestV1' is set + if (getKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'getKeychainEntryRequestV1' when calling getKeychainEntryV1(Async)"); + } + + return getKeychainEntryV1Call(getKeychainEntryRequestV1, _callback); + + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return GetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public GetKeychainEntryResponseV1 getKeychainEntryV1(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = getKeychainEntryV1WithHttpInfo(getKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @return ApiResponse<GetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public ApiResponse getKeychainEntryV1WithHttpInfo(GetKeychainEntryRequestV1 getKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the contents of a keychain entry from the backend. (asynchronously) + * + * @param getKeychainEntryRequestV1 Request body to obtain a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
404 A keychain item with the specified key was not found. -
500 Unexpected error. -
+ */ + public okhttp3.Call getKeychainEntryV1Async(GetKeychainEntryRequestV1 getKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getKeychainEntryV1ValidateBeforeCall(getKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + 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 getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasKeychainEntryV1 + * @param hasKeychainEntryRequestV1 (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call hasKeychainEntryV1Call(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = hasKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/has-keychain-entry"; + + 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 hasKeychainEntryV1ValidateBeforeCall(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + return hasKeychainEntryV1Call(hasKeychainEntryRequestV1, _callback); + + } + + /** + * Retrieves the information regarding a key being present on the keychain or not. + * + * @param hasKeychainEntryRequestV1 (optional) + * @return HasKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public HasKeychainEntryResponseV1 hasKeychainEntryV1(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = hasKeychainEntryV1WithHttpInfo(hasKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Retrieves the information regarding a key being present on the keychain or not. + * + * @param hasKeychainEntryRequestV1 (optional) + * @return ApiResponse<HasKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse hasKeychainEntryV1WithHttpInfo(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the information regarding a key being present on the keychain or not. (asynchronously) + * + * @param hasKeychainEntryRequestV1 (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call hasKeychainEntryV1Async(HasKeychainEntryRequestV1 hasKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasKeychainEntryV1ValidateBeforeCall(hasKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setKeychainEntryV1 + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Call(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = setKeychainEntryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-keychain-vault/set-keychain-entry"; + + 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 setKeychainEntryV1ValidateBeforeCall(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'setKeychainEntryRequestV1' is set + if (setKeychainEntryRequestV1 == null) { + throw new ApiException("Missing the required parameter 'setKeychainEntryRequestV1' when calling setKeychainEntryV1(Async)"); + } + + return setKeychainEntryV1Call(setKeychainEntryRequestV1, _callback); + + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return SetKeychainEntryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public SetKeychainEntryResponseV1 setKeychainEntryV1(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + ApiResponse localVarResp = setKeychainEntryV1WithHttpInfo(setKeychainEntryRequestV1); + return localVarResp.getData(); + } + + /** + * Sets a value under a key on the keychain backend. + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @return ApiResponse<SetKeychainEntryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public ApiResponse setKeychainEntryV1WithHttpInfo(SetKeychainEntryRequestV1 setKeychainEntryRequestV1) throws ApiException { + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Sets a value under a key on the keychain backend. (asynchronously) + * + * @param setKeychainEntryRequestV1 Request body to write/update a keychain entry via its key (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad request. Key must be a string and longer than 0, shorter than 1024 characters. -
401 Authorization information is missing or invalid. -
500 Unexpected error. -
+ */ + public okhttp3.Call setKeychainEntryV1Async(SetKeychainEntryRequestV1 setKeychainEntryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = setKeychainEntryV1ValidateBeforeCall(setKeychainEntryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..9d478953d92 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..2896c25c21c --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..660312a6f53 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..07bda43db19 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..506c3d798e8 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java new file mode 100644 index 00000000000..0eb0853c1a2 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryRequestV1() { + } + + public DeleteKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry to delete from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = (DeleteKeychainEntryRequestV1) o; + return Objects.equals(this.key, deleteKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryRequestV1 is not found in the empty JSON string", DeleteKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryRequestV1 + */ + public static DeleteKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java new file mode 100644 index 00000000000..640a111cac8 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeleteKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeleteKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public DeleteKeychainEntryResponseV1() { + } + + public DeleteKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key of the entry that was deleted from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteKeychainEntryResponseV1 deleteKeychainEntryResponseV1 = (DeleteKeychainEntryResponseV1) o; + return Objects.equals(this.key, deleteKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeleteKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteKeychainEntryResponseV1 is not found in the empty JSON string", DeleteKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeleteKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeleteKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeleteKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeleteKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeleteKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to DeleteKeychainEntryResponseV1 + */ + public static DeleteKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of DeleteKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java new file mode 100644 index 00000000000..697c441d6f8 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public GetKeychainEntryRequestV1() { + } + + public GetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to get from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = (GetKeychainEntryRequestV1) o; + return Objects.equals(this.key, getKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryRequestV1 is not found in the empty JSON string", GetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryRequestV1 + */ + public static GetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of GetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java new file mode 100644 index 00000000000..42041c99071 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetKeychainEntryResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public GetKeychainEntryResponseV1() { + } + + public GetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to retrieve the value from the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetKeychainEntryResponseV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value associated with the requested key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetKeychainEntryResponseV1 getKeychainEntryResponseV1 = (GetKeychainEntryResponseV1) o; + return Objects.equals(this.key, getKeychainEntryResponseV1.key) && + Objects.equals(this.value, getKeychainEntryResponseV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetKeychainEntryResponseV1 is not found in the empty JSON string", GetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetKeychainEntryResponseV1 + */ + public static GetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of GetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java new file mode 100644 index 00000000000..25e02ce2899 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryRequestV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public HasKeychainEntryRequestV1() { + } + + public HasKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key to check for presence in the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = (HasKeychainEntryRequestV1) o; + return Objects.equals(this.key, hasKeychainEntryRequestV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryRequestV1 is not found in the empty JSON string", HasKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryRequestV1 + */ + public static HasKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of HasKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java new file mode 100644 index 00000000000..3710edd38f7 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/HasKeychainEntryResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * HasKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HasKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_CHECKED_AT = "checkedAt"; + @SerializedName(SERIALIZED_NAME_CHECKED_AT) + private String checkedAt; + + public static final String SERIALIZED_NAME_IS_PRESENT = "isPresent"; + @SerializedName(SERIALIZED_NAME_IS_PRESENT) + private Boolean isPresent; + + public HasKeychainEntryResponseV1() { + } + + public HasKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to check the presence of the value in the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public HasKeychainEntryResponseV1 checkedAt(String checkedAt) { + + this.checkedAt = checkedAt; + return this; + } + + /** + * Date and time encoded as JSON when the presence check was performed by the plugin backend. + * @return checkedAt + **/ + @javax.annotation.Nonnull + public String getCheckedAt() { + return checkedAt; + } + + + public void setCheckedAt(String checkedAt) { + this.checkedAt = checkedAt; + } + + + public HasKeychainEntryResponseV1 isPresent(Boolean isPresent) { + + this.isPresent = isPresent; + return this; + } + + /** + * The boolean true or false indicating the presence or absence of an entry under 'key'. + * @return isPresent + **/ + @javax.annotation.Nonnull + public Boolean getIsPresent() { + return isPresent; + } + + + public void setIsPresent(Boolean isPresent) { + this.isPresent = isPresent; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasKeychainEntryResponseV1 hasKeychainEntryResponseV1 = (HasKeychainEntryResponseV1) o; + return Objects.equals(this.key, hasKeychainEntryResponseV1.key) && + Objects.equals(this.checkedAt, hasKeychainEntryResponseV1.checkedAt) && + Objects.equals(this.isPresent, hasKeychainEntryResponseV1.isPresent); + } + + @Override + public int hashCode() { + return Objects.hash(key, checkedAt, isPresent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" checkedAt: ").append(toIndentedString(checkedAt)).append("\n"); + sb.append(" isPresent: ").append(toIndentedString(isPresent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("checkedAt"); + openapiFields.add("isPresent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("checkedAt"); + openapiRequiredFields.add("isPresent"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!HasKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HasKeychainEntryResponseV1 is not found in the empty JSON string", HasKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HasKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("checkedAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `checkedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkedAt").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HasKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HasKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HasKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HasKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HasKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HasKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to HasKeychainEntryResponseV1 + */ + public static HasKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of HasKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java new file mode 100644 index 00000000000..2c57c8999ce --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryRequestV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryRequestV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetKeychainEntryRequestV1() { + } + + public SetKeychainEntryRequestV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key for the entry to set on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetKeychainEntryRequestV1 value(String value) { + + this.value = value; + return this; + } + + /** + * The value that will be associated with the key on the keychain. + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = (SetKeychainEntryRequestV1) o; + return Objects.equals(this.key, setKeychainEntryRequestV1.key) && + Objects.equals(this.value, setKeychainEntryRequestV1.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryRequestV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryRequestV1 is not found in the empty JSON string", SetKeychainEntryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryRequestV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryRequestV1 + */ + public static SetKeychainEntryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryRequestV1.class); + } + + /** + * Convert an instance of SetKeychainEntryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java new file mode 100644 index 00000000000..b0cde0e9aa1 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetKeychainEntryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SetKeychainEntryResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetKeychainEntryResponseV1 { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public SetKeychainEntryResponseV1() { + } + + public SetKeychainEntryResponseV1 key(String key) { + + this.key = key; + return this; + } + + /** + * The key that was used to set the value on the keychain. + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetKeychainEntryResponseV1 setKeychainEntryResponseV1 = (SetKeychainEntryResponseV1) o; + return Objects.equals(this.key, setKeychainEntryResponseV1.key); + } + + @Override + public int hashCode() { + return Objects.hash(key); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetKeychainEntryResponseV1 {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetKeychainEntryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetKeychainEntryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetKeychainEntryResponseV1 is not found in the empty JSON string", SetKeychainEntryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetKeychainEntryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetKeychainEntryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetKeychainEntryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetKeychainEntryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetKeychainEntryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetKeychainEntryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetKeychainEntryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetKeychainEntryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetKeychainEntryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetKeychainEntryResponseV1 + * @throws IOException if the JSON string is invalid with respect to SetKeychainEntryResponseV1 + */ + public static SetKeychainEntryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetKeychainEntryResponseV1.class); + } + + /** + * Convert an instance of SetKeychainEntryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..cb70998467c --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,100 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeleteKeychainEntryRequestV1; +import org.openapitools.client.model.DeleteKeychainEntryResponseV1; +import org.openapitools.client.model.GetKeychainEntryRequestV1; +import org.openapitools.client.model.GetKeychainEntryResponseV1; +import org.openapitools.client.model.HasKeychainEntryRequestV1; +import org.openapitools.client.model.HasKeychainEntryResponseV1; +import org.openapitools.client.model.SetKeychainEntryRequestV1; +import org.openapitools.client.model.SetKeychainEntryResponseV1; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deletes an entry from the keychain stored under the provided key. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteKeychainEntryV1Test() throws ApiException { + DeleteKeychainEntryRequestV1 deleteKeychainEntryRequestV1 = null; + DeleteKeychainEntryResponseV1 response = api.deleteKeychainEntryV1(deleteKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Retrieves the contents of a keychain entry from the backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getKeychainEntryV1Test() throws ApiException { + GetKeychainEntryRequestV1 getKeychainEntryRequestV1 = null; + GetKeychainEntryResponseV1 response = api.getKeychainEntryV1(getKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Retrieves the information regarding a key being present on the keychain or not. + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasKeychainEntryV1Test() throws ApiException { + HasKeychainEntryRequestV1 hasKeychainEntryRequestV1 = null; + HasKeychainEntryResponseV1 response = api.hasKeychainEntryV1(hasKeychainEntryRequestV1); + // TODO: test validations + } + + /** + * Sets a value under a key on the keychain backend. + * + * @throws ApiException if the Api call fails + */ + @Test + public void setKeychainEntryV1Test() throws ApiException { + SetKeychainEntryRequestV1 setKeychainEntryRequestV1 = null; + SetKeychainEntryResponseV1 response = api.setKeychainEntryV1(setKeychainEntryRequestV1); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..a0ea09b02b0 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryRequestV1 + */ +public class DeleteKeychainEntryRequestV1Test { + private final DeleteKeychainEntryRequestV1 model = new DeleteKeychainEntryRequestV1(); + + /** + * Model tests for DeleteKeychainEntryRequestV1 + */ + @Test + public void testDeleteKeychainEntryRequestV1() { + // TODO: test DeleteKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..d7a52b6063c --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeleteKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeleteKeychainEntryResponseV1 + */ +public class DeleteKeychainEntryResponseV1Test { + private final DeleteKeychainEntryResponseV1 model = new DeleteKeychainEntryResponseV1(); + + /** + * Model tests for DeleteKeychainEntryResponseV1 + */ + @Test + public void testDeleteKeychainEntryResponseV1() { + // TODO: test DeleteKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..717fa3097a7 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryRequestV1 + */ +public class GetKeychainEntryRequestV1Test { + private final GetKeychainEntryRequestV1 model = new GetKeychainEntryRequestV1(); + + /** + * Model tests for GetKeychainEntryRequestV1 + */ + @Test + public void testGetKeychainEntryRequestV1() { + // TODO: test GetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..b9128dc390b --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetKeychainEntryResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetKeychainEntryResponseV1 + */ +public class GetKeychainEntryResponseV1Test { + private final GetKeychainEntryResponseV1 model = new GetKeychainEntryResponseV1(); + + /** + * Model tests for GetKeychainEntryResponseV1 + */ + @Test + public void testGetKeychainEntryResponseV1() { + // TODO: test GetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..807c27abc5b --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryRequestV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryRequestV1 + */ +public class HasKeychainEntryRequestV1Test { + private final HasKeychainEntryRequestV1 model = new HasKeychainEntryRequestV1(); + + /** + * Model tests for HasKeychainEntryRequestV1 + */ + @Test + public void testHasKeychainEntryRequestV1() { + // TODO: test HasKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..fb5162f240d --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HasKeychainEntryResponseV1Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasKeychainEntryResponseV1 + */ +public class HasKeychainEntryResponseV1Test { + private final HasKeychainEntryResponseV1 model = new HasKeychainEntryResponseV1(); + + /** + * Model tests for HasKeychainEntryResponseV1 + */ + @Test + public void testHasKeychainEntryResponseV1() { + // TODO: test HasKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'checkedAt' + */ + @Test + public void checkedAtTest() { + // TODO: test checkedAt + } + + /** + * Test the property 'isPresent' + */ + @Test + public void isPresentTest() { + // TODO: test isPresent + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java new file mode 100644 index 00000000000..b0ccc68cd6c --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryRequestV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryRequestV1 + */ +public class SetKeychainEntryRequestV1Test { + private final SetKeychainEntryRequestV1 model = new SetKeychainEntryRequestV1(); + + /** + * Model tests for SetKeychainEntryRequestV1 + */ + @Test + public void testSetKeychainEntryRequestV1() { + // TODO: test SetKeychainEntryRequestV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java new file mode 100644 index 00000000000..0543bd17835 --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetKeychainEntryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus - Keychain API + * Contains/describes the Keychain API types/paths for Hyperledger Cactus. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetKeychainEntryResponseV1 + */ +public class SetKeychainEntryResponseV1Test { + private final SetKeychainEntryResponseV1 model = new SetKeychainEntryResponseV1(); + + /** + * Model tests for SetKeychainEntryResponseV1 + */ + @Test + public void testSetKeychainEntryResponseV1() { + // TODO: test SetKeychainEntryResponseV1 + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/package.json b/packages/cactus-plugin-ledger-connector-besu/package.json index 11e461ad2a6..a03d161f57f 100644 --- a/packages/cactus-plugin-ledger-connector-besu/package.json +++ b/packages/cactus-plugin-ledger-connector-besu/package.json @@ -47,6 +47,8 @@ "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..97619d19a59 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,52 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_besu_private_transaction_config.go +model_besu_transaction_config.go +model_besu_transaction_config_to.go +model_consistency_strategy.go +model_deploy_contract_solidity_bytecode_v1_request.go +model_deploy_contract_solidity_bytecode_v1_response.go +model_eth_contract_invocation_type.go +model_evm_block.go +model_evm_log.go +model_evm_transaction.go +model_get_balance_v1_request.go +model_get_balance_v1_response.go +model_get_besu_record_v1_request.go +model_get_besu_record_v1_response.go +model_get_block_v1_request.go +model_get_block_v1_response.go +model_get_past_logs_v1_request.go +model_get_past_logs_v1_response.go +model_get_transaction_v1_request.go +model_get_transaction_v1_response.go +model_invoke_contract_v1_request.go +model_invoke_contract_v1_response.go +model_receipt_type.go +model_run_transaction_request.go +model_run_transaction_response.go +model_sign_transaction_request.go +model_sign_transaction_response.go +model_solidity_contract_json_artifact.go +model_solidity_contract_json_artifact_compiler.go +model_solidity_contract_json_artifact_gas_estimates.go +model_solidity_contract_json_artifact_gas_estimates_creation.go +model_watch_blocks_v1.go +model_watch_blocks_v1_progress.go +model_web3_block_header.go +model_web3_block_header_timestamp.go +model_web3_signing_credential.go +model_web3_signing_credential_cactus_keychain_ref.go +model_web3_signing_credential_none.go +model_web3_signing_credential_private_key_hex.go +model_web3_signing_credential_type.go +model_web3_transaction_receipt.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..54c5ca022cd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,162 @@ +# Go API client for cactus-plugin-ledger-connector-besu + +Can perform basic tasks on a Besu ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-besu "github.com/hyperledger/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-besu.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-besu.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-besu.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-besu.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeployContractSolBytecodeV1**](docs/DefaultApi.md#deploycontractsolbytecodev1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**GetBalanceV1**](docs/DefaultApi.md#getbalancev1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance | Return balance of an address of a given block +*DefaultApi* | [**GetBesuRecordV1**](docs/DefaultApi.md#getbesurecordv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record | Retrieves an arbitrary record (any piece of information) from the ledger. Ledger records can be call outputs, transaction input, etc. +*DefaultApi* | [**GetBlockV1**](docs/DefaultApi.md#getblockv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-block | Returns a block matching the block +*DefaultApi* | [**GetOpenApiSpecV1**](docs/DefaultApi.md#getopenapispecv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-open-api-spec | Retrieves the .json file that contains the OpenAPI specification for the plugin. +*DefaultApi* | [**GetPastLogsV1**](docs/DefaultApi.md#getpastlogsv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs | Gets past logs, matching the given options. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**GetTransactionV1**](docs/DefaultApi.md#gettransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction | Executes a transaction on a besu ledger +*DefaultApi* | [**InvokeContractV1**](docs/DefaultApi.md#invokecontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract | Invokes a contract on a besu ledger +*DefaultApi* | [**RunTransactionV1**](docs/DefaultApi.md#runtransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction | Executes a transaction on a besu ledger +*DefaultApi* | [**SignTransactionV1**](docs/DefaultApi.md#signtransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction | Obtain signatures of ledger from the corresponding transaction hash. + + +## Documentation For Models + + - [BesuPrivateTransactionConfig](docs/BesuPrivateTransactionConfig.md) + - [BesuTransactionConfig](docs/BesuTransactionConfig.md) + - [BesuTransactionConfigTo](docs/BesuTransactionConfigTo.md) + - [ConsistencyStrategy](docs/ConsistencyStrategy.md) + - [DeployContractSolidityBytecodeV1Request](docs/DeployContractSolidityBytecodeV1Request.md) + - [DeployContractSolidityBytecodeV1Response](docs/DeployContractSolidityBytecodeV1Response.md) + - [EthContractInvocationType](docs/EthContractInvocationType.md) + - [EvmBlock](docs/EvmBlock.md) + - [EvmLog](docs/EvmLog.md) + - [EvmTransaction](docs/EvmTransaction.md) + - [GetBalanceV1Request](docs/GetBalanceV1Request.md) + - [GetBalanceV1Response](docs/GetBalanceV1Response.md) + - [GetBesuRecordV1Request](docs/GetBesuRecordV1Request.md) + - [GetBesuRecordV1Response](docs/GetBesuRecordV1Response.md) + - [GetBlockV1Request](docs/GetBlockV1Request.md) + - [GetBlockV1Response](docs/GetBlockV1Response.md) + - [GetPastLogsV1Request](docs/GetPastLogsV1Request.md) + - [GetPastLogsV1Response](docs/GetPastLogsV1Response.md) + - [GetTransactionV1Request](docs/GetTransactionV1Request.md) + - [GetTransactionV1Response](docs/GetTransactionV1Response.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [ReceiptType](docs/ReceiptType.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [SignTransactionRequest](docs/SignTransactionRequest.md) + - [SignTransactionResponse](docs/SignTransactionResponse.md) + - [SolidityContractJsonArtifact](docs/SolidityContractJsonArtifact.md) + - [SolidityContractJsonArtifactCompiler](docs/SolidityContractJsonArtifactCompiler.md) + - [SolidityContractJsonArtifactGasEstimates](docs/SolidityContractJsonArtifactGasEstimates.md) + - [SolidityContractJsonArtifactGasEstimatesCreation](docs/SolidityContractJsonArtifactGasEstimatesCreation.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WatchBlocksV1Progress](docs/WatchBlocksV1Progress.md) + - [Web3BlockHeader](docs/Web3BlockHeader.md) + - [Web3BlockHeaderTimestamp](docs/Web3BlockHeaderTimestamp.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..36af3f61d51 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,1228 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Besu ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Besu + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-open-api-spec: + get: + operationId: getOpenApiSpecV1 + parameters: [] + responses: + "200": + content: + application/json: + schema: + type: string + description: OK + summary: Retrieves the .json file that contains the OpenAPI specification for + the plugin. + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-open-api-spec + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode: + post: + operationId: deployContractSolBytecodeV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance: + post: + operationId: getBalanceV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetBalanceV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetBalanceV1Response' + description: OK + summary: Return balance of an address of a given block + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-block: + post: + operationId: getBlockV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetBlockV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetBlockV1Response' + description: OK + summary: Returns a block matching the block + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-block + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + summary: Executes a transaction on a besu ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction: + post: + operationId: getTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetTransactionV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetTransactionV1Response' + description: OK + summary: Executes a transaction on a besu ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs: + post: + operationId: getPastLogsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetPastLogsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetPastLogsV1Response' + description: OK + summary: "Gets past logs, matching the given options." + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a besu ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction: + post: + description: Obtain signatures of ledger from the corresponding transaction + hash. + operationId: signTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SignTransactionRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SignTransactionResponse' + description: OK + "404": + description: Not able to find the corresponding tranaction from the transaction + hash + summary: Obtain signatures of ledger from the corresponding transaction hash. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record: + post: + operationId: getBesuRecordV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetBesuRecordV1Request' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/GetBesuRecordV1Response' + description: OK + summary: "Retrieves an arbitrary record (any piece of information) from the\ + \ ledger. Ledger records can be call outputs, transaction input, etc." + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record +components: + schemas: + GetBalanceV1Response: + example: + balance: balance + properties: + balance: + type: string + required: + - balance + type: object + GetBalanceV1Request: + additionalProperties: false + example: + address: address + defaultBlock: "" + properties: + address: + type: string + defaultBlock: {} + required: + - address + type: object + EvmBlock: + example: + logsBloom: logsBloom + totalDifficulty: 1.4658129805029452 + extraData: extraData + transactions: + - "" + - "" + nonce: nonce + miner: miner + difficulty: 6.027456183070403 + number: 0.8008281904610115 + gasLimit: 5.637376656633329 + gasUsed: 2.3021358869347655 + uncles: + - "" + - "" + sha3Uncles: sha3Uncles + size: 5.962133916683182 + transactionsRoot: transactionsRoot + stateRoot: stateRoot + parentHash: parentHash + hash: hash + timestamp: "" + properties: + number: + type: number + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionsRoot: + type: string + stateRoot: + type: string + miner: + type: string + difficulty: + type: number + totalDifficulty: + type: number + extraData: + type: string + size: + type: number + gasLimit: + type: number + gasUsed: + type: number + timestamp: {} + transactions: + items: {} + type: array + uncles: + items: {} + type: array + type: object + GetBlockV1Response: + example: + block: + logsBloom: logsBloom + totalDifficulty: 1.4658129805029452 + extraData: extraData + transactions: + - "" + - "" + nonce: nonce + miner: miner + difficulty: 6.027456183070403 + number: 0.8008281904610115 + gasLimit: 5.637376656633329 + gasUsed: 2.3021358869347655 + uncles: + - "" + - "" + sha3Uncles: sha3Uncles + size: 5.962133916683182 + transactionsRoot: transactionsRoot + stateRoot: stateRoot + parentHash: parentHash + hash: hash + timestamp: "" + properties: + block: + $ref: '#/components/schemas/EvmBlock' + required: + - block + type: object + EvmTransaction: + example: + blockHash: "" + input: input + blockNumber: "" + gas: 6.027456183070403 + transactionIndex: "" + from: from + to: "" + nonce: 0.8008281904610115 + value: value + hash: hash + gasPrice: gasPrice + properties: + hash: + type: string + nonce: + type: number + blockHash: {} + blockNumber: {} + transactionIndex: {} + from: + type: string + to: {} + value: + type: string + gasPrice: + type: string + gas: + type: number + input: + type: string + type: object + GetTransactionV1Response: + example: + transaction: + blockHash: "" + input: input + blockNumber: "" + gas: 6.027456183070403 + transactionIndex: "" + from: from + to: "" + nonce: 0.8008281904610115 + value: value + hash: hash + gasPrice: gasPrice + properties: + transaction: + $ref: '#/components/schemas/EvmTransaction' + required: + - transaction + type: object + GetTransactionV1Request: + additionalProperties: false + example: + transactionHash: transactionHash + properties: + transactionHash: + type: string + required: + - transactionHash + type: object + GetPastLogsV1Response: + example: + logs: + - blockHash: blockHash + address: address + logIndex: 0.8008281904610115 + data: data + topics: + - topics + - topics + blockNumber: 1.4658129805029452 + transactionIndex: 6.027456183070403 + transactionHash: transactionHash + - blockHash: blockHash + address: address + logIndex: 0.8008281904610115 + data: data + topics: + - topics + - topics + blockNumber: 1.4658129805029452 + transactionIndex: 6.027456183070403 + transactionHash: transactionHash + properties: + logs: + items: + $ref: '#/components/schemas/EvmLog' + type: array + required: + - logs + type: object + GetPastLogsV1Request: + additionalProperties: false + example: + fromBlock: "" + toBlock: "" + address: "" + topics: + - "" + - "" + properties: + toBlock: {} + fromBlock: {} + address: {} + topics: + items: {} + type: array + type: object + EvmLog: + example: + blockHash: blockHash + address: address + logIndex: 0.8008281904610115 + data: data + topics: + - topics + - topics + blockNumber: 1.4658129805029452 + transactionIndex: 6.027456183070403 + transactionHash: transactionHash + properties: + address: + type: string + data: + type: string + blockHash: + type: string + transactionHash: + type: string + topics: + items: + type: string + type: array + logIndex: + type: number + transactionIndex: + type: number + blockNumber: + type: number + required: + - address + - blockHash + - blockNumber + - data + - logIndex + - topics + - transactionHash + - transactionIndex + type: object + GetBlockV1Request: + additionalProperties: false + example: + blockHashOrBlockNumber: "" + properties: + blockHashOrBlockNumber: {} + required: + - blockHashOrBlockNumber + type: object + WatchBlocksV1: + enum: + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + Web3BlockHeader: + properties: + number: + type: number + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionRoot: + type: string + stateRoot: + type: string + receiptRoot: + type: string + miner: + type: string + extraData: + type: string + gasLimit: + type: integer + gasUsed: + type: integer + timestamp: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + required: + - extraData + - gasLimit + - gasUsed + - hash + - logsBloom + - miner + - nonce + - number + - parentHash + - receiptRoot + - sha3Uncles + - stateRoot + - timestamp + - transactionRoot + type: object + WatchBlocksV1Progress: + properties: + blockHeader: + $ref: '#/components/schemas/Web3BlockHeader' + required: + - blockHeader + type: object + ReceiptType: + description: Enumerates the possible types of receipts that can be waited for + by someone or something that has requested the execution of a transaction + on a ledger. + enum: + - NODE_TX_POOL_ACK + - LEDGER_BLOCK_ACK + type: string + ConsistencyStrategy: + example: + blockConfirmations: 2931 + receiptType: null + timeoutMs: 0 + properties: + receiptType: + $ref: '#/components/schemas/ReceiptType' + timeoutMs: + description: "The amount of milliseconds to wait for the receipt to arrive\ + \ to the connector. Defaults to 0 which means to wait for an unlimited\ + \ amount of time. Note that this wait may be interrupted still by other\ + \ parts of the infrastructure such as load balancers cutting of HTTP requests\ + \ after some time even if they are the type that is supposed to be kept\ + \ alive. The question of re-entrance is a broader topic not in scope to\ + \ discuss here, but it is important to mention it." + minimum: 0 + type: integer + blockConfirmations: + description: "The number of blocks to wait to be confirmed in addition to\ + \ the block containing the transaction in question. Note that if the receipt\ + \ type is set to only wait for node transaction pool ACK and this parameter\ + \ is set to anything, but zero then the API will not accept the request\ + \ due to conflicting parameters." + maximum: 20000 + minimum: 0 + type: integer + required: + - blockConfirmations + - receiptType + type: object + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + EthContractInvocationType: + enum: + - SEND + - CALL + type: string + SolidityContractJsonArtifact: + properties: + contractName: + nullable: false + type: string + metadata: + nullable: false + type: string + bytecode: + nullable: false + type: string + deployedBytecode: + nullable: false + type: string + sourceMap: + nullable: false + type: string + deployedSourceMap: + nullable: false + type: string + sourcePath: + type: string + compiler: + $ref: '#/components/schemas/SolidityContractJsonArtifact_compiler' + functionHashes: + additionalProperties: true + type: object + gasEstimates: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates' + required: + - contractName + type: object + BesuTransactionConfig: + additionalProperties: true + example: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + rawTransaction: + nullable: false + type: string + from: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + to: + $ref: '#/components/schemas/BesuTransactionConfig_to' + value: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + gas: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + gasPrice: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + nonce: + type: number + data: + $ref: '#/components/schemas/BesuTransactionConfig_to' + type: object + BesuPrivateTransactionConfig: + example: + privateFrom: privateFrom + privateFor: + - "" + - "" + properties: + privateFrom: + nullable: false + type: string + privateFor: + default: [] + items: {} + nullable: false + type: array + required: + - privateFor + - privateFrom + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + RunTransactionRequest: + additionalProperties: false + example: + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + transactionConfig: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + consistencyStrategy: + blockConfirmations: 2931 + receiptType: null + timeoutMs: 0 + web3SigningCredential: + type: null + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + transactionConfig: + $ref: '#/components/schemas/BesuTransactionConfig' + consistencyStrategy: + $ref: '#/components/schemas/ConsistencyStrategy' + privateTransactionConfig: + $ref: '#/components/schemas/BesuPrivateTransactionConfig' + required: + - consistencyStrategy + - transactionConfig + - web3SigningCredential + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractSolidityBytecodeV1Request: + additionalProperties: false + example: + bytecode: bytecode + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + keychainId: keychainId + constructorArgs: + - "" + - "" + timeoutMs: 0.6027456183070403 + contractAbi: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + contractName: contractName + gasPrice: gasPrice + properties: + contractName: + description: The contract name for retrieve the contracts json on the keychain. + maxLength: 100 + minLength: 1 + nullable: false + type: string + contractAbi: + description: The application binary interface of the solidity contract + items: {} + nullable: false + type: array + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: string + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + privateTransactionConfig: + $ref: '#/components/schemas/BesuPrivateTransactionConfig' + required: + - bytecode + - constructorArgs + - contractAbi + - contractName + - keychainId + - web3SigningCredential + type: object + DeployContractSolidityBytecodeV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + InvokeContractV1Request: + additionalProperties: false + example: + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + nonce: 0.8008281904610115 + invocationType: null + keychainId: keychainId + timeoutMs: 0.6027456183070403 + contractAbi: + - "" + - "" + gas: null + contractName: contractName + value: null + signingCredential: + type: null + gasPrice: null + properties: + contractName: + nullable: false + type: string + signingCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + contractAbi: + description: "The application binary interface of the solidity contract,\ + \ optional parameter" + items: {} + nullable: false + type: array + contractAddress: + description: "Address of the solidity contract, optional parameter" + nullable: false + type: string + value: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + gas: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + gasPrice: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + type: string + privateTransactionConfig: + $ref: '#/components/schemas/BesuPrivateTransactionConfig' + required: + - contractName + - invocationType + - methodName + - params + - signingCredential + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + SignTransactionRequest: + additionalProperties: false + example: + keychainId: keychainId + keychainRef: keychainRef + transactionHash: transactionHash + properties: + keychainId: + maxLength: 100 + minLength: 1 + nullable: false + type: string + keychainRef: + maxLength: 100 + minLength: 1 + nullable: false + type: string + transactionHash: + description: The transaction hash of ledger will be used to fetch the contain. + maxLength: 2048 + minLength: 0 + nullable: false + type: string + required: + - keychainId + - keychainRef + - transactionHash + type: object + SignTransactionResponse: + example: + signature: signature + properties: + signature: + description: The signatures of ledger from the corresponding transaction + hash. + maxLength: 2048 + minLength: 0 + nullable: false + type: string + required: + - signature + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetBesuRecordV1Request: + additionalProperties: false + example: + invokeCall: + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + nonce: 0.8008281904610115 + invocationType: null + keychainId: keychainId + timeoutMs: 0.6027456183070403 + contractAbi: + - "" + - "" + gas: null + contractName: contractName + value: null + signingCredential: + type: null + gasPrice: null + transactionHash: transactionHash + properties: + invokeCall: + $ref: '#/components/schemas/InvokeContractV1Request' + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + type: object + GetBesuRecordV1Response: + properties: + ledgerId: + type: string + stateContract: + type: string + transactionInputData: {} + callOutput: {} + type: object + Web3BlockHeader_timestamp: + oneOf: + - type: string + - type: number + SolidityContractJsonArtifact_compiler: + additionalProperties: true + properties: + name: + type: string + version: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates_creation: + properties: + codeDepositCost: + type: string + executionCost: + type: string + totalCost: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates: + properties: + creation: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates_creation' + external: + additionalProperties: true + type: object + BesuTransactionConfig_to: + oneOf: + - type: string diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..997df0bf8ba --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,1167 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeployContractSolBytecodeV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractSolidityBytecodeV1Request *DeployContractSolidityBytecodeV1Request +} + +func (r ApiDeployContractSolBytecodeV1Request) DeployContractSolidityBytecodeV1Request(deployContractSolidityBytecodeV1Request DeployContractSolidityBytecodeV1Request) ApiDeployContractSolBytecodeV1Request { + r.deployContractSolidityBytecodeV1Request = &deployContractSolidityBytecodeV1Request + return r +} + +func (r ApiDeployContractSolBytecodeV1Request) Execute() (*DeployContractSolidityBytecodeV1Response, *http.Response, error) { + return r.ApiService.DeployContractSolBytecodeV1Execute(r) +} + +/* +DeployContractSolBytecodeV1 Deploys the bytecode of a Solidity contract. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractSolBytecodeV1Request +*/ +func (a *DefaultApiService) DeployContractSolBytecodeV1(ctx context.Context) ApiDeployContractSolBytecodeV1Request { + return ApiDeployContractSolBytecodeV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractSolidityBytecodeV1Response +func (a *DefaultApiService) DeployContractSolBytecodeV1Execute(r ApiDeployContractSolBytecodeV1Request) (*DeployContractSolidityBytecodeV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractSolidityBytecodeV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractSolBytecodeV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractSolidityBytecodeV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetBalanceV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getBalanceV1Request *GetBalanceV1Request +} + +func (r ApiGetBalanceV1Request) GetBalanceV1Request(getBalanceV1Request GetBalanceV1Request) ApiGetBalanceV1Request { + r.getBalanceV1Request = &getBalanceV1Request + return r +} + +func (r ApiGetBalanceV1Request) Execute() (*GetBalanceV1Response, *http.Response, error) { + return r.ApiService.GetBalanceV1Execute(r) +} + +/* +GetBalanceV1 Return balance of an address of a given block + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetBalanceV1Request +*/ +func (a *DefaultApiService) GetBalanceV1(ctx context.Context) ApiGetBalanceV1Request { + return ApiGetBalanceV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetBalanceV1Response +func (a *DefaultApiService) GetBalanceV1Execute(r ApiGetBalanceV1Request) (*GetBalanceV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBalanceV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBalanceV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getBalanceV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetBesuRecordV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getBesuRecordV1Request *GetBesuRecordV1Request +} + +func (r ApiGetBesuRecordV1Request) GetBesuRecordV1Request(getBesuRecordV1Request GetBesuRecordV1Request) ApiGetBesuRecordV1Request { + r.getBesuRecordV1Request = &getBesuRecordV1Request + return r +} + +func (r ApiGetBesuRecordV1Request) Execute() (*GetBesuRecordV1Response, *http.Response, error) { + return r.ApiService.GetBesuRecordV1Execute(r) +} + +/* +GetBesuRecordV1 Retrieves an arbitrary record (any piece of information) from the ledger. Ledger records can be call outputs, transaction input, etc. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetBesuRecordV1Request +*/ +func (a *DefaultApiService) GetBesuRecordV1(ctx context.Context) ApiGetBesuRecordV1Request { + return ApiGetBesuRecordV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetBesuRecordV1Response +func (a *DefaultApiService) GetBesuRecordV1Execute(r ApiGetBesuRecordV1Request) (*GetBesuRecordV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBesuRecordV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBesuRecordV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getBesuRecordV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetBlockV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getBlockV1Request *GetBlockV1Request +} + +func (r ApiGetBlockV1Request) GetBlockV1Request(getBlockV1Request GetBlockV1Request) ApiGetBlockV1Request { + r.getBlockV1Request = &getBlockV1Request + return r +} + +func (r ApiGetBlockV1Request) Execute() (*GetBlockV1Response, *http.Response, error) { + return r.ApiService.GetBlockV1Execute(r) +} + +/* +GetBlockV1 Returns a block matching the block + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetBlockV1Request +*/ +func (a *DefaultApiService) GetBlockV1(ctx context.Context) ApiGetBlockV1Request { + return ApiGetBlockV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetBlockV1Response +func (a *DefaultApiService) GetBlockV1Execute(r ApiGetBlockV1Request) (*GetBlockV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBlockV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBlockV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-block" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getBlockV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetOpenApiSpecV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetOpenApiSpecV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetOpenApiSpecV1Execute(r) +} + +/* +GetOpenApiSpecV1 Retrieves the .json file that contains the OpenAPI specification for the plugin. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetOpenApiSpecV1Request +*/ +func (a *DefaultApiService) GetOpenApiSpecV1(ctx context.Context) ApiGetOpenApiSpecV1Request { + return ApiGetOpenApiSpecV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetOpenApiSpecV1Execute(r ApiGetOpenApiSpecV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetOpenApiSpecV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-open-api-spec" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPastLogsV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getPastLogsV1Request *GetPastLogsV1Request +} + +func (r ApiGetPastLogsV1Request) GetPastLogsV1Request(getPastLogsV1Request GetPastLogsV1Request) ApiGetPastLogsV1Request { + r.getPastLogsV1Request = &getPastLogsV1Request + return r +} + +func (r ApiGetPastLogsV1Request) Execute() (*GetPastLogsV1Response, *http.Response, error) { + return r.ApiService.GetPastLogsV1Execute(r) +} + +/* +GetPastLogsV1 Gets past logs, matching the given options. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPastLogsV1Request +*/ +func (a *DefaultApiService) GetPastLogsV1(ctx context.Context) ApiGetPastLogsV1Request { + return ApiGetPastLogsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetPastLogsV1Response +func (a *DefaultApiService) GetPastLogsV1Execute(r ApiGetPastLogsV1Request) (*GetPastLogsV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetPastLogsV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPastLogsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getPastLogsV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getTransactionV1Request *GetTransactionV1Request +} + +func (r ApiGetTransactionV1Request) GetTransactionV1Request(getTransactionV1Request GetTransactionV1Request) ApiGetTransactionV1Request { + r.getTransactionV1Request = &getTransactionV1Request + return r +} + +func (r ApiGetTransactionV1Request) Execute() (*GetTransactionV1Response, *http.Response, error) { + return r.ApiService.GetTransactionV1Execute(r) +} + +/* +GetTransactionV1 Executes a transaction on a besu ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetTransactionV1Request +*/ +func (a *DefaultApiService) GetTransactionV1(ctx context.Context) ApiGetTransactionV1Request { + return ApiGetTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetTransactionV1Response +func (a *DefaultApiService) GetTransactionV1Execute(r ApiGetTransactionV1Request) (*GetTransactionV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetTransactionV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getTransactionV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + invokeContractV1Request *InvokeContractV1Request +} + +func (r ApiInvokeContractV1Request) InvokeContractV1Request(invokeContractV1Request InvokeContractV1Request) ApiInvokeContractV1Request { + r.invokeContractV1Request = &invokeContractV1Request + return r +} + +func (r ApiInvokeContractV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.InvokeContractV1Execute(r) +} + +/* +InvokeContractV1 Invokes a contract on a besu ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeContractV1Request +*/ +func (a *DefaultApiService) InvokeContractV1(ctx context.Context) ApiInvokeContractV1Request { + return ApiInvokeContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) InvokeContractV1Execute(r ApiInvokeContractV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRunTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + runTransactionRequest *RunTransactionRequest +} + +func (r ApiRunTransactionV1Request) RunTransactionRequest(runTransactionRequest RunTransactionRequest) ApiRunTransactionV1Request { + r.runTransactionRequest = &runTransactionRequest + return r +} + +func (r ApiRunTransactionV1Request) Execute() (*RunTransactionResponse, *http.Response, error) { + return r.ApiService.RunTransactionV1Execute(r) +} + +/* +RunTransactionV1 Executes a transaction on a besu ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRunTransactionV1Request +*/ +func (a *DefaultApiService) RunTransactionV1(ctx context.Context) ApiRunTransactionV1Request { + return ApiRunTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionResponse +func (a *DefaultApiService) RunTransactionV1Execute(r ApiRunTransactionV1Request) (*RunTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RunTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.runTransactionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSignTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + signTransactionRequest *SignTransactionRequest +} + +func (r ApiSignTransactionV1Request) SignTransactionRequest(signTransactionRequest SignTransactionRequest) ApiSignTransactionV1Request { + r.signTransactionRequest = &signTransactionRequest + return r +} + +func (r ApiSignTransactionV1Request) Execute() (*SignTransactionResponse, *http.Response, error) { + return r.ApiService.SignTransactionV1Execute(r) +} + +/* +SignTransactionV1 Obtain signatures of ledger from the corresponding transaction hash. + +Obtain signatures of ledger from the corresponding transaction hash. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSignTransactionV1Request +*/ +func (a *DefaultApiService) SignTransactionV1(ctx context.Context) ApiSignTransactionV1Request { + return ApiSignTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SignTransactionResponse +func (a *DefaultApiService) SignTransactionV1Execute(r ApiSignTransactionV1Request) (*SignTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SignTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SignTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.signTransactionRequest == nil { + return localVarReturnValue, nil, reportError("signTransactionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.signTransactionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..49c08cba0b6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Connector Besu API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..8c2917f44d5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..9ed243b897a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_private_transaction_config.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_private_transaction_config.go new file mode 100644 index 00000000000..9271d96eb74 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_private_transaction_config.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the BesuPrivateTransactionConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BesuPrivateTransactionConfig{} + +// BesuPrivateTransactionConfig struct for BesuPrivateTransactionConfig +type BesuPrivateTransactionConfig struct { + PrivateFrom string `json:"privateFrom"` + PrivateFor []interface{} `json:"privateFor"` +} + +// NewBesuPrivateTransactionConfig instantiates a new BesuPrivateTransactionConfig 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 +// will change when the set of required properties is changed +func NewBesuPrivateTransactionConfig(privateFrom string, privateFor []interface{}) *BesuPrivateTransactionConfig { + this := BesuPrivateTransactionConfig{} + this.PrivateFrom = privateFrom + this.PrivateFor = privateFor + return &this +} + +// NewBesuPrivateTransactionConfigWithDefaults instantiates a new BesuPrivateTransactionConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBesuPrivateTransactionConfigWithDefaults() *BesuPrivateTransactionConfig { + this := BesuPrivateTransactionConfig{} + return &this +} + +// GetPrivateFrom returns the PrivateFrom field value +func (o *BesuPrivateTransactionConfig) GetPrivateFrom() string { + if o == nil { + var ret string + return ret + } + + return o.PrivateFrom +} + +// GetPrivateFromOk returns a tuple with the PrivateFrom field value +// and a boolean to check if the value has been set. +func (o *BesuPrivateTransactionConfig) GetPrivateFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PrivateFrom, true +} + +// SetPrivateFrom sets field value +func (o *BesuPrivateTransactionConfig) SetPrivateFrom(v string) { + o.PrivateFrom = v +} + +// GetPrivateFor returns the PrivateFor field value +func (o *BesuPrivateTransactionConfig) GetPrivateFor() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.PrivateFor +} + +// GetPrivateForOk returns a tuple with the PrivateFor field value +// and a boolean to check if the value has been set. +func (o *BesuPrivateTransactionConfig) GetPrivateForOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.PrivateFor, true +} + +// SetPrivateFor sets field value +func (o *BesuPrivateTransactionConfig) SetPrivateFor(v []interface{}) { + o.PrivateFor = v +} + +func (o BesuPrivateTransactionConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BesuPrivateTransactionConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["privateFrom"] = o.PrivateFrom + toSerialize["privateFor"] = o.PrivateFor + return toSerialize, nil +} + +type NullableBesuPrivateTransactionConfig struct { + value *BesuPrivateTransactionConfig + isSet bool +} + +func (v NullableBesuPrivateTransactionConfig) Get() *BesuPrivateTransactionConfig { + return v.value +} + +func (v *NullableBesuPrivateTransactionConfig) Set(val *BesuPrivateTransactionConfig) { + v.value = val + v.isSet = true +} + +func (v NullableBesuPrivateTransactionConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableBesuPrivateTransactionConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBesuPrivateTransactionConfig(val *BesuPrivateTransactionConfig) *NullableBesuPrivateTransactionConfig { + return &NullableBesuPrivateTransactionConfig{value: val, isSet: true} +} + +func (v NullableBesuPrivateTransactionConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBesuPrivateTransactionConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_transaction_config.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_transaction_config.go new file mode 100644 index 00000000000..1fcc9ae2e45 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_transaction_config.go @@ -0,0 +1,410 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the BesuTransactionConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BesuTransactionConfig{} + +// BesuTransactionConfig struct for BesuTransactionConfig +type BesuTransactionConfig struct { + RawTransaction *string `json:"rawTransaction,omitempty"` + From *Web3BlockHeaderTimestamp `json:"from,omitempty"` + To *BesuTransactionConfigTo `json:"to,omitempty"` + Value *Web3BlockHeaderTimestamp `json:"value,omitempty"` + Gas *Web3BlockHeaderTimestamp `json:"gas,omitempty"` + GasPrice *Web3BlockHeaderTimestamp `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + Data *BesuTransactionConfigTo `json:"data,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BesuTransactionConfig BesuTransactionConfig + +// NewBesuTransactionConfig instantiates a new BesuTransactionConfig 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 +// will change when the set of required properties is changed +func NewBesuTransactionConfig() *BesuTransactionConfig { + this := BesuTransactionConfig{} + return &this +} + +// NewBesuTransactionConfigWithDefaults instantiates a new BesuTransactionConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBesuTransactionConfigWithDefaults() *BesuTransactionConfig { + this := BesuTransactionConfig{} + return &this +} + +// GetRawTransaction returns the RawTransaction field value if set, zero value otherwise. +func (o *BesuTransactionConfig) GetRawTransaction() string { + if o == nil || IsNil(o.RawTransaction) { + var ret string + return ret + } + return *o.RawTransaction +} + +// GetRawTransactionOk returns a tuple with the RawTransaction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BesuTransactionConfig) GetRawTransactionOk() (*string, bool) { + if o == nil || IsNil(o.RawTransaction) { + return nil, false + } + return o.RawTransaction, true +} + +// HasRawTransaction returns a boolean if a field has been set. +func (o *BesuTransactionConfig) HasRawTransaction() bool { + if o != nil && !IsNil(o.RawTransaction) { + return true + } + + return false +} + +// SetRawTransaction gets a reference to the given string and assigns it to the RawTransaction field. +func (o *BesuTransactionConfig) SetRawTransaction(v string) { + o.RawTransaction = &v +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *BesuTransactionConfig) GetFrom() Web3BlockHeaderTimestamp { + if o == nil || IsNil(o.From) { + var ret Web3BlockHeaderTimestamp + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BesuTransactionConfig) GetFromOk() (*Web3BlockHeaderTimestamp, bool) { + if o == nil || IsNil(o.From) { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *BesuTransactionConfig) HasFrom() bool { + if o != nil && !IsNil(o.From) { + return true + } + + return false +} + +// SetFrom gets a reference to the given Web3BlockHeaderTimestamp and assigns it to the From field. +func (o *BesuTransactionConfig) SetFrom(v Web3BlockHeaderTimestamp) { + o.From = &v +} + +// GetTo returns the To field value if set, zero value otherwise. +func (o *BesuTransactionConfig) GetTo() BesuTransactionConfigTo { + if o == nil || IsNil(o.To) { + var ret BesuTransactionConfigTo + return ret + } + return *o.To +} + +// GetToOk returns a tuple with the To field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BesuTransactionConfig) GetToOk() (*BesuTransactionConfigTo, bool) { + if o == nil || IsNil(o.To) { + return nil, false + } + return o.To, true +} + +// HasTo returns a boolean if a field has been set. +func (o *BesuTransactionConfig) HasTo() bool { + if o != nil && !IsNil(o.To) { + return true + } + + return false +} + +// SetTo gets a reference to the given BesuTransactionConfigTo and assigns it to the To field. +func (o *BesuTransactionConfig) SetTo(v BesuTransactionConfigTo) { + o.To = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *BesuTransactionConfig) GetValue() Web3BlockHeaderTimestamp { + if o == nil || IsNil(o.Value) { + var ret Web3BlockHeaderTimestamp + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BesuTransactionConfig) GetValueOk() (*Web3BlockHeaderTimestamp, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *BesuTransactionConfig) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given Web3BlockHeaderTimestamp and assigns it to the Value field. +func (o *BesuTransactionConfig) SetValue(v Web3BlockHeaderTimestamp) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *BesuTransactionConfig) GetGas() Web3BlockHeaderTimestamp { + if o == nil || IsNil(o.Gas) { + var ret Web3BlockHeaderTimestamp + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BesuTransactionConfig) GetGasOk() (*Web3BlockHeaderTimestamp, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *BesuTransactionConfig) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given Web3BlockHeaderTimestamp and assigns it to the Gas field. +func (o *BesuTransactionConfig) SetGas(v Web3BlockHeaderTimestamp) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *BesuTransactionConfig) GetGasPrice() Web3BlockHeaderTimestamp { + if o == nil || IsNil(o.GasPrice) { + var ret Web3BlockHeaderTimestamp + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BesuTransactionConfig) GetGasPriceOk() (*Web3BlockHeaderTimestamp, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *BesuTransactionConfig) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given Web3BlockHeaderTimestamp and assigns it to the GasPrice field. +func (o *BesuTransactionConfig) SetGasPrice(v Web3BlockHeaderTimestamp) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *BesuTransactionConfig) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BesuTransactionConfig) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *BesuTransactionConfig) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *BesuTransactionConfig) SetNonce(v float32) { + o.Nonce = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *BesuTransactionConfig) GetData() BesuTransactionConfigTo { + if o == nil || IsNil(o.Data) { + var ret BesuTransactionConfigTo + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BesuTransactionConfig) GetDataOk() (*BesuTransactionConfigTo, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *BesuTransactionConfig) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given BesuTransactionConfigTo and assigns it to the Data field. +func (o *BesuTransactionConfig) SetData(v BesuTransactionConfigTo) { + o.Data = &v +} + +func (o BesuTransactionConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BesuTransactionConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RawTransaction) { + toSerialize["rawTransaction"] = o.RawTransaction + } + if !IsNil(o.From) { + toSerialize["from"] = o.From + } + if !IsNil(o.To) { + toSerialize["to"] = o.To + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BesuTransactionConfig) UnmarshalJSON(bytes []byte) (err error) { + varBesuTransactionConfig := _BesuTransactionConfig{} + + if err = json.Unmarshal(bytes, &varBesuTransactionConfig); err == nil { + *o = BesuTransactionConfig(varBesuTransactionConfig) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "rawTransaction") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + delete(additionalProperties, "value") + delete(additionalProperties, "gas") + delete(additionalProperties, "gasPrice") + delete(additionalProperties, "nonce") + delete(additionalProperties, "data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBesuTransactionConfig struct { + value *BesuTransactionConfig + isSet bool +} + +func (v NullableBesuTransactionConfig) Get() *BesuTransactionConfig { + return v.value +} + +func (v *NullableBesuTransactionConfig) Set(val *BesuTransactionConfig) { + v.value = val + v.isSet = true +} + +func (v NullableBesuTransactionConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableBesuTransactionConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBesuTransactionConfig(val *BesuTransactionConfig) *NullableBesuTransactionConfig { + return &NullableBesuTransactionConfig{value: val, isSet: true} +} + +func (v NullableBesuTransactionConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBesuTransactionConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_transaction_config_to.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_transaction_config_to.go new file mode 100644 index 00000000000..0cd08280d1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_besu_transaction_config_to.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" + "fmt" +) + +// BesuTransactionConfigTo - struct for BesuTransactionConfigTo +type BesuTransactionConfigTo struct { + String *string +} + +// stringAsBesuTransactionConfigTo is a convenience function that returns string wrapped in BesuTransactionConfigTo +func StringAsBesuTransactionConfigTo(v *string) BesuTransactionConfigTo { + return BesuTransactionConfigTo{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *BesuTransactionConfigTo) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(BesuTransactionConfigTo)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(BesuTransactionConfigTo)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src BesuTransactionConfigTo) MarshalJSON() ([]byte, error) { + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *BesuTransactionConfigTo) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableBesuTransactionConfigTo struct { + value *BesuTransactionConfigTo + isSet bool +} + +func (v NullableBesuTransactionConfigTo) Get() *BesuTransactionConfigTo { + return v.value +} + +func (v *NullableBesuTransactionConfigTo) Set(val *BesuTransactionConfigTo) { + v.value = val + v.isSet = true +} + +func (v NullableBesuTransactionConfigTo) IsSet() bool { + return v.isSet +} + +func (v *NullableBesuTransactionConfigTo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBesuTransactionConfigTo(val *BesuTransactionConfigTo) *NullableBesuTransactionConfigTo { + return &NullableBesuTransactionConfigTo{value: val, isSet: true} +} + +func (v NullableBesuTransactionConfigTo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBesuTransactionConfigTo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_consistency_strategy.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_consistency_strategy.go new file mode 100644 index 00000000000..942cd8711eb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_consistency_strategy.go @@ -0,0 +1,182 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the ConsistencyStrategy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsistencyStrategy{} + +// ConsistencyStrategy struct for ConsistencyStrategy +type ConsistencyStrategy struct { + ReceiptType ReceiptType `json:"receiptType"` + // The amount of milliseconds to wait for the receipt to arrive to the connector. Defaults to 0 which means to wait for an unlimited amount of time. Note that this wait may be interrupted still by other parts of the infrastructure such as load balancers cutting of HTTP requests after some time even if they are the type that is supposed to be kept alive. The question of re-entrance is a broader topic not in scope to discuss here, but it is important to mention it. + TimeoutMs *int32 `json:"timeoutMs,omitempty"` + // The number of blocks to wait to be confirmed in addition to the block containing the transaction in question. Note that if the receipt type is set to only wait for node transaction pool ACK and this parameter is set to anything, but zero then the API will not accept the request due to conflicting parameters. + BlockConfirmations int32 `json:"blockConfirmations"` +} + +// NewConsistencyStrategy instantiates a new ConsistencyStrategy 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 +// will change when the set of required properties is changed +func NewConsistencyStrategy(receiptType ReceiptType, blockConfirmations int32) *ConsistencyStrategy { + this := ConsistencyStrategy{} + this.ReceiptType = receiptType + this.BlockConfirmations = blockConfirmations + return &this +} + +// NewConsistencyStrategyWithDefaults instantiates a new ConsistencyStrategy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsistencyStrategyWithDefaults() *ConsistencyStrategy { + this := ConsistencyStrategy{} + return &this +} + +// GetReceiptType returns the ReceiptType field value +func (o *ConsistencyStrategy) GetReceiptType() ReceiptType { + if o == nil { + var ret ReceiptType + return ret + } + + return o.ReceiptType +} + +// GetReceiptTypeOk returns a tuple with the ReceiptType field value +// and a boolean to check if the value has been set. +func (o *ConsistencyStrategy) GetReceiptTypeOk() (*ReceiptType, bool) { + if o == nil { + return nil, false + } + return &o.ReceiptType, true +} + +// SetReceiptType sets field value +func (o *ConsistencyStrategy) SetReceiptType(v ReceiptType) { + o.ReceiptType = v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *ConsistencyStrategy) GetTimeoutMs() int32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret int32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsistencyStrategy) GetTimeoutMsOk() (*int32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *ConsistencyStrategy) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given int32 and assigns it to the TimeoutMs field. +func (o *ConsistencyStrategy) SetTimeoutMs(v int32) { + o.TimeoutMs = &v +} + +// GetBlockConfirmations returns the BlockConfirmations field value +func (o *ConsistencyStrategy) GetBlockConfirmations() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BlockConfirmations +} + +// GetBlockConfirmationsOk returns a tuple with the BlockConfirmations field value +// and a boolean to check if the value has been set. +func (o *ConsistencyStrategy) GetBlockConfirmationsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BlockConfirmations, true +} + +// SetBlockConfirmations sets field value +func (o *ConsistencyStrategy) SetBlockConfirmations(v int32) { + o.BlockConfirmations = v +} + +func (o ConsistencyStrategy) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsistencyStrategy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["receiptType"] = o.ReceiptType + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["blockConfirmations"] = o.BlockConfirmations + return toSerialize, nil +} + +type NullableConsistencyStrategy struct { + value *ConsistencyStrategy + isSet bool +} + +func (v NullableConsistencyStrategy) Get() *ConsistencyStrategy { + return v.value +} + +func (v *NullableConsistencyStrategy) Set(val *ConsistencyStrategy) { + v.value = val + v.isSet = true +} + +func (v NullableConsistencyStrategy) IsSet() bool { + return v.isSet +} + +func (v *NullableConsistencyStrategy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsistencyStrategy(val *ConsistencyStrategy) *NullableConsistencyStrategy { + return &NullableConsistencyStrategy{value: val, isSet: true} +} + +func (v NullableConsistencyStrategy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsistencyStrategy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go new file mode 100644 index 00000000000..b3c214824e0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go @@ -0,0 +1,405 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the DeployContractSolidityBytecodeV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractSolidityBytecodeV1Request{} + +// DeployContractSolidityBytecodeV1Request struct for DeployContractSolidityBytecodeV1Request +type DeployContractSolidityBytecodeV1Request struct { + // The contract name for retrieve the contracts json on the keychain. + ContractName string `json:"contractName"` + // The application binary interface of the solidity contract + ContractAbi []interface{} `json:"contractAbi"` + ConstructorArgs []interface{} `json:"constructorArgs"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + Bytecode string `json:"bytecode"` + // The keychainId for retrieve the contracts json. + KeychainId string `json:"keychainId"` + Gas *float32 `json:"gas,omitempty"` + GasPrice *string `json:"gasPrice,omitempty"` + // The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + PrivateTransactionConfig *BesuPrivateTransactionConfig `json:"privateTransactionConfig,omitempty"` +} + +// NewDeployContractSolidityBytecodeV1Request instantiates a new DeployContractSolidityBytecodeV1Request 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 +// will change when the set of required properties is changed +func NewDeployContractSolidityBytecodeV1Request(contractName string, contractAbi []interface{}, constructorArgs []interface{}, web3SigningCredential Web3SigningCredential, bytecode string, keychainId string) *DeployContractSolidityBytecodeV1Request { + this := DeployContractSolidityBytecodeV1Request{} + this.ContractName = contractName + this.ContractAbi = contractAbi + this.ConstructorArgs = constructorArgs + this.Web3SigningCredential = web3SigningCredential + this.Bytecode = bytecode + this.KeychainId = keychainId + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewDeployContractSolidityBytecodeV1RequestWithDefaults instantiates a new DeployContractSolidityBytecodeV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractSolidityBytecodeV1RequestWithDefaults() *DeployContractSolidityBytecodeV1Request { + this := DeployContractSolidityBytecodeV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractName returns the ContractName field value +func (o *DeployContractSolidityBytecodeV1Request) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetContractName(v string) { + o.ContractName = v +} + +// GetContractAbi returns the ContractAbi field value +func (o *DeployContractSolidityBytecodeV1Request) GetContractAbi() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.ContractAbi +} + +// GetContractAbiOk returns a tuple with the ContractAbi field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetContractAbiOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ContractAbi, true +} + +// SetContractAbi sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetContractAbi(v []interface{}) { + o.ContractAbi = v +} + +// GetConstructorArgs returns the ConstructorArgs field value +func (o *DeployContractSolidityBytecodeV1Request) GetConstructorArgs() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ConstructorArgs, true +} + +// SetConstructorArgs sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployContractSolidityBytecodeV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetBytecode returns the Bytecode field value +func (o *DeployContractSolidityBytecodeV1Request) GetBytecode() string { + if o == nil { + var ret string + return ret + } + + return o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetBytecodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bytecode, true +} + +// SetBytecode sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetBytecode(v string) { + o.Bytecode = v +} + +// GetKeychainId returns the KeychainId field value +func (o *DeployContractSolidityBytecodeV1Request) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *DeployContractSolidityBytecodeV1Request) SetGas(v float32) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetGasPrice() string { + if o == nil || IsNil(o.GasPrice) { + var ret string + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetGasPriceOk() (*string, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given string and assigns it to the GasPrice field. +func (o *DeployContractSolidityBytecodeV1Request) SetGasPrice(v string) { + o.GasPrice = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *DeployContractSolidityBytecodeV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetPrivateTransactionConfig returns the PrivateTransactionConfig field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetPrivateTransactionConfig() BesuPrivateTransactionConfig { + if o == nil || IsNil(o.PrivateTransactionConfig) { + var ret BesuPrivateTransactionConfig + return ret + } + return *o.PrivateTransactionConfig +} + +// GetPrivateTransactionConfigOk returns a tuple with the PrivateTransactionConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetPrivateTransactionConfigOk() (*BesuPrivateTransactionConfig, bool) { + if o == nil || IsNil(o.PrivateTransactionConfig) { + return nil, false + } + return o.PrivateTransactionConfig, true +} + +// HasPrivateTransactionConfig returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasPrivateTransactionConfig() bool { + if o != nil && !IsNil(o.PrivateTransactionConfig) { + return true + } + + return false +} + +// SetPrivateTransactionConfig gets a reference to the given BesuPrivateTransactionConfig and assigns it to the PrivateTransactionConfig field. +func (o *DeployContractSolidityBytecodeV1Request) SetPrivateTransactionConfig(v BesuPrivateTransactionConfig) { + o.PrivateTransactionConfig = &v +} + +func (o DeployContractSolidityBytecodeV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractSolidityBytecodeV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + toSerialize["contractAbi"] = o.ContractAbi + toSerialize["constructorArgs"] = o.ConstructorArgs + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["bytecode"] = o.Bytecode + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + if !IsNil(o.PrivateTransactionConfig) { + toSerialize["privateTransactionConfig"] = o.PrivateTransactionConfig + } + return toSerialize, nil +} + +type NullableDeployContractSolidityBytecodeV1Request struct { + value *DeployContractSolidityBytecodeV1Request + isSet bool +} + +func (v NullableDeployContractSolidityBytecodeV1Request) Get() *DeployContractSolidityBytecodeV1Request { + return v.value +} + +func (v *NullableDeployContractSolidityBytecodeV1Request) Set(val *DeployContractSolidityBytecodeV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractSolidityBytecodeV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractSolidityBytecodeV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractSolidityBytecodeV1Request(val *DeployContractSolidityBytecodeV1Request) *NullableDeployContractSolidityBytecodeV1Request { + return &NullableDeployContractSolidityBytecodeV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractSolidityBytecodeV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractSolidityBytecodeV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go new file mode 100644 index 00000000000..f63c352fc77 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the DeployContractSolidityBytecodeV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractSolidityBytecodeV1Response{} + +// DeployContractSolidityBytecodeV1Response struct for DeployContractSolidityBytecodeV1Response +type DeployContractSolidityBytecodeV1Response struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewDeployContractSolidityBytecodeV1Response instantiates a new DeployContractSolidityBytecodeV1Response 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 +// will change when the set of required properties is changed +func NewDeployContractSolidityBytecodeV1Response(transactionReceipt Web3TransactionReceipt) *DeployContractSolidityBytecodeV1Response { + this := DeployContractSolidityBytecodeV1Response{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewDeployContractSolidityBytecodeV1ResponseWithDefaults instantiates a new DeployContractSolidityBytecodeV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractSolidityBytecodeV1ResponseWithDefaults() *DeployContractSolidityBytecodeV1Response { + this := DeployContractSolidityBytecodeV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *DeployContractSolidityBytecodeV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *DeployContractSolidityBytecodeV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o DeployContractSolidityBytecodeV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractSolidityBytecodeV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableDeployContractSolidityBytecodeV1Response struct { + value *DeployContractSolidityBytecodeV1Response + isSet bool +} + +func (v NullableDeployContractSolidityBytecodeV1Response) Get() *DeployContractSolidityBytecodeV1Response { + return v.value +} + +func (v *NullableDeployContractSolidityBytecodeV1Response) Set(val *DeployContractSolidityBytecodeV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractSolidityBytecodeV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractSolidityBytecodeV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractSolidityBytecodeV1Response(val *DeployContractSolidityBytecodeV1Response) *NullableDeployContractSolidityBytecodeV1Response { + return &NullableDeployContractSolidityBytecodeV1Response{value: val, isSet: true} +} + +func (v NullableDeployContractSolidityBytecodeV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractSolidityBytecodeV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go new file mode 100644 index 00000000000..7185a28ac59 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" + "fmt" +) + +// EthContractInvocationType the model 'EthContractInvocationType' +type EthContractInvocationType string + +// List of EthContractInvocationType +const ( + SEND EthContractInvocationType = "SEND" + CALL EthContractInvocationType = "CALL" +) + +// All allowed values of EthContractInvocationType enum +var AllowedEthContractInvocationTypeEnumValues = []EthContractInvocationType{ + "SEND", + "CALL", +} + +func (v *EthContractInvocationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EthContractInvocationType(value) + for _, existing := range AllowedEthContractInvocationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EthContractInvocationType", value) +} + +// NewEthContractInvocationTypeFromValue returns a pointer to a valid EthContractInvocationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEthContractInvocationTypeFromValue(v string) (*EthContractInvocationType, error) { + ev := EthContractInvocationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EthContractInvocationType: valid values are %v", v, AllowedEthContractInvocationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EthContractInvocationType) IsValid() bool { + for _, existing := range AllowedEthContractInvocationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EthContractInvocationType value +func (v EthContractInvocationType) Ptr() *EthContractInvocationType { + return &v +} + +type NullableEthContractInvocationType struct { + value *EthContractInvocationType + isSet bool +} + +func (v NullableEthContractInvocationType) Get() *EthContractInvocationType { + return v.value +} + +func (v *NullableEthContractInvocationType) Set(val *EthContractInvocationType) { + v.value = val + v.isSet = true +} + +func (v NullableEthContractInvocationType) IsSet() bool { + return v.isSet +} + +func (v *NullableEthContractInvocationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEthContractInvocationType(val *EthContractInvocationType) *NullableEthContractInvocationType { + return &NullableEthContractInvocationType{value: val, isSet: true} +} + +func (v NullableEthContractInvocationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEthContractInvocationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_block.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_block.go new file mode 100644 index 00000000000..dcffe7a48b6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_block.go @@ -0,0 +1,739 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the EvmBlock type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EvmBlock{} + +// EvmBlock struct for EvmBlock +type EvmBlock struct { + Number *float32 `json:"number,omitempty"` + Hash *string `json:"hash,omitempty"` + ParentHash *string `json:"parentHash,omitempty"` + Nonce *string `json:"nonce,omitempty"` + Sha3Uncles *string `json:"sha3Uncles,omitempty"` + LogsBloom *string `json:"logsBloom,omitempty"` + TransactionsRoot *string `json:"transactionsRoot,omitempty"` + StateRoot *string `json:"stateRoot,omitempty"` + Miner *string `json:"miner,omitempty"` + Difficulty *float32 `json:"difficulty,omitempty"` + TotalDifficulty *float32 `json:"totalDifficulty,omitempty"` + ExtraData *string `json:"extraData,omitempty"` + Size *float32 `json:"size,omitempty"` + GasLimit *float32 `json:"gasLimit,omitempty"` + GasUsed *float32 `json:"gasUsed,omitempty"` + Timestamp interface{} `json:"timestamp,omitempty"` + Transactions []interface{} `json:"transactions,omitempty"` + Uncles []interface{} `json:"uncles,omitempty"` +} + +// NewEvmBlock instantiates a new EvmBlock 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 +// will change when the set of required properties is changed +func NewEvmBlock() *EvmBlock { + this := EvmBlock{} + return &this +} + +// NewEvmBlockWithDefaults instantiates a new EvmBlock object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEvmBlockWithDefaults() *EvmBlock { + this := EvmBlock{} + return &this +} + +// GetNumber returns the Number field value if set, zero value otherwise. +func (o *EvmBlock) GetNumber() float32 { + if o == nil || IsNil(o.Number) { + var ret float32 + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetNumberOk() (*float32, bool) { + if o == nil || IsNil(o.Number) { + return nil, false + } + return o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *EvmBlock) HasNumber() bool { + if o != nil && !IsNil(o.Number) { + return true + } + + return false +} + +// SetNumber gets a reference to the given float32 and assigns it to the Number field. +func (o *EvmBlock) SetNumber(v float32) { + o.Number = &v +} + +// GetHash returns the Hash field value if set, zero value otherwise. +func (o *EvmBlock) GetHash() string { + if o == nil || IsNil(o.Hash) { + var ret string + return ret + } + return *o.Hash +} + +// GetHashOk returns a tuple with the Hash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetHashOk() (*string, bool) { + if o == nil || IsNil(o.Hash) { + return nil, false + } + return o.Hash, true +} + +// HasHash returns a boolean if a field has been set. +func (o *EvmBlock) HasHash() bool { + if o != nil && !IsNil(o.Hash) { + return true + } + + return false +} + +// SetHash gets a reference to the given string and assigns it to the Hash field. +func (o *EvmBlock) SetHash(v string) { + o.Hash = &v +} + +// GetParentHash returns the ParentHash field value if set, zero value otherwise. +func (o *EvmBlock) GetParentHash() string { + if o == nil || IsNil(o.ParentHash) { + var ret string + return ret + } + return *o.ParentHash +} + +// GetParentHashOk returns a tuple with the ParentHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetParentHashOk() (*string, bool) { + if o == nil || IsNil(o.ParentHash) { + return nil, false + } + return o.ParentHash, true +} + +// HasParentHash returns a boolean if a field has been set. +func (o *EvmBlock) HasParentHash() bool { + if o != nil && !IsNil(o.ParentHash) { + return true + } + + return false +} + +// SetParentHash gets a reference to the given string and assigns it to the ParentHash field. +func (o *EvmBlock) SetParentHash(v string) { + o.ParentHash = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *EvmBlock) GetNonce() string { + if o == nil || IsNil(o.Nonce) { + var ret string + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetNonceOk() (*string, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *EvmBlock) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given string and assigns it to the Nonce field. +func (o *EvmBlock) SetNonce(v string) { + o.Nonce = &v +} + +// GetSha3Uncles returns the Sha3Uncles field value if set, zero value otherwise. +func (o *EvmBlock) GetSha3Uncles() string { + if o == nil || IsNil(o.Sha3Uncles) { + var ret string + return ret + } + return *o.Sha3Uncles +} + +// GetSha3UnclesOk returns a tuple with the Sha3Uncles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetSha3UnclesOk() (*string, bool) { + if o == nil || IsNil(o.Sha3Uncles) { + return nil, false + } + return o.Sha3Uncles, true +} + +// HasSha3Uncles returns a boolean if a field has been set. +func (o *EvmBlock) HasSha3Uncles() bool { + if o != nil && !IsNil(o.Sha3Uncles) { + return true + } + + return false +} + +// SetSha3Uncles gets a reference to the given string and assigns it to the Sha3Uncles field. +func (o *EvmBlock) SetSha3Uncles(v string) { + o.Sha3Uncles = &v +} + +// GetLogsBloom returns the LogsBloom field value if set, zero value otherwise. +func (o *EvmBlock) GetLogsBloom() string { + if o == nil || IsNil(o.LogsBloom) { + var ret string + return ret + } + return *o.LogsBloom +} + +// GetLogsBloomOk returns a tuple with the LogsBloom field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetLogsBloomOk() (*string, bool) { + if o == nil || IsNil(o.LogsBloom) { + return nil, false + } + return o.LogsBloom, true +} + +// HasLogsBloom returns a boolean if a field has been set. +func (o *EvmBlock) HasLogsBloom() bool { + if o != nil && !IsNil(o.LogsBloom) { + return true + } + + return false +} + +// SetLogsBloom gets a reference to the given string and assigns it to the LogsBloom field. +func (o *EvmBlock) SetLogsBloom(v string) { + o.LogsBloom = &v +} + +// GetTransactionsRoot returns the TransactionsRoot field value if set, zero value otherwise. +func (o *EvmBlock) GetTransactionsRoot() string { + if o == nil || IsNil(o.TransactionsRoot) { + var ret string + return ret + } + return *o.TransactionsRoot +} + +// GetTransactionsRootOk returns a tuple with the TransactionsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetTransactionsRootOk() (*string, bool) { + if o == nil || IsNil(o.TransactionsRoot) { + return nil, false + } + return o.TransactionsRoot, true +} + +// HasTransactionsRoot returns a boolean if a field has been set. +func (o *EvmBlock) HasTransactionsRoot() bool { + if o != nil && !IsNil(o.TransactionsRoot) { + return true + } + + return false +} + +// SetTransactionsRoot gets a reference to the given string and assigns it to the TransactionsRoot field. +func (o *EvmBlock) SetTransactionsRoot(v string) { + o.TransactionsRoot = &v +} + +// GetStateRoot returns the StateRoot field value if set, zero value otherwise. +func (o *EvmBlock) GetStateRoot() string { + if o == nil || IsNil(o.StateRoot) { + var ret string + return ret + } + return *o.StateRoot +} + +// GetStateRootOk returns a tuple with the StateRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetStateRootOk() (*string, bool) { + if o == nil || IsNil(o.StateRoot) { + return nil, false + } + return o.StateRoot, true +} + +// HasStateRoot returns a boolean if a field has been set. +func (o *EvmBlock) HasStateRoot() bool { + if o != nil && !IsNil(o.StateRoot) { + return true + } + + return false +} + +// SetStateRoot gets a reference to the given string and assigns it to the StateRoot field. +func (o *EvmBlock) SetStateRoot(v string) { + o.StateRoot = &v +} + +// GetMiner returns the Miner field value if set, zero value otherwise. +func (o *EvmBlock) GetMiner() string { + if o == nil || IsNil(o.Miner) { + var ret string + return ret + } + return *o.Miner +} + +// GetMinerOk returns a tuple with the Miner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetMinerOk() (*string, bool) { + if o == nil || IsNil(o.Miner) { + return nil, false + } + return o.Miner, true +} + +// HasMiner returns a boolean if a field has been set. +func (o *EvmBlock) HasMiner() bool { + if o != nil && !IsNil(o.Miner) { + return true + } + + return false +} + +// SetMiner gets a reference to the given string and assigns it to the Miner field. +func (o *EvmBlock) SetMiner(v string) { + o.Miner = &v +} + +// GetDifficulty returns the Difficulty field value if set, zero value otherwise. +func (o *EvmBlock) GetDifficulty() float32 { + if o == nil || IsNil(o.Difficulty) { + var ret float32 + return ret + } + return *o.Difficulty +} + +// GetDifficultyOk returns a tuple with the Difficulty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetDifficultyOk() (*float32, bool) { + if o == nil || IsNil(o.Difficulty) { + return nil, false + } + return o.Difficulty, true +} + +// HasDifficulty returns a boolean if a field has been set. +func (o *EvmBlock) HasDifficulty() bool { + if o != nil && !IsNil(o.Difficulty) { + return true + } + + return false +} + +// SetDifficulty gets a reference to the given float32 and assigns it to the Difficulty field. +func (o *EvmBlock) SetDifficulty(v float32) { + o.Difficulty = &v +} + +// GetTotalDifficulty returns the TotalDifficulty field value if set, zero value otherwise. +func (o *EvmBlock) GetTotalDifficulty() float32 { + if o == nil || IsNil(o.TotalDifficulty) { + var ret float32 + return ret + } + return *o.TotalDifficulty +} + +// GetTotalDifficultyOk returns a tuple with the TotalDifficulty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetTotalDifficultyOk() (*float32, bool) { + if o == nil || IsNil(o.TotalDifficulty) { + return nil, false + } + return o.TotalDifficulty, true +} + +// HasTotalDifficulty returns a boolean if a field has been set. +func (o *EvmBlock) HasTotalDifficulty() bool { + if o != nil && !IsNil(o.TotalDifficulty) { + return true + } + + return false +} + +// SetTotalDifficulty gets a reference to the given float32 and assigns it to the TotalDifficulty field. +func (o *EvmBlock) SetTotalDifficulty(v float32) { + o.TotalDifficulty = &v +} + +// GetExtraData returns the ExtraData field value if set, zero value otherwise. +func (o *EvmBlock) GetExtraData() string { + if o == nil || IsNil(o.ExtraData) { + var ret string + return ret + } + return *o.ExtraData +} + +// GetExtraDataOk returns a tuple with the ExtraData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetExtraDataOk() (*string, bool) { + if o == nil || IsNil(o.ExtraData) { + return nil, false + } + return o.ExtraData, true +} + +// HasExtraData returns a boolean if a field has been set. +func (o *EvmBlock) HasExtraData() bool { + if o != nil && !IsNil(o.ExtraData) { + return true + } + + return false +} + +// SetExtraData gets a reference to the given string and assigns it to the ExtraData field. +func (o *EvmBlock) SetExtraData(v string) { + o.ExtraData = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *EvmBlock) GetSize() float32 { + if o == nil || IsNil(o.Size) { + var ret float32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetSizeOk() (*float32, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *EvmBlock) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given float32 and assigns it to the Size field. +func (o *EvmBlock) SetSize(v float32) { + o.Size = &v +} + +// GetGasLimit returns the GasLimit field value if set, zero value otherwise. +func (o *EvmBlock) GetGasLimit() float32 { + if o == nil || IsNil(o.GasLimit) { + var ret float32 + return ret + } + return *o.GasLimit +} + +// GetGasLimitOk returns a tuple with the GasLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetGasLimitOk() (*float32, bool) { + if o == nil || IsNil(o.GasLimit) { + return nil, false + } + return o.GasLimit, true +} + +// HasGasLimit returns a boolean if a field has been set. +func (o *EvmBlock) HasGasLimit() bool { + if o != nil && !IsNil(o.GasLimit) { + return true + } + + return false +} + +// SetGasLimit gets a reference to the given float32 and assigns it to the GasLimit field. +func (o *EvmBlock) SetGasLimit(v float32) { + o.GasLimit = &v +} + +// GetGasUsed returns the GasUsed field value if set, zero value otherwise. +func (o *EvmBlock) GetGasUsed() float32 { + if o == nil || IsNil(o.GasUsed) { + var ret float32 + return ret + } + return *o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetGasUsedOk() (*float32, bool) { + if o == nil || IsNil(o.GasUsed) { + return nil, false + } + return o.GasUsed, true +} + +// HasGasUsed returns a boolean if a field has been set. +func (o *EvmBlock) HasGasUsed() bool { + if o != nil && !IsNil(o.GasUsed) { + return true + } + + return false +} + +// SetGasUsed gets a reference to the given float32 and assigns it to the GasUsed field. +func (o *EvmBlock) SetGasUsed(v float32) { + o.GasUsed = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EvmBlock) GetTimestamp() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EvmBlock) GetTimestampOk() (*interface{}, bool) { + if o == nil || IsNil(o.Timestamp) { + return nil, false + } + return &o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *EvmBlock) HasTimestamp() bool { + if o != nil && IsNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given interface{} and assigns it to the Timestamp field. +func (o *EvmBlock) SetTimestamp(v interface{}) { + o.Timestamp = v +} + +// GetTransactions returns the Transactions field value if set, zero value otherwise. +func (o *EvmBlock) GetTransactions() []interface{} { + if o == nil || IsNil(o.Transactions) { + var ret []interface{} + return ret + } + return o.Transactions +} + +// GetTransactionsOk returns a tuple with the Transactions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetTransactionsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Transactions) { + return nil, false + } + return o.Transactions, true +} + +// HasTransactions returns a boolean if a field has been set. +func (o *EvmBlock) HasTransactions() bool { + if o != nil && !IsNil(o.Transactions) { + return true + } + + return false +} + +// SetTransactions gets a reference to the given []interface{} and assigns it to the Transactions field. +func (o *EvmBlock) SetTransactions(v []interface{}) { + o.Transactions = v +} + +// GetUncles returns the Uncles field value if set, zero value otherwise. +func (o *EvmBlock) GetUncles() []interface{} { + if o == nil || IsNil(o.Uncles) { + var ret []interface{} + return ret + } + return o.Uncles +} + +// GetUnclesOk returns a tuple with the Uncles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmBlock) GetUnclesOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Uncles) { + return nil, false + } + return o.Uncles, true +} + +// HasUncles returns a boolean if a field has been set. +func (o *EvmBlock) HasUncles() bool { + if o != nil && !IsNil(o.Uncles) { + return true + } + + return false +} + +// SetUncles gets a reference to the given []interface{} and assigns it to the Uncles field. +func (o *EvmBlock) SetUncles(v []interface{}) { + o.Uncles = v +} + +func (o EvmBlock) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EvmBlock) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Number) { + toSerialize["number"] = o.Number + } + if !IsNil(o.Hash) { + toSerialize["hash"] = o.Hash + } + if !IsNil(o.ParentHash) { + toSerialize["parentHash"] = o.ParentHash + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.Sha3Uncles) { + toSerialize["sha3Uncles"] = o.Sha3Uncles + } + if !IsNil(o.LogsBloom) { + toSerialize["logsBloom"] = o.LogsBloom + } + if !IsNil(o.TransactionsRoot) { + toSerialize["transactionsRoot"] = o.TransactionsRoot + } + if !IsNil(o.StateRoot) { + toSerialize["stateRoot"] = o.StateRoot + } + if !IsNil(o.Miner) { + toSerialize["miner"] = o.Miner + } + if !IsNil(o.Difficulty) { + toSerialize["difficulty"] = o.Difficulty + } + if !IsNil(o.TotalDifficulty) { + toSerialize["totalDifficulty"] = o.TotalDifficulty + } + if !IsNil(o.ExtraData) { + toSerialize["extraData"] = o.ExtraData + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.GasLimit) { + toSerialize["gasLimit"] = o.GasLimit + } + if !IsNil(o.GasUsed) { + toSerialize["gasUsed"] = o.GasUsed + } + if o.Timestamp != nil { + toSerialize["timestamp"] = o.Timestamp + } + if !IsNil(o.Transactions) { + toSerialize["transactions"] = o.Transactions + } + if !IsNil(o.Uncles) { + toSerialize["uncles"] = o.Uncles + } + return toSerialize, nil +} + +type NullableEvmBlock struct { + value *EvmBlock + isSet bool +} + +func (v NullableEvmBlock) Get() *EvmBlock { + return v.value +} + +func (v *NullableEvmBlock) Set(val *EvmBlock) { + v.value = val + v.isSet = true +} + +func (v NullableEvmBlock) IsSet() bool { + return v.isSet +} + +func (v *NullableEvmBlock) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEvmBlock(val *EvmBlock) *NullableEvmBlock { + return &NullableEvmBlock{value: val, isSet: true} +} + +func (v NullableEvmBlock) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEvmBlock) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_log.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_log.go new file mode 100644 index 00000000000..2e5b6079483 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_log.go @@ -0,0 +1,306 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the EvmLog type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EvmLog{} + +// EvmLog struct for EvmLog +type EvmLog struct { + Address string `json:"address"` + Data string `json:"data"` + BlockHash string `json:"blockHash"` + TransactionHash string `json:"transactionHash"` + Topics []string `json:"topics"` + LogIndex float32 `json:"logIndex"` + TransactionIndex float32 `json:"transactionIndex"` + BlockNumber float32 `json:"blockNumber"` +} + +// NewEvmLog instantiates a new EvmLog 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 +// will change when the set of required properties is changed +func NewEvmLog(address string, data string, blockHash string, transactionHash string, topics []string, logIndex float32, transactionIndex float32, blockNumber float32) *EvmLog { + this := EvmLog{} + this.Address = address + this.Data = data + this.BlockHash = blockHash + this.TransactionHash = transactionHash + this.Topics = topics + this.LogIndex = logIndex + this.TransactionIndex = transactionIndex + this.BlockNumber = blockNumber + return &this +} + +// NewEvmLogWithDefaults instantiates a new EvmLog object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEvmLogWithDefaults() *EvmLog { + this := EvmLog{} + return &this +} + +// GetAddress returns the Address field value +func (o *EvmLog) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *EvmLog) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *EvmLog) SetAddress(v string) { + o.Address = v +} + +// GetData returns the Data field value +func (o *EvmLog) GetData() string { + if o == nil { + var ret string + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *EvmLog) GetDataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *EvmLog) SetData(v string) { + o.Data = v +} + +// GetBlockHash returns the BlockHash field value +func (o *EvmLog) GetBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +func (o *EvmLog) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *EvmLog) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetTransactionHash returns the TransactionHash field value +func (o *EvmLog) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *EvmLog) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *EvmLog) SetTransactionHash(v string) { + o.TransactionHash = v +} + +// GetTopics returns the Topics field value +func (o *EvmLog) GetTopics() []string { + if o == nil { + var ret []string + return ret + } + + return o.Topics +} + +// GetTopicsOk returns a tuple with the Topics field value +// and a boolean to check if the value has been set. +func (o *EvmLog) GetTopicsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Topics, true +} + +// SetTopics sets field value +func (o *EvmLog) SetTopics(v []string) { + o.Topics = v +} + +// GetLogIndex returns the LogIndex field value +func (o *EvmLog) GetLogIndex() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.LogIndex +} + +// GetLogIndexOk returns a tuple with the LogIndex field value +// and a boolean to check if the value has been set. +func (o *EvmLog) GetLogIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.LogIndex, true +} + +// SetLogIndex sets field value +func (o *EvmLog) SetLogIndex(v float32) { + o.LogIndex = v +} + +// GetTransactionIndex returns the TransactionIndex field value +func (o *EvmLog) GetTransactionIndex() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +func (o *EvmLog) GetTransactionIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TransactionIndex, true +} + +// SetTransactionIndex sets field value +func (o *EvmLog) SetTransactionIndex(v float32) { + o.TransactionIndex = v +} + +// GetBlockNumber returns the BlockNumber field value +func (o *EvmLog) GetBlockNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +func (o *EvmLog) GetBlockNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *EvmLog) SetBlockNumber(v float32) { + o.BlockNumber = v +} + +func (o EvmLog) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EvmLog) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address"] = o.Address + toSerialize["data"] = o.Data + toSerialize["blockHash"] = o.BlockHash + toSerialize["transactionHash"] = o.TransactionHash + toSerialize["topics"] = o.Topics + toSerialize["logIndex"] = o.LogIndex + toSerialize["transactionIndex"] = o.TransactionIndex + toSerialize["blockNumber"] = o.BlockNumber + return toSerialize, nil +} + +type NullableEvmLog struct { + value *EvmLog + isSet bool +} + +func (v NullableEvmLog) Get() *EvmLog { + return v.value +} + +func (v *NullableEvmLog) Set(val *EvmLog) { + v.value = val + v.isSet = true +} + +func (v NullableEvmLog) IsSet() bool { + return v.isSet +} + +func (v *NullableEvmLog) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEvmLog(val *EvmLog) *NullableEvmLog { + return &NullableEvmLog{value: val, isSet: true} +} + +func (v NullableEvmLog) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEvmLog) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_transaction.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_transaction.go new file mode 100644 index 00000000000..650abb41cb1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_evm_transaction.go @@ -0,0 +1,490 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the EvmTransaction type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EvmTransaction{} + +// EvmTransaction struct for EvmTransaction +type EvmTransaction struct { + Hash *string `json:"hash,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + BlockHash interface{} `json:"blockHash,omitempty"` + BlockNumber interface{} `json:"blockNumber,omitempty"` + TransactionIndex interface{} `json:"transactionIndex,omitempty"` + From *string `json:"from,omitempty"` + To interface{} `json:"to,omitempty"` + Value *string `json:"value,omitempty"` + GasPrice *string `json:"gasPrice,omitempty"` + Gas *float32 `json:"gas,omitempty"` + Input *string `json:"input,omitempty"` +} + +// NewEvmTransaction instantiates a new EvmTransaction 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 +// will change when the set of required properties is changed +func NewEvmTransaction() *EvmTransaction { + this := EvmTransaction{} + return &this +} + +// NewEvmTransactionWithDefaults instantiates a new EvmTransaction object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEvmTransactionWithDefaults() *EvmTransaction { + this := EvmTransaction{} + return &this +} + +// GetHash returns the Hash field value if set, zero value otherwise. +func (o *EvmTransaction) GetHash() string { + if o == nil || IsNil(o.Hash) { + var ret string + return ret + } + return *o.Hash +} + +// GetHashOk returns a tuple with the Hash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmTransaction) GetHashOk() (*string, bool) { + if o == nil || IsNil(o.Hash) { + return nil, false + } + return o.Hash, true +} + +// HasHash returns a boolean if a field has been set. +func (o *EvmTransaction) HasHash() bool { + if o != nil && !IsNil(o.Hash) { + return true + } + + return false +} + +// SetHash gets a reference to the given string and assigns it to the Hash field. +func (o *EvmTransaction) SetHash(v string) { + o.Hash = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *EvmTransaction) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmTransaction) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *EvmTransaction) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *EvmTransaction) SetNonce(v float32) { + o.Nonce = &v +} + +// GetBlockHash returns the BlockHash field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EvmTransaction) GetBlockHash() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EvmTransaction) GetBlockHashOk() (*interface{}, bool) { + if o == nil || IsNil(o.BlockHash) { + return nil, false + } + return &o.BlockHash, true +} + +// HasBlockHash returns a boolean if a field has been set. +func (o *EvmTransaction) HasBlockHash() bool { + if o != nil && IsNil(o.BlockHash) { + return true + } + + return false +} + +// SetBlockHash gets a reference to the given interface{} and assigns it to the BlockHash field. +func (o *EvmTransaction) SetBlockHash(v interface{}) { + o.BlockHash = v +} + +// GetBlockNumber returns the BlockNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EvmTransaction) GetBlockNumber() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EvmTransaction) GetBlockNumberOk() (*interface{}, bool) { + if o == nil || IsNil(o.BlockNumber) { + return nil, false + } + return &o.BlockNumber, true +} + +// HasBlockNumber returns a boolean if a field has been set. +func (o *EvmTransaction) HasBlockNumber() bool { + if o != nil && IsNil(o.BlockNumber) { + return true + } + + return false +} + +// SetBlockNumber gets a reference to the given interface{} and assigns it to the BlockNumber field. +func (o *EvmTransaction) SetBlockNumber(v interface{}) { + o.BlockNumber = v +} + +// GetTransactionIndex returns the TransactionIndex field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EvmTransaction) GetTransactionIndex() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EvmTransaction) GetTransactionIndexOk() (*interface{}, bool) { + if o == nil || IsNil(o.TransactionIndex) { + return nil, false + } + return &o.TransactionIndex, true +} + +// HasTransactionIndex returns a boolean if a field has been set. +func (o *EvmTransaction) HasTransactionIndex() bool { + if o != nil && IsNil(o.TransactionIndex) { + return true + } + + return false +} + +// SetTransactionIndex gets a reference to the given interface{} and assigns it to the TransactionIndex field. +func (o *EvmTransaction) SetTransactionIndex(v interface{}) { + o.TransactionIndex = v +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *EvmTransaction) GetFrom() string { + if o == nil || IsNil(o.From) { + var ret string + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmTransaction) GetFromOk() (*string, bool) { + if o == nil || IsNil(o.From) { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *EvmTransaction) HasFrom() bool { + if o != nil && !IsNil(o.From) { + return true + } + + return false +} + +// SetFrom gets a reference to the given string and assigns it to the From field. +func (o *EvmTransaction) SetFrom(v string) { + o.From = &v +} + +// GetTo returns the To field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EvmTransaction) GetTo() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.To +} + +// GetToOk returns a tuple with the To field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EvmTransaction) GetToOk() (*interface{}, bool) { + if o == nil || IsNil(o.To) { + return nil, false + } + return &o.To, true +} + +// HasTo returns a boolean if a field has been set. +func (o *EvmTransaction) HasTo() bool { + if o != nil && IsNil(o.To) { + return true + } + + return false +} + +// SetTo gets a reference to the given interface{} and assigns it to the To field. +func (o *EvmTransaction) SetTo(v interface{}) { + o.To = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *EvmTransaction) GetValue() string { + if o == nil || IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmTransaction) GetValueOk() (*string, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *EvmTransaction) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *EvmTransaction) SetValue(v string) { + o.Value = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *EvmTransaction) GetGasPrice() string { + if o == nil || IsNil(o.GasPrice) { + var ret string + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmTransaction) GetGasPriceOk() (*string, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *EvmTransaction) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given string and assigns it to the GasPrice field. +func (o *EvmTransaction) SetGasPrice(v string) { + o.GasPrice = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *EvmTransaction) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmTransaction) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *EvmTransaction) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *EvmTransaction) SetGas(v float32) { + o.Gas = &v +} + +// GetInput returns the Input field value if set, zero value otherwise. +func (o *EvmTransaction) GetInput() string { + if o == nil || IsNil(o.Input) { + var ret string + return ret + } + return *o.Input +} + +// GetInputOk returns a tuple with the Input field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EvmTransaction) GetInputOk() (*string, bool) { + if o == nil || IsNil(o.Input) { + return nil, false + } + return o.Input, true +} + +// HasInput returns a boolean if a field has been set. +func (o *EvmTransaction) HasInput() bool { + if o != nil && !IsNil(o.Input) { + return true + } + + return false +} + +// SetInput gets a reference to the given string and assigns it to the Input field. +func (o *EvmTransaction) SetInput(v string) { + o.Input = &v +} + +func (o EvmTransaction) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EvmTransaction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Hash) { + toSerialize["hash"] = o.Hash + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if o.BlockHash != nil { + toSerialize["blockHash"] = o.BlockHash + } + if o.BlockNumber != nil { + toSerialize["blockNumber"] = o.BlockNumber + } + if o.TransactionIndex != nil { + toSerialize["transactionIndex"] = o.TransactionIndex + } + if !IsNil(o.From) { + toSerialize["from"] = o.From + } + if o.To != nil { + toSerialize["to"] = o.To + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.Input) { + toSerialize["input"] = o.Input + } + return toSerialize, nil +} + +type NullableEvmTransaction struct { + value *EvmTransaction + isSet bool +} + +func (v NullableEvmTransaction) Get() *EvmTransaction { + return v.value +} + +func (v *NullableEvmTransaction) Set(val *EvmTransaction) { + v.value = val + v.isSet = true +} + +func (v NullableEvmTransaction) IsSet() bool { + return v.isSet +} + +func (v *NullableEvmTransaction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEvmTransaction(val *EvmTransaction) *NullableEvmTransaction { + return &NullableEvmTransaction{value: val, isSet: true} +} + +func (v NullableEvmTransaction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEvmTransaction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_balance_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_balance_v1_request.go new file mode 100644 index 00000000000..dc885dbc977 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_balance_v1_request.go @@ -0,0 +1,154 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetBalanceV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBalanceV1Request{} + +// GetBalanceV1Request struct for GetBalanceV1Request +type GetBalanceV1Request struct { + Address string `json:"address"` + DefaultBlock interface{} `json:"defaultBlock,omitempty"` +} + +// NewGetBalanceV1Request instantiates a new GetBalanceV1Request 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 +// will change when the set of required properties is changed +func NewGetBalanceV1Request(address string) *GetBalanceV1Request { + this := GetBalanceV1Request{} + this.Address = address + return &this +} + +// NewGetBalanceV1RequestWithDefaults instantiates a new GetBalanceV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBalanceV1RequestWithDefaults() *GetBalanceV1Request { + this := GetBalanceV1Request{} + return &this +} + +// GetAddress returns the Address field value +func (o *GetBalanceV1Request) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *GetBalanceV1Request) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *GetBalanceV1Request) SetAddress(v string) { + o.Address = v +} + +// GetDefaultBlock returns the DefaultBlock field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetBalanceV1Request) GetDefaultBlock() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.DefaultBlock +} + +// GetDefaultBlockOk returns a tuple with the DefaultBlock field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetBalanceV1Request) GetDefaultBlockOk() (*interface{}, bool) { + if o == nil || IsNil(o.DefaultBlock) { + return nil, false + } + return &o.DefaultBlock, true +} + +// HasDefaultBlock returns a boolean if a field has been set. +func (o *GetBalanceV1Request) HasDefaultBlock() bool { + if o != nil && IsNil(o.DefaultBlock) { + return true + } + + return false +} + +// SetDefaultBlock gets a reference to the given interface{} and assigns it to the DefaultBlock field. +func (o *GetBalanceV1Request) SetDefaultBlock(v interface{}) { + o.DefaultBlock = v +} + +func (o GetBalanceV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBalanceV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address"] = o.Address + if o.DefaultBlock != nil { + toSerialize["defaultBlock"] = o.DefaultBlock + } + return toSerialize, nil +} + +type NullableGetBalanceV1Request struct { + value *GetBalanceV1Request + isSet bool +} + +func (v NullableGetBalanceV1Request) Get() *GetBalanceV1Request { + return v.value +} + +func (v *NullableGetBalanceV1Request) Set(val *GetBalanceV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableGetBalanceV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBalanceV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBalanceV1Request(val *GetBalanceV1Request) *NullableGetBalanceV1Request { + return &NullableGetBalanceV1Request{value: val, isSet: true} +} + +func (v NullableGetBalanceV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBalanceV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_balance_v1_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_balance_v1_response.go new file mode 100644 index 00000000000..ac9994dff1d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_balance_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetBalanceV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBalanceV1Response{} + +// GetBalanceV1Response struct for GetBalanceV1Response +type GetBalanceV1Response struct { + Balance string `json:"balance"` +} + +// NewGetBalanceV1Response instantiates a new GetBalanceV1Response 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 +// will change when the set of required properties is changed +func NewGetBalanceV1Response(balance string) *GetBalanceV1Response { + this := GetBalanceV1Response{} + this.Balance = balance + return &this +} + +// NewGetBalanceV1ResponseWithDefaults instantiates a new GetBalanceV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBalanceV1ResponseWithDefaults() *GetBalanceV1Response { + this := GetBalanceV1Response{} + return &this +} + +// GetBalance returns the Balance field value +func (o *GetBalanceV1Response) GetBalance() string { + if o == nil { + var ret string + return ret + } + + return o.Balance +} + +// GetBalanceOk returns a tuple with the Balance field value +// and a boolean to check if the value has been set. +func (o *GetBalanceV1Response) GetBalanceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Balance, true +} + +// SetBalance sets field value +func (o *GetBalanceV1Response) SetBalance(v string) { + o.Balance = v +} + +func (o GetBalanceV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBalanceV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["balance"] = o.Balance + return toSerialize, nil +} + +type NullableGetBalanceV1Response struct { + value *GetBalanceV1Response + isSet bool +} + +func (v NullableGetBalanceV1Response) Get() *GetBalanceV1Response { + return v.value +} + +func (v *NullableGetBalanceV1Response) Set(val *GetBalanceV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetBalanceV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBalanceV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBalanceV1Response(val *GetBalanceV1Response) *NullableGetBalanceV1Response { + return &NullableGetBalanceV1Response{value: val, isSet: true} +} + +func (v NullableGetBalanceV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBalanceV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_besu_record_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_besu_record_v1_request.go new file mode 100644 index 00000000000..ce576c76df0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_besu_record_v1_request.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetBesuRecordV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBesuRecordV1Request{} + +// GetBesuRecordV1Request struct for GetBesuRecordV1Request +type GetBesuRecordV1Request struct { + InvokeCall *InvokeContractV1Request `json:"invokeCall,omitempty"` + TransactionHash *string `json:"transactionHash,omitempty"` +} + +// NewGetBesuRecordV1Request instantiates a new GetBesuRecordV1Request 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 +// will change when the set of required properties is changed +func NewGetBesuRecordV1Request() *GetBesuRecordV1Request { + this := GetBesuRecordV1Request{} + return &this +} + +// NewGetBesuRecordV1RequestWithDefaults instantiates a new GetBesuRecordV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBesuRecordV1RequestWithDefaults() *GetBesuRecordV1Request { + this := GetBesuRecordV1Request{} + return &this +} + +// GetInvokeCall returns the InvokeCall field value if set, zero value otherwise. +func (o *GetBesuRecordV1Request) GetInvokeCall() InvokeContractV1Request { + if o == nil || IsNil(o.InvokeCall) { + var ret InvokeContractV1Request + return ret + } + return *o.InvokeCall +} + +// GetInvokeCallOk returns a tuple with the InvokeCall field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBesuRecordV1Request) GetInvokeCallOk() (*InvokeContractV1Request, bool) { + if o == nil || IsNil(o.InvokeCall) { + return nil, false + } + return o.InvokeCall, true +} + +// HasInvokeCall returns a boolean if a field has been set. +func (o *GetBesuRecordV1Request) HasInvokeCall() bool { + if o != nil && !IsNil(o.InvokeCall) { + return true + } + + return false +} + +// SetInvokeCall gets a reference to the given InvokeContractV1Request and assigns it to the InvokeCall field. +func (o *GetBesuRecordV1Request) SetInvokeCall(v InvokeContractV1Request) { + o.InvokeCall = &v +} + +// GetTransactionHash returns the TransactionHash field value if set, zero value otherwise. +func (o *GetBesuRecordV1Request) GetTransactionHash() string { + if o == nil || IsNil(o.TransactionHash) { + var ret string + return ret + } + return *o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBesuRecordV1Request) GetTransactionHashOk() (*string, bool) { + if o == nil || IsNil(o.TransactionHash) { + return nil, false + } + return o.TransactionHash, true +} + +// HasTransactionHash returns a boolean if a field has been set. +func (o *GetBesuRecordV1Request) HasTransactionHash() bool { + if o != nil && !IsNil(o.TransactionHash) { + return true + } + + return false +} + +// SetTransactionHash gets a reference to the given string and assigns it to the TransactionHash field. +func (o *GetBesuRecordV1Request) SetTransactionHash(v string) { + o.TransactionHash = &v +} + +func (o GetBesuRecordV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBesuRecordV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.InvokeCall) { + toSerialize["invokeCall"] = o.InvokeCall + } + if !IsNil(o.TransactionHash) { + toSerialize["transactionHash"] = o.TransactionHash + } + return toSerialize, nil +} + +type NullableGetBesuRecordV1Request struct { + value *GetBesuRecordV1Request + isSet bool +} + +func (v NullableGetBesuRecordV1Request) Get() *GetBesuRecordV1Request { + return v.value +} + +func (v *NullableGetBesuRecordV1Request) Set(val *GetBesuRecordV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableGetBesuRecordV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBesuRecordV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBesuRecordV1Request(val *GetBesuRecordV1Request) *NullableGetBesuRecordV1Request { + return &NullableGetBesuRecordV1Request{value: val, isSet: true} +} + +func (v NullableGetBesuRecordV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBesuRecordV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_besu_record_v1_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_besu_record_v1_response.go new file mode 100644 index 00000000000..a3a65deb0c5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_besu_record_v1_response.go @@ -0,0 +1,236 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetBesuRecordV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBesuRecordV1Response{} + +// GetBesuRecordV1Response struct for GetBesuRecordV1Response +type GetBesuRecordV1Response struct { + LedgerId *string `json:"ledgerId,omitempty"` + StateContract *string `json:"stateContract,omitempty"` + TransactionInputData interface{} `json:"transactionInputData,omitempty"` + CallOutput interface{} `json:"callOutput,omitempty"` +} + +// NewGetBesuRecordV1Response instantiates a new GetBesuRecordV1Response 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 +// will change when the set of required properties is changed +func NewGetBesuRecordV1Response() *GetBesuRecordV1Response { + this := GetBesuRecordV1Response{} + return &this +} + +// NewGetBesuRecordV1ResponseWithDefaults instantiates a new GetBesuRecordV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBesuRecordV1ResponseWithDefaults() *GetBesuRecordV1Response { + this := GetBesuRecordV1Response{} + return &this +} + +// GetLedgerId returns the LedgerId field value if set, zero value otherwise. +func (o *GetBesuRecordV1Response) GetLedgerId() string { + if o == nil || IsNil(o.LedgerId) { + var ret string + return ret + } + return *o.LedgerId +} + +// GetLedgerIdOk returns a tuple with the LedgerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBesuRecordV1Response) GetLedgerIdOk() (*string, bool) { + if o == nil || IsNil(o.LedgerId) { + return nil, false + } + return o.LedgerId, true +} + +// HasLedgerId returns a boolean if a field has been set. +func (o *GetBesuRecordV1Response) HasLedgerId() bool { + if o != nil && !IsNil(o.LedgerId) { + return true + } + + return false +} + +// SetLedgerId gets a reference to the given string and assigns it to the LedgerId field. +func (o *GetBesuRecordV1Response) SetLedgerId(v string) { + o.LedgerId = &v +} + +// GetStateContract returns the StateContract field value if set, zero value otherwise. +func (o *GetBesuRecordV1Response) GetStateContract() string { + if o == nil || IsNil(o.StateContract) { + var ret string + return ret + } + return *o.StateContract +} + +// GetStateContractOk returns a tuple with the StateContract field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBesuRecordV1Response) GetStateContractOk() (*string, bool) { + if o == nil || IsNil(o.StateContract) { + return nil, false + } + return o.StateContract, true +} + +// HasStateContract returns a boolean if a field has been set. +func (o *GetBesuRecordV1Response) HasStateContract() bool { + if o != nil && !IsNil(o.StateContract) { + return true + } + + return false +} + +// SetStateContract gets a reference to the given string and assigns it to the StateContract field. +func (o *GetBesuRecordV1Response) SetStateContract(v string) { + o.StateContract = &v +} + +// GetTransactionInputData returns the TransactionInputData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetBesuRecordV1Response) GetTransactionInputData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.TransactionInputData +} + +// GetTransactionInputDataOk returns a tuple with the TransactionInputData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetBesuRecordV1Response) GetTransactionInputDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.TransactionInputData) { + return nil, false + } + return &o.TransactionInputData, true +} + +// HasTransactionInputData returns a boolean if a field has been set. +func (o *GetBesuRecordV1Response) HasTransactionInputData() bool { + if o != nil && IsNil(o.TransactionInputData) { + return true + } + + return false +} + +// SetTransactionInputData gets a reference to the given interface{} and assigns it to the TransactionInputData field. +func (o *GetBesuRecordV1Response) SetTransactionInputData(v interface{}) { + o.TransactionInputData = v +} + +// GetCallOutput returns the CallOutput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetBesuRecordV1Response) GetCallOutput() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.CallOutput +} + +// GetCallOutputOk returns a tuple with the CallOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetBesuRecordV1Response) GetCallOutputOk() (*interface{}, bool) { + if o == nil || IsNil(o.CallOutput) { + return nil, false + } + return &o.CallOutput, true +} + +// HasCallOutput returns a boolean if a field has been set. +func (o *GetBesuRecordV1Response) HasCallOutput() bool { + if o != nil && IsNil(o.CallOutput) { + return true + } + + return false +} + +// SetCallOutput gets a reference to the given interface{} and assigns it to the CallOutput field. +func (o *GetBesuRecordV1Response) SetCallOutput(v interface{}) { + o.CallOutput = v +} + +func (o GetBesuRecordV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBesuRecordV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.LedgerId) { + toSerialize["ledgerId"] = o.LedgerId + } + if !IsNil(o.StateContract) { + toSerialize["stateContract"] = o.StateContract + } + if o.TransactionInputData != nil { + toSerialize["transactionInputData"] = o.TransactionInputData + } + if o.CallOutput != nil { + toSerialize["callOutput"] = o.CallOutput + } + return toSerialize, nil +} + +type NullableGetBesuRecordV1Response struct { + value *GetBesuRecordV1Response + isSet bool +} + +func (v NullableGetBesuRecordV1Response) Get() *GetBesuRecordV1Response { + return v.value +} + +func (v *NullableGetBesuRecordV1Response) Set(val *GetBesuRecordV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetBesuRecordV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBesuRecordV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBesuRecordV1Response(val *GetBesuRecordV1Response) *NullableGetBesuRecordV1Response { + return &NullableGetBesuRecordV1Response{value: val, isSet: true} +} + +func (v NullableGetBesuRecordV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBesuRecordV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_block_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_block_v1_request.go new file mode 100644 index 00000000000..c095bbde711 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_block_v1_request.go @@ -0,0 +1,121 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetBlockV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBlockV1Request{} + +// GetBlockV1Request struct for GetBlockV1Request +type GetBlockV1Request struct { + BlockHashOrBlockNumber interface{} `json:"blockHashOrBlockNumber"` +} + +// NewGetBlockV1Request instantiates a new GetBlockV1Request 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 +// will change when the set of required properties is changed +func NewGetBlockV1Request(blockHashOrBlockNumber interface{}) *GetBlockV1Request { + this := GetBlockV1Request{} + this.BlockHashOrBlockNumber = blockHashOrBlockNumber + return &this +} + +// NewGetBlockV1RequestWithDefaults instantiates a new GetBlockV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBlockV1RequestWithDefaults() *GetBlockV1Request { + this := GetBlockV1Request{} + return &this +} + +// GetBlockHashOrBlockNumber returns the BlockHashOrBlockNumber field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *GetBlockV1Request) GetBlockHashOrBlockNumber() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.BlockHashOrBlockNumber +} + +// GetBlockHashOrBlockNumberOk returns a tuple with the BlockHashOrBlockNumber field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetBlockV1Request) GetBlockHashOrBlockNumberOk() (*interface{}, bool) { + if o == nil || IsNil(o.BlockHashOrBlockNumber) { + return nil, false + } + return &o.BlockHashOrBlockNumber, true +} + +// SetBlockHashOrBlockNumber sets field value +func (o *GetBlockV1Request) SetBlockHashOrBlockNumber(v interface{}) { + o.BlockHashOrBlockNumber = v +} + +func (o GetBlockV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBlockV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.BlockHashOrBlockNumber != nil { + toSerialize["blockHashOrBlockNumber"] = o.BlockHashOrBlockNumber + } + return toSerialize, nil +} + +type NullableGetBlockV1Request struct { + value *GetBlockV1Request + isSet bool +} + +func (v NullableGetBlockV1Request) Get() *GetBlockV1Request { + return v.value +} + +func (v *NullableGetBlockV1Request) Set(val *GetBlockV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockV1Request(val *GetBlockV1Request) *NullableGetBlockV1Request { + return &NullableGetBlockV1Request{value: val, isSet: true} +} + +func (v NullableGetBlockV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_block_v1_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_block_v1_response.go new file mode 100644 index 00000000000..c154ef9d2d7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_block_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetBlockV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBlockV1Response{} + +// GetBlockV1Response struct for GetBlockV1Response +type GetBlockV1Response struct { + Block EvmBlock `json:"block"` +} + +// NewGetBlockV1Response instantiates a new GetBlockV1Response 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 +// will change when the set of required properties is changed +func NewGetBlockV1Response(block EvmBlock) *GetBlockV1Response { + this := GetBlockV1Response{} + this.Block = block + return &this +} + +// NewGetBlockV1ResponseWithDefaults instantiates a new GetBlockV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBlockV1ResponseWithDefaults() *GetBlockV1Response { + this := GetBlockV1Response{} + return &this +} + +// GetBlock returns the Block field value +func (o *GetBlockV1Response) GetBlock() EvmBlock { + if o == nil { + var ret EvmBlock + return ret + } + + return o.Block +} + +// GetBlockOk returns a tuple with the Block field value +// and a boolean to check if the value has been set. +func (o *GetBlockV1Response) GetBlockOk() (*EvmBlock, bool) { + if o == nil { + return nil, false + } + return &o.Block, true +} + +// SetBlock sets field value +func (o *GetBlockV1Response) SetBlock(v EvmBlock) { + o.Block = v +} + +func (o GetBlockV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBlockV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["block"] = o.Block + return toSerialize, nil +} + +type NullableGetBlockV1Response struct { + value *GetBlockV1Response + isSet bool +} + +func (v NullableGetBlockV1Response) Get() *GetBlockV1Response { + return v.value +} + +func (v *NullableGetBlockV1Response) Set(val *GetBlockV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockV1Response(val *GetBlockV1Response) *NullableGetBlockV1Response { + return &NullableGetBlockV1Response{value: val, isSet: true} +} + +func (v NullableGetBlockV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_past_logs_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_past_logs_v1_request.go new file mode 100644 index 00000000000..e7626ccca34 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_past_logs_v1_request.go @@ -0,0 +1,237 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetPastLogsV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetPastLogsV1Request{} + +// GetPastLogsV1Request struct for GetPastLogsV1Request +type GetPastLogsV1Request struct { + ToBlock interface{} `json:"toBlock,omitempty"` + FromBlock interface{} `json:"fromBlock,omitempty"` + Address interface{} `json:"address,omitempty"` + Topics []interface{} `json:"topics,omitempty"` +} + +// NewGetPastLogsV1Request instantiates a new GetPastLogsV1Request 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 +// will change when the set of required properties is changed +func NewGetPastLogsV1Request() *GetPastLogsV1Request { + this := GetPastLogsV1Request{} + return &this +} + +// NewGetPastLogsV1RequestWithDefaults instantiates a new GetPastLogsV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetPastLogsV1RequestWithDefaults() *GetPastLogsV1Request { + this := GetPastLogsV1Request{} + return &this +} + +// GetToBlock returns the ToBlock field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetPastLogsV1Request) GetToBlock() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.ToBlock +} + +// GetToBlockOk returns a tuple with the ToBlock field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetPastLogsV1Request) GetToBlockOk() (*interface{}, bool) { + if o == nil || IsNil(o.ToBlock) { + return nil, false + } + return &o.ToBlock, true +} + +// HasToBlock returns a boolean if a field has been set. +func (o *GetPastLogsV1Request) HasToBlock() bool { + if o != nil && IsNil(o.ToBlock) { + return true + } + + return false +} + +// SetToBlock gets a reference to the given interface{} and assigns it to the ToBlock field. +func (o *GetPastLogsV1Request) SetToBlock(v interface{}) { + o.ToBlock = v +} + +// GetFromBlock returns the FromBlock field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetPastLogsV1Request) GetFromBlock() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.FromBlock +} + +// GetFromBlockOk returns a tuple with the FromBlock field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetPastLogsV1Request) GetFromBlockOk() (*interface{}, bool) { + if o == nil || IsNil(o.FromBlock) { + return nil, false + } + return &o.FromBlock, true +} + +// HasFromBlock returns a boolean if a field has been set. +func (o *GetPastLogsV1Request) HasFromBlock() bool { + if o != nil && IsNil(o.FromBlock) { + return true + } + + return false +} + +// SetFromBlock gets a reference to the given interface{} and assigns it to the FromBlock field. +func (o *GetPastLogsV1Request) SetFromBlock(v interface{}) { + o.FromBlock = v +} + +// GetAddress returns the Address field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GetPastLogsV1Request) GetAddress() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetPastLogsV1Request) GetAddressOk() (*interface{}, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return &o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *GetPastLogsV1Request) HasAddress() bool { + if o != nil && IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given interface{} and assigns it to the Address field. +func (o *GetPastLogsV1Request) SetAddress(v interface{}) { + o.Address = v +} + +// GetTopics returns the Topics field value if set, zero value otherwise. +func (o *GetPastLogsV1Request) GetTopics() []interface{} { + if o == nil || IsNil(o.Topics) { + var ret []interface{} + return ret + } + return o.Topics +} + +// GetTopicsOk returns a tuple with the Topics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetPastLogsV1Request) GetTopicsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Topics) { + return nil, false + } + return o.Topics, true +} + +// HasTopics returns a boolean if a field has been set. +func (o *GetPastLogsV1Request) HasTopics() bool { + if o != nil && !IsNil(o.Topics) { + return true + } + + return false +} + +// SetTopics gets a reference to the given []interface{} and assigns it to the Topics field. +func (o *GetPastLogsV1Request) SetTopics(v []interface{}) { + o.Topics = v +} + +func (o GetPastLogsV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetPastLogsV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ToBlock != nil { + toSerialize["toBlock"] = o.ToBlock + } + if o.FromBlock != nil { + toSerialize["fromBlock"] = o.FromBlock + } + if o.Address != nil { + toSerialize["address"] = o.Address + } + if !IsNil(o.Topics) { + toSerialize["topics"] = o.Topics + } + return toSerialize, nil +} + +type NullableGetPastLogsV1Request struct { + value *GetPastLogsV1Request + isSet bool +} + +func (v NullableGetPastLogsV1Request) Get() *GetPastLogsV1Request { + return v.value +} + +func (v *NullableGetPastLogsV1Request) Set(val *GetPastLogsV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableGetPastLogsV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableGetPastLogsV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetPastLogsV1Request(val *GetPastLogsV1Request) *NullableGetPastLogsV1Request { + return &NullableGetPastLogsV1Request{value: val, isSet: true} +} + +func (v NullableGetPastLogsV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetPastLogsV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_past_logs_v1_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_past_logs_v1_response.go new file mode 100644 index 00000000000..4a26a2e69a5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_past_logs_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetPastLogsV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetPastLogsV1Response{} + +// GetPastLogsV1Response struct for GetPastLogsV1Response +type GetPastLogsV1Response struct { + Logs []EvmLog `json:"logs"` +} + +// NewGetPastLogsV1Response instantiates a new GetPastLogsV1Response 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 +// will change when the set of required properties is changed +func NewGetPastLogsV1Response(logs []EvmLog) *GetPastLogsV1Response { + this := GetPastLogsV1Response{} + this.Logs = logs + return &this +} + +// NewGetPastLogsV1ResponseWithDefaults instantiates a new GetPastLogsV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetPastLogsV1ResponseWithDefaults() *GetPastLogsV1Response { + this := GetPastLogsV1Response{} + return &this +} + +// GetLogs returns the Logs field value +func (o *GetPastLogsV1Response) GetLogs() []EvmLog { + if o == nil { + var ret []EvmLog + return ret + } + + return o.Logs +} + +// GetLogsOk returns a tuple with the Logs field value +// and a boolean to check if the value has been set. +func (o *GetPastLogsV1Response) GetLogsOk() ([]EvmLog, bool) { + if o == nil { + return nil, false + } + return o.Logs, true +} + +// SetLogs sets field value +func (o *GetPastLogsV1Response) SetLogs(v []EvmLog) { + o.Logs = v +} + +func (o GetPastLogsV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetPastLogsV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["logs"] = o.Logs + return toSerialize, nil +} + +type NullableGetPastLogsV1Response struct { + value *GetPastLogsV1Response + isSet bool +} + +func (v NullableGetPastLogsV1Response) Get() *GetPastLogsV1Response { + return v.value +} + +func (v *NullableGetPastLogsV1Response) Set(val *GetPastLogsV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetPastLogsV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetPastLogsV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetPastLogsV1Response(val *GetPastLogsV1Response) *NullableGetPastLogsV1Response { + return &NullableGetPastLogsV1Response{value: val, isSet: true} +} + +func (v NullableGetPastLogsV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetPastLogsV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_transaction_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_transaction_v1_request.go new file mode 100644 index 00000000000..5de9a18ab98 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_transaction_v1_request.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetTransactionV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetTransactionV1Request{} + +// GetTransactionV1Request struct for GetTransactionV1Request +type GetTransactionV1Request struct { + TransactionHash string `json:"transactionHash"` +} + +// NewGetTransactionV1Request instantiates a new GetTransactionV1Request 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 +// will change when the set of required properties is changed +func NewGetTransactionV1Request(transactionHash string) *GetTransactionV1Request { + this := GetTransactionV1Request{} + this.TransactionHash = transactionHash + return &this +} + +// NewGetTransactionV1RequestWithDefaults instantiates a new GetTransactionV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetTransactionV1RequestWithDefaults() *GetTransactionV1Request { + this := GetTransactionV1Request{} + return &this +} + +// GetTransactionHash returns the TransactionHash field value +func (o *GetTransactionV1Request) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *GetTransactionV1Request) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *GetTransactionV1Request) SetTransactionHash(v string) { + o.TransactionHash = v +} + +func (o GetTransactionV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetTransactionV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionHash"] = o.TransactionHash + return toSerialize, nil +} + +type NullableGetTransactionV1Request struct { + value *GetTransactionV1Request + isSet bool +} + +func (v NullableGetTransactionV1Request) Get() *GetTransactionV1Request { + return v.value +} + +func (v *NullableGetTransactionV1Request) Set(val *GetTransactionV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableGetTransactionV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableGetTransactionV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetTransactionV1Request(val *GetTransactionV1Request) *NullableGetTransactionV1Request { + return &NullableGetTransactionV1Request{value: val, isSet: true} +} + +func (v NullableGetTransactionV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetTransactionV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_transaction_v1_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_transaction_v1_response.go new file mode 100644 index 00000000000..2bafe3c63e8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_get_transaction_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the GetTransactionV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetTransactionV1Response{} + +// GetTransactionV1Response struct for GetTransactionV1Response +type GetTransactionV1Response struct { + Transaction EvmTransaction `json:"transaction"` +} + +// NewGetTransactionV1Response instantiates a new GetTransactionV1Response 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 +// will change when the set of required properties is changed +func NewGetTransactionV1Response(transaction EvmTransaction) *GetTransactionV1Response { + this := GetTransactionV1Response{} + this.Transaction = transaction + return &this +} + +// NewGetTransactionV1ResponseWithDefaults instantiates a new GetTransactionV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetTransactionV1ResponseWithDefaults() *GetTransactionV1Response { + this := GetTransactionV1Response{} + return &this +} + +// GetTransaction returns the Transaction field value +func (o *GetTransactionV1Response) GetTransaction() EvmTransaction { + if o == nil { + var ret EvmTransaction + return ret + } + + return o.Transaction +} + +// GetTransactionOk returns a tuple with the Transaction field value +// and a boolean to check if the value has been set. +func (o *GetTransactionV1Response) GetTransactionOk() (*EvmTransaction, bool) { + if o == nil { + return nil, false + } + return &o.Transaction, true +} + +// SetTransaction sets field value +func (o *GetTransactionV1Response) SetTransaction(v EvmTransaction) { + o.Transaction = v +} + +func (o GetTransactionV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetTransactionV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transaction"] = o.Transaction + return toSerialize, nil +} + +type NullableGetTransactionV1Response struct { + value *GetTransactionV1Response + isSet bool +} + +func (v NullableGetTransactionV1Response) Get() *GetTransactionV1Response { + return v.value +} + +func (v *NullableGetTransactionV1Response) Set(val *GetTransactionV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetTransactionV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetTransactionV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetTransactionV1Response(val *GetTransactionV1Response) *NullableGetTransactionV1Response { + return &NullableGetTransactionV1Response{value: val, isSet: true} +} + +func (v NullableGetTransactionV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetTransactionV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go new file mode 100644 index 00000000000..d708d91869c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go @@ -0,0 +1,559 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Request{} + +// InvokeContractV1Request struct for InvokeContractV1Request +type InvokeContractV1Request struct { + ContractName string `json:"contractName"` + SigningCredential Web3SigningCredential `json:"signingCredential"` + InvocationType EthContractInvocationType `json:"invocationType"` + // The name of the contract method to invoke. + MethodName string `json:"methodName"` + // The list of arguments to pass in to the contract method being invoked. + Params []interface{} `json:"params"` + // The application binary interface of the solidity contract, optional parameter + ContractAbi []interface{} `json:"contractAbi,omitempty"` + // Address of the solidity contract, optional parameter + ContractAddress *string `json:"contractAddress,omitempty"` + Value *Web3BlockHeaderTimestamp `json:"value,omitempty"` + Gas *Web3BlockHeaderTimestamp `json:"gas,omitempty"` + GasPrice *Web3BlockHeaderTimestamp `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + // The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + // The keychainId for retrieve the contracts json. + KeychainId *string `json:"keychainId,omitempty"` + PrivateTransactionConfig *BesuPrivateTransactionConfig `json:"privateTransactionConfig,omitempty"` +} + +// NewInvokeContractV1Request instantiates a new InvokeContractV1Request 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 +// will change when the set of required properties is changed +func NewInvokeContractV1Request(contractName string, signingCredential Web3SigningCredential, invocationType EthContractInvocationType, methodName string, params []interface{}) *InvokeContractV1Request { + this := InvokeContractV1Request{} + this.ContractName = contractName + this.SigningCredential = signingCredential + this.InvocationType = invocationType + this.MethodName = methodName + this.Params = params + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewInvokeContractV1RequestWithDefaults instantiates a new InvokeContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1RequestWithDefaults() *InvokeContractV1Request { + this := InvokeContractV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractName returns the ContractName field value +func (o *InvokeContractV1Request) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *InvokeContractV1Request) SetContractName(v string) { + o.ContractName = v +} + +// GetSigningCredential returns the SigningCredential field value +func (o *InvokeContractV1Request) GetSigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.SigningCredential +} + +// GetSigningCredentialOk returns a tuple with the SigningCredential field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetSigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.SigningCredential, true +} + +// SetSigningCredential sets field value +func (o *InvokeContractV1Request) SetSigningCredential(v Web3SigningCredential) { + o.SigningCredential = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeContractV1Request) GetInvocationType() EthContractInvocationType { + if o == nil { + var ret EthContractInvocationType + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetInvocationTypeOk() (*EthContractInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeContractV1Request) SetInvocationType(v EthContractInvocationType) { + o.InvocationType = v +} + +// GetMethodName returns the MethodName field value +func (o *InvokeContractV1Request) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeContractV1Request) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value +func (o *InvokeContractV1Request) GetParams() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetParamsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *InvokeContractV1Request) SetParams(v []interface{}) { + o.Params = v +} + +// GetContractAbi returns the ContractAbi field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetContractAbi() []interface{} { + if o == nil || IsNil(o.ContractAbi) { + var ret []interface{} + return ret + } + return o.ContractAbi +} + +// GetContractAbiOk returns a tuple with the ContractAbi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetContractAbiOk() ([]interface{}, bool) { + if o == nil || IsNil(o.ContractAbi) { + return nil, false + } + return o.ContractAbi, true +} + +// HasContractAbi returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasContractAbi() bool { + if o != nil && !IsNil(o.ContractAbi) { + return true + } + + return false +} + +// SetContractAbi gets a reference to the given []interface{} and assigns it to the ContractAbi field. +func (o *InvokeContractV1Request) SetContractAbi(v []interface{}) { + o.ContractAbi = v +} + +// GetContractAddress returns the ContractAddress field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetContractAddress() string { + if o == nil || IsNil(o.ContractAddress) { + var ret string + return ret + } + return *o.ContractAddress +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetContractAddressOk() (*string, bool) { + if o == nil || IsNil(o.ContractAddress) { + return nil, false + } + return o.ContractAddress, true +} + +// HasContractAddress returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasContractAddress() bool { + if o != nil && !IsNil(o.ContractAddress) { + return true + } + + return false +} + +// SetContractAddress gets a reference to the given string and assigns it to the ContractAddress field. +func (o *InvokeContractV1Request) SetContractAddress(v string) { + o.ContractAddress = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetValue() Web3BlockHeaderTimestamp { + if o == nil || IsNil(o.Value) { + var ret Web3BlockHeaderTimestamp + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetValueOk() (*Web3BlockHeaderTimestamp, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given Web3BlockHeaderTimestamp and assigns it to the Value field. +func (o *InvokeContractV1Request) SetValue(v Web3BlockHeaderTimestamp) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetGas() Web3BlockHeaderTimestamp { + if o == nil || IsNil(o.Gas) { + var ret Web3BlockHeaderTimestamp + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetGasOk() (*Web3BlockHeaderTimestamp, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given Web3BlockHeaderTimestamp and assigns it to the Gas field. +func (o *InvokeContractV1Request) SetGas(v Web3BlockHeaderTimestamp) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetGasPrice() Web3BlockHeaderTimestamp { + if o == nil || IsNil(o.GasPrice) { + var ret Web3BlockHeaderTimestamp + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetGasPriceOk() (*Web3BlockHeaderTimestamp, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given Web3BlockHeaderTimestamp and assigns it to the GasPrice field. +func (o *InvokeContractV1Request) SetGasPrice(v Web3BlockHeaderTimestamp) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *InvokeContractV1Request) SetNonce(v float32) { + o.Nonce = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *InvokeContractV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetKeychainId returns the KeychainId field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetKeychainId() string { + if o == nil || IsNil(o.KeychainId) { + var ret string + return ret + } + return *o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetKeychainIdOk() (*string, bool) { + if o == nil || IsNil(o.KeychainId) { + return nil, false + } + return o.KeychainId, true +} + +// HasKeychainId returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasKeychainId() bool { + if o != nil && !IsNil(o.KeychainId) { + return true + } + + return false +} + +// SetKeychainId gets a reference to the given string and assigns it to the KeychainId field. +func (o *InvokeContractV1Request) SetKeychainId(v string) { + o.KeychainId = &v +} + +// GetPrivateTransactionConfig returns the PrivateTransactionConfig field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetPrivateTransactionConfig() BesuPrivateTransactionConfig { + if o == nil || IsNil(o.PrivateTransactionConfig) { + var ret BesuPrivateTransactionConfig + return ret + } + return *o.PrivateTransactionConfig +} + +// GetPrivateTransactionConfigOk returns a tuple with the PrivateTransactionConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetPrivateTransactionConfigOk() (*BesuPrivateTransactionConfig, bool) { + if o == nil || IsNil(o.PrivateTransactionConfig) { + return nil, false + } + return o.PrivateTransactionConfig, true +} + +// HasPrivateTransactionConfig returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasPrivateTransactionConfig() bool { + if o != nil && !IsNil(o.PrivateTransactionConfig) { + return true + } + + return false +} + +// SetPrivateTransactionConfig gets a reference to the given BesuPrivateTransactionConfig and assigns it to the PrivateTransactionConfig field. +func (o *InvokeContractV1Request) SetPrivateTransactionConfig(v BesuPrivateTransactionConfig) { + o.PrivateTransactionConfig = &v +} + +func (o InvokeContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + toSerialize["signingCredential"] = o.SigningCredential + toSerialize["invocationType"] = o.InvocationType + toSerialize["methodName"] = o.MethodName + toSerialize["params"] = o.Params + if !IsNil(o.ContractAbi) { + toSerialize["contractAbi"] = o.ContractAbi + } + if !IsNil(o.ContractAddress) { + toSerialize["contractAddress"] = o.ContractAddress + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + if !IsNil(o.KeychainId) { + toSerialize["keychainId"] = o.KeychainId + } + if !IsNil(o.PrivateTransactionConfig) { + toSerialize["privateTransactionConfig"] = o.PrivateTransactionConfig + } + return toSerialize, nil +} + +type NullableInvokeContractV1Request struct { + value *InvokeContractV1Request + isSet bool +} + +func (v NullableInvokeContractV1Request) Get() *InvokeContractV1Request { + return v.value +} + +func (v *NullableInvokeContractV1Request) Set(val *InvokeContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Request(val *InvokeContractV1Request) *NullableInvokeContractV1Request { + return &NullableInvokeContractV1Request{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go new file mode 100644 index 00000000000..8d0e4e6a66a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go @@ -0,0 +1,190 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Response{} + +// InvokeContractV1Response struct for InvokeContractV1Response +type InvokeContractV1Response struct { + TransactionReceipt *Web3TransactionReceipt `json:"transactionReceipt,omitempty"` + CallOutput interface{} `json:"callOutput,omitempty"` + Success bool `json:"success"` +} + +// NewInvokeContractV1Response instantiates a new InvokeContractV1Response 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 +// will change when the set of required properties is changed +func NewInvokeContractV1Response(success bool) *InvokeContractV1Response { + this := InvokeContractV1Response{} + this.Success = success + return &this +} + +// NewInvokeContractV1ResponseWithDefaults instantiates a new InvokeContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1ResponseWithDefaults() *InvokeContractV1Response { + this := InvokeContractV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value if set, zero value otherwise. +func (o *InvokeContractV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil || IsNil(o.TransactionReceipt) { + var ret Web3TransactionReceipt + return ret + } + return *o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil || IsNil(o.TransactionReceipt) { + return nil, false + } + return o.TransactionReceipt, true +} + +// HasTransactionReceipt returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasTransactionReceipt() bool { + if o != nil && !IsNil(o.TransactionReceipt) { + return true + } + + return false +} + +// SetTransactionReceipt gets a reference to the given Web3TransactionReceipt and assigns it to the TransactionReceipt field. +func (o *InvokeContractV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = &v +} + +// GetCallOutput returns the CallOutput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeContractV1Response) GetCallOutput() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.CallOutput +} + +// GetCallOutputOk returns a tuple with the CallOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeContractV1Response) GetCallOutputOk() (*interface{}, bool) { + if o == nil || IsNil(o.CallOutput) { + return nil, false + } + return &o.CallOutput, true +} + +// HasCallOutput returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasCallOutput() bool { + if o != nil && IsNil(o.CallOutput) { + return true + } + + return false +} + +// SetCallOutput gets a reference to the given interface{} and assigns it to the CallOutput field. +func (o *InvokeContractV1Response) SetCallOutput(v interface{}) { + o.CallOutput = v +} + +// GetSuccess returns the Success field value +func (o *InvokeContractV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *InvokeContractV1Response) SetSuccess(v bool) { + o.Success = v +} + +func (o InvokeContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TransactionReceipt) { + toSerialize["transactionReceipt"] = o.TransactionReceipt + } + if o.CallOutput != nil { + toSerialize["callOutput"] = o.CallOutput + } + toSerialize["success"] = o.Success + return toSerialize, nil +} + +type NullableInvokeContractV1Response struct { + value *InvokeContractV1Response + isSet bool +} + +func (v NullableInvokeContractV1Response) Get() *InvokeContractV1Response { + return v.value +} + +func (v *NullableInvokeContractV1Response) Set(val *InvokeContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Response(val *InvokeContractV1Response) *NullableInvokeContractV1Response { + return &NullableInvokeContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_receipt_type.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_receipt_type.go new file mode 100644 index 00000000000..7e729ca5117 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_receipt_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" + "fmt" +) + +// ReceiptType Enumerates the possible types of receipts that can be waited for by someone or something that has requested the execution of a transaction on a ledger. +type ReceiptType string + +// List of ReceiptType +const ( + NODE_TX_POOL_ACK ReceiptType = "NODE_TX_POOL_ACK" + LEDGER_BLOCK_ACK ReceiptType = "LEDGER_BLOCK_ACK" +) + +// All allowed values of ReceiptType enum +var AllowedReceiptTypeEnumValues = []ReceiptType{ + "NODE_TX_POOL_ACK", + "LEDGER_BLOCK_ACK", +} + +func (v *ReceiptType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ReceiptType(value) + for _, existing := range AllowedReceiptTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ReceiptType", value) +} + +// NewReceiptTypeFromValue returns a pointer to a valid ReceiptType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewReceiptTypeFromValue(v string) (*ReceiptType, error) { + ev := ReceiptType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ReceiptType: valid values are %v", v, AllowedReceiptTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ReceiptType) IsValid() bool { + for _, existing := range AllowedReceiptTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ReceiptType value +func (v ReceiptType) Ptr() *ReceiptType { + return &v +} + +type NullableReceiptType struct { + value *ReceiptType + isSet bool +} + +func (v NullableReceiptType) Get() *ReceiptType { + return v.value +} + +func (v *NullableReceiptType) Set(val *ReceiptType) { + v.value = val + v.isSet = true +} + +func (v NullableReceiptType) IsSet() bool { + return v.isSet +} + +func (v *NullableReceiptType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReceiptType(val *ReceiptType) *NullableReceiptType { + return &NullableReceiptType{value: val, isSet: true} +} + +func (v NullableReceiptType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReceiptType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_run_transaction_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_run_transaction_request.go new file mode 100644 index 00000000000..a72071e0f0f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_run_transaction_request.go @@ -0,0 +1,207 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the RunTransactionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionRequest{} + +// RunTransactionRequest struct for RunTransactionRequest +type RunTransactionRequest struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + TransactionConfig BesuTransactionConfig `json:"transactionConfig"` + ConsistencyStrategy ConsistencyStrategy `json:"consistencyStrategy"` + PrivateTransactionConfig *BesuPrivateTransactionConfig `json:"privateTransactionConfig,omitempty"` +} + +// NewRunTransactionRequest instantiates a new RunTransactionRequest 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 +// will change when the set of required properties is changed +func NewRunTransactionRequest(web3SigningCredential Web3SigningCredential, transactionConfig BesuTransactionConfig, consistencyStrategy ConsistencyStrategy) *RunTransactionRequest { + this := RunTransactionRequest{} + this.Web3SigningCredential = web3SigningCredential + this.TransactionConfig = transactionConfig + this.ConsistencyStrategy = consistencyStrategy + return &this +} + +// NewRunTransactionRequestWithDefaults instantiates a new RunTransactionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionRequestWithDefaults() *RunTransactionRequest { + this := RunTransactionRequest{} + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *RunTransactionRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *RunTransactionRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetTransactionConfig returns the TransactionConfig field value +func (o *RunTransactionRequest) GetTransactionConfig() BesuTransactionConfig { + if o == nil { + var ret BesuTransactionConfig + return ret + } + + return o.TransactionConfig +} + +// GetTransactionConfigOk returns a tuple with the TransactionConfig field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetTransactionConfigOk() (*BesuTransactionConfig, bool) { + if o == nil { + return nil, false + } + return &o.TransactionConfig, true +} + +// SetTransactionConfig sets field value +func (o *RunTransactionRequest) SetTransactionConfig(v BesuTransactionConfig) { + o.TransactionConfig = v +} + +// GetConsistencyStrategy returns the ConsistencyStrategy field value +func (o *RunTransactionRequest) GetConsistencyStrategy() ConsistencyStrategy { + if o == nil { + var ret ConsistencyStrategy + return ret + } + + return o.ConsistencyStrategy +} + +// GetConsistencyStrategyOk returns a tuple with the ConsistencyStrategy field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetConsistencyStrategyOk() (*ConsistencyStrategy, bool) { + if o == nil { + return nil, false + } + return &o.ConsistencyStrategy, true +} + +// SetConsistencyStrategy sets field value +func (o *RunTransactionRequest) SetConsistencyStrategy(v ConsistencyStrategy) { + o.ConsistencyStrategy = v +} + +// GetPrivateTransactionConfig returns the PrivateTransactionConfig field value if set, zero value otherwise. +func (o *RunTransactionRequest) GetPrivateTransactionConfig() BesuPrivateTransactionConfig { + if o == nil || IsNil(o.PrivateTransactionConfig) { + var ret BesuPrivateTransactionConfig + return ret + } + return *o.PrivateTransactionConfig +} + +// GetPrivateTransactionConfigOk returns a tuple with the PrivateTransactionConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetPrivateTransactionConfigOk() (*BesuPrivateTransactionConfig, bool) { + if o == nil || IsNil(o.PrivateTransactionConfig) { + return nil, false + } + return o.PrivateTransactionConfig, true +} + +// HasPrivateTransactionConfig returns a boolean if a field has been set. +func (o *RunTransactionRequest) HasPrivateTransactionConfig() bool { + if o != nil && !IsNil(o.PrivateTransactionConfig) { + return true + } + + return false +} + +// SetPrivateTransactionConfig gets a reference to the given BesuPrivateTransactionConfig and assigns it to the PrivateTransactionConfig field. +func (o *RunTransactionRequest) SetPrivateTransactionConfig(v BesuPrivateTransactionConfig) { + o.PrivateTransactionConfig = &v +} + +func (o RunTransactionRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["transactionConfig"] = o.TransactionConfig + toSerialize["consistencyStrategy"] = o.ConsistencyStrategy + if !IsNil(o.PrivateTransactionConfig) { + toSerialize["privateTransactionConfig"] = o.PrivateTransactionConfig + } + return toSerialize, nil +} + +type NullableRunTransactionRequest struct { + value *RunTransactionRequest + isSet bool +} + +func (v NullableRunTransactionRequest) Get() *RunTransactionRequest { + return v.value +} + +func (v *NullableRunTransactionRequest) Set(val *RunTransactionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionRequest(val *RunTransactionRequest) *NullableRunTransactionRequest { + return &NullableRunTransactionRequest{value: val, isSet: true} +} + +func (v NullableRunTransactionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_run_transaction_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_run_transaction_response.go new file mode 100644 index 00000000000..627cac1fa4c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_run_transaction_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the RunTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionResponse{} + +// RunTransactionResponse struct for RunTransactionResponse +type RunTransactionResponse struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewRunTransactionResponse instantiates a new RunTransactionResponse 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 +// will change when the set of required properties is changed +func NewRunTransactionResponse(transactionReceipt Web3TransactionReceipt) *RunTransactionResponse { + this := RunTransactionResponse{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewRunTransactionResponseWithDefaults instantiates a new RunTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionResponseWithDefaults() *RunTransactionResponse { + this := RunTransactionResponse{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *RunTransactionResponse) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *RunTransactionResponse) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *RunTransactionResponse) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o RunTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableRunTransactionResponse struct { + value *RunTransactionResponse + isSet bool +} + +func (v NullableRunTransactionResponse) Get() *RunTransactionResponse { + return v.value +} + +func (v *NullableRunTransactionResponse) Set(val *RunTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionResponse(val *RunTransactionResponse) *NullableRunTransactionResponse { + return &NullableRunTransactionResponse{value: val, isSet: true} +} + +func (v NullableRunTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_sign_transaction_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_sign_transaction_request.go new file mode 100644 index 00000000000..844e41f9eb6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_sign_transaction_request.go @@ -0,0 +1,172 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the SignTransactionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SignTransactionRequest{} + +// SignTransactionRequest struct for SignTransactionRequest +type SignTransactionRequest struct { + KeychainId string `json:"keychainId"` + KeychainRef string `json:"keychainRef"` + // The transaction hash of ledger will be used to fetch the contain. + TransactionHash string `json:"transactionHash"` +} + +// NewSignTransactionRequest instantiates a new SignTransactionRequest 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 +// will change when the set of required properties is changed +func NewSignTransactionRequest(keychainId string, keychainRef string, transactionHash string) *SignTransactionRequest { + this := SignTransactionRequest{} + this.KeychainId = keychainId + this.KeychainRef = keychainRef + this.TransactionHash = transactionHash + return &this +} + +// NewSignTransactionRequestWithDefaults instantiates a new SignTransactionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSignTransactionRequestWithDefaults() *SignTransactionRequest { + this := SignTransactionRequest{} + return &this +} + +// GetKeychainId returns the KeychainId field value +func (o *SignTransactionRequest) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *SignTransactionRequest) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *SignTransactionRequest) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetKeychainRef returns the KeychainRef field value +func (o *SignTransactionRequest) GetKeychainRef() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainRef +} + +// GetKeychainRefOk returns a tuple with the KeychainRef field value +// and a boolean to check if the value has been set. +func (o *SignTransactionRequest) GetKeychainRefOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainRef, true +} + +// SetKeychainRef sets field value +func (o *SignTransactionRequest) SetKeychainRef(v string) { + o.KeychainRef = v +} + +// GetTransactionHash returns the TransactionHash field value +func (o *SignTransactionRequest) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *SignTransactionRequest) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *SignTransactionRequest) SetTransactionHash(v string) { + o.TransactionHash = v +} + +func (o SignTransactionRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SignTransactionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["keychainId"] = o.KeychainId + toSerialize["keychainRef"] = o.KeychainRef + toSerialize["transactionHash"] = o.TransactionHash + return toSerialize, nil +} + +type NullableSignTransactionRequest struct { + value *SignTransactionRequest + isSet bool +} + +func (v NullableSignTransactionRequest) Get() *SignTransactionRequest { + return v.value +} + +func (v *NullableSignTransactionRequest) Set(val *SignTransactionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSignTransactionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSignTransactionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSignTransactionRequest(val *SignTransactionRequest) *NullableSignTransactionRequest { + return &NullableSignTransactionRequest{value: val, isSet: true} +} + +func (v NullableSignTransactionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSignTransactionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_sign_transaction_response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_sign_transaction_response.go new file mode 100644 index 00000000000..bac3b0f4342 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_sign_transaction_response.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the SignTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SignTransactionResponse{} + +// SignTransactionResponse struct for SignTransactionResponse +type SignTransactionResponse struct { + // The signatures of ledger from the corresponding transaction hash. + Signature string `json:"signature"` +} + +// NewSignTransactionResponse instantiates a new SignTransactionResponse 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 +// will change when the set of required properties is changed +func NewSignTransactionResponse(signature string) *SignTransactionResponse { + this := SignTransactionResponse{} + this.Signature = signature + return &this +} + +// NewSignTransactionResponseWithDefaults instantiates a new SignTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSignTransactionResponseWithDefaults() *SignTransactionResponse { + this := SignTransactionResponse{} + return &this +} + +// GetSignature returns the Signature field value +func (o *SignTransactionResponse) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *SignTransactionResponse) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *SignTransactionResponse) SetSignature(v string) { + o.Signature = v +} + +func (o SignTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SignTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableSignTransactionResponse struct { + value *SignTransactionResponse + isSet bool +} + +func (v NullableSignTransactionResponse) Get() *SignTransactionResponse { + return v.value +} + +func (v *NullableSignTransactionResponse) Set(val *SignTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSignTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSignTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSignTransactionResponse(val *SignTransactionResponse) *NullableSignTransactionResponse { + return &NullableSignTransactionResponse{value: val, isSet: true} +} + +func (v NullableSignTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSignTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go new file mode 100644 index 00000000000..6cd73d2ae57 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go @@ -0,0 +1,441 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifact type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifact{} + +// SolidityContractJsonArtifact struct for SolidityContractJsonArtifact +type SolidityContractJsonArtifact struct { + ContractName string `json:"contractName"` + Metadata *string `json:"metadata,omitempty"` + Bytecode *string `json:"bytecode,omitempty"` + DeployedBytecode *string `json:"deployedBytecode,omitempty"` + SourceMap *string `json:"sourceMap,omitempty"` + DeployedSourceMap *string `json:"deployedSourceMap,omitempty"` + SourcePath *string `json:"sourcePath,omitempty"` + Compiler *SolidityContractJsonArtifactCompiler `json:"compiler,omitempty"` + FunctionHashes map[string]interface{} `json:"functionHashes,omitempty"` + GasEstimates *SolidityContractJsonArtifactGasEstimates `json:"gasEstimates,omitempty"` +} + +// NewSolidityContractJsonArtifact instantiates a new SolidityContractJsonArtifact 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 +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifact(contractName string) *SolidityContractJsonArtifact { + this := SolidityContractJsonArtifact{} + this.ContractName = contractName + return &this +} + +// NewSolidityContractJsonArtifactWithDefaults instantiates a new SolidityContractJsonArtifact object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactWithDefaults() *SolidityContractJsonArtifact { + this := SolidityContractJsonArtifact{} + return &this +} + +// GetContractName returns the ContractName field value +func (o *SolidityContractJsonArtifact) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *SolidityContractJsonArtifact) SetContractName(v string) { + o.ContractName = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetMetadata() string { + if o == nil || IsNil(o.Metadata) { + var ret string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetMetadataOk() (*string, bool) { + if o == nil || IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given string and assigns it to the Metadata field. +func (o *SolidityContractJsonArtifact) SetMetadata(v string) { + o.Metadata = &v +} + +// GetBytecode returns the Bytecode field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetBytecode() string { + if o == nil || IsNil(o.Bytecode) { + var ret string + return ret + } + return *o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.Bytecode) { + return nil, false + } + return o.Bytecode, true +} + +// HasBytecode returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasBytecode() bool { + if o != nil && !IsNil(o.Bytecode) { + return true + } + + return false +} + +// SetBytecode gets a reference to the given string and assigns it to the Bytecode field. +func (o *SolidityContractJsonArtifact) SetBytecode(v string) { + o.Bytecode = &v +} + +// GetDeployedBytecode returns the DeployedBytecode field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetDeployedBytecode() string { + if o == nil || IsNil(o.DeployedBytecode) { + var ret string + return ret + } + return *o.DeployedBytecode +} + +// GetDeployedBytecodeOk returns a tuple with the DeployedBytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetDeployedBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.DeployedBytecode) { + return nil, false + } + return o.DeployedBytecode, true +} + +// HasDeployedBytecode returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasDeployedBytecode() bool { + if o != nil && !IsNil(o.DeployedBytecode) { + return true + } + + return false +} + +// SetDeployedBytecode gets a reference to the given string and assigns it to the DeployedBytecode field. +func (o *SolidityContractJsonArtifact) SetDeployedBytecode(v string) { + o.DeployedBytecode = &v +} + +// GetSourceMap returns the SourceMap field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetSourceMap() string { + if o == nil || IsNil(o.SourceMap) { + var ret string + return ret + } + return *o.SourceMap +} + +// GetSourceMapOk returns a tuple with the SourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.SourceMap) { + return nil, false + } + return o.SourceMap, true +} + +// HasSourceMap returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasSourceMap() bool { + if o != nil && !IsNil(o.SourceMap) { + return true + } + + return false +} + +// SetSourceMap gets a reference to the given string and assigns it to the SourceMap field. +func (o *SolidityContractJsonArtifact) SetSourceMap(v string) { + o.SourceMap = &v +} + +// GetDeployedSourceMap returns the DeployedSourceMap field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetDeployedSourceMap() string { + if o == nil || IsNil(o.DeployedSourceMap) { + var ret string + return ret + } + return *o.DeployedSourceMap +} + +// GetDeployedSourceMapOk returns a tuple with the DeployedSourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetDeployedSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.DeployedSourceMap) { + return nil, false + } + return o.DeployedSourceMap, true +} + +// HasDeployedSourceMap returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasDeployedSourceMap() bool { + if o != nil && !IsNil(o.DeployedSourceMap) { + return true + } + + return false +} + +// SetDeployedSourceMap gets a reference to the given string and assigns it to the DeployedSourceMap field. +func (o *SolidityContractJsonArtifact) SetDeployedSourceMap(v string) { + o.DeployedSourceMap = &v +} + +// GetSourcePath returns the SourcePath field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetSourcePath() string { + if o == nil || IsNil(o.SourcePath) { + var ret string + return ret + } + return *o.SourcePath +} + +// GetSourcePathOk returns a tuple with the SourcePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetSourcePathOk() (*string, bool) { + if o == nil || IsNil(o.SourcePath) { + return nil, false + } + return o.SourcePath, true +} + +// HasSourcePath returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasSourcePath() bool { + if o != nil && !IsNil(o.SourcePath) { + return true + } + + return false +} + +// SetSourcePath gets a reference to the given string and assigns it to the SourcePath field. +func (o *SolidityContractJsonArtifact) SetSourcePath(v string) { + o.SourcePath = &v +} + +// GetCompiler returns the Compiler field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetCompiler() SolidityContractJsonArtifactCompiler { + if o == nil || IsNil(o.Compiler) { + var ret SolidityContractJsonArtifactCompiler + return ret + } + return *o.Compiler +} + +// GetCompilerOk returns a tuple with the Compiler field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetCompilerOk() (*SolidityContractJsonArtifactCompiler, bool) { + if o == nil || IsNil(o.Compiler) { + return nil, false + } + return o.Compiler, true +} + +// HasCompiler returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasCompiler() bool { + if o != nil && !IsNil(o.Compiler) { + return true + } + + return false +} + +// SetCompiler gets a reference to the given SolidityContractJsonArtifactCompiler and assigns it to the Compiler field. +func (o *SolidityContractJsonArtifact) SetCompiler(v SolidityContractJsonArtifactCompiler) { + o.Compiler = &v +} + +// GetFunctionHashes returns the FunctionHashes field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetFunctionHashes() map[string]interface{} { + if o == nil || IsNil(o.FunctionHashes) { + var ret map[string]interface{} + return ret + } + return o.FunctionHashes +} + +// GetFunctionHashesOk returns a tuple with the FunctionHashes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetFunctionHashesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FunctionHashes) { + return map[string]interface{}{}, false + } + return o.FunctionHashes, true +} + +// HasFunctionHashes returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasFunctionHashes() bool { + if o != nil && !IsNil(o.FunctionHashes) { + return true + } + + return false +} + +// SetFunctionHashes gets a reference to the given map[string]interface{} and assigns it to the FunctionHashes field. +func (o *SolidityContractJsonArtifact) SetFunctionHashes(v map[string]interface{}) { + o.FunctionHashes = v +} + +// GetGasEstimates returns the GasEstimates field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetGasEstimates() SolidityContractJsonArtifactGasEstimates { + if o == nil || IsNil(o.GasEstimates) { + var ret SolidityContractJsonArtifactGasEstimates + return ret + } + return *o.GasEstimates +} + +// GetGasEstimatesOk returns a tuple with the GasEstimates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetGasEstimatesOk() (*SolidityContractJsonArtifactGasEstimates, bool) { + if o == nil || IsNil(o.GasEstimates) { + return nil, false + } + return o.GasEstimates, true +} + +// HasGasEstimates returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasGasEstimates() bool { + if o != nil && !IsNil(o.GasEstimates) { + return true + } + + return false +} + +// SetGasEstimates gets a reference to the given SolidityContractJsonArtifactGasEstimates and assigns it to the GasEstimates field. +func (o *SolidityContractJsonArtifact) SetGasEstimates(v SolidityContractJsonArtifactGasEstimates) { + o.GasEstimates = &v +} + +func (o SolidityContractJsonArtifact) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifact) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !IsNil(o.Bytecode) { + toSerialize["bytecode"] = o.Bytecode + } + if !IsNil(o.DeployedBytecode) { + toSerialize["deployedBytecode"] = o.DeployedBytecode + } + if !IsNil(o.SourceMap) { + toSerialize["sourceMap"] = o.SourceMap + } + if !IsNil(o.DeployedSourceMap) { + toSerialize["deployedSourceMap"] = o.DeployedSourceMap + } + if !IsNil(o.SourcePath) { + toSerialize["sourcePath"] = o.SourcePath + } + if !IsNil(o.Compiler) { + toSerialize["compiler"] = o.Compiler + } + if !IsNil(o.FunctionHashes) { + toSerialize["functionHashes"] = o.FunctionHashes + } + if !IsNil(o.GasEstimates) { + toSerialize["gasEstimates"] = o.GasEstimates + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifact struct { + value *SolidityContractJsonArtifact + isSet bool +} + +func (v NullableSolidityContractJsonArtifact) Get() *SolidityContractJsonArtifact { + return v.value +} + +func (v *NullableSolidityContractJsonArtifact) Set(val *SolidityContractJsonArtifact) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifact) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifact) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifact(val *SolidityContractJsonArtifact) *NullableSolidityContractJsonArtifact { + return &NullableSolidityContractJsonArtifact{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifact) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifact) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go new file mode 100644 index 00000000000..4b927356a89 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go @@ -0,0 +1,188 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactCompiler type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactCompiler{} + +// SolidityContractJsonArtifactCompiler struct for SolidityContractJsonArtifactCompiler +type SolidityContractJsonArtifactCompiler struct { + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SolidityContractJsonArtifactCompiler SolidityContractJsonArtifactCompiler + +// NewSolidityContractJsonArtifactCompiler instantiates a new SolidityContractJsonArtifactCompiler 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 +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactCompiler() *SolidityContractJsonArtifactCompiler { + this := SolidityContractJsonArtifactCompiler{} + return &this +} + +// NewSolidityContractJsonArtifactCompilerWithDefaults instantiates a new SolidityContractJsonArtifactCompiler object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactCompilerWithDefaults() *SolidityContractJsonArtifactCompiler { + this := SolidityContractJsonArtifactCompiler{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactCompiler) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactCompiler) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactCompiler) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SolidityContractJsonArtifactCompiler) SetName(v string) { + o.Name = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactCompiler) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactCompiler) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactCompiler) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *SolidityContractJsonArtifactCompiler) SetVersion(v string) { + o.Version = &v +} + +func (o SolidityContractJsonArtifactCompiler) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactCompiler) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SolidityContractJsonArtifactCompiler) UnmarshalJSON(bytes []byte) (err error) { + varSolidityContractJsonArtifactCompiler := _SolidityContractJsonArtifactCompiler{} + + if err = json.Unmarshal(bytes, &varSolidityContractJsonArtifactCompiler); err == nil { + *o = SolidityContractJsonArtifactCompiler(varSolidityContractJsonArtifactCompiler) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSolidityContractJsonArtifactCompiler struct { + value *SolidityContractJsonArtifactCompiler + isSet bool +} + +func (v NullableSolidityContractJsonArtifactCompiler) Get() *SolidityContractJsonArtifactCompiler { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactCompiler) Set(val *SolidityContractJsonArtifactCompiler) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactCompiler) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactCompiler) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactCompiler(val *SolidityContractJsonArtifactCompiler) *NullableSolidityContractJsonArtifactCompiler { + return &NullableSolidityContractJsonArtifactCompiler{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactCompiler) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactCompiler) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go new file mode 100644 index 00000000000..226fc7181ac --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactGasEstimates type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactGasEstimates{} + +// SolidityContractJsonArtifactGasEstimates struct for SolidityContractJsonArtifactGasEstimates +type SolidityContractJsonArtifactGasEstimates struct { + Creation *SolidityContractJsonArtifactGasEstimatesCreation `json:"creation,omitempty"` + External map[string]interface{} `json:"external,omitempty"` +} + +// NewSolidityContractJsonArtifactGasEstimates instantiates a new SolidityContractJsonArtifactGasEstimates 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 +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactGasEstimates() *SolidityContractJsonArtifactGasEstimates { + this := SolidityContractJsonArtifactGasEstimates{} + return &this +} + +// NewSolidityContractJsonArtifactGasEstimatesWithDefaults instantiates a new SolidityContractJsonArtifactGasEstimates object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactGasEstimatesWithDefaults() *SolidityContractJsonArtifactGasEstimates { + this := SolidityContractJsonArtifactGasEstimates{} + return &this +} + +// GetCreation returns the Creation field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimates) GetCreation() SolidityContractJsonArtifactGasEstimatesCreation { + if o == nil || IsNil(o.Creation) { + var ret SolidityContractJsonArtifactGasEstimatesCreation + return ret + } + return *o.Creation +} + +// GetCreationOk returns a tuple with the Creation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimates) GetCreationOk() (*SolidityContractJsonArtifactGasEstimatesCreation, bool) { + if o == nil || IsNil(o.Creation) { + return nil, false + } + return o.Creation, true +} + +// HasCreation returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimates) HasCreation() bool { + if o != nil && !IsNil(o.Creation) { + return true + } + + return false +} + +// SetCreation gets a reference to the given SolidityContractJsonArtifactGasEstimatesCreation and assigns it to the Creation field. +func (o *SolidityContractJsonArtifactGasEstimates) SetCreation(v SolidityContractJsonArtifactGasEstimatesCreation) { + o.Creation = &v +} + +// GetExternal returns the External field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimates) GetExternal() map[string]interface{} { + if o == nil || IsNil(o.External) { + var ret map[string]interface{} + return ret + } + return o.External +} + +// GetExternalOk returns a tuple with the External field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimates) GetExternalOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.External) { + return map[string]interface{}{}, false + } + return o.External, true +} + +// HasExternal returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimates) HasExternal() bool { + if o != nil && !IsNil(o.External) { + return true + } + + return false +} + +// SetExternal gets a reference to the given map[string]interface{} and assigns it to the External field. +func (o *SolidityContractJsonArtifactGasEstimates) SetExternal(v map[string]interface{}) { + o.External = v +} + +func (o SolidityContractJsonArtifactGasEstimates) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactGasEstimates) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Creation) { + toSerialize["creation"] = o.Creation + } + if !IsNil(o.External) { + toSerialize["external"] = o.External + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifactGasEstimates struct { + value *SolidityContractJsonArtifactGasEstimates + isSet bool +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) Get() *SolidityContractJsonArtifactGasEstimates { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) Set(val *SolidityContractJsonArtifactGasEstimates) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactGasEstimates(val *SolidityContractJsonArtifactGasEstimates) *NullableSolidityContractJsonArtifactGasEstimates { + return &NullableSolidityContractJsonArtifactGasEstimates{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go new file mode 100644 index 00000000000..01601925d27 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactGasEstimatesCreation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactGasEstimatesCreation{} + +// SolidityContractJsonArtifactGasEstimatesCreation struct for SolidityContractJsonArtifactGasEstimatesCreation +type SolidityContractJsonArtifactGasEstimatesCreation struct { + CodeDepositCost *string `json:"codeDepositCost,omitempty"` + ExecutionCost *string `json:"executionCost,omitempty"` + TotalCost *string `json:"totalCost,omitempty"` +} + +// NewSolidityContractJsonArtifactGasEstimatesCreation instantiates a new SolidityContractJsonArtifactGasEstimatesCreation 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 +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactGasEstimatesCreation() *SolidityContractJsonArtifactGasEstimatesCreation { + this := SolidityContractJsonArtifactGasEstimatesCreation{} + return &this +} + +// NewSolidityContractJsonArtifactGasEstimatesCreationWithDefaults instantiates a new SolidityContractJsonArtifactGasEstimatesCreation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactGasEstimatesCreationWithDefaults() *SolidityContractJsonArtifactGasEstimatesCreation { + this := SolidityContractJsonArtifactGasEstimatesCreation{} + return &this +} + +// GetCodeDepositCost returns the CodeDepositCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetCodeDepositCost() string { + if o == nil || IsNil(o.CodeDepositCost) { + var ret string + return ret + } + return *o.CodeDepositCost +} + +// GetCodeDepositCostOk returns a tuple with the CodeDepositCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetCodeDepositCostOk() (*string, bool) { + if o == nil || IsNil(o.CodeDepositCost) { + return nil, false + } + return o.CodeDepositCost, true +} + +// HasCodeDepositCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasCodeDepositCost() bool { + if o != nil && !IsNil(o.CodeDepositCost) { + return true + } + + return false +} + +// SetCodeDepositCost gets a reference to the given string and assigns it to the CodeDepositCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetCodeDepositCost(v string) { + o.CodeDepositCost = &v +} + +// GetExecutionCost returns the ExecutionCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetExecutionCost() string { + if o == nil || IsNil(o.ExecutionCost) { + var ret string + return ret + } + return *o.ExecutionCost +} + +// GetExecutionCostOk returns a tuple with the ExecutionCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetExecutionCostOk() (*string, bool) { + if o == nil || IsNil(o.ExecutionCost) { + return nil, false + } + return o.ExecutionCost, true +} + +// HasExecutionCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasExecutionCost() bool { + if o != nil && !IsNil(o.ExecutionCost) { + return true + } + + return false +} + +// SetExecutionCost gets a reference to the given string and assigns it to the ExecutionCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetExecutionCost(v string) { + o.ExecutionCost = &v +} + +// GetTotalCost returns the TotalCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetTotalCost() string { + if o == nil || IsNil(o.TotalCost) { + var ret string + return ret + } + return *o.TotalCost +} + +// GetTotalCostOk returns a tuple with the TotalCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetTotalCostOk() (*string, bool) { + if o == nil || IsNil(o.TotalCost) { + return nil, false + } + return o.TotalCost, true +} + +// HasTotalCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasTotalCost() bool { + if o != nil && !IsNil(o.TotalCost) { + return true + } + + return false +} + +// SetTotalCost gets a reference to the given string and assigns it to the TotalCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetTotalCost(v string) { + o.TotalCost = &v +} + +func (o SolidityContractJsonArtifactGasEstimatesCreation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactGasEstimatesCreation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CodeDepositCost) { + toSerialize["codeDepositCost"] = o.CodeDepositCost + } + if !IsNil(o.ExecutionCost) { + toSerialize["executionCost"] = o.ExecutionCost + } + if !IsNil(o.TotalCost) { + toSerialize["totalCost"] = o.TotalCost + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifactGasEstimatesCreation struct { + value *SolidityContractJsonArtifactGasEstimatesCreation + isSet bool +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) Get() *SolidityContractJsonArtifactGasEstimatesCreation { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) Set(val *SolidityContractJsonArtifactGasEstimatesCreation) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactGasEstimatesCreation(val *SolidityContractJsonArtifactGasEstimatesCreation) *NullableSolidityContractJsonArtifactGasEstimatesCreation { + return &NullableSolidityContractJsonArtifactGasEstimatesCreation{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go new file mode 100644 index 00000000000..f604658d4dc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksV1 the model 'WatchBlocksV1' +type WatchBlocksV1 string + +// List of WatchBlocksV1 +const ( + Subscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Subscribe" + Next WatchBlocksV1 = "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Next" + Unsubscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Unsubscribe" + Error WatchBlocksV1 = "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Error" + Complete WatchBlocksV1 = "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Complete" +) + +// All allowed values of WatchBlocksV1 enum +var AllowedWatchBlocksV1EnumValues = []WatchBlocksV1{ + "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Subscribe", + "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Next", + "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Unsubscribe", + "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Error", + "org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Complete", +} + +func (v *WatchBlocksV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchBlocksV1(value) + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchBlocksV1", value) +} + +// NewWatchBlocksV1FromValue returns a pointer to a valid WatchBlocksV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchBlocksV1FromValue(v string) (*WatchBlocksV1, error) { + ev := WatchBlocksV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchBlocksV1: valid values are %v", v, AllowedWatchBlocksV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchBlocksV1) IsValid() bool { + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchBlocksV1 value +func (v WatchBlocksV1) Ptr() *WatchBlocksV1 { + return &v +} + +type NullableWatchBlocksV1 struct { + value *WatchBlocksV1 + isSet bool +} + +func (v NullableWatchBlocksV1) Get() *WatchBlocksV1 { + return v.value +} + +func (v *NullableWatchBlocksV1) Set(val *WatchBlocksV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1(val *WatchBlocksV1) *NullableWatchBlocksV1 { + return &NullableWatchBlocksV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go new file mode 100644 index 00000000000..f1242a35216 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1Progress type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1Progress{} + +// WatchBlocksV1Progress struct for WatchBlocksV1Progress +type WatchBlocksV1Progress struct { + BlockHeader Web3BlockHeader `json:"blockHeader"` +} + +// NewWatchBlocksV1Progress instantiates a new WatchBlocksV1Progress 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 +// will change when the set of required properties is changed +func NewWatchBlocksV1Progress(blockHeader Web3BlockHeader) *WatchBlocksV1Progress { + this := WatchBlocksV1Progress{} + this.BlockHeader = blockHeader + return &this +} + +// NewWatchBlocksV1ProgressWithDefaults instantiates a new WatchBlocksV1Progress object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1ProgressWithDefaults() *WatchBlocksV1Progress { + this := WatchBlocksV1Progress{} + return &this +} + +// GetBlockHeader returns the BlockHeader field value +func (o *WatchBlocksV1Progress) GetBlockHeader() Web3BlockHeader { + if o == nil { + var ret Web3BlockHeader + return ret + } + + return o.BlockHeader +} + +// GetBlockHeaderOk returns a tuple with the BlockHeader field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Progress) GetBlockHeaderOk() (*Web3BlockHeader, bool) { + if o == nil { + return nil, false + } + return &o.BlockHeader, true +} + +// SetBlockHeader sets field value +func (o *WatchBlocksV1Progress) SetBlockHeader(v Web3BlockHeader) { + o.BlockHeader = v +} + +func (o WatchBlocksV1Progress) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1Progress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["blockHeader"] = o.BlockHeader + return toSerialize, nil +} + +type NullableWatchBlocksV1Progress struct { + value *WatchBlocksV1Progress + isSet bool +} + +func (v NullableWatchBlocksV1Progress) Get() *WatchBlocksV1Progress { + return v.value +} + +func (v *NullableWatchBlocksV1Progress) Set(val *WatchBlocksV1Progress) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1Progress) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1Progress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1Progress(val *WatchBlocksV1Progress) *NullableWatchBlocksV1Progress { + return &NullableWatchBlocksV1Progress{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1Progress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1Progress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_block_header.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_block_header.go new file mode 100644 index 00000000000..54dec170522 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_block_header.go @@ -0,0 +1,468 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the Web3BlockHeader type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3BlockHeader{} + +// Web3BlockHeader struct for Web3BlockHeader +type Web3BlockHeader struct { + Number float32 `json:"number"` + Hash string `json:"hash"` + ParentHash string `json:"parentHash"` + Nonce string `json:"nonce"` + Sha3Uncles string `json:"sha3Uncles"` + LogsBloom string `json:"logsBloom"` + TransactionRoot string `json:"transactionRoot"` + StateRoot string `json:"stateRoot"` + ReceiptRoot string `json:"receiptRoot"` + Miner string `json:"miner"` + ExtraData string `json:"extraData"` + GasLimit int32 `json:"gasLimit"` + GasUsed int32 `json:"gasUsed"` + Timestamp Web3BlockHeaderTimestamp `json:"timestamp"` +} + +// NewWeb3BlockHeader instantiates a new Web3BlockHeader 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 +// will change when the set of required properties is changed +func NewWeb3BlockHeader(number float32, hash string, parentHash string, nonce string, sha3Uncles string, logsBloom string, transactionRoot string, stateRoot string, receiptRoot string, miner string, extraData string, gasLimit int32, gasUsed int32, timestamp Web3BlockHeaderTimestamp) *Web3BlockHeader { + this := Web3BlockHeader{} + this.Number = number + this.Hash = hash + this.ParentHash = parentHash + this.Nonce = nonce + this.Sha3Uncles = sha3Uncles + this.LogsBloom = logsBloom + this.TransactionRoot = transactionRoot + this.StateRoot = stateRoot + this.ReceiptRoot = receiptRoot + this.Miner = miner + this.ExtraData = extraData + this.GasLimit = gasLimit + this.GasUsed = gasUsed + this.Timestamp = timestamp + return &this +} + +// NewWeb3BlockHeaderWithDefaults instantiates a new Web3BlockHeader object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3BlockHeaderWithDefaults() *Web3BlockHeader { + this := Web3BlockHeader{} + return &this +} + +// GetNumber returns the Number field value +func (o *Web3BlockHeader) GetNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Number +} + +// GetNumberOk returns a tuple with the Number field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Number, true +} + +// SetNumber sets field value +func (o *Web3BlockHeader) SetNumber(v float32) { + o.Number = v +} + +// GetHash returns the Hash field value +func (o *Web3BlockHeader) GetHash() string { + if o == nil { + var ret string + return ret + } + + return o.Hash +} + +// GetHashOk returns a tuple with the Hash field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *Web3BlockHeader) SetHash(v string) { + o.Hash = v +} + +// GetParentHash returns the ParentHash field value +func (o *Web3BlockHeader) GetParentHash() string { + if o == nil { + var ret string + return ret + } + + return o.ParentHash +} + +// GetParentHashOk returns a tuple with the ParentHash field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetParentHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ParentHash, true +} + +// SetParentHash sets field value +func (o *Web3BlockHeader) SetParentHash(v string) { + o.ParentHash = v +} + +// GetNonce returns the Nonce field value +func (o *Web3BlockHeader) GetNonce() string { + if o == nil { + var ret string + return ret + } + + return o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetNonceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Nonce, true +} + +// SetNonce sets field value +func (o *Web3BlockHeader) SetNonce(v string) { + o.Nonce = v +} + +// GetSha3Uncles returns the Sha3Uncles field value +func (o *Web3BlockHeader) GetSha3Uncles() string { + if o == nil { + var ret string + return ret + } + + return o.Sha3Uncles +} + +// GetSha3UnclesOk returns a tuple with the Sha3Uncles field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetSha3UnclesOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Sha3Uncles, true +} + +// SetSha3Uncles sets field value +func (o *Web3BlockHeader) SetSha3Uncles(v string) { + o.Sha3Uncles = v +} + +// GetLogsBloom returns the LogsBloom field value +func (o *Web3BlockHeader) GetLogsBloom() string { + if o == nil { + var ret string + return ret + } + + return o.LogsBloom +} + +// GetLogsBloomOk returns a tuple with the LogsBloom field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetLogsBloomOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LogsBloom, true +} + +// SetLogsBloom sets field value +func (o *Web3BlockHeader) SetLogsBloom(v string) { + o.LogsBloom = v +} + +// GetTransactionRoot returns the TransactionRoot field value +func (o *Web3BlockHeader) GetTransactionRoot() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionRoot +} + +// GetTransactionRootOk returns a tuple with the TransactionRoot field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetTransactionRootOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionRoot, true +} + +// SetTransactionRoot sets field value +func (o *Web3BlockHeader) SetTransactionRoot(v string) { + o.TransactionRoot = v +} + +// GetStateRoot returns the StateRoot field value +func (o *Web3BlockHeader) GetStateRoot() string { + if o == nil { + var ret string + return ret + } + + return o.StateRoot +} + +// GetStateRootOk returns a tuple with the StateRoot field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetStateRootOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateRoot, true +} + +// SetStateRoot sets field value +func (o *Web3BlockHeader) SetStateRoot(v string) { + o.StateRoot = v +} + +// GetReceiptRoot returns the ReceiptRoot field value +func (o *Web3BlockHeader) GetReceiptRoot() string { + if o == nil { + var ret string + return ret + } + + return o.ReceiptRoot +} + +// GetReceiptRootOk returns a tuple with the ReceiptRoot field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetReceiptRootOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ReceiptRoot, true +} + +// SetReceiptRoot sets field value +func (o *Web3BlockHeader) SetReceiptRoot(v string) { + o.ReceiptRoot = v +} + +// GetMiner returns the Miner field value +func (o *Web3BlockHeader) GetMiner() string { + if o == nil { + var ret string + return ret + } + + return o.Miner +} + +// GetMinerOk returns a tuple with the Miner field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetMinerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Miner, true +} + +// SetMiner sets field value +func (o *Web3BlockHeader) SetMiner(v string) { + o.Miner = v +} + +// GetExtraData returns the ExtraData field value +func (o *Web3BlockHeader) GetExtraData() string { + if o == nil { + var ret string + return ret + } + + return o.ExtraData +} + +// GetExtraDataOk returns a tuple with the ExtraData field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetExtraDataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExtraData, true +} + +// SetExtraData sets field value +func (o *Web3BlockHeader) SetExtraData(v string) { + o.ExtraData = v +} + +// GetGasLimit returns the GasLimit field value +func (o *Web3BlockHeader) GetGasLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.GasLimit +} + +// GetGasLimitOk returns a tuple with the GasLimit field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetGasLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.GasLimit, true +} + +// SetGasLimit sets field value +func (o *Web3BlockHeader) SetGasLimit(v int32) { + o.GasLimit = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3BlockHeader) GetGasUsed() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetGasUsedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3BlockHeader) SetGasUsed(v int32) { + o.GasUsed = v +} + +// GetTimestamp returns the Timestamp field value +func (o *Web3BlockHeader) GetTimestamp() Web3BlockHeaderTimestamp { + if o == nil { + var ret Web3BlockHeaderTimestamp + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetTimestampOk() (*Web3BlockHeaderTimestamp, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *Web3BlockHeader) SetTimestamp(v Web3BlockHeaderTimestamp) { + o.Timestamp = v +} + +func (o Web3BlockHeader) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3BlockHeader) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["number"] = o.Number + toSerialize["hash"] = o.Hash + toSerialize["parentHash"] = o.ParentHash + toSerialize["nonce"] = o.Nonce + toSerialize["sha3Uncles"] = o.Sha3Uncles + toSerialize["logsBloom"] = o.LogsBloom + toSerialize["transactionRoot"] = o.TransactionRoot + toSerialize["stateRoot"] = o.StateRoot + toSerialize["receiptRoot"] = o.ReceiptRoot + toSerialize["miner"] = o.Miner + toSerialize["extraData"] = o.ExtraData + toSerialize["gasLimit"] = o.GasLimit + toSerialize["gasUsed"] = o.GasUsed + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + +type NullableWeb3BlockHeader struct { + value *Web3BlockHeader + isSet bool +} + +func (v NullableWeb3BlockHeader) Get() *Web3BlockHeader { + return v.value +} + +func (v *NullableWeb3BlockHeader) Set(val *Web3BlockHeader) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3BlockHeader) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3BlockHeader) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3BlockHeader(val *Web3BlockHeader) *NullableWeb3BlockHeader { + return &NullableWeb3BlockHeader{value: val, isSet: true} +} + +func (v NullableWeb3BlockHeader) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3BlockHeader) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_block_header_timestamp.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_block_header_timestamp.go new file mode 100644 index 00000000000..c9f09a037ee --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_block_header_timestamp.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" + "fmt" +) + +// Web3BlockHeaderTimestamp - struct for Web3BlockHeaderTimestamp +type Web3BlockHeaderTimestamp struct { + Float32 *float32 + String *string +} + +// float32AsWeb3BlockHeaderTimestamp is a convenience function that returns float32 wrapped in Web3BlockHeaderTimestamp +func Float32AsWeb3BlockHeaderTimestamp(v *float32) Web3BlockHeaderTimestamp { + return Web3BlockHeaderTimestamp{ + Float32: v, + } +} + +// stringAsWeb3BlockHeaderTimestamp is a convenience function that returns string wrapped in Web3BlockHeaderTimestamp +func StringAsWeb3BlockHeaderTimestamp(v *string) Web3BlockHeaderTimestamp { + return Web3BlockHeaderTimestamp{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Web3BlockHeaderTimestamp) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Float32 + err = newStrictDecoder(data).Decode(&dst.Float32) + if err == nil { + jsonFloat32, _ := json.Marshal(dst.Float32) + if string(jsonFloat32) == "{}" { // empty struct + dst.Float32 = nil + } else { + match++ + } + } else { + dst.Float32 = nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Float32 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Web3BlockHeaderTimestamp)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Web3BlockHeaderTimestamp)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Web3BlockHeaderTimestamp) MarshalJSON() ([]byte, error) { + if src.Float32 != nil { + return json.Marshal(&src.Float32) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Web3BlockHeaderTimestamp) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Float32 != nil { + return obj.Float32 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableWeb3BlockHeaderTimestamp struct { + value *Web3BlockHeaderTimestamp + isSet bool +} + +func (v NullableWeb3BlockHeaderTimestamp) Get() *Web3BlockHeaderTimestamp { + return v.value +} + +func (v *NullableWeb3BlockHeaderTimestamp) Set(val *Web3BlockHeaderTimestamp) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3BlockHeaderTimestamp) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3BlockHeaderTimestamp) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3BlockHeaderTimestamp(val *Web3BlockHeaderTimestamp) *NullableWeb3BlockHeaderTimestamp { + return &NullableWeb3BlockHeaderTimestamp{value: val, isSet: true} +} + +func (v NullableWeb3BlockHeaderTimestamp) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3BlockHeaderTimestamp) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go new file mode 100644 index 00000000000..af9428c82c5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go @@ -0,0 +1,178 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredential - struct for Web3SigningCredential +type Web3SigningCredential struct { + Web3SigningCredentialCactusKeychainRef *Web3SigningCredentialCactusKeychainRef + Web3SigningCredentialNone *Web3SigningCredentialNone + Web3SigningCredentialPrivateKeyHex *Web3SigningCredentialPrivateKeyHex +} + +// Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialCactusKeychainRef wrapped in Web3SigningCredential +func Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential(v *Web3SigningCredentialCactusKeychainRef) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialCactusKeychainRef: v, + } +} + +// Web3SigningCredentialNoneAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialNone wrapped in Web3SigningCredential +func Web3SigningCredentialNoneAsWeb3SigningCredential(v *Web3SigningCredentialNone) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialNone: v, + } +} + +// Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialPrivateKeyHex wrapped in Web3SigningCredential +func Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential(v *Web3SigningCredentialPrivateKeyHex) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialPrivateKeyHex: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Web3SigningCredential) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Web3SigningCredentialCactusKeychainRef + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialCactusKeychainRef) + if err == nil { + jsonWeb3SigningCredentialCactusKeychainRef, _ := json.Marshal(dst.Web3SigningCredentialCactusKeychainRef) + if string(jsonWeb3SigningCredentialCactusKeychainRef) == "{}" { // empty struct + dst.Web3SigningCredentialCactusKeychainRef = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialCactusKeychainRef = nil + } + + // try to unmarshal data into Web3SigningCredentialNone + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialNone) + if err == nil { + jsonWeb3SigningCredentialNone, _ := json.Marshal(dst.Web3SigningCredentialNone) + if string(jsonWeb3SigningCredentialNone) == "{}" { // empty struct + dst.Web3SigningCredentialNone = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialNone = nil + } + + // try to unmarshal data into Web3SigningCredentialPrivateKeyHex + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialPrivateKeyHex) + if err == nil { + jsonWeb3SigningCredentialPrivateKeyHex, _ := json.Marshal(dst.Web3SigningCredentialPrivateKeyHex) + if string(jsonWeb3SigningCredentialPrivateKeyHex) == "{}" { // empty struct + dst.Web3SigningCredentialPrivateKeyHex = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialPrivateKeyHex = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Web3SigningCredentialCactusKeychainRef = nil + dst.Web3SigningCredentialNone = nil + dst.Web3SigningCredentialPrivateKeyHex = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Web3SigningCredential)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Web3SigningCredential)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Web3SigningCredential) MarshalJSON() ([]byte, error) { + if src.Web3SigningCredentialCactusKeychainRef != nil { + return json.Marshal(&src.Web3SigningCredentialCactusKeychainRef) + } + + if src.Web3SigningCredentialNone != nil { + return json.Marshal(&src.Web3SigningCredentialNone) + } + + if src.Web3SigningCredentialPrivateKeyHex != nil { + return json.Marshal(&src.Web3SigningCredentialPrivateKeyHex) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Web3SigningCredential) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Web3SigningCredentialCactusKeychainRef != nil { + return obj.Web3SigningCredentialCactusKeychainRef + } + + if obj.Web3SigningCredentialNone != nil { + return obj.Web3SigningCredentialNone + } + + if obj.Web3SigningCredentialPrivateKeyHex != nil { + return obj.Web3SigningCredentialPrivateKeyHex + } + + // all schemas are nil + return nil +} + +type NullableWeb3SigningCredential struct { + value *Web3SigningCredential + isSet bool +} + +func (v NullableWeb3SigningCredential) Get() *Web3SigningCredential { + return v.value +} + +func (v *NullableWeb3SigningCredential) Set(val *Web3SigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredential(val *Web3SigningCredential) *NullableWeb3SigningCredential { + return &NullableWeb3SigningCredential{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go new file mode 100644 index 00000000000..4aa2ce22898 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go @@ -0,0 +1,201 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialCactusKeychainRef type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialCactusKeychainRef{} + +// Web3SigningCredentialCactusKeychainRef struct for Web3SigningCredentialCactusKeychainRef +type Web3SigningCredentialCactusKeychainRef struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + KeychainEntryKey string `json:"keychainEntryKey"` + // The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + KeychainId string `json:"keychainId"` +} + +// NewWeb3SigningCredentialCactusKeychainRef instantiates a new Web3SigningCredentialCactusKeychainRef 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialCactusKeychainRef(type_ Web3SigningCredentialType, ethAccount string, keychainEntryKey string, keychainId string) *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + this.Type = type_ + this.EthAccount = ethAccount + this.KeychainEntryKey = keychainEntryKey + this.KeychainId = keychainId + return &this +} + +// NewWeb3SigningCredentialCactusKeychainRefWithDefaults instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialCactusKeychainRefWithDefaults() *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialCactusKeychainRef) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetKeychainEntryKey returns the KeychainEntryKey field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKey() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainEntryKey +} + +// GetKeychainEntryKeyOk returns a tuple with the KeychainEntryKey field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainEntryKey, true +} + +// SetKeychainEntryKey sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainEntryKey(v string) { + o.KeychainEntryKey = v +} + +// GetKeychainId returns the KeychainId field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o Web3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialCactusKeychainRef) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["keychainEntryKey"] = o.KeychainEntryKey + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableWeb3SigningCredentialCactusKeychainRef struct { + value *Web3SigningCredentialCactusKeychainRef + isSet bool +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) Get() *Web3SigningCredentialCactusKeychainRef { + return v.value +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Set(val *Web3SigningCredentialCactusKeychainRef) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialCactusKeychainRef(val *Web3SigningCredentialCactusKeychainRef) *NullableWeb3SigningCredentialCactusKeychainRef { + return &NullableWeb3SigningCredentialCactusKeychainRef{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go new file mode 100644 index 00000000000..ba1ca853781 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialNone type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialNone{} + +// Web3SigningCredentialNone Using this denotes that there is no signing required because the transaction is pre-signed. +type Web3SigningCredentialNone struct { + Type Web3SigningCredentialType `json:"type"` +} + +// NewWeb3SigningCredentialNone instantiates a new Web3SigningCredentialNone 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialNone(type_ Web3SigningCredentialType) *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + this.Type = type_ + return &this +} + +// NewWeb3SigningCredentialNoneWithDefaults instantiates a new Web3SigningCredentialNone object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialNoneWithDefaults() *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialNone) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialNone) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialNone) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +func (o Web3SigningCredentialNone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialNone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableWeb3SigningCredentialNone struct { + value *Web3SigningCredentialNone + isSet bool +} + +func (v NullableWeb3SigningCredentialNone) Get() *Web3SigningCredentialNone { + return v.value +} + +func (v *NullableWeb3SigningCredentialNone) Set(val *Web3SigningCredentialNone) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialNone) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialNone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialNone(val *Web3SigningCredentialNone) *NullableWeb3SigningCredentialNone { + return &NullableWeb3SigningCredentialNone{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialNone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialNone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go new file mode 100644 index 00000000000..72f2dd4a429 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialPrivateKeyHex type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialPrivateKeyHex{} + +// Web3SigningCredentialPrivateKeyHex struct for Web3SigningCredentialPrivateKeyHex +type Web3SigningCredentialPrivateKeyHex struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The HEX encoded private key of an eth account. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialPrivateKeyHex instantiates a new Web3SigningCredentialPrivateKeyHex 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialPrivateKeyHex(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialPrivateKeyHexWithDefaults instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialPrivateKeyHexWithDefaults() *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialPrivateKeyHex) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialPrivateKeyHex) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialPrivateKeyHex) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialPrivateKeyHex struct { + value *Web3SigningCredentialPrivateKeyHex + isSet bool +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) Get() *Web3SigningCredentialPrivateKeyHex { + return v.value +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Set(val *Web3SigningCredentialPrivateKeyHex) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialPrivateKeyHex(val *Web3SigningCredentialPrivateKeyHex) *NullableWeb3SigningCredentialPrivateKeyHex { + return &NullableWeb3SigningCredentialPrivateKeyHex{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go new file mode 100644 index 00000000000..5649dd04945 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredentialType the model 'Web3SigningCredentialType' +type Web3SigningCredentialType string + +// List of Web3SigningCredentialType +const ( + CACTUS_KEYCHAIN_REF Web3SigningCredentialType = "CACTUS_KEYCHAIN_REF" + GETH_KEYCHAIN_PASSWORD Web3SigningCredentialType = "GETH_KEYCHAIN_PASSWORD" + PRIVATE_KEY_HEX Web3SigningCredentialType = "PRIVATE_KEY_HEX" + NONE Web3SigningCredentialType = "NONE" +) + +// All allowed values of Web3SigningCredentialType enum +var AllowedWeb3SigningCredentialTypeEnumValues = []Web3SigningCredentialType{ + "CACTUS_KEYCHAIN_REF", + "GETH_KEYCHAIN_PASSWORD", + "PRIVATE_KEY_HEX", + "NONE", +} + +func (v *Web3SigningCredentialType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Web3SigningCredentialType(value) + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Web3SigningCredentialType", value) +} + +// NewWeb3SigningCredentialTypeFromValue returns a pointer to a valid Web3SigningCredentialType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWeb3SigningCredentialTypeFromValue(v string) (*Web3SigningCredentialType, error) { + ev := Web3SigningCredentialType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Web3SigningCredentialType: valid values are %v", v, AllowedWeb3SigningCredentialTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Web3SigningCredentialType) IsValid() bool { + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Web3SigningCredentialType value +func (v Web3SigningCredentialType) Ptr() *Web3SigningCredentialType { + return &v +} + +type NullableWeb3SigningCredentialType struct { + value *Web3SigningCredentialType + isSet bool +} + +func (v NullableWeb3SigningCredentialType) Get() *Web3SigningCredentialType { + return v.value +} + +func (v *NullableWeb3SigningCredentialType) Set(val *Web3SigningCredentialType) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialType) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialType(val *Web3SigningCredentialType) *NullableWeb3SigningCredentialType { + return &NullableWeb3SigningCredentialType{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go new file mode 100644 index 00000000000..4c1b772e59a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go @@ -0,0 +1,385 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the Web3TransactionReceipt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3TransactionReceipt{} + +// Web3TransactionReceipt struct for Web3TransactionReceipt +type Web3TransactionReceipt struct { + Status bool `json:"status"` + TransactionHash string `json:"transactionHash"` + TransactionIndex float32 `json:"transactionIndex"` + BlockHash string `json:"blockHash"` + BlockNumber float32 `json:"blockNumber"` + GasUsed float32 `json:"gasUsed"` + ContractAddress NullableString `json:"contractAddress,omitempty"` + From string `json:"from"` + To string `json:"to"` + AdditionalProperties map[string]interface{} +} + +type _Web3TransactionReceipt Web3TransactionReceipt + +// NewWeb3TransactionReceipt instantiates a new Web3TransactionReceipt 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 +// will change when the set of required properties is changed +func NewWeb3TransactionReceipt(status bool, transactionHash string, transactionIndex float32, blockHash string, blockNumber float32, gasUsed float32, from string, to string) *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + this.Status = status + this.TransactionHash = transactionHash + this.TransactionIndex = transactionIndex + this.BlockHash = blockHash + this.BlockNumber = blockNumber + this.GasUsed = gasUsed + this.From = from + this.To = to + return &this +} + +// NewWeb3TransactionReceiptWithDefaults instantiates a new Web3TransactionReceipt object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3TransactionReceiptWithDefaults() *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + return &this +} + +// GetStatus returns the Status field value +func (o *Web3TransactionReceipt) GetStatus() bool { + if o == nil { + var ret bool + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetStatusOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Web3TransactionReceipt) SetStatus(v bool) { + o.Status = v +} + +// GetTransactionHash returns the TransactionHash field value +func (o *Web3TransactionReceipt) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *Web3TransactionReceipt) SetTransactionHash(v string) { + o.TransactionHash = v +} + +// GetTransactionIndex returns the TransactionIndex field value +func (o *Web3TransactionReceipt) GetTransactionIndex() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TransactionIndex, true +} + +// SetTransactionIndex sets field value +func (o *Web3TransactionReceipt) SetTransactionIndex(v float32) { + o.TransactionIndex = v +} + +// GetBlockHash returns the BlockHash field value +func (o *Web3TransactionReceipt) GetBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *Web3TransactionReceipt) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetBlockNumber returns the BlockNumber field value +func (o *Web3TransactionReceipt) GetBlockNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *Web3TransactionReceipt) SetBlockNumber(v float32) { + o.BlockNumber = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3TransactionReceipt) GetGasUsed() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetGasUsedOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3TransactionReceipt) SetGasUsed(v float32) { + o.GasUsed = v +} + +// GetContractAddress returns the ContractAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Web3TransactionReceipt) GetContractAddress() string { + if o == nil || IsNil(o.ContractAddress.Get()) { + var ret string + return ret + } + return *o.ContractAddress.Get() +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3TransactionReceipt) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ContractAddress.Get(), o.ContractAddress.IsSet() +} + +// HasContractAddress returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasContractAddress() bool { + if o != nil && o.ContractAddress.IsSet() { + return true + } + + return false +} + +// SetContractAddress gets a reference to the given NullableString and assigns it to the ContractAddress field. +func (o *Web3TransactionReceipt) SetContractAddress(v string) { + o.ContractAddress.Set(&v) +} +// SetContractAddressNil sets the value for ContractAddress to be an explicit nil +func (o *Web3TransactionReceipt) SetContractAddressNil() { + o.ContractAddress.Set(nil) +} + +// UnsetContractAddress ensures that no value is present for ContractAddress, not even an explicit nil +func (o *Web3TransactionReceipt) UnsetContractAddress() { + o.ContractAddress.Unset() +} + +// GetFrom returns the From field value +func (o *Web3TransactionReceipt) GetFrom() string { + if o == nil { + var ret string + return ret + } + + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value +func (o *Web3TransactionReceipt) SetFrom(v string) { + o.From = v +} + +// GetTo returns the To field value +func (o *Web3TransactionReceipt) GetTo() string { + if o == nil { + var ret string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *Web3TransactionReceipt) SetTo(v string) { + o.To = v +} + +func (o Web3TransactionReceipt) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3TransactionReceipt) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + toSerialize["transactionHash"] = o.TransactionHash + toSerialize["transactionIndex"] = o.TransactionIndex + toSerialize["blockHash"] = o.BlockHash + toSerialize["blockNumber"] = o.BlockNumber + toSerialize["gasUsed"] = o.GasUsed + if o.ContractAddress.IsSet() { + toSerialize["contractAddress"] = o.ContractAddress.Get() + } + toSerialize["from"] = o.From + toSerialize["to"] = o.To + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Web3TransactionReceipt) UnmarshalJSON(bytes []byte) (err error) { + varWeb3TransactionReceipt := _Web3TransactionReceipt{} + + if err = json.Unmarshal(bytes, &varWeb3TransactionReceipt); err == nil { + *o = Web3TransactionReceipt(varWeb3TransactionReceipt) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "status") + delete(additionalProperties, "transactionHash") + delete(additionalProperties, "transactionIndex") + delete(additionalProperties, "blockHash") + delete(additionalProperties, "blockNumber") + delete(additionalProperties, "gasUsed") + delete(additionalProperties, "contractAddress") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWeb3TransactionReceipt struct { + value *Web3TransactionReceipt + isSet bool +} + +func (v NullableWeb3TransactionReceipt) Get() *Web3TransactionReceipt { + return v.value +} + +func (v *NullableWeb3TransactionReceipt) Set(val *Web3TransactionReceipt) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3TransactionReceipt) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3TransactionReceipt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3TransactionReceipt(val *Web3TransactionReceipt) *NullableWeb3TransactionReceipt { + return &NullableWeb3TransactionReceipt{value: val, isSet: true} +} + +func (v NullableWeb3TransactionReceipt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3TransactionReceipt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..a2ae524e0d0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..92a89ef0d21 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,157 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-ledger-connector-besu + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-ledger-connector-besu_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService DeployContractSolBytecodeV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeployContractSolBytecodeV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetBalanceV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetBalanceV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetBesuRecordV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetBesuRecordV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetBlockV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetBlockV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetOpenApiSpecV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetOpenApiSpecV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPastLogsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPastLogsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPrometheusMetricsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPrometheusMetricsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetTransactionV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetTransactionV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeContractV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeContractV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RunTransactionV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.RunTransactionV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService SignTransactionV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.SignTransactionV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..41b7dc28cf0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..1b4c76af8fb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - Connector Besu + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..c9f9a690380 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,114 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/BesuPrivateTransactionConfig.java +src/main/java/org/openapitools/client/model/BesuTransactionConfig.java +src/main/java/org/openapitools/client/model/BesuTransactionConfigTo.java +src/main/java/org/openapitools/client/model/ConsistencyStrategy.java +src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java +src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java +src/main/java/org/openapitools/client/model/EthContractInvocationType.java +src/main/java/org/openapitools/client/model/EvmBlock.java +src/main/java/org/openapitools/client/model/EvmLog.java +src/main/java/org/openapitools/client/model/EvmTransaction.java +src/main/java/org/openapitools/client/model/GetBalanceV1Request.java +src/main/java/org/openapitools/client/model/GetBalanceV1Response.java +src/main/java/org/openapitools/client/model/GetBesuRecordV1Request.java +src/main/java/org/openapitools/client/model/GetBesuRecordV1Response.java +src/main/java/org/openapitools/client/model/GetBlockV1Request.java +src/main/java/org/openapitools/client/model/GetBlockV1Response.java +src/main/java/org/openapitools/client/model/GetPastLogsV1Request.java +src/main/java/org/openapitools/client/model/GetPastLogsV1Response.java +src/main/java/org/openapitools/client/model/GetTransactionV1Request.java +src/main/java/org/openapitools/client/model/GetTransactionV1Response.java +src/main/java/org/openapitools/client/model/InvokeContractV1Request.java +src/main/java/org/openapitools/client/model/InvokeContractV1Response.java +src/main/java/org/openapitools/client/model/ReceiptType.java +src/main/java/org/openapitools/client/model/RunTransactionRequest.java +src/main/java/org/openapitools/client/model/RunTransactionResponse.java +src/main/java/org/openapitools/client/model/SignTransactionRequest.java +src/main/java/org/openapitools/client/model/SignTransactionResponse.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java +src/main/java/org/openapitools/client/model/WatchBlocksV1.java +src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java +src/main/java/org/openapitools/client/model/Web3BlockHeader.java +src/main/java/org/openapitools/client/model/Web3BlockHeaderTimestamp.java +src/main/java/org/openapitools/client/model/Web3SigningCredential.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java +src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/BesuPrivateTransactionConfigTest.java +src/test/java/org/openapitools/client/model/BesuTransactionConfigTest.java +src/test/java/org/openapitools/client/model/BesuTransactionConfigToTest.java +src/test/java/org/openapitools/client/model/ConsistencyStrategyTest.java +src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java +src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java +src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java +src/test/java/org/openapitools/client/model/EvmBlockTest.java +src/test/java/org/openapitools/client/model/EvmLogTest.java +src/test/java/org/openapitools/client/model/EvmTransactionTest.java +src/test/java/org/openapitools/client/model/GetBalanceV1RequestTest.java +src/test/java/org/openapitools/client/model/GetBalanceV1ResponseTest.java +src/test/java/org/openapitools/client/model/GetBesuRecordV1RequestTest.java +src/test/java/org/openapitools/client/model/GetBesuRecordV1ResponseTest.java +src/test/java/org/openapitools/client/model/GetBlockV1RequestTest.java +src/test/java/org/openapitools/client/model/GetBlockV1ResponseTest.java +src/test/java/org/openapitools/client/model/GetPastLogsV1RequestTest.java +src/test/java/org/openapitools/client/model/GetPastLogsV1ResponseTest.java +src/test/java/org/openapitools/client/model/GetTransactionV1RequestTest.java +src/test/java/org/openapitools/client/model/GetTransactionV1ResponseTest.java +src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java +src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java +src/test/java/org/openapitools/client/model/ReceiptTypeTest.java +src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java +src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java +src/test/java/org/openapitools/client/model/SignTransactionRequestTest.java +src/test/java/org/openapitools/client/model/SignTransactionResponseTest.java +src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java +src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java +src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java +src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java +src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java +src/test/java/org/openapitools/client/model/Web3BlockHeaderTimestampTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java +src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..b3228b4d86c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,187 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Connector Besu +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a Besu ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request = new DeployContractSolidityBytecodeV1Request(); // DeployContractSolidityBytecodeV1Request | + try { + DeployContractSolidityBytecodeV1Response result = apiInstance.deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deployContractSolBytecodeV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deployContractSolBytecodeV1**](docs/DefaultApi.md#deployContractSolBytecodeV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**getBalanceV1**](docs/DefaultApi.md#getBalanceV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance | Return balance of an address of a given block +*DefaultApi* | [**getBesuRecordV1**](docs/DefaultApi.md#getBesuRecordV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record | Retrieves an arbitrary record (any piece of information) from the ledger. Ledger records can be call outputs, transaction input, etc. +*DefaultApi* | [**getBlockV1**](docs/DefaultApi.md#getBlockV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-block | Returns a block matching the block +*DefaultApi* | [**getOpenApiSpecV1**](docs/DefaultApi.md#getOpenApiSpecV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-open-api-spec | Retrieves the .json file that contains the OpenAPI specification for the plugin. +*DefaultApi* | [**getPastLogsV1**](docs/DefaultApi.md#getPastLogsV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs | Gets past logs, matching the given options. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**getTransactionV1**](docs/DefaultApi.md#getTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction | Executes a transaction on a besu ledger +*DefaultApi* | [**invokeContractV1**](docs/DefaultApi.md#invokeContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract | Invokes a contract on a besu ledger +*DefaultApi* | [**runTransactionV1**](docs/DefaultApi.md#runTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction | Executes a transaction on a besu ledger +*DefaultApi* | [**signTransactionV1**](docs/DefaultApi.md#signTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction | Obtain signatures of ledger from the corresponding transaction hash. + + +## Documentation for Models + + - [BesuPrivateTransactionConfig](docs/BesuPrivateTransactionConfig.md) + - [BesuTransactionConfig](docs/BesuTransactionConfig.md) + - [BesuTransactionConfigTo](docs/BesuTransactionConfigTo.md) + - [ConsistencyStrategy](docs/ConsistencyStrategy.md) + - [DeployContractSolidityBytecodeV1Request](docs/DeployContractSolidityBytecodeV1Request.md) + - [DeployContractSolidityBytecodeV1Response](docs/DeployContractSolidityBytecodeV1Response.md) + - [EthContractInvocationType](docs/EthContractInvocationType.md) + - [EvmBlock](docs/EvmBlock.md) + - [EvmLog](docs/EvmLog.md) + - [EvmTransaction](docs/EvmTransaction.md) + - [GetBalanceV1Request](docs/GetBalanceV1Request.md) + - [GetBalanceV1Response](docs/GetBalanceV1Response.md) + - [GetBesuRecordV1Request](docs/GetBesuRecordV1Request.md) + - [GetBesuRecordV1Response](docs/GetBesuRecordV1Response.md) + - [GetBlockV1Request](docs/GetBlockV1Request.md) + - [GetBlockV1Response](docs/GetBlockV1Response.md) + - [GetPastLogsV1Request](docs/GetPastLogsV1Request.md) + - [GetPastLogsV1Response](docs/GetPastLogsV1Response.md) + - [GetTransactionV1Request](docs/GetTransactionV1Request.md) + - [GetTransactionV1Response](docs/GetTransactionV1Response.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [ReceiptType](docs/ReceiptType.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [SignTransactionRequest](docs/SignTransactionRequest.md) + - [SignTransactionResponse](docs/SignTransactionResponse.md) + - [SolidityContractJsonArtifact](docs/SolidityContractJsonArtifact.md) + - [SolidityContractJsonArtifactCompiler](docs/SolidityContractJsonArtifactCompiler.md) + - [SolidityContractJsonArtifactGasEstimates](docs/SolidityContractJsonArtifactGasEstimates.md) + - [SolidityContractJsonArtifactGasEstimatesCreation](docs/SolidityContractJsonArtifactGasEstimatesCreation.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WatchBlocksV1Progress](docs/WatchBlocksV1Progress.md) + - [Web3BlockHeader](docs/Web3BlockHeader.md) + - [Web3BlockHeaderTimestamp](docs/Web3BlockHeaderTimestamp.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..765d7cd037a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,1249 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Besu ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Besu + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-open-api-spec: + get: + operationId: getOpenApiSpecV1 + parameters: [] + responses: + "200": + content: + application/json: + schema: + type: string + description: OK + summary: Retrieves the .json file that contains the OpenAPI specification for + the plugin. + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-open-api-spec + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode: + post: + operationId: deployContractSolBytecodeV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance: + post: + operationId: getBalanceV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetBalanceV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetBalanceV1Response' + description: OK + summary: Return balance of an address of a given block + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-block: + post: + operationId: getBlockV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetBlockV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetBlockV1Response' + description: OK + summary: Returns a block matching the block + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-block + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + summary: Executes a transaction on a besu ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction: + post: + operationId: getTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetTransactionV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetTransactionV1Response' + description: OK + summary: Executes a transaction on a besu ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs: + post: + operationId: getPastLogsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetPastLogsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetPastLogsV1Response' + description: OK + summary: "Gets past logs, matching the given options." + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a besu ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction: + post: + description: Obtain signatures of ledger from the corresponding transaction + hash. + operationId: signTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SignTransactionRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SignTransactionResponse' + description: OK + "404": + description: Not able to find the corresponding tranaction from the transaction + hash + summary: Obtain signatures of ledger from the corresponding transaction hash. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics + x-accepts: text/plain + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record: + post: + operationId: getBesuRecordV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetBesuRecordV1Request' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/GetBesuRecordV1Response' + description: OK + summary: "Retrieves an arbitrary record (any piece of information) from the\ + \ ledger. Ledger records can be call outputs, transaction input, etc." + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record + x-content-type: application/json + x-accepts: text/plain +components: + schemas: + GetBalanceV1Response: + example: + balance: balance + properties: + balance: + type: string + required: + - balance + type: object + GetBalanceV1Request: + additionalProperties: false + example: + address: address + defaultBlock: "" + properties: + address: + type: string + defaultBlock: {} + required: + - address + type: object + EvmBlock: + example: + logsBloom: logsBloom + totalDifficulty: 1.4658129805029452 + extraData: extraData + transactions: + - "" + - "" + nonce: nonce + miner: miner + difficulty: 6.027456183070403 + number: 0.8008281904610115 + gasLimit: 5.637376656633329 + gasUsed: 2.3021358869347655 + uncles: + - "" + - "" + sha3Uncles: sha3Uncles + size: 5.962133916683182 + transactionsRoot: transactionsRoot + stateRoot: stateRoot + parentHash: parentHash + hash: hash + timestamp: "" + properties: + number: + type: number + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionsRoot: + type: string + stateRoot: + type: string + miner: + type: string + difficulty: + type: number + totalDifficulty: + type: number + extraData: + type: string + size: + type: number + gasLimit: + type: number + gasUsed: + type: number + timestamp: {} + transactions: + items: {} + type: array + uncles: + items: {} + type: array + type: object + GetBlockV1Response: + example: + block: + logsBloom: logsBloom + totalDifficulty: 1.4658129805029452 + extraData: extraData + transactions: + - "" + - "" + nonce: nonce + miner: miner + difficulty: 6.027456183070403 + number: 0.8008281904610115 + gasLimit: 5.637376656633329 + gasUsed: 2.3021358869347655 + uncles: + - "" + - "" + sha3Uncles: sha3Uncles + size: 5.962133916683182 + transactionsRoot: transactionsRoot + stateRoot: stateRoot + parentHash: parentHash + hash: hash + timestamp: "" + properties: + block: + $ref: '#/components/schemas/EvmBlock' + required: + - block + type: object + EvmTransaction: + example: + blockHash: "" + input: input + blockNumber: "" + gas: 6.027456183070403 + transactionIndex: "" + from: from + to: "" + nonce: 0.8008281904610115 + value: value + hash: hash + gasPrice: gasPrice + properties: + hash: + type: string + nonce: + type: number + blockHash: {} + blockNumber: {} + transactionIndex: {} + from: + type: string + to: {} + value: + type: string + gasPrice: + type: string + gas: + type: number + input: + type: string + type: object + GetTransactionV1Response: + example: + transaction: + blockHash: "" + input: input + blockNumber: "" + gas: 6.027456183070403 + transactionIndex: "" + from: from + to: "" + nonce: 0.8008281904610115 + value: value + hash: hash + gasPrice: gasPrice + properties: + transaction: + $ref: '#/components/schemas/EvmTransaction' + required: + - transaction + type: object + GetTransactionV1Request: + additionalProperties: false + example: + transactionHash: transactionHash + properties: + transactionHash: + type: string + required: + - transactionHash + type: object + GetPastLogsV1Response: + example: + logs: + - blockHash: blockHash + address: address + logIndex: 0.8008281904610115 + data: data + topics: + - topics + - topics + blockNumber: 1.4658129805029452 + transactionIndex: 6.027456183070403 + transactionHash: transactionHash + - blockHash: blockHash + address: address + logIndex: 0.8008281904610115 + data: data + topics: + - topics + - topics + blockNumber: 1.4658129805029452 + transactionIndex: 6.027456183070403 + transactionHash: transactionHash + properties: + logs: + items: + $ref: '#/components/schemas/EvmLog' + type: array + required: + - logs + type: object + GetPastLogsV1Request: + additionalProperties: false + example: + fromBlock: "" + toBlock: "" + address: "" + topics: + - "" + - "" + properties: + toBlock: {} + fromBlock: {} + address: {} + topics: + items: {} + type: array + type: object + EvmLog: + example: + blockHash: blockHash + address: address + logIndex: 0.8008281904610115 + data: data + topics: + - topics + - topics + blockNumber: 1.4658129805029452 + transactionIndex: 6.027456183070403 + transactionHash: transactionHash + properties: + address: + type: string + data: + type: string + blockHash: + type: string + transactionHash: + type: string + topics: + items: + type: string + type: array + logIndex: + type: number + transactionIndex: + type: number + blockNumber: + type: number + required: + - address + - blockHash + - blockNumber + - data + - logIndex + - topics + - transactionHash + - transactionIndex + type: object + GetBlockV1Request: + additionalProperties: false + example: + blockHashOrBlockNumber: "" + properties: + blockHashOrBlockNumber: {} + required: + - blockHashOrBlockNumber + type: object + WatchBlocksV1: + enum: + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + Web3BlockHeader: + properties: + number: + type: number + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionRoot: + type: string + stateRoot: + type: string + receiptRoot: + type: string + miner: + type: string + extraData: + type: string + gasLimit: + type: integer + gasUsed: + type: integer + timestamp: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + required: + - extraData + - gasLimit + - gasUsed + - hash + - logsBloom + - miner + - nonce + - number + - parentHash + - receiptRoot + - sha3Uncles + - stateRoot + - timestamp + - transactionRoot + type: object + WatchBlocksV1Progress: + properties: + blockHeader: + $ref: '#/components/schemas/Web3BlockHeader' + required: + - blockHeader + type: object + ReceiptType: + description: Enumerates the possible types of receipts that can be waited for + by someone or something that has requested the execution of a transaction + on a ledger. + enum: + - NODE_TX_POOL_ACK + - LEDGER_BLOCK_ACK + type: string + ConsistencyStrategy: + example: + blockConfirmations: 2931 + receiptType: null + timeoutMs: 0 + properties: + receiptType: + $ref: '#/components/schemas/ReceiptType' + timeoutMs: + description: "The amount of milliseconds to wait for the receipt to arrive\ + \ to the connector. Defaults to 0 which means to wait for an unlimited\ + \ amount of time. Note that this wait may be interrupted still by other\ + \ parts of the infrastructure such as load balancers cutting of HTTP requests\ + \ after some time even if they are the type that is supposed to be kept\ + \ alive. The question of re-entrance is a broader topic not in scope to\ + \ discuss here, but it is important to mention it." + minimum: 0 + type: integer + blockConfirmations: + description: "The number of blocks to wait to be confirmed in addition to\ + \ the block containing the transaction in question. Note that if the receipt\ + \ type is set to only wait for node transaction pool ACK and this parameter\ + \ is set to anything, but zero then the API will not accept the request\ + \ due to conflicting parameters." + maximum: 20000 + minimum: 0 + type: integer + required: + - blockConfirmations + - receiptType + type: object + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + EthContractInvocationType: + enum: + - SEND + - CALL + type: string + SolidityContractJsonArtifact: + properties: + contractName: + nullable: false + type: string + metadata: + nullable: false + type: string + bytecode: + nullable: false + type: string + deployedBytecode: + nullable: false + type: string + sourceMap: + nullable: false + type: string + deployedSourceMap: + nullable: false + type: string + sourcePath: + type: string + compiler: + $ref: '#/components/schemas/SolidityContractJsonArtifact_compiler' + functionHashes: + additionalProperties: true + type: object + gasEstimates: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates' + required: + - contractName + type: object + BesuTransactionConfig: + additionalProperties: true + example: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + rawTransaction: + nullable: false + type: string + from: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + to: + $ref: '#/components/schemas/BesuTransactionConfig_to' + value: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + gas: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + gasPrice: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + nonce: + type: number + data: + $ref: '#/components/schemas/BesuTransactionConfig_to' + type: object + BesuPrivateTransactionConfig: + example: + privateFrom: privateFrom + privateFor: + - "" + - "" + properties: + privateFrom: + nullable: false + type: string + privateFor: + default: [] + items: {} + nullable: false + type: array + required: + - privateFor + - privateFrom + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + RunTransactionRequest: + additionalProperties: false + example: + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + transactionConfig: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + consistencyStrategy: + blockConfirmations: 2931 + receiptType: null + timeoutMs: 0 + web3SigningCredential: + type: null + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + transactionConfig: + $ref: '#/components/schemas/BesuTransactionConfig' + consistencyStrategy: + $ref: '#/components/schemas/ConsistencyStrategy' + privateTransactionConfig: + $ref: '#/components/schemas/BesuPrivateTransactionConfig' + required: + - consistencyStrategy + - transactionConfig + - web3SigningCredential + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractSolidityBytecodeV1Request: + additionalProperties: false + example: + bytecode: bytecode + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + keychainId: keychainId + constructorArgs: + - "" + - "" + timeoutMs: 0.6027456183070403 + contractAbi: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + contractName: contractName + gasPrice: gasPrice + properties: + contractName: + description: The contract name for retrieve the contracts json on the keychain. + maxLength: 100 + minLength: 1 + nullable: false + type: string + contractAbi: + description: The application binary interface of the solidity contract + items: {} + nullable: false + type: array + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: string + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + privateTransactionConfig: + $ref: '#/components/schemas/BesuPrivateTransactionConfig' + required: + - bytecode + - constructorArgs + - contractAbi + - contractName + - keychainId + - web3SigningCredential + type: object + DeployContractSolidityBytecodeV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + InvokeContractV1Request: + additionalProperties: false + example: + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + nonce: 0.8008281904610115 + invocationType: null + keychainId: keychainId + timeoutMs: 0.6027456183070403 + contractAbi: + - "" + - "" + gas: null + contractName: contractName + value: null + signingCredential: + type: null + gasPrice: null + properties: + contractName: + nullable: false + type: string + signingCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + contractAbi: + description: "The application binary interface of the solidity contract,\ + \ optional parameter" + items: {} + nullable: false + type: array + contractAddress: + description: "Address of the solidity contract, optional parameter" + nullable: false + type: string + value: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + gas: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + gasPrice: + $ref: '#/components/schemas/Web3BlockHeader_timestamp' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + type: string + privateTransactionConfig: + $ref: '#/components/schemas/BesuPrivateTransactionConfig' + required: + - contractName + - invocationType + - methodName + - params + - signingCredential + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + SignTransactionRequest: + additionalProperties: false + example: + keychainId: keychainId + keychainRef: keychainRef + transactionHash: transactionHash + properties: + keychainId: + maxLength: 100 + minLength: 1 + nullable: false + type: string + keychainRef: + maxLength: 100 + minLength: 1 + nullable: false + type: string + transactionHash: + description: The transaction hash of ledger will be used to fetch the contain. + maxLength: 2048 + minLength: 0 + nullable: false + type: string + required: + - keychainId + - keychainRef + - transactionHash + type: object + SignTransactionResponse: + example: + signature: signature + properties: + signature: + description: The signatures of ledger from the corresponding transaction + hash. + maxLength: 2048 + minLength: 0 + nullable: false + type: string + required: + - signature + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetBesuRecordV1Request: + additionalProperties: false + example: + invokeCall: + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + nonce: 0.8008281904610115 + invocationType: null + keychainId: keychainId + timeoutMs: 0.6027456183070403 + contractAbi: + - "" + - "" + gas: null + contractName: contractName + value: null + signingCredential: + type: null + gasPrice: null + transactionHash: transactionHash + properties: + invokeCall: + $ref: '#/components/schemas/InvokeContractV1Request' + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + type: object + GetBesuRecordV1Response: + properties: + ledgerId: + type: string + stateContract: + type: string + transactionInputData: {} + callOutput: {} + type: object + Web3BlockHeader_timestamp: + oneOf: + - type: string + - type: number + SolidityContractJsonArtifact_compiler: + additionalProperties: true + properties: + name: + type: string + version: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates_creation: + properties: + codeDepositCost: + type: string + executionCost: + type: string + totalCost: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates: + properties: + creation: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates_creation' + external: + additionalProperties: true + type: object + BesuTransactionConfig_to: + oneOf: + - type: string + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..772166db976 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..2d79f8a60a8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..94b5348a7eb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..9601cee4a38 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..e1e802c8cf5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..75a5e0fbc25 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..3fc2bc6fa44 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,449 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(org.openapitools.client.model.Web3SigningCredential.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Web3SigningCredentialCactusKeychainRef", org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.class); + classByDiscriminatorValue.put("Web3SigningCredentialNone", org.openapitools.client.model.Web3SigningCredentialNone.class); + classByDiscriminatorValue.put("Web3SigningCredentialPrivateKeyHex", org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.class); + classByDiscriminatorValue.put("Web3SigningCredential", org.openapitools.client.model.Web3SigningCredential.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) + ; + 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; + } + + { + 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.BesuPrivateTransactionConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BesuTransactionConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BesuTransactionConfigTo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ConsistencyStrategy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractSolidityBytecodeV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractSolidityBytecodeV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.EvmBlock.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.EvmLog.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.EvmTransaction.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBalanceV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBalanceV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBesuRecordV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBesuRecordV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetPastLogsV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetPastLogsV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetTransactionV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetTransactionV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SignTransactionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SignTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifact.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactCompiler.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1Progress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3BlockHeader.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3BlockHeaderTimestamp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialNone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3TransactionReceipt.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); + } + } + } + + /** + * 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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..b701c29ce8e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..fbcf354c5c2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..1969e8afc5c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..fd98ffedd46 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..499d28f69dc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,1390 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeployContractSolidityBytecodeV1Request; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Response; +import org.openapitools.client.model.GetBalanceV1Request; +import org.openapitools.client.model.GetBalanceV1Response; +import org.openapitools.client.model.GetBesuRecordV1Request; +import org.openapitools.client.model.GetBesuRecordV1Response; +import org.openapitools.client.model.GetBlockV1Request; +import org.openapitools.client.model.GetBlockV1Response; +import org.openapitools.client.model.GetPastLogsV1Request; +import org.openapitools.client.model.GetPastLogsV1Response; +import org.openapitools.client.model.GetTransactionV1Request; +import org.openapitools.client.model.GetTransactionV1Response; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.RunTransactionRequest; +import org.openapitools.client.model.RunTransactionResponse; +import org.openapitools.client.model.SignTransactionRequest; +import org.openapitools.client.model.SignTransactionResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 deployContractSolBytecodeV1 + * @param deployContractSolidityBytecodeV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractSolBytecodeV1Call(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractSolidityBytecodeV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode"; + + 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 deployContractSolBytecodeV1ValidateBeforeCall(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request, final ApiCallback _callback) throws ApiException { + return deployContractSolBytecodeV1Call(deployContractSolidityBytecodeV1Request, _callback); + + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractSolidityBytecodeV1Request (optional) + * @return DeployContractSolidityBytecodeV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DeployContractSolidityBytecodeV1Response deployContractSolBytecodeV1(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request) throws ApiException { + ApiResponse localVarResp = deployContractSolBytecodeV1WithHttpInfo(deployContractSolidityBytecodeV1Request); + return localVarResp.getData(); + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractSolidityBytecodeV1Request (optional) + * @return ApiResponse<DeployContractSolidityBytecodeV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse deployContractSolBytecodeV1WithHttpInfo(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractSolBytecodeV1ValidateBeforeCall(deployContractSolidityBytecodeV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys the bytecode of a Solidity contract. (asynchronously) + * + * @param deployContractSolidityBytecodeV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractSolBytecodeV1Async(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractSolBytecodeV1ValidateBeforeCall(deployContractSolidityBytecodeV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getBalanceV1 + * @param getBalanceV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getBalanceV1Call(GetBalanceV1Request getBalanceV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getBalanceV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-balance"; + + 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 getBalanceV1ValidateBeforeCall(GetBalanceV1Request getBalanceV1Request, final ApiCallback _callback) throws ApiException { + return getBalanceV1Call(getBalanceV1Request, _callback); + + } + + /** + * Return balance of an address of a given block + * + * @param getBalanceV1Request (optional) + * @return GetBalanceV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetBalanceV1Response getBalanceV1(GetBalanceV1Request getBalanceV1Request) throws ApiException { + ApiResponse localVarResp = getBalanceV1WithHttpInfo(getBalanceV1Request); + return localVarResp.getData(); + } + + /** + * Return balance of an address of a given block + * + * @param getBalanceV1Request (optional) + * @return ApiResponse<GetBalanceV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getBalanceV1WithHttpInfo(GetBalanceV1Request getBalanceV1Request) throws ApiException { + okhttp3.Call localVarCall = getBalanceV1ValidateBeforeCall(getBalanceV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Return balance of an address of a given block (asynchronously) + * + * @param getBalanceV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getBalanceV1Async(GetBalanceV1Request getBalanceV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getBalanceV1ValidateBeforeCall(getBalanceV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getBesuRecordV1 + * @param getBesuRecordV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getBesuRecordV1Call(GetBesuRecordV1Request getBesuRecordV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getBesuRecordV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-besu-record"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + 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 getBesuRecordV1ValidateBeforeCall(GetBesuRecordV1Request getBesuRecordV1Request, final ApiCallback _callback) throws ApiException { + return getBesuRecordV1Call(getBesuRecordV1Request, _callback); + + } + + /** + * Retrieves an arbitrary record (any piece of information) from the ledger. Ledger records can be call outputs, transaction input, etc. + * + * @param getBesuRecordV1Request (optional) + * @return GetBesuRecordV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetBesuRecordV1Response getBesuRecordV1(GetBesuRecordV1Request getBesuRecordV1Request) throws ApiException { + ApiResponse localVarResp = getBesuRecordV1WithHttpInfo(getBesuRecordV1Request); + return localVarResp.getData(); + } + + /** + * Retrieves an arbitrary record (any piece of information) from the ledger. Ledger records can be call outputs, transaction input, etc. + * + * @param getBesuRecordV1Request (optional) + * @return ApiResponse<GetBesuRecordV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getBesuRecordV1WithHttpInfo(GetBesuRecordV1Request getBesuRecordV1Request) throws ApiException { + okhttp3.Call localVarCall = getBesuRecordV1ValidateBeforeCall(getBesuRecordV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves an arbitrary record (any piece of information) from the ledger. Ledger records can be call outputs, transaction input, etc. (asynchronously) + * + * @param getBesuRecordV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getBesuRecordV1Async(GetBesuRecordV1Request getBesuRecordV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getBesuRecordV1ValidateBeforeCall(getBesuRecordV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getBlockV1 + * @param getBlockV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getBlockV1Call(GetBlockV1Request getBlockV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getBlockV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-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 = { + "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 getBlockV1ValidateBeforeCall(GetBlockV1Request getBlockV1Request, final ApiCallback _callback) throws ApiException { + return getBlockV1Call(getBlockV1Request, _callback); + + } + + /** + * Returns a block matching the block + * + * @param getBlockV1Request (optional) + * @return GetBlockV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetBlockV1Response getBlockV1(GetBlockV1Request getBlockV1Request) throws ApiException { + ApiResponse localVarResp = getBlockV1WithHttpInfo(getBlockV1Request); + return localVarResp.getData(); + } + + /** + * Returns a block matching the block + * + * @param getBlockV1Request (optional) + * @return ApiResponse<GetBlockV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getBlockV1WithHttpInfo(GetBlockV1Request getBlockV1Request) throws ApiException { + okhttp3.Call localVarCall = getBlockV1ValidateBeforeCall(getBlockV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Returns a block matching the block (asynchronously) + * + * @param getBlockV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getBlockV1Async(GetBlockV1Request getBlockV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getBlockV1ValidateBeforeCall(getBlockV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOpenApiSpecV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getOpenApiSpecV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-open-api-spec"; + + 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 getOpenApiSpecV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getOpenApiSpecV1Call(_callback); + + } + + /** + * Retrieves the .json file that contains the OpenAPI specification for the plugin. + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getOpenApiSpecV1() throws ApiException { + ApiResponse localVarResp = getOpenApiSpecV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieves the .json file that contains the OpenAPI specification for the plugin. + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getOpenApiSpecV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getOpenApiSpecV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves the .json file that contains the OpenAPI specification for the plugin. (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getOpenApiSpecV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getOpenApiSpecV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPastLogsV1 + * @param getPastLogsV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPastLogsV1Call(GetPastLogsV1Request getPastLogsV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getPastLogsV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-past-logs"; + + 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 getPastLogsV1ValidateBeforeCall(GetPastLogsV1Request getPastLogsV1Request, final ApiCallback _callback) throws ApiException { + return getPastLogsV1Call(getPastLogsV1Request, _callback); + + } + + /** + * Gets past logs, matching the given options. + * + * @param getPastLogsV1Request (optional) + * @return GetPastLogsV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetPastLogsV1Response getPastLogsV1(GetPastLogsV1Request getPastLogsV1Request) throws ApiException { + ApiResponse localVarResp = getPastLogsV1WithHttpInfo(getPastLogsV1Request); + return localVarResp.getData(); + } + + /** + * Gets past logs, matching the given options. + * + * @param getPastLogsV1Request (optional) + * @return ApiResponse<GetPastLogsV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPastLogsV1WithHttpInfo(GetPastLogsV1Request getPastLogsV1Request) throws ApiException { + okhttp3.Call localVarCall = getPastLogsV1ValidateBeforeCall(getPastLogsV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Gets past logs, matching the given options. (asynchronously) + * + * @param getPastLogsV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPastLogsV1Async(GetPastLogsV1Request getPastLogsV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPastLogsV1ValidateBeforeCall(getPastLogsV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + 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 getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getTransactionV1 + * @param getTransactionV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getTransactionV1Call(GetTransactionV1Request getTransactionV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getTransactionV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-transaction"; + + 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 getTransactionV1ValidateBeforeCall(GetTransactionV1Request getTransactionV1Request, final ApiCallback _callback) throws ApiException { + return getTransactionV1Call(getTransactionV1Request, _callback); + + } + + /** + * Executes a transaction on a besu ledger + * + * @param getTransactionV1Request (optional) + * @return GetTransactionV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetTransactionV1Response getTransactionV1(GetTransactionV1Request getTransactionV1Request) throws ApiException { + ApiResponse localVarResp = getTransactionV1WithHttpInfo(getTransactionV1Request); + return localVarResp.getData(); + } + + /** + * Executes a transaction on a besu ledger + * + * @param getTransactionV1Request (optional) + * @return ApiResponse<GetTransactionV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getTransactionV1WithHttpInfo(GetTransactionV1Request getTransactionV1Request) throws ApiException { + okhttp3.Call localVarCall = getTransactionV1ValidateBeforeCall(getTransactionV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Executes a transaction on a besu ledger (asynchronously) + * + * @param getTransactionV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getTransactionV1Async(GetTransactionV1Request getTransactionV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getTransactionV1ValidateBeforeCall(getTransactionV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeContractV1 + * @param invokeContractV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Call(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/invoke-contract"; + + 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 invokeContractV1ValidateBeforeCall(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + return invokeContractV1Call(invokeContractV1Request, _callback); + + } + + /** + * Invokes a contract on a besu ledger + * + * @param invokeContractV1Request (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response invokeContractV1(InvokeContractV1Request invokeContractV1Request) throws ApiException { + ApiResponse localVarResp = invokeContractV1WithHttpInfo(invokeContractV1Request); + return localVarResp.getData(); + } + + /** + * Invokes a contract on a besu ledger + * + * @param invokeContractV1Request (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeContractV1WithHttpInfo(InvokeContractV1Request invokeContractV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invokes a contract on a besu ledger (asynchronously) + * + * @param invokeContractV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Async(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for runTransactionV1 + * @param runTransactionRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call runTransactionV1Call(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = runTransactionRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/run-transaction"; + + 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 runTransactionV1ValidateBeforeCall(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + return runTransactionV1Call(runTransactionRequest, _callback); + + } + + /** + * Executes a transaction on a besu ledger + * + * @param runTransactionRequest (optional) + * @return RunTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public RunTransactionResponse runTransactionV1(RunTransactionRequest runTransactionRequest) throws ApiException { + ApiResponse localVarResp = runTransactionV1WithHttpInfo(runTransactionRequest); + return localVarResp.getData(); + } + + /** + * Executes a transaction on a besu ledger + * + * @param runTransactionRequest (optional) + * @return ApiResponse<RunTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse runTransactionV1WithHttpInfo(RunTransactionRequest runTransactionRequest) throws ApiException { + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Executes a transaction on a besu ledger (asynchronously) + * + * @param runTransactionRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call runTransactionV1Async(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for signTransactionV1 + * @param signTransactionRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 Not able to find the corresponding tranaction from the transaction hash -
+ */ + public okhttp3.Call signTransactionV1Call(SignTransactionRequest signTransactionRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = signTransactionRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/sign-transaction"; + + 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 signTransactionV1ValidateBeforeCall(SignTransactionRequest signTransactionRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'signTransactionRequest' is set + if (signTransactionRequest == null) { + throw new ApiException("Missing the required parameter 'signTransactionRequest' when calling signTransactionV1(Async)"); + } + + return signTransactionV1Call(signTransactionRequest, _callback); + + } + + /** + * Obtain signatures of ledger from the corresponding transaction hash. + * Obtain signatures of ledger from the corresponding transaction hash. + * @param signTransactionRequest (required) + * @return SignTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 Not able to find the corresponding tranaction from the transaction hash -
+ */ + public SignTransactionResponse signTransactionV1(SignTransactionRequest signTransactionRequest) throws ApiException { + ApiResponse localVarResp = signTransactionV1WithHttpInfo(signTransactionRequest); + return localVarResp.getData(); + } + + /** + * Obtain signatures of ledger from the corresponding transaction hash. + * Obtain signatures of ledger from the corresponding transaction hash. + * @param signTransactionRequest (required) + * @return ApiResponse<SignTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 Not able to find the corresponding tranaction from the transaction hash -
+ */ + public ApiResponse signTransactionV1WithHttpInfo(SignTransactionRequest signTransactionRequest) throws ApiException { + okhttp3.Call localVarCall = signTransactionV1ValidateBeforeCall(signTransactionRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Obtain signatures of ledger from the corresponding transaction hash. (asynchronously) + * Obtain signatures of ledger from the corresponding transaction hash. + * @param signTransactionRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 Not able to find the corresponding tranaction from the transaction hash -
+ */ + public okhttp3.Call signTransactionV1Async(SignTransactionRequest signTransactionRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = signTransactionV1ValidateBeforeCall(signTransactionRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..a5156007d42 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..152c351d897 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..019ad173844 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..a83fc43a1a5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..e7de9c5e87d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuPrivateTransactionConfig.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuPrivateTransactionConfig.java new file mode 100644 index 00000000000..5a5c89f9b13 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuPrivateTransactionConfig.java @@ -0,0 +1,261 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * BesuPrivateTransactionConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BesuPrivateTransactionConfig { + public static final String SERIALIZED_NAME_PRIVATE_FROM = "privateFrom"; + @SerializedName(SERIALIZED_NAME_PRIVATE_FROM) + private String privateFrom; + + public static final String SERIALIZED_NAME_PRIVATE_FOR = "privateFor"; + @SerializedName(SERIALIZED_NAME_PRIVATE_FOR) + private List privateFor = null; + + public BesuPrivateTransactionConfig() { + } + + public BesuPrivateTransactionConfig privateFrom(String privateFrom) { + + this.privateFrom = privateFrom; + return this; + } + + /** + * Get privateFrom + * @return privateFrom + **/ + @javax.annotation.Nonnull + public String getPrivateFrom() { + return privateFrom; + } + + + public void setPrivateFrom(String privateFrom) { + this.privateFrom = privateFrom; + } + + + public BesuPrivateTransactionConfig privateFor(List privateFor) { + + this.privateFor = privateFor; + return this; + } + + public BesuPrivateTransactionConfig addPrivateForItem(Object privateForItem) { + if (this.privateFor == null) { + this.privateFor = null; + } + this.privateFor.add(privateForItem); + return this; + } + + /** + * Get privateFor + * @return privateFor + **/ + @javax.annotation.Nonnull + public List getPrivateFor() { + return privateFor; + } + + + public void setPrivateFor(List privateFor) { + this.privateFor = privateFor; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BesuPrivateTransactionConfig besuPrivateTransactionConfig = (BesuPrivateTransactionConfig) o; + return Objects.equals(this.privateFrom, besuPrivateTransactionConfig.privateFrom) && + Objects.equals(this.privateFor, besuPrivateTransactionConfig.privateFor); + } + + @Override + public int hashCode() { + return Objects.hash(privateFrom, privateFor); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BesuPrivateTransactionConfig {\n"); + sb.append(" privateFrom: ").append(toIndentedString(privateFrom)).append("\n"); + sb.append(" privateFor: ").append(toIndentedString(privateFor)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("privateFrom"); + openapiFields.add("privateFor"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("privateFrom"); + openapiRequiredFields.add("privateFor"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BesuPrivateTransactionConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!BesuPrivateTransactionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BesuPrivateTransactionConfig is not found in the empty JSON string", BesuPrivateTransactionConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BesuPrivateTransactionConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BesuPrivateTransactionConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BesuPrivateTransactionConfig.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("privateFrom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `privateFrom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("privateFrom").toString())); + } + // ensure the required json array is present + if (jsonObj.get("privateFor") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("privateFor").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `privateFor` to be an array in the JSON string but got `%s`", jsonObj.get("privateFor").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BesuPrivateTransactionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BesuPrivateTransactionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BesuPrivateTransactionConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BesuPrivateTransactionConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BesuPrivateTransactionConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BesuPrivateTransactionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of BesuPrivateTransactionConfig + * @throws IOException if the JSON string is invalid with respect to BesuPrivateTransactionConfig + */ + public static BesuPrivateTransactionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BesuPrivateTransactionConfig.class); + } + + /** + * Convert an instance of BesuPrivateTransactionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuTransactionConfig.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuTransactionConfig.java new file mode 100644 index 00000000000..ec9fe879fa1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuTransactionConfig.java @@ -0,0 +1,506 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.BesuTransactionConfigTo; +import org.openapitools.client.model.Web3BlockHeaderTimestamp; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * BesuTransactionConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BesuTransactionConfig { + public static final String SERIALIZED_NAME_RAW_TRANSACTION = "rawTransaction"; + @SerializedName(SERIALIZED_NAME_RAW_TRANSACTION) + private String rawTransaction; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private Web3BlockHeaderTimestamp from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private BesuTransactionConfigTo to; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private Web3BlockHeaderTimestamp value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private Web3BlockHeaderTimestamp gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private Web3BlockHeaderTimestamp gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private BesuTransactionConfigTo data; + + public BesuTransactionConfig() { + } + + public BesuTransactionConfig rawTransaction(String rawTransaction) { + + this.rawTransaction = rawTransaction; + return this; + } + + /** + * Get rawTransaction + * @return rawTransaction + **/ + @javax.annotation.Nullable + public String getRawTransaction() { + return rawTransaction; + } + + + public void setRawTransaction(String rawTransaction) { + this.rawTransaction = rawTransaction; + } + + + public BesuTransactionConfig from(Web3BlockHeaderTimestamp from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nullable + public Web3BlockHeaderTimestamp getFrom() { + return from; + } + + + public void setFrom(Web3BlockHeaderTimestamp from) { + this.from = from; + } + + + public BesuTransactionConfig to(BesuTransactionConfigTo to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nullable + public BesuTransactionConfigTo getTo() { + return to; + } + + + public void setTo(BesuTransactionConfigTo to) { + this.to = to; + } + + + public BesuTransactionConfig value(Web3BlockHeaderTimestamp value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public Web3BlockHeaderTimestamp getValue() { + return value; + } + + + public void setValue(Web3BlockHeaderTimestamp value) { + this.value = value; + } + + + public BesuTransactionConfig gas(Web3BlockHeaderTimestamp gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public Web3BlockHeaderTimestamp getGas() { + return gas; + } + + + public void setGas(Web3BlockHeaderTimestamp gas) { + this.gas = gas; + } + + + public BesuTransactionConfig gasPrice(Web3BlockHeaderTimestamp gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public Web3BlockHeaderTimestamp getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(Web3BlockHeaderTimestamp gasPrice) { + this.gasPrice = gasPrice; + } + + + public BesuTransactionConfig nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public BesuTransactionConfig data(BesuTransactionConfigTo data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + public BesuTransactionConfigTo getData() { + return data; + } + + + public void setData(BesuTransactionConfigTo data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BesuTransactionConfig instance itself + */ + public BesuTransactionConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BesuTransactionConfig besuTransactionConfig = (BesuTransactionConfig) o; + return Objects.equals(this.rawTransaction, besuTransactionConfig.rawTransaction) && + Objects.equals(this.from, besuTransactionConfig.from) && + Objects.equals(this.to, besuTransactionConfig.to) && + Objects.equals(this.value, besuTransactionConfig.value) && + Objects.equals(this.gas, besuTransactionConfig.gas) && + Objects.equals(this.gasPrice, besuTransactionConfig.gasPrice) && + Objects.equals(this.nonce, besuTransactionConfig.nonce) && + Objects.equals(this.data, besuTransactionConfig.data)&& + Objects.equals(this.additionalProperties, besuTransactionConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rawTransaction, from, to, value, gas, gasPrice, nonce, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BesuTransactionConfig {\n"); + sb.append(" rawTransaction: ").append(toIndentedString(rawTransaction)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rawTransaction"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BesuTransactionConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!BesuTransactionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BesuTransactionConfig is not found in the empty JSON string", BesuTransactionConfig.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("rawTransaction") != null && !jsonObj.get("rawTransaction").isJsonNull()) && !jsonObj.get("rawTransaction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rawTransaction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawTransaction").toString())); + } + // validate the optional field `from` + if (jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) { + Web3BlockHeaderTimestamp.validateJsonObject(jsonObj.getAsJsonObject("from")); + } + // validate the optional field `to` + if (jsonObj.get("to") != null && !jsonObj.get("to").isJsonNull()) { + BesuTransactionConfigTo.validateJsonObject(jsonObj.getAsJsonObject("to")); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + Web3BlockHeaderTimestamp.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + Web3BlockHeaderTimestamp.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + Web3BlockHeaderTimestamp.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + BesuTransactionConfigTo.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BesuTransactionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BesuTransactionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BesuTransactionConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BesuTransactionConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BesuTransactionConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + BesuTransactionConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BesuTransactionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of BesuTransactionConfig + * @throws IOException if the JSON string is invalid with respect to BesuTransactionConfig + */ + public static BesuTransactionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BesuTransactionConfig.class); + } + + /** + * Convert an instance of BesuTransactionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuTransactionConfigTo.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuTransactionConfigTo.java new file mode 100644 index 00000000000..1b7db9dcb4f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BesuTransactionConfigTo.java @@ -0,0 +1,224 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class BesuTransactionConfigTo extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(BesuTransactionConfigTo.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BesuTransactionConfigTo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BesuTransactionConfigTo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BesuTransactionConfigTo value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: String"); + } + + @Override + public BesuTransactionConfigTo read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + BesuTransactionConfigTo ret = new BesuTransactionConfigTo(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for BesuTransactionConfigTo: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public BesuTransactionConfigTo() { + super("oneOf", Boolean.FALSE); + } + + public BesuTransactionConfigTo(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return BesuTransactionConfigTo.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be String"); + } + + /** + * Get the actual instance, which can be the following: + * String + * + * @return The actual instance (String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BesuTransactionConfigTo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for BesuTransactionConfigTo with oneOf schemas: String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of BesuTransactionConfigTo given an JSON string + * + * @param jsonString JSON string + * @return An instance of BesuTransactionConfigTo + * @throws IOException if the JSON string is invalid with respect to BesuTransactionConfigTo + */ + public static BesuTransactionConfigTo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BesuTransactionConfigTo.class); + } + + /** + * Convert an instance of BesuTransactionConfigTo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsistencyStrategy.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsistencyStrategy.java new file mode 100644 index 00000000000..046a93af2d8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsistencyStrategy.java @@ -0,0 +1,274 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ReceiptType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ConsistencyStrategy + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConsistencyStrategy { + public static final String SERIALIZED_NAME_RECEIPT_TYPE = "receiptType"; + @SerializedName(SERIALIZED_NAME_RECEIPT_TYPE) + private ReceiptType receiptType; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private Integer timeoutMs; + + public static final String SERIALIZED_NAME_BLOCK_CONFIRMATIONS = "blockConfirmations"; + @SerializedName(SERIALIZED_NAME_BLOCK_CONFIRMATIONS) + private Integer blockConfirmations; + + public ConsistencyStrategy() { + } + + public ConsistencyStrategy receiptType(ReceiptType receiptType) { + + this.receiptType = receiptType; + return this; + } + + /** + * Get receiptType + * @return receiptType + **/ + @javax.annotation.Nonnull + public ReceiptType getReceiptType() { + return receiptType; + } + + + public void setReceiptType(ReceiptType receiptType) { + this.receiptType = receiptType; + } + + + public ConsistencyStrategy timeoutMs(Integer timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for the receipt to arrive to the connector. Defaults to 0 which means to wait for an unlimited amount of time. Note that this wait may be interrupted still by other parts of the infrastructure such as load balancers cutting of HTTP requests after some time even if they are the type that is supposed to be kept alive. The question of re-entrance is a broader topic not in scope to discuss here, but it is important to mention it. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public Integer getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(Integer timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public ConsistencyStrategy blockConfirmations(Integer blockConfirmations) { + + this.blockConfirmations = blockConfirmations; + return this; + } + + /** + * The number of blocks to wait to be confirmed in addition to the block containing the transaction in question. Note that if the receipt type is set to only wait for node transaction pool ACK and this parameter is set to anything, but zero then the API will not accept the request due to conflicting parameters. + * minimum: 0 + * maximum: 20000 + * @return blockConfirmations + **/ + @javax.annotation.Nonnull + public Integer getBlockConfirmations() { + return blockConfirmations; + } + + + public void setBlockConfirmations(Integer blockConfirmations) { + this.blockConfirmations = blockConfirmations; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsistencyStrategy consistencyStrategy = (ConsistencyStrategy) o; + return Objects.equals(this.receiptType, consistencyStrategy.receiptType) && + Objects.equals(this.timeoutMs, consistencyStrategy.timeoutMs) && + Objects.equals(this.blockConfirmations, consistencyStrategy.blockConfirmations); + } + + @Override + public int hashCode() { + return Objects.hash(receiptType, timeoutMs, blockConfirmations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsistencyStrategy {\n"); + sb.append(" receiptType: ").append(toIndentedString(receiptType)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" blockConfirmations: ").append(toIndentedString(blockConfirmations)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("receiptType"); + openapiFields.add("timeoutMs"); + openapiFields.add("blockConfirmations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("receiptType"); + openapiRequiredFields.add("blockConfirmations"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsistencyStrategy + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ConsistencyStrategy.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsistencyStrategy is not found in the empty JSON string", ConsistencyStrategy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsistencyStrategy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsistencyStrategy` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConsistencyStrategy.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsistencyStrategy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsistencyStrategy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsistencyStrategy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsistencyStrategy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsistencyStrategy read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsistencyStrategy given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsistencyStrategy + * @throws IOException if the JSON string is invalid with respect to ConsistencyStrategy + */ + public static ConsistencyStrategy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsistencyStrategy.class); + } + + /** + * Convert an instance of ConsistencyStrategy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java new file mode 100644 index 00000000000..866a710d7f9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java @@ -0,0 +1,522 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.BesuPrivateTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractSolidityBytecodeV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractSolidityBytecodeV1Request { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_CONTRACT_ABI = "contractAbi"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ABI) + private List contractAbi = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private String gasPrice; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG = "privateTransactionConfig"; + @SerializedName(SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG) + private BesuPrivateTransactionConfig privateTransactionConfig; + + public DeployContractSolidityBytecodeV1Request() { + } + + public DeployContractSolidityBytecodeV1Request contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * The contract name for retrieve the contracts json on the keychain. + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public DeployContractSolidityBytecodeV1Request contractAbi(List contractAbi) { + + this.contractAbi = contractAbi; + return this; + } + + public DeployContractSolidityBytecodeV1Request addContractAbiItem(Object contractAbiItem) { + if (this.contractAbi == null) { + this.contractAbi = new ArrayList<>(); + } + this.contractAbi.add(contractAbiItem); + return this; + } + + /** + * The application binary interface of the solidity contract + * @return contractAbi + **/ + @javax.annotation.Nonnull + public List getContractAbi() { + return contractAbi; + } + + + public void setContractAbi(List contractAbi) { + this.contractAbi = contractAbi; + } + + + public DeployContractSolidityBytecodeV1Request constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public DeployContractSolidityBytecodeV1Request addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * Get constructorArgs + * @return constructorArgs + **/ + @javax.annotation.Nonnull + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public DeployContractSolidityBytecodeV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public DeployContractSolidityBytecodeV1Request bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + * @return bytecode + **/ + @javax.annotation.Nonnull + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public DeployContractSolidityBytecodeV1Request keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychainId for retrieve the contracts json. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public DeployContractSolidityBytecodeV1Request gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + public DeployContractSolidityBytecodeV1Request gasPrice(String gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public String getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(String gasPrice) { + this.gasPrice = gasPrice; + } + + + public DeployContractSolidityBytecodeV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public DeployContractSolidityBytecodeV1Request privateTransactionConfig(BesuPrivateTransactionConfig privateTransactionConfig) { + + this.privateTransactionConfig = privateTransactionConfig; + return this; + } + + /** + * Get privateTransactionConfig + * @return privateTransactionConfig + **/ + @javax.annotation.Nullable + public BesuPrivateTransactionConfig getPrivateTransactionConfig() { + return privateTransactionConfig; + } + + + public void setPrivateTransactionConfig(BesuPrivateTransactionConfig privateTransactionConfig) { + this.privateTransactionConfig = privateTransactionConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request = (DeployContractSolidityBytecodeV1Request) o; + return Objects.equals(this.contractName, deployContractSolidityBytecodeV1Request.contractName) && + Objects.equals(this.contractAbi, deployContractSolidityBytecodeV1Request.contractAbi) && + Objects.equals(this.constructorArgs, deployContractSolidityBytecodeV1Request.constructorArgs) && + Objects.equals(this.web3SigningCredential, deployContractSolidityBytecodeV1Request.web3SigningCredential) && + Objects.equals(this.bytecode, deployContractSolidityBytecodeV1Request.bytecode) && + Objects.equals(this.keychainId, deployContractSolidityBytecodeV1Request.keychainId) && + Objects.equals(this.gas, deployContractSolidityBytecodeV1Request.gas) && + Objects.equals(this.gasPrice, deployContractSolidityBytecodeV1Request.gasPrice) && + Objects.equals(this.timeoutMs, deployContractSolidityBytecodeV1Request.timeoutMs) && + Objects.equals(this.privateTransactionConfig, deployContractSolidityBytecodeV1Request.privateTransactionConfig); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, contractAbi, constructorArgs, web3SigningCredential, bytecode, keychainId, gas, gasPrice, timeoutMs, privateTransactionConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractSolidityBytecodeV1Request {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" contractAbi: ").append(toIndentedString(contractAbi)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" privateTransactionConfig: ").append(toIndentedString(privateTransactionConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("contractAbi"); + openapiFields.add("constructorArgs"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("bytecode"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("timeoutMs"); + openapiFields.add("privateTransactionConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("contractAbi"); + openapiRequiredFields.add("constructorArgs"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("bytecode"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractSolidityBytecodeV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractSolidityBytecodeV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractSolidityBytecodeV1Request is not found in the empty JSON string", DeployContractSolidityBytecodeV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractSolidityBytecodeV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractSolidityBytecodeV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractSolidityBytecodeV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("contractAbi") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("contractAbi").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAbi` to be an array in the JSON string but got `%s`", jsonObj.get("contractAbi").toString())); + } + // ensure the required json array is present + if (jsonObj.get("constructorArgs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + if ((jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) && !jsonObj.get("gasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasPrice").toString())); + } + // validate the optional field `privateTransactionConfig` + if (jsonObj.get("privateTransactionConfig") != null && !jsonObj.get("privateTransactionConfig").isJsonNull()) { + BesuPrivateTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("privateTransactionConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractSolidityBytecodeV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractSolidityBytecodeV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractSolidityBytecodeV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractSolidityBytecodeV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractSolidityBytecodeV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractSolidityBytecodeV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractSolidityBytecodeV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractSolidityBytecodeV1Request + */ + public static DeployContractSolidityBytecodeV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractSolidityBytecodeV1Request.class); + } + + /** + * Convert an instance of DeployContractSolidityBytecodeV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java new file mode 100644 index 00000000000..d99c7e7973e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractSolidityBytecodeV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractSolidityBytecodeV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public DeployContractSolidityBytecodeV1Response() { + } + + public DeployContractSolidityBytecodeV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractSolidityBytecodeV1Response deployContractSolidityBytecodeV1Response = (DeployContractSolidityBytecodeV1Response) o; + return Objects.equals(this.transactionReceipt, deployContractSolidityBytecodeV1Response.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractSolidityBytecodeV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractSolidityBytecodeV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractSolidityBytecodeV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractSolidityBytecodeV1Response is not found in the empty JSON string", DeployContractSolidityBytecodeV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractSolidityBytecodeV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractSolidityBytecodeV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractSolidityBytecodeV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractSolidityBytecodeV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractSolidityBytecodeV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractSolidityBytecodeV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractSolidityBytecodeV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractSolidityBytecodeV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractSolidityBytecodeV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractSolidityBytecodeV1Response + * @throws IOException if the JSON string is invalid with respect to DeployContractSolidityBytecodeV1Response + */ + public static DeployContractSolidityBytecodeV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractSolidityBytecodeV1Response.class); + } + + /** + * Convert an instance of DeployContractSolidityBytecodeV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java new file mode 100644 index 00000000000..1f5a2e829b0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets EthContractInvocationType + */ +@JsonAdapter(EthContractInvocationType.Adapter.class) +public enum EthContractInvocationType { + + SEND("SEND"), + + CALL("CALL"); + + private String value; + + EthContractInvocationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EthContractInvocationType fromValue(String value) { + for (EthContractInvocationType b : EthContractInvocationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EthContractInvocationType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EthContractInvocationType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EthContractInvocationType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmBlock.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmBlock.java new file mode 100644 index 00000000000..7210ab56aa4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmBlock.java @@ -0,0 +1,747 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * EvmBlock + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EvmBlock { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private BigDecimal number; + + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_PARENT_HASH = "parentHash"; + @SerializedName(SERIALIZED_NAME_PARENT_HASH) + private String parentHash; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_SHA3_UNCLES = "sha3Uncles"; + @SerializedName(SERIALIZED_NAME_SHA3_UNCLES) + private String sha3Uncles; + + public static final String SERIALIZED_NAME_LOGS_BLOOM = "logsBloom"; + @SerializedName(SERIALIZED_NAME_LOGS_BLOOM) + private String logsBloom; + + public static final String SERIALIZED_NAME_TRANSACTIONS_ROOT = "transactionsRoot"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS_ROOT) + private String transactionsRoot; + + public static final String SERIALIZED_NAME_STATE_ROOT = "stateRoot"; + @SerializedName(SERIALIZED_NAME_STATE_ROOT) + private String stateRoot; + + public static final String SERIALIZED_NAME_MINER = "miner"; + @SerializedName(SERIALIZED_NAME_MINER) + private String miner; + + public static final String SERIALIZED_NAME_DIFFICULTY = "difficulty"; + @SerializedName(SERIALIZED_NAME_DIFFICULTY) + private BigDecimal difficulty; + + public static final String SERIALIZED_NAME_TOTAL_DIFFICULTY = "totalDifficulty"; + @SerializedName(SERIALIZED_NAME_TOTAL_DIFFICULTY) + private BigDecimal totalDifficulty; + + public static final String SERIALIZED_NAME_EXTRA_DATA = "extraData"; + @SerializedName(SERIALIZED_NAME_EXTRA_DATA) + private String extraData; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private BigDecimal size; + + public static final String SERIALIZED_NAME_GAS_LIMIT = "gasLimit"; + @SerializedName(SERIALIZED_NAME_GAS_LIMIT) + private BigDecimal gasLimit; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private BigDecimal gasUsed; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private Object timestamp = null; + + public static final String SERIALIZED_NAME_TRANSACTIONS = "transactions"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS) + private List transactions; + + public static final String SERIALIZED_NAME_UNCLES = "uncles"; + @SerializedName(SERIALIZED_NAME_UNCLES) + private List uncles; + + public EvmBlock() { + } + + public EvmBlock number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @javax.annotation.Nullable + public BigDecimal getNumber() { + return number; + } + + + public void setNumber(BigDecimal number) { + this.number = number; + } + + + public EvmBlock hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + **/ + @javax.annotation.Nullable + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public EvmBlock parentHash(String parentHash) { + + this.parentHash = parentHash; + return this; + } + + /** + * Get parentHash + * @return parentHash + **/ + @javax.annotation.Nullable + public String getParentHash() { + return parentHash; + } + + + public void setParentHash(String parentHash) { + this.parentHash = parentHash; + } + + + public EvmBlock nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public EvmBlock sha3Uncles(String sha3Uncles) { + + this.sha3Uncles = sha3Uncles; + return this; + } + + /** + * Get sha3Uncles + * @return sha3Uncles + **/ + @javax.annotation.Nullable + public String getSha3Uncles() { + return sha3Uncles; + } + + + public void setSha3Uncles(String sha3Uncles) { + this.sha3Uncles = sha3Uncles; + } + + + public EvmBlock logsBloom(String logsBloom) { + + this.logsBloom = logsBloom; + return this; + } + + /** + * Get logsBloom + * @return logsBloom + **/ + @javax.annotation.Nullable + public String getLogsBloom() { + return logsBloom; + } + + + public void setLogsBloom(String logsBloom) { + this.logsBloom = logsBloom; + } + + + public EvmBlock transactionsRoot(String transactionsRoot) { + + this.transactionsRoot = transactionsRoot; + return this; + } + + /** + * Get transactionsRoot + * @return transactionsRoot + **/ + @javax.annotation.Nullable + public String getTransactionsRoot() { + return transactionsRoot; + } + + + public void setTransactionsRoot(String transactionsRoot) { + this.transactionsRoot = transactionsRoot; + } + + + public EvmBlock stateRoot(String stateRoot) { + + this.stateRoot = stateRoot; + return this; + } + + /** + * Get stateRoot + * @return stateRoot + **/ + @javax.annotation.Nullable + public String getStateRoot() { + return stateRoot; + } + + + public void setStateRoot(String stateRoot) { + this.stateRoot = stateRoot; + } + + + public EvmBlock miner(String miner) { + + this.miner = miner; + return this; + } + + /** + * Get miner + * @return miner + **/ + @javax.annotation.Nullable + public String getMiner() { + return miner; + } + + + public void setMiner(String miner) { + this.miner = miner; + } + + + public EvmBlock difficulty(BigDecimal difficulty) { + + this.difficulty = difficulty; + return this; + } + + /** + * Get difficulty + * @return difficulty + **/ + @javax.annotation.Nullable + public BigDecimal getDifficulty() { + return difficulty; + } + + + public void setDifficulty(BigDecimal difficulty) { + this.difficulty = difficulty; + } + + + public EvmBlock totalDifficulty(BigDecimal totalDifficulty) { + + this.totalDifficulty = totalDifficulty; + return this; + } + + /** + * Get totalDifficulty + * @return totalDifficulty + **/ + @javax.annotation.Nullable + public BigDecimal getTotalDifficulty() { + return totalDifficulty; + } + + + public void setTotalDifficulty(BigDecimal totalDifficulty) { + this.totalDifficulty = totalDifficulty; + } + + + public EvmBlock extraData(String extraData) { + + this.extraData = extraData; + return this; + } + + /** + * Get extraData + * @return extraData + **/ + @javax.annotation.Nullable + public String getExtraData() { + return extraData; + } + + + public void setExtraData(String extraData) { + this.extraData = extraData; + } + + + public EvmBlock size(BigDecimal size) { + + this.size = size; + return this; + } + + /** + * Get size + * @return size + **/ + @javax.annotation.Nullable + public BigDecimal getSize() { + return size; + } + + + public void setSize(BigDecimal size) { + this.size = size; + } + + + public EvmBlock gasLimit(BigDecimal gasLimit) { + + this.gasLimit = gasLimit; + return this; + } + + /** + * Get gasLimit + * @return gasLimit + **/ + @javax.annotation.Nullable + public BigDecimal getGasLimit() { + return gasLimit; + } + + + public void setGasLimit(BigDecimal gasLimit) { + this.gasLimit = gasLimit; + } + + + public EvmBlock gasUsed(BigDecimal gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nullable + public BigDecimal getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(BigDecimal gasUsed) { + this.gasUsed = gasUsed; + } + + + public EvmBlock timestamp(Object timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nullable + public Object getTimestamp() { + return timestamp; + } + + + public void setTimestamp(Object timestamp) { + this.timestamp = timestamp; + } + + + public EvmBlock transactions(List transactions) { + + this.transactions = transactions; + return this; + } + + public EvmBlock addTransactionsItem(Object transactionsItem) { + if (this.transactions == null) { + this.transactions = new ArrayList<>(); + } + this.transactions.add(transactionsItem); + return this; + } + + /** + * Get transactions + * @return transactions + **/ + @javax.annotation.Nullable + public List getTransactions() { + return transactions; + } + + + public void setTransactions(List transactions) { + this.transactions = transactions; + } + + + public EvmBlock uncles(List uncles) { + + this.uncles = uncles; + return this; + } + + public EvmBlock addUnclesItem(Object unclesItem) { + if (this.uncles == null) { + this.uncles = new ArrayList<>(); + } + this.uncles.add(unclesItem); + return this; + } + + /** + * Get uncles + * @return uncles + **/ + @javax.annotation.Nullable + public List getUncles() { + return uncles; + } + + + public void setUncles(List uncles) { + this.uncles = uncles; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EvmBlock evmBlock = (EvmBlock) o; + return Objects.equals(this.number, evmBlock.number) && + Objects.equals(this.hash, evmBlock.hash) && + Objects.equals(this.parentHash, evmBlock.parentHash) && + Objects.equals(this.nonce, evmBlock.nonce) && + Objects.equals(this.sha3Uncles, evmBlock.sha3Uncles) && + Objects.equals(this.logsBloom, evmBlock.logsBloom) && + Objects.equals(this.transactionsRoot, evmBlock.transactionsRoot) && + Objects.equals(this.stateRoot, evmBlock.stateRoot) && + Objects.equals(this.miner, evmBlock.miner) && + Objects.equals(this.difficulty, evmBlock.difficulty) && + Objects.equals(this.totalDifficulty, evmBlock.totalDifficulty) && + Objects.equals(this.extraData, evmBlock.extraData) && + Objects.equals(this.size, evmBlock.size) && + Objects.equals(this.gasLimit, evmBlock.gasLimit) && + Objects.equals(this.gasUsed, evmBlock.gasUsed) && + Objects.equals(this.timestamp, evmBlock.timestamp) && + Objects.equals(this.transactions, evmBlock.transactions) && + Objects.equals(this.uncles, evmBlock.uncles); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(number, hash, parentHash, nonce, sha3Uncles, logsBloom, transactionsRoot, stateRoot, miner, difficulty, totalDifficulty, extraData, size, gasLimit, gasUsed, timestamp, transactions, uncles); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EvmBlock {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" parentHash: ").append(toIndentedString(parentHash)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" sha3Uncles: ").append(toIndentedString(sha3Uncles)).append("\n"); + sb.append(" logsBloom: ").append(toIndentedString(logsBloom)).append("\n"); + sb.append(" transactionsRoot: ").append(toIndentedString(transactionsRoot)).append("\n"); + sb.append(" stateRoot: ").append(toIndentedString(stateRoot)).append("\n"); + sb.append(" miner: ").append(toIndentedString(miner)).append("\n"); + sb.append(" difficulty: ").append(toIndentedString(difficulty)).append("\n"); + sb.append(" totalDifficulty: ").append(toIndentedString(totalDifficulty)).append("\n"); + sb.append(" extraData: ").append(toIndentedString(extraData)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" transactions: ").append(toIndentedString(transactions)).append("\n"); + sb.append(" uncles: ").append(toIndentedString(uncles)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("number"); + openapiFields.add("hash"); + openapiFields.add("parentHash"); + openapiFields.add("nonce"); + openapiFields.add("sha3Uncles"); + openapiFields.add("logsBloom"); + openapiFields.add("transactionsRoot"); + openapiFields.add("stateRoot"); + openapiFields.add("miner"); + openapiFields.add("difficulty"); + openapiFields.add("totalDifficulty"); + openapiFields.add("extraData"); + openapiFields.add("size"); + openapiFields.add("gasLimit"); + openapiFields.add("gasUsed"); + openapiFields.add("timestamp"); + openapiFields.add("transactions"); + openapiFields.add("uncles"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EvmBlock + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EvmBlock.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EvmBlock is not found in the empty JSON string", EvmBlock.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EvmBlock.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EvmBlock` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("hash") != null && !jsonObj.get("hash").isJsonNull()) && !jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if ((jsonObj.get("parentHash") != null && !jsonObj.get("parentHash").isJsonNull()) && !jsonObj.get("parentHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parentHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parentHash").toString())); + } + if ((jsonObj.get("nonce") != null && !jsonObj.get("nonce").isJsonNull()) && !jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if ((jsonObj.get("sha3Uncles") != null && !jsonObj.get("sha3Uncles").isJsonNull()) && !jsonObj.get("sha3Uncles").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sha3Uncles` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3Uncles").toString())); + } + if ((jsonObj.get("logsBloom") != null && !jsonObj.get("logsBloom").isJsonNull()) && !jsonObj.get("logsBloom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logsBloom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logsBloom").toString())); + } + if ((jsonObj.get("transactionsRoot") != null && !jsonObj.get("transactionsRoot").isJsonNull()) && !jsonObj.get("transactionsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionsRoot").toString())); + } + if ((jsonObj.get("stateRoot") != null && !jsonObj.get("stateRoot").isJsonNull()) && !jsonObj.get("stateRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateRoot").toString())); + } + if ((jsonObj.get("miner") != null && !jsonObj.get("miner").isJsonNull()) && !jsonObj.get("miner").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `miner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("miner").toString())); + } + if ((jsonObj.get("extraData") != null && !jsonObj.get("extraData").isJsonNull()) && !jsonObj.get("extraData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `extraData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraData").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("transactions") != null && !jsonObj.get("transactions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transactions` to be an array in the JSON string but got `%s`", jsonObj.get("transactions").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("uncles") != null && !jsonObj.get("uncles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `uncles` to be an array in the JSON string but got `%s`", jsonObj.get("uncles").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EvmBlock.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EvmBlock' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EvmBlock.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EvmBlock value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EvmBlock read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EvmBlock given an JSON string + * + * @param jsonString JSON string + * @return An instance of EvmBlock + * @throws IOException if the JSON string is invalid with respect to EvmBlock + */ + public static EvmBlock fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EvmBlock.class); + } + + /** + * Convert an instance of EvmBlock to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmLog.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmLog.java new file mode 100644 index 00000000000..f0cb8bee56c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmLog.java @@ -0,0 +1,445 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * EvmLog + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EvmLog { + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private String data; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public static final String SERIALIZED_NAME_TOPICS = "topics"; + @SerializedName(SERIALIZED_NAME_TOPICS) + private List topics = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LOG_INDEX = "logIndex"; + @SerializedName(SERIALIZED_NAME_LOG_INDEX) + private BigDecimal logIndex; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private BigDecimal transactionIndex; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private BigDecimal blockNumber; + + public EvmLog() { + } + + public EvmLog address(String address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @javax.annotation.Nonnull + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public EvmLog data(String data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + public String getData() { + return data; + } + + + public void setData(String data) { + this.data = data; + } + + + public EvmLog blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nonnull + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public EvmLog transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nonnull + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + public EvmLog topics(List topics) { + + this.topics = topics; + return this; + } + + public EvmLog addTopicsItem(String topicsItem) { + if (this.topics == null) { + this.topics = new ArrayList<>(); + } + this.topics.add(topicsItem); + return this; + } + + /** + * Get topics + * @return topics + **/ + @javax.annotation.Nonnull + public List getTopics() { + return topics; + } + + + public void setTopics(List topics) { + this.topics = topics; + } + + + public EvmLog logIndex(BigDecimal logIndex) { + + this.logIndex = logIndex; + return this; + } + + /** + * Get logIndex + * @return logIndex + **/ + @javax.annotation.Nonnull + public BigDecimal getLogIndex() { + return logIndex; + } + + + public void setLogIndex(BigDecimal logIndex) { + this.logIndex = logIndex; + } + + + public EvmLog transactionIndex(BigDecimal transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nonnull + public BigDecimal getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(BigDecimal transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public EvmLog blockNumber(BigDecimal blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(BigDecimal blockNumber) { + this.blockNumber = blockNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EvmLog evmLog = (EvmLog) o; + return Objects.equals(this.address, evmLog.address) && + Objects.equals(this.data, evmLog.data) && + Objects.equals(this.blockHash, evmLog.blockHash) && + Objects.equals(this.transactionHash, evmLog.transactionHash) && + Objects.equals(this.topics, evmLog.topics) && + Objects.equals(this.logIndex, evmLog.logIndex) && + Objects.equals(this.transactionIndex, evmLog.transactionIndex) && + Objects.equals(this.blockNumber, evmLog.blockNumber); + } + + @Override + public int hashCode() { + return Objects.hash(address, data, blockHash, transactionHash, topics, logIndex, transactionIndex, blockNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EvmLog {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append(" topics: ").append(toIndentedString(topics)).append("\n"); + sb.append(" logIndex: ").append(toIndentedString(logIndex)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("address"); + openapiFields.add("data"); + openapiFields.add("blockHash"); + openapiFields.add("transactionHash"); + openapiFields.add("topics"); + openapiFields.add("logIndex"); + openapiFields.add("transactionIndex"); + openapiFields.add("blockNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("transactionHash"); + openapiRequiredFields.add("topics"); + openapiRequiredFields.add("logIndex"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("blockNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EvmLog + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EvmLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EvmLog is not found in the empty JSON string", EvmLog.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EvmLog.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EvmLog` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EvmLog.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if (!jsonObj.get("data").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + // ensure the required json array is present + if (jsonObj.get("topics") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("topics").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `topics` to be an array in the JSON string but got `%s`", jsonObj.get("topics").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EvmLog.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EvmLog' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EvmLog.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EvmLog value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EvmLog read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EvmLog given an JSON string + * + * @param jsonString JSON string + * @return An instance of EvmLog + * @throws IOException if the JSON string is invalid with respect to EvmLog + */ + public static EvmLog fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EvmLog.class); + } + + /** + * Convert an instance of EvmLog to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmTransaction.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmTransaction.java new file mode 100644 index 00000000000..8fec01001c5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EvmTransaction.java @@ -0,0 +1,513 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * EvmTransaction + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EvmTransaction { + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private Object blockHash = null; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private Object blockNumber = null; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private Object transactionIndex = null; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private Object to = null; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private String gasPrice; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public static final String SERIALIZED_NAME_INPUT = "input"; + @SerializedName(SERIALIZED_NAME_INPUT) + private String input; + + public EvmTransaction() { + } + + public EvmTransaction hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + **/ + @javax.annotation.Nullable + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public EvmTransaction nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public EvmTransaction blockHash(Object blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nullable + public Object getBlockHash() { + return blockHash; + } + + + public void setBlockHash(Object blockHash) { + this.blockHash = blockHash; + } + + + public EvmTransaction blockNumber(Object blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nullable + public Object getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(Object blockNumber) { + this.blockNumber = blockNumber; + } + + + public EvmTransaction transactionIndex(Object transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nullable + public Object getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(Object transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public EvmTransaction from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nullable + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public EvmTransaction to(Object to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nullable + public Object getTo() { + return to; + } + + + public void setTo(Object to) { + this.to = to; + } + + + public EvmTransaction value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + public EvmTransaction gasPrice(String gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public String getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(String gasPrice) { + this.gasPrice = gasPrice; + } + + + public EvmTransaction gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + public EvmTransaction input(String input) { + + this.input = input; + return this; + } + + /** + * Get input + * @return input + **/ + @javax.annotation.Nullable + public String getInput() { + return input; + } + + + public void setInput(String input) { + this.input = input; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EvmTransaction evmTransaction = (EvmTransaction) o; + return Objects.equals(this.hash, evmTransaction.hash) && + Objects.equals(this.nonce, evmTransaction.nonce) && + Objects.equals(this.blockHash, evmTransaction.blockHash) && + Objects.equals(this.blockNumber, evmTransaction.blockNumber) && + Objects.equals(this.transactionIndex, evmTransaction.transactionIndex) && + Objects.equals(this.from, evmTransaction.from) && + Objects.equals(this.to, evmTransaction.to) && + Objects.equals(this.value, evmTransaction.value) && + Objects.equals(this.gasPrice, evmTransaction.gasPrice) && + Objects.equals(this.gas, evmTransaction.gas) && + Objects.equals(this.input, evmTransaction.input); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hash, nonce, blockHash, blockNumber, transactionIndex, from, to, value, gasPrice, gas, input); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EvmTransaction {\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" input: ").append(toIndentedString(input)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hash"); + openapiFields.add("nonce"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("transactionIndex"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("value"); + openapiFields.add("gasPrice"); + openapiFields.add("gas"); + openapiFields.add("input"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EvmTransaction + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EvmTransaction.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EvmTransaction is not found in the empty JSON string", EvmTransaction.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EvmTransaction.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EvmTransaction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("hash") != null && !jsonObj.get("hash").isJsonNull()) && !jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + if ((jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) && !jsonObj.get("gasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasPrice").toString())); + } + if ((jsonObj.get("input") != null && !jsonObj.get("input").isJsonNull()) && !jsonObj.get("input").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `input` to be a primitive type in the JSON string but got `%s`", jsonObj.get("input").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EvmTransaction.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EvmTransaction' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EvmTransaction.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EvmTransaction value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EvmTransaction read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EvmTransaction given an JSON string + * + * @param jsonString JSON string + * @return An instance of EvmTransaction + * @throws IOException if the JSON string is invalid with respect to EvmTransaction + */ + public static EvmTransaction fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EvmTransaction.class); + } + + /** + * Convert an instance of EvmTransaction to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBalanceV1Request.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBalanceV1Request.java new file mode 100644 index 00000000000..93df8d47859 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBalanceV1Request.java @@ -0,0 +1,256 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetBalanceV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBalanceV1Request { + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_DEFAULT_BLOCK = "defaultBlock"; + @SerializedName(SERIALIZED_NAME_DEFAULT_BLOCK) + private Object defaultBlock = null; + + public GetBalanceV1Request() { + } + + public GetBalanceV1Request address(String address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @javax.annotation.Nonnull + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public GetBalanceV1Request defaultBlock(Object defaultBlock) { + + this.defaultBlock = defaultBlock; + return this; + } + + /** + * Get defaultBlock + * @return defaultBlock + **/ + @javax.annotation.Nullable + public Object getDefaultBlock() { + return defaultBlock; + } + + + public void setDefaultBlock(Object defaultBlock) { + this.defaultBlock = defaultBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBalanceV1Request getBalanceV1Request = (GetBalanceV1Request) o; + return Objects.equals(this.address, getBalanceV1Request.address) && + Objects.equals(this.defaultBlock, getBalanceV1Request.defaultBlock); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(address, defaultBlock); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBalanceV1Request {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" defaultBlock: ").append(toIndentedString(defaultBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("address"); + openapiFields.add("defaultBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("address"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBalanceV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBalanceV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBalanceV1Request is not found in the empty JSON string", GetBalanceV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBalanceV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBalanceV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBalanceV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBalanceV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBalanceV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBalanceV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBalanceV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBalanceV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBalanceV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBalanceV1Request + * @throws IOException if the JSON string is invalid with respect to GetBalanceV1Request + */ + public static GetBalanceV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBalanceV1Request.class); + } + + /** + * Convert an instance of GetBalanceV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBalanceV1Response.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBalanceV1Response.java new file mode 100644 index 00000000000..32ac16a4d6e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBalanceV1Response.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetBalanceV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBalanceV1Response { + public static final String SERIALIZED_NAME_BALANCE = "balance"; + @SerializedName(SERIALIZED_NAME_BALANCE) + private String balance; + + public GetBalanceV1Response() { + } + + public GetBalanceV1Response balance(String balance) { + + this.balance = balance; + return this; + } + + /** + * Get balance + * @return balance + **/ + @javax.annotation.Nonnull + public String getBalance() { + return balance; + } + + + public void setBalance(String balance) { + this.balance = balance; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBalanceV1Response getBalanceV1Response = (GetBalanceV1Response) o; + return Objects.equals(this.balance, getBalanceV1Response.balance); + } + + @Override + public int hashCode() { + return Objects.hash(balance); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBalanceV1Response {\n"); + sb.append(" balance: ").append(toIndentedString(balance)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("balance"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("balance"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBalanceV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBalanceV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBalanceV1Response is not found in the empty JSON string", GetBalanceV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBalanceV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBalanceV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBalanceV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("balance").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `balance` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balance").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBalanceV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBalanceV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBalanceV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBalanceV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBalanceV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBalanceV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBalanceV1Response + * @throws IOException if the JSON string is invalid with respect to GetBalanceV1Response + */ + public static GetBalanceV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBalanceV1Response.class); + } + + /** + * Convert an instance of GetBalanceV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBesuRecordV1Request.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBesuRecordV1Request.java new file mode 100644 index 00000000000..3db239fb9a8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBesuRecordV1Request.java @@ -0,0 +1,241 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.InvokeContractV1Request; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetBesuRecordV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBesuRecordV1Request { + public static final String SERIALIZED_NAME_INVOKE_CALL = "invokeCall"; + @SerializedName(SERIALIZED_NAME_INVOKE_CALL) + private InvokeContractV1Request invokeCall; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public GetBesuRecordV1Request() { + } + + public GetBesuRecordV1Request invokeCall(InvokeContractV1Request invokeCall) { + + this.invokeCall = invokeCall; + return this; + } + + /** + * Get invokeCall + * @return invokeCall + **/ + @javax.annotation.Nullable + public InvokeContractV1Request getInvokeCall() { + return invokeCall; + } + + + public void setInvokeCall(InvokeContractV1Request invokeCall) { + this.invokeCall = invokeCall; + } + + + public GetBesuRecordV1Request transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nullable + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBesuRecordV1Request getBesuRecordV1Request = (GetBesuRecordV1Request) o; + return Objects.equals(this.invokeCall, getBesuRecordV1Request.invokeCall) && + Objects.equals(this.transactionHash, getBesuRecordV1Request.transactionHash); + } + + @Override + public int hashCode() { + return Objects.hash(invokeCall, transactionHash); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBesuRecordV1Request {\n"); + sb.append(" invokeCall: ").append(toIndentedString(invokeCall)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("invokeCall"); + openapiFields.add("transactionHash"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBesuRecordV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBesuRecordV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBesuRecordV1Request is not found in the empty JSON string", GetBesuRecordV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBesuRecordV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBesuRecordV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `invokeCall` + if (jsonObj.get("invokeCall") != null && !jsonObj.get("invokeCall").isJsonNull()) { + InvokeContractV1Request.validateJsonObject(jsonObj.getAsJsonObject("invokeCall")); + } + if ((jsonObj.get("transactionHash") != null && !jsonObj.get("transactionHash").isJsonNull()) && !jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBesuRecordV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBesuRecordV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBesuRecordV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBesuRecordV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBesuRecordV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBesuRecordV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBesuRecordV1Request + * @throws IOException if the JSON string is invalid with respect to GetBesuRecordV1Request + */ + public static GetBesuRecordV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBesuRecordV1Request.class); + } + + /** + * Convert an instance of GetBesuRecordV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBesuRecordV1Response.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBesuRecordV1Response.java new file mode 100644 index 00000000000..abd15a6a540 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBesuRecordV1Response.java @@ -0,0 +1,307 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetBesuRecordV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBesuRecordV1Response { + public static final String SERIALIZED_NAME_LEDGER_ID = "ledgerId"; + @SerializedName(SERIALIZED_NAME_LEDGER_ID) + private String ledgerId; + + public static final String SERIALIZED_NAME_STATE_CONTRACT = "stateContract"; + @SerializedName(SERIALIZED_NAME_STATE_CONTRACT) + private String stateContract; + + public static final String SERIALIZED_NAME_TRANSACTION_INPUT_DATA = "transactionInputData"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INPUT_DATA) + private Object transactionInputData = null; + + public static final String SERIALIZED_NAME_CALL_OUTPUT = "callOutput"; + @SerializedName(SERIALIZED_NAME_CALL_OUTPUT) + private Object callOutput = null; + + public GetBesuRecordV1Response() { + } + + public GetBesuRecordV1Response ledgerId(String ledgerId) { + + this.ledgerId = ledgerId; + return this; + } + + /** + * Get ledgerId + * @return ledgerId + **/ + @javax.annotation.Nullable + public String getLedgerId() { + return ledgerId; + } + + + public void setLedgerId(String ledgerId) { + this.ledgerId = ledgerId; + } + + + public GetBesuRecordV1Response stateContract(String stateContract) { + + this.stateContract = stateContract; + return this; + } + + /** + * Get stateContract + * @return stateContract + **/ + @javax.annotation.Nullable + public String getStateContract() { + return stateContract; + } + + + public void setStateContract(String stateContract) { + this.stateContract = stateContract; + } + + + public GetBesuRecordV1Response transactionInputData(Object transactionInputData) { + + this.transactionInputData = transactionInputData; + return this; + } + + /** + * Get transactionInputData + * @return transactionInputData + **/ + @javax.annotation.Nullable + public Object getTransactionInputData() { + return transactionInputData; + } + + + public void setTransactionInputData(Object transactionInputData) { + this.transactionInputData = transactionInputData; + } + + + public GetBesuRecordV1Response callOutput(Object callOutput) { + + this.callOutput = callOutput; + return this; + } + + /** + * Get callOutput + * @return callOutput + **/ + @javax.annotation.Nullable + public Object getCallOutput() { + return callOutput; + } + + + public void setCallOutput(Object callOutput) { + this.callOutput = callOutput; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBesuRecordV1Response getBesuRecordV1Response = (GetBesuRecordV1Response) o; + return Objects.equals(this.ledgerId, getBesuRecordV1Response.ledgerId) && + Objects.equals(this.stateContract, getBesuRecordV1Response.stateContract) && + Objects.equals(this.transactionInputData, getBesuRecordV1Response.transactionInputData) && + Objects.equals(this.callOutput, getBesuRecordV1Response.callOutput); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(ledgerId, stateContract, transactionInputData, callOutput); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBesuRecordV1Response {\n"); + sb.append(" ledgerId: ").append(toIndentedString(ledgerId)).append("\n"); + sb.append(" stateContract: ").append(toIndentedString(stateContract)).append("\n"); + sb.append(" transactionInputData: ").append(toIndentedString(transactionInputData)).append("\n"); + sb.append(" callOutput: ").append(toIndentedString(callOutput)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ledgerId"); + openapiFields.add("stateContract"); + openapiFields.add("transactionInputData"); + openapiFields.add("callOutput"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBesuRecordV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBesuRecordV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBesuRecordV1Response is not found in the empty JSON string", GetBesuRecordV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBesuRecordV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBesuRecordV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("ledgerId") != null && !jsonObj.get("ledgerId").isJsonNull()) && !jsonObj.get("ledgerId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ledgerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ledgerId").toString())); + } + if ((jsonObj.get("stateContract") != null && !jsonObj.get("stateContract").isJsonNull()) && !jsonObj.get("stateContract").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateContract` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateContract").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBesuRecordV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBesuRecordV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBesuRecordV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBesuRecordV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBesuRecordV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBesuRecordV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBesuRecordV1Response + * @throws IOException if the JSON string is invalid with respect to GetBesuRecordV1Response + */ + public static GetBesuRecordV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBesuRecordV1Response.class); + } + + /** + * Convert an instance of GetBesuRecordV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockV1Request.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockV1Request.java new file mode 100644 index 00000000000..944d1f213b6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockV1Request.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetBlockV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockV1Request { + public static final String SERIALIZED_NAME_BLOCK_HASH_OR_BLOCK_NUMBER = "blockHashOrBlockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH_OR_BLOCK_NUMBER) + private Object blockHashOrBlockNumber = null; + + public GetBlockV1Request() { + } + + public GetBlockV1Request blockHashOrBlockNumber(Object blockHashOrBlockNumber) { + + this.blockHashOrBlockNumber = blockHashOrBlockNumber; + return this; + } + + /** + * Get blockHashOrBlockNumber + * @return blockHashOrBlockNumber + **/ + @javax.annotation.Nullable + public Object getBlockHashOrBlockNumber() { + return blockHashOrBlockNumber; + } + + + public void setBlockHashOrBlockNumber(Object blockHashOrBlockNumber) { + this.blockHashOrBlockNumber = blockHashOrBlockNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockV1Request getBlockV1Request = (GetBlockV1Request) o; + return Objects.equals(this.blockHashOrBlockNumber, getBlockV1Request.blockHashOrBlockNumber); + } + + @Override + public int hashCode() { + return Objects.hash(blockHashOrBlockNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockV1Request {\n"); + sb.append(" blockHashOrBlockNumber: ").append(toIndentedString(blockHashOrBlockNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("blockHashOrBlockNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("blockHashOrBlockNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBlockV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBlockV1Request is not found in the empty JSON string", GetBlockV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBlockV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBlockV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBlockV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBlockV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBlockV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBlockV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockV1Request + * @throws IOException if the JSON string is invalid with respect to GetBlockV1Request + */ + public static GetBlockV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockV1Request.class); + } + + /** + * Convert an instance of GetBlockV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockV1Response.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockV1Response.java new file mode 100644 index 00000000000..19a7b345750 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockV1Response.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.EvmBlock; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetBlockV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockV1Response { + public static final String SERIALIZED_NAME_BLOCK = "block"; + @SerializedName(SERIALIZED_NAME_BLOCK) + private EvmBlock block; + + public GetBlockV1Response() { + } + + public GetBlockV1Response block(EvmBlock block) { + + this.block = block; + return this; + } + + /** + * Get block + * @return block + **/ + @javax.annotation.Nonnull + public EvmBlock getBlock() { + return block; + } + + + public void setBlock(EvmBlock block) { + this.block = block; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockV1Response getBlockV1Response = (GetBlockV1Response) o; + return Objects.equals(this.block, getBlockV1Response.block); + } + + @Override + public int hashCode() { + return Objects.hash(block); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockV1Response {\n"); + sb.append(" block: ").append(toIndentedString(block)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("block"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("block"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBlockV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBlockV1Response is not found in the empty JSON string", GetBlockV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBlockV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBlockV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBlockV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `block` + EvmBlock.validateJsonObject(jsonObj.getAsJsonObject("block")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBlockV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBlockV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBlockV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockV1Response + * @throws IOException if the JSON string is invalid with respect to GetBlockV1Response + */ + public static GetBlockV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockV1Response.class); + } + + /** + * Convert an instance of GetBlockV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPastLogsV1Request.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPastLogsV1Request.java new file mode 100644 index 00000000000..05c29eec013 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPastLogsV1Request.java @@ -0,0 +1,315 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetPastLogsV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetPastLogsV1Request { + public static final String SERIALIZED_NAME_TO_BLOCK = "toBlock"; + @SerializedName(SERIALIZED_NAME_TO_BLOCK) + private Object toBlock = null; + + public static final String SERIALIZED_NAME_FROM_BLOCK = "fromBlock"; + @SerializedName(SERIALIZED_NAME_FROM_BLOCK) + private Object fromBlock = null; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private Object address = null; + + public static final String SERIALIZED_NAME_TOPICS = "topics"; + @SerializedName(SERIALIZED_NAME_TOPICS) + private List topics; + + public GetPastLogsV1Request() { + } + + public GetPastLogsV1Request toBlock(Object toBlock) { + + this.toBlock = toBlock; + return this; + } + + /** + * Get toBlock + * @return toBlock + **/ + @javax.annotation.Nullable + public Object getToBlock() { + return toBlock; + } + + + public void setToBlock(Object toBlock) { + this.toBlock = toBlock; + } + + + public GetPastLogsV1Request fromBlock(Object fromBlock) { + + this.fromBlock = fromBlock; + return this; + } + + /** + * Get fromBlock + * @return fromBlock + **/ + @javax.annotation.Nullable + public Object getFromBlock() { + return fromBlock; + } + + + public void setFromBlock(Object fromBlock) { + this.fromBlock = fromBlock; + } + + + public GetPastLogsV1Request address(Object address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @javax.annotation.Nullable + public Object getAddress() { + return address; + } + + + public void setAddress(Object address) { + this.address = address; + } + + + public GetPastLogsV1Request topics(List topics) { + + this.topics = topics; + return this; + } + + public GetPastLogsV1Request addTopicsItem(Object topicsItem) { + if (this.topics == null) { + this.topics = new ArrayList<>(); + } + this.topics.add(topicsItem); + return this; + } + + /** + * Get topics + * @return topics + **/ + @javax.annotation.Nullable + public List getTopics() { + return topics; + } + + + public void setTopics(List topics) { + this.topics = topics; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPastLogsV1Request getPastLogsV1Request = (GetPastLogsV1Request) o; + return Objects.equals(this.toBlock, getPastLogsV1Request.toBlock) && + Objects.equals(this.fromBlock, getPastLogsV1Request.fromBlock) && + Objects.equals(this.address, getPastLogsV1Request.address) && + Objects.equals(this.topics, getPastLogsV1Request.topics); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(toBlock, fromBlock, address, topics); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPastLogsV1Request {\n"); + sb.append(" toBlock: ").append(toIndentedString(toBlock)).append("\n"); + sb.append(" fromBlock: ").append(toIndentedString(fromBlock)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" topics: ").append(toIndentedString(topics)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("toBlock"); + openapiFields.add("fromBlock"); + openapiFields.add("address"); + openapiFields.add("topics"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetPastLogsV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetPastLogsV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetPastLogsV1Request is not found in the empty JSON string", GetPastLogsV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetPastLogsV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetPastLogsV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("topics") != null && !jsonObj.get("topics").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `topics` to be an array in the JSON string but got `%s`", jsonObj.get("topics").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetPastLogsV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetPastLogsV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetPastLogsV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetPastLogsV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetPastLogsV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetPastLogsV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetPastLogsV1Request + * @throws IOException if the JSON string is invalid with respect to GetPastLogsV1Request + */ + public static GetPastLogsV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetPastLogsV1Request.class); + } + + /** + * Convert an instance of GetPastLogsV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPastLogsV1Response.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPastLogsV1Response.java new file mode 100644 index 00000000000..6aad971ece7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPastLogsV1Response.java @@ -0,0 +1,234 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.EvmLog; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetPastLogsV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetPastLogsV1Response { + public static final String SERIALIZED_NAME_LOGS = "logs"; + @SerializedName(SERIALIZED_NAME_LOGS) + private List logs = new ArrayList<>(); + + public GetPastLogsV1Response() { + } + + public GetPastLogsV1Response logs(List logs) { + + this.logs = logs; + return this; + } + + public GetPastLogsV1Response addLogsItem(EvmLog logsItem) { + if (this.logs == null) { + this.logs = new ArrayList<>(); + } + this.logs.add(logsItem); + return this; + } + + /** + * Get logs + * @return logs + **/ + @javax.annotation.Nonnull + public List getLogs() { + return logs; + } + + + public void setLogs(List logs) { + this.logs = logs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPastLogsV1Response getPastLogsV1Response = (GetPastLogsV1Response) o; + return Objects.equals(this.logs, getPastLogsV1Response.logs); + } + + @Override + public int hashCode() { + return Objects.hash(logs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPastLogsV1Response {\n"); + sb.append(" logs: ").append(toIndentedString(logs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("logs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("logs"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetPastLogsV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetPastLogsV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetPastLogsV1Response is not found in the empty JSON string", GetPastLogsV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetPastLogsV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetPastLogsV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetPastLogsV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("logs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `logs` to be an array in the JSON string but got `%s`", jsonObj.get("logs").toString())); + } + + JsonArray jsonArraylogs = jsonObj.getAsJsonArray("logs"); + // validate the required field `logs` (array) + for (int i = 0; i < jsonArraylogs.size(); i++) { + EvmLog.validateJsonObject(jsonArraylogs.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetPastLogsV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetPastLogsV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetPastLogsV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetPastLogsV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetPastLogsV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetPastLogsV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetPastLogsV1Response + * @throws IOException if the JSON string is invalid with respect to GetPastLogsV1Response + */ + public static GetPastLogsV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetPastLogsV1Response.class); + } + + /** + * Convert an instance of GetPastLogsV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionV1Request.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionV1Request.java new file mode 100644 index 00000000000..fe10b68d1cb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionV1Request.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetTransactionV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransactionV1Request { + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public GetTransactionV1Request() { + } + + public GetTransactionV1Request transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nonnull + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransactionV1Request getTransactionV1Request = (GetTransactionV1Request) o; + return Objects.equals(this.transactionHash, getTransactionV1Request.transactionHash); + } + + @Override + public int hashCode() { + return Objects.hash(transactionHash); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransactionV1Request {\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionHash"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionHash"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransactionV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransactionV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetTransactionV1Request is not found in the empty JSON string", GetTransactionV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransactionV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTransactionV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTransactionV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransactionV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransactionV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetTransactionV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransactionV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransactionV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransactionV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransactionV1Request + * @throws IOException if the JSON string is invalid with respect to GetTransactionV1Request + */ + public static GetTransactionV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransactionV1Request.class); + } + + /** + * Convert an instance of GetTransactionV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionV1Response.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionV1Response.java new file mode 100644 index 00000000000..934cf02d239 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionV1Response.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.EvmTransaction; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetTransactionV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransactionV1Response { + public static final String SERIALIZED_NAME_TRANSACTION = "transaction"; + @SerializedName(SERIALIZED_NAME_TRANSACTION) + private EvmTransaction transaction; + + public GetTransactionV1Response() { + } + + public GetTransactionV1Response transaction(EvmTransaction transaction) { + + this.transaction = transaction; + return this; + } + + /** + * Get transaction + * @return transaction + **/ + @javax.annotation.Nonnull + public EvmTransaction getTransaction() { + return transaction; + } + + + public void setTransaction(EvmTransaction transaction) { + this.transaction = transaction; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransactionV1Response getTransactionV1Response = (GetTransactionV1Response) o; + return Objects.equals(this.transaction, getTransactionV1Response.transaction); + } + + @Override + public int hashCode() { + return Objects.hash(transaction); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransactionV1Response {\n"); + sb.append(" transaction: ").append(toIndentedString(transaction)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transaction"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transaction"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransactionV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransactionV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetTransactionV1Response is not found in the empty JSON string", GetTransactionV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransactionV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTransactionV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTransactionV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `transaction` + EvmTransaction.validateJsonObject(jsonObj.getAsJsonObject("transaction")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransactionV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransactionV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetTransactionV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransactionV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransactionV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransactionV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransactionV1Response + * @throws IOException if the JSON string is invalid with respect to GetTransactionV1Response + */ + public static GetTransactionV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransactionV1Response.class); + } + + /** + * Convert an instance of GetTransactionV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java new file mode 100644 index 00000000000..9e431816083 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java @@ -0,0 +1,645 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.BesuPrivateTransactionConfig; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.Web3BlockHeaderTimestamp; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Request { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_SIGNING_CREDENTIAL = "signingCredential"; + @SerializedName(SERIALIZED_NAME_SIGNING_CREDENTIAL) + private Web3SigningCredential signingCredential; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_CONTRACT_ABI = "contractAbi"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ABI) + private List contractAbi; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private Web3BlockHeaderTimestamp value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private Web3BlockHeaderTimestamp gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private Web3BlockHeaderTimestamp gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG = "privateTransactionConfig"; + @SerializedName(SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG) + private BesuPrivateTransactionConfig privateTransactionConfig; + + public InvokeContractV1Request() { + } + + public InvokeContractV1Request contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public InvokeContractV1Request signingCredential(Web3SigningCredential signingCredential) { + + this.signingCredential = signingCredential; + return this; + } + + /** + * Get signingCredential + * @return signingCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getSigningCredential() { + return signingCredential; + } + + + public void setSigningCredential(Web3SigningCredential signingCredential) { + this.signingCredential = signingCredential; + } + + + public InvokeContractV1Request invocationType(EthContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public EthContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public InvokeContractV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the contract method to invoke. + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeContractV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeContractV1Request addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeContractV1Request contractAbi(List contractAbi) { + + this.contractAbi = contractAbi; + return this; + } + + public InvokeContractV1Request addContractAbiItem(Object contractAbiItem) { + if (this.contractAbi == null) { + this.contractAbi = new ArrayList<>(); + } + this.contractAbi.add(contractAbiItem); + return this; + } + + /** + * The application binary interface of the solidity contract, optional parameter + * @return contractAbi + **/ + @javax.annotation.Nullable + public List getContractAbi() { + return contractAbi; + } + + + public void setContractAbi(List contractAbi) { + this.contractAbi = contractAbi; + } + + + public InvokeContractV1Request contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Address of the solidity contract, optional parameter + * @return contractAddress + **/ + @javax.annotation.Nullable + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public InvokeContractV1Request value(Web3BlockHeaderTimestamp value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public Web3BlockHeaderTimestamp getValue() { + return value; + } + + + public void setValue(Web3BlockHeaderTimestamp value) { + this.value = value; + } + + + public InvokeContractV1Request gas(Web3BlockHeaderTimestamp gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public Web3BlockHeaderTimestamp getGas() { + return gas; + } + + + public void setGas(Web3BlockHeaderTimestamp gas) { + this.gas = gas; + } + + + public InvokeContractV1Request gasPrice(Web3BlockHeaderTimestamp gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public Web3BlockHeaderTimestamp getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(Web3BlockHeaderTimestamp gasPrice) { + this.gasPrice = gasPrice; + } + + + public InvokeContractV1Request nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public InvokeContractV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public InvokeContractV1Request keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychainId for retrieve the contracts json. + * @return keychainId + **/ + @javax.annotation.Nullable + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public InvokeContractV1Request privateTransactionConfig(BesuPrivateTransactionConfig privateTransactionConfig) { + + this.privateTransactionConfig = privateTransactionConfig; + return this; + } + + /** + * Get privateTransactionConfig + * @return privateTransactionConfig + **/ + @javax.annotation.Nullable + public BesuPrivateTransactionConfig getPrivateTransactionConfig() { + return privateTransactionConfig; + } + + + public void setPrivateTransactionConfig(BesuPrivateTransactionConfig privateTransactionConfig) { + this.privateTransactionConfig = privateTransactionConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Request invokeContractV1Request = (InvokeContractV1Request) o; + return Objects.equals(this.contractName, invokeContractV1Request.contractName) && + Objects.equals(this.signingCredential, invokeContractV1Request.signingCredential) && + Objects.equals(this.invocationType, invokeContractV1Request.invocationType) && + Objects.equals(this.methodName, invokeContractV1Request.methodName) && + Objects.equals(this.params, invokeContractV1Request.params) && + Objects.equals(this.contractAbi, invokeContractV1Request.contractAbi) && + Objects.equals(this.contractAddress, invokeContractV1Request.contractAddress) && + Objects.equals(this.value, invokeContractV1Request.value) && + Objects.equals(this.gas, invokeContractV1Request.gas) && + Objects.equals(this.gasPrice, invokeContractV1Request.gasPrice) && + Objects.equals(this.nonce, invokeContractV1Request.nonce) && + Objects.equals(this.timeoutMs, invokeContractV1Request.timeoutMs) && + Objects.equals(this.keychainId, invokeContractV1Request.keychainId) && + Objects.equals(this.privateTransactionConfig, invokeContractV1Request.privateTransactionConfig); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, signingCredential, invocationType, methodName, params, contractAbi, contractAddress, value, gas, gasPrice, nonce, timeoutMs, keychainId, privateTransactionConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Request {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" signingCredential: ").append(toIndentedString(signingCredential)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" contractAbi: ").append(toIndentedString(contractAbi)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" privateTransactionConfig: ").append(toIndentedString(privateTransactionConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("signingCredential"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("contractAbi"); + openapiFields.add("contractAddress"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("timeoutMs"); + openapiFields.add("keychainId"); + openapiFields.add("privateTransactionConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("signingCredential"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Request is not found in the empty JSON string", InvokeContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + // validate the required field `signingCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("signingCredential")); + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("contractAbi") != null && !jsonObj.get("contractAbi").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAbi` to be an array in the JSON string but got `%s`", jsonObj.get("contractAbi").toString())); + } + if ((jsonObj.get("contractAddress") != null && !jsonObj.get("contractAddress").isJsonNull()) && !jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + Web3BlockHeaderTimestamp.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + Web3BlockHeaderTimestamp.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + Web3BlockHeaderTimestamp.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + if ((jsonObj.get("keychainId") != null && !jsonObj.get("keychainId").isJsonNull()) && !jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // validate the optional field `privateTransactionConfig` + if (jsonObj.get("privateTransactionConfig") != null && !jsonObj.get("privateTransactionConfig").isJsonNull()) { + BesuPrivateTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("privateTransactionConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Request + */ + public static InvokeContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Request.class); + } + + /** + * Convert an instance of InvokeContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java new file mode 100644 index 00000000000..0510ac145d4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java @@ -0,0 +1,282 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public static final String SERIALIZED_NAME_CALL_OUTPUT = "callOutput"; + @SerializedName(SERIALIZED_NAME_CALL_OUTPUT) + private Object callOutput = null; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public InvokeContractV1Response() { + } + + public InvokeContractV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nullable + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + public InvokeContractV1Response callOutput(Object callOutput) { + + this.callOutput = callOutput; + return this; + } + + /** + * Get callOutput + * @return callOutput + **/ + @javax.annotation.Nullable + public Object getCallOutput() { + return callOutput; + } + + + public void setCallOutput(Object callOutput) { + this.callOutput = callOutput; + } + + + public InvokeContractV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Response invokeContractV1Response = (InvokeContractV1Response) o; + return Objects.equals(this.transactionReceipt, invokeContractV1Response.transactionReceipt) && + Objects.equals(this.callOutput, invokeContractV1Response.callOutput) && + Objects.equals(this.success, invokeContractV1Response.success); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt, callOutput, success); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append(" callOutput: ").append(toIndentedString(callOutput)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + openapiFields.add("callOutput"); + openapiFields.add("success"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Response is not found in the empty JSON string", InvokeContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Response + */ + public static InvokeContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Response.class); + } + + /** + * Convert an instance of InvokeContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ReceiptType.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ReceiptType.java new file mode 100644 index 00000000000..fe0c08dacb7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ReceiptType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates the possible types of receipts that can be waited for by someone or something that has requested the execution of a transaction on a ledger. + */ +@JsonAdapter(ReceiptType.Adapter.class) +public enum ReceiptType { + + NODE_TX_POOL_ACK("NODE_TX_POOL_ACK"), + + LEDGER_BLOCK_ACK("LEDGER_BLOCK_ACK"); + + private String value; + + ReceiptType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ReceiptType fromValue(String value) { + for (ReceiptType b : ReceiptType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ReceiptType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ReceiptType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ReceiptType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java new file mode 100644 index 00000000000..48f9308aa3e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java @@ -0,0 +1,311 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.BesuPrivateTransactionConfig; +import org.openapitools.client.model.BesuTransactionConfig; +import org.openapitools.client.model.ConsistencyStrategy; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionRequest { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_TRANSACTION_CONFIG = "transactionConfig"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_CONFIG) + private BesuTransactionConfig transactionConfig; + + public static final String SERIALIZED_NAME_CONSISTENCY_STRATEGY = "consistencyStrategy"; + @SerializedName(SERIALIZED_NAME_CONSISTENCY_STRATEGY) + private ConsistencyStrategy consistencyStrategy; + + public static final String SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG = "privateTransactionConfig"; + @SerializedName(SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG) + private BesuPrivateTransactionConfig privateTransactionConfig; + + public RunTransactionRequest() { + } + + public RunTransactionRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public RunTransactionRequest transactionConfig(BesuTransactionConfig transactionConfig) { + + this.transactionConfig = transactionConfig; + return this; + } + + /** + * Get transactionConfig + * @return transactionConfig + **/ + @javax.annotation.Nonnull + public BesuTransactionConfig getTransactionConfig() { + return transactionConfig; + } + + + public void setTransactionConfig(BesuTransactionConfig transactionConfig) { + this.transactionConfig = transactionConfig; + } + + + public RunTransactionRequest consistencyStrategy(ConsistencyStrategy consistencyStrategy) { + + this.consistencyStrategy = consistencyStrategy; + return this; + } + + /** + * Get consistencyStrategy + * @return consistencyStrategy + **/ + @javax.annotation.Nonnull + public ConsistencyStrategy getConsistencyStrategy() { + return consistencyStrategy; + } + + + public void setConsistencyStrategy(ConsistencyStrategy consistencyStrategy) { + this.consistencyStrategy = consistencyStrategy; + } + + + public RunTransactionRequest privateTransactionConfig(BesuPrivateTransactionConfig privateTransactionConfig) { + + this.privateTransactionConfig = privateTransactionConfig; + return this; + } + + /** + * Get privateTransactionConfig + * @return privateTransactionConfig + **/ + @javax.annotation.Nullable + public BesuPrivateTransactionConfig getPrivateTransactionConfig() { + return privateTransactionConfig; + } + + + public void setPrivateTransactionConfig(BesuPrivateTransactionConfig privateTransactionConfig) { + this.privateTransactionConfig = privateTransactionConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionRequest runTransactionRequest = (RunTransactionRequest) o; + return Objects.equals(this.web3SigningCredential, runTransactionRequest.web3SigningCredential) && + Objects.equals(this.transactionConfig, runTransactionRequest.transactionConfig) && + Objects.equals(this.consistencyStrategy, runTransactionRequest.consistencyStrategy) && + Objects.equals(this.privateTransactionConfig, runTransactionRequest.privateTransactionConfig); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, transactionConfig, consistencyStrategy, privateTransactionConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionRequest {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" transactionConfig: ").append(toIndentedString(transactionConfig)).append("\n"); + sb.append(" consistencyStrategy: ").append(toIndentedString(consistencyStrategy)).append("\n"); + sb.append(" privateTransactionConfig: ").append(toIndentedString(privateTransactionConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("transactionConfig"); + openapiFields.add("consistencyStrategy"); + openapiFields.add("privateTransactionConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("transactionConfig"); + openapiRequiredFields.add("consistencyStrategy"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionRequest is not found in the empty JSON string", RunTransactionRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + // validate the required field `consistencyStrategy` + ConsistencyStrategy.validateJsonObject(jsonObj.getAsJsonObject("consistencyStrategy")); + // validate the optional field `privateTransactionConfig` + if (jsonObj.get("privateTransactionConfig") != null && !jsonObj.get("privateTransactionConfig").isJsonNull()) { + BesuPrivateTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("privateTransactionConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionRequest + * @throws IOException if the JSON string is invalid with respect to RunTransactionRequest + */ + public static RunTransactionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionRequest.class); + } + + /** + * Convert an instance of RunTransactionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java new file mode 100644 index 00000000000..e82865a3d24 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionResponse { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public RunTransactionResponse() { + } + + public RunTransactionResponse transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionResponse runTransactionResponse = (RunTransactionResponse) o; + return Objects.equals(this.transactionReceipt, runTransactionResponse.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionResponse {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionResponse is not found in the empty JSON string", RunTransactionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionResponse + * @throws IOException if the JSON string is invalid with respect to RunTransactionResponse + */ + public static RunTransactionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionResponse.class); + } + + /** + * Convert an instance of RunTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SignTransactionRequest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SignTransactionRequest.java new file mode 100644 index 00000000000..ce661beab85 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SignTransactionRequest.java @@ -0,0 +1,280 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SignTransactionRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SignTransactionRequest { + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_KEYCHAIN_REF = "keychainRef"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_REF) + private String keychainRef; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public SignTransactionRequest() { + } + + public SignTransactionRequest keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * Get keychainId + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public SignTransactionRequest keychainRef(String keychainRef) { + + this.keychainRef = keychainRef; + return this; + } + + /** + * Get keychainRef + * @return keychainRef + **/ + @javax.annotation.Nonnull + public String getKeychainRef() { + return keychainRef; + } + + + public void setKeychainRef(String keychainRef) { + this.keychainRef = keychainRef; + } + + + public SignTransactionRequest transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * The transaction hash of ledger will be used to fetch the contain. + * @return transactionHash + **/ + @javax.annotation.Nonnull + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignTransactionRequest signTransactionRequest = (SignTransactionRequest) o; + return Objects.equals(this.keychainId, signTransactionRequest.keychainId) && + Objects.equals(this.keychainRef, signTransactionRequest.keychainRef) && + Objects.equals(this.transactionHash, signTransactionRequest.transactionHash); + } + + @Override + public int hashCode() { + return Objects.hash(keychainId, keychainRef, transactionHash); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignTransactionRequest {\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" keychainRef: ").append(toIndentedString(keychainRef)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("keychainId"); + openapiFields.add("keychainRef"); + openapiFields.add("transactionHash"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("keychainId"); + openapiRequiredFields.add("keychainRef"); + openapiRequiredFields.add("transactionHash"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SignTransactionRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SignTransactionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SignTransactionRequest is not found in the empty JSON string", SignTransactionRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SignTransactionRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SignTransactionRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SignTransactionRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + if (!jsonObj.get("keychainRef").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainRef` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainRef").toString())); + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SignTransactionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SignTransactionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SignTransactionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SignTransactionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SignTransactionRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SignTransactionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SignTransactionRequest + * @throws IOException if the JSON string is invalid with respect to SignTransactionRequest + */ + public static SignTransactionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SignTransactionRequest.class); + } + + /** + * Convert an instance of SignTransactionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SignTransactionResponse.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SignTransactionResponse.java new file mode 100644 index 00000000000..4d98d1dc1a7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SignTransactionResponse.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SignTransactionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SignTransactionResponse { + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public SignTransactionResponse() { + } + + public SignTransactionResponse signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * The signatures of ledger from the corresponding transaction hash. + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SignTransactionResponse signTransactionResponse = (SignTransactionResponse) o; + return Objects.equals(this.signature, signTransactionResponse.signature); + } + + @Override + public int hashCode() { + return Objects.hash(signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SignTransactionResponse {\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SignTransactionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SignTransactionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SignTransactionResponse is not found in the empty JSON string", SignTransactionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SignTransactionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SignTransactionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SignTransactionResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SignTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SignTransactionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SignTransactionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SignTransactionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SignTransactionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SignTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SignTransactionResponse + * @throws IOException if the JSON string is invalid with respect to SignTransactionResponse + */ + public static SignTransactionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SignTransactionResponse.class); + } + + /** + * Convert an instance of SignTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java new file mode 100644 index 00000000000..1edcb663d0d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java @@ -0,0 +1,502 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactCompiler; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifact + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifact { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private String metadata; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_DEPLOYED_BYTECODE = "deployedBytecode"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_BYTECODE) + private String deployedBytecode; + + public static final String SERIALIZED_NAME_SOURCE_MAP = "sourceMap"; + @SerializedName(SERIALIZED_NAME_SOURCE_MAP) + private String sourceMap; + + public static final String SERIALIZED_NAME_DEPLOYED_SOURCE_MAP = "deployedSourceMap"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_SOURCE_MAP) + private String deployedSourceMap; + + public static final String SERIALIZED_NAME_SOURCE_PATH = "sourcePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_PATH) + private String sourcePath; + + public static final String SERIALIZED_NAME_COMPILER = "compiler"; + @SerializedName(SERIALIZED_NAME_COMPILER) + private SolidityContractJsonArtifactCompiler compiler; + + public static final String SERIALIZED_NAME_FUNCTION_HASHES = "functionHashes"; + @SerializedName(SERIALIZED_NAME_FUNCTION_HASHES) + private Map functionHashes = new HashMap<>(); + + public static final String SERIALIZED_NAME_GAS_ESTIMATES = "gasEstimates"; + @SerializedName(SERIALIZED_NAME_GAS_ESTIMATES) + private SolidityContractJsonArtifactGasEstimates gasEstimates; + + public SolidityContractJsonArtifact() { + } + + public SolidityContractJsonArtifact contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public SolidityContractJsonArtifact metadata(String metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + public String getMetadata() { + return metadata; + } + + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + + public SolidityContractJsonArtifact bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * Get bytecode + * @return bytecode + **/ + @javax.annotation.Nullable + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public SolidityContractJsonArtifact deployedBytecode(String deployedBytecode) { + + this.deployedBytecode = deployedBytecode; + return this; + } + + /** + * Get deployedBytecode + * @return deployedBytecode + **/ + @javax.annotation.Nullable + public String getDeployedBytecode() { + return deployedBytecode; + } + + + public void setDeployedBytecode(String deployedBytecode) { + this.deployedBytecode = deployedBytecode; + } + + + public SolidityContractJsonArtifact sourceMap(String sourceMap) { + + this.sourceMap = sourceMap; + return this; + } + + /** + * Get sourceMap + * @return sourceMap + **/ + @javax.annotation.Nullable + public String getSourceMap() { + return sourceMap; + } + + + public void setSourceMap(String sourceMap) { + this.sourceMap = sourceMap; + } + + + public SolidityContractJsonArtifact deployedSourceMap(String deployedSourceMap) { + + this.deployedSourceMap = deployedSourceMap; + return this; + } + + /** + * Get deployedSourceMap + * @return deployedSourceMap + **/ + @javax.annotation.Nullable + public String getDeployedSourceMap() { + return deployedSourceMap; + } + + + public void setDeployedSourceMap(String deployedSourceMap) { + this.deployedSourceMap = deployedSourceMap; + } + + + public SolidityContractJsonArtifact sourcePath(String sourcePath) { + + this.sourcePath = sourcePath; + return this; + } + + /** + * Get sourcePath + * @return sourcePath + **/ + @javax.annotation.Nullable + public String getSourcePath() { + return sourcePath; + } + + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + } + + + public SolidityContractJsonArtifact compiler(SolidityContractJsonArtifactCompiler compiler) { + + this.compiler = compiler; + return this; + } + + /** + * Get compiler + * @return compiler + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactCompiler getCompiler() { + return compiler; + } + + + public void setCompiler(SolidityContractJsonArtifactCompiler compiler) { + this.compiler = compiler; + } + + + public SolidityContractJsonArtifact functionHashes(Map functionHashes) { + + this.functionHashes = functionHashes; + return this; + } + + public SolidityContractJsonArtifact putFunctionHashesItem(String key, Object functionHashesItem) { + if (this.functionHashes == null) { + this.functionHashes = new HashMap<>(); + } + this.functionHashes.put(key, functionHashesItem); + return this; + } + + /** + * Get functionHashes + * @return functionHashes + **/ + @javax.annotation.Nullable + public Map getFunctionHashes() { + return functionHashes; + } + + + public void setFunctionHashes(Map functionHashes) { + this.functionHashes = functionHashes; + } + + + public SolidityContractJsonArtifact gasEstimates(SolidityContractJsonArtifactGasEstimates gasEstimates) { + + this.gasEstimates = gasEstimates; + return this; + } + + /** + * Get gasEstimates + * @return gasEstimates + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactGasEstimates getGasEstimates() { + return gasEstimates; + } + + + public void setGasEstimates(SolidityContractJsonArtifactGasEstimates gasEstimates) { + this.gasEstimates = gasEstimates; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifact solidityContractJsonArtifact = (SolidityContractJsonArtifact) o; + return Objects.equals(this.contractName, solidityContractJsonArtifact.contractName) && + Objects.equals(this.metadata, solidityContractJsonArtifact.metadata) && + Objects.equals(this.bytecode, solidityContractJsonArtifact.bytecode) && + Objects.equals(this.deployedBytecode, solidityContractJsonArtifact.deployedBytecode) && + Objects.equals(this.sourceMap, solidityContractJsonArtifact.sourceMap) && + Objects.equals(this.deployedSourceMap, solidityContractJsonArtifact.deployedSourceMap) && + Objects.equals(this.sourcePath, solidityContractJsonArtifact.sourcePath) && + Objects.equals(this.compiler, solidityContractJsonArtifact.compiler) && + Objects.equals(this.functionHashes, solidityContractJsonArtifact.functionHashes) && + Objects.equals(this.gasEstimates, solidityContractJsonArtifact.gasEstimates); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, metadata, bytecode, deployedBytecode, sourceMap, deployedSourceMap, sourcePath, compiler, functionHashes, gasEstimates); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifact {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" deployedBytecode: ").append(toIndentedString(deployedBytecode)).append("\n"); + sb.append(" sourceMap: ").append(toIndentedString(sourceMap)).append("\n"); + sb.append(" deployedSourceMap: ").append(toIndentedString(deployedSourceMap)).append("\n"); + sb.append(" sourcePath: ").append(toIndentedString(sourcePath)).append("\n"); + sb.append(" compiler: ").append(toIndentedString(compiler)).append("\n"); + sb.append(" functionHashes: ").append(toIndentedString(functionHashes)).append("\n"); + sb.append(" gasEstimates: ").append(toIndentedString(gasEstimates)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("metadata"); + openapiFields.add("bytecode"); + openapiFields.add("deployedBytecode"); + openapiFields.add("sourceMap"); + openapiFields.add("deployedSourceMap"); + openapiFields.add("sourcePath"); + openapiFields.add("compiler"); + openapiFields.add("functionHashes"); + openapiFields.add("gasEstimates"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifact + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifact.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifact is not found in the empty JSON string", SolidityContractJsonArtifact.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifact.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifact` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SolidityContractJsonArtifact.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if ((jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) && !jsonObj.get("metadata").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `metadata` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadata").toString())); + } + if ((jsonObj.get("bytecode") != null && !jsonObj.get("bytecode").isJsonNull()) && !jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + if ((jsonObj.get("deployedBytecode") != null && !jsonObj.get("deployedBytecode").isJsonNull()) && !jsonObj.get("deployedBytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedBytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedBytecode").toString())); + } + if ((jsonObj.get("sourceMap") != null && !jsonObj.get("sourceMap").isJsonNull()) && !jsonObj.get("sourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceMap").toString())); + } + if ((jsonObj.get("deployedSourceMap") != null && !jsonObj.get("deployedSourceMap").isJsonNull()) && !jsonObj.get("deployedSourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedSourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedSourceMap").toString())); + } + if ((jsonObj.get("sourcePath") != null && !jsonObj.get("sourcePath").isJsonNull()) && !jsonObj.get("sourcePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourcePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourcePath").toString())); + } + // validate the optional field `gasEstimates` + if (jsonObj.get("gasEstimates") != null && !jsonObj.get("gasEstimates").isJsonNull()) { + SolidityContractJsonArtifactGasEstimates.validateJsonObject(jsonObj.getAsJsonObject("gasEstimates")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifact.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifact' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifact.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifact value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifact read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifact given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifact + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifact + */ + public static SolidityContractJsonArtifact fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifact.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifact to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java new file mode 100644 index 00000000000..677f1bd3986 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java @@ -0,0 +1,314 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactCompiler + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactCompiler { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public SolidityContractJsonArtifactCompiler() { + } + + public SolidityContractJsonArtifactCompiler name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public SolidityContractJsonArtifactCompiler version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SolidityContractJsonArtifactCompiler instance itself + */ + public SolidityContractJsonArtifactCompiler putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactCompiler solidityContractJsonArtifactCompiler = (SolidityContractJsonArtifactCompiler) o; + return Objects.equals(this.name, solidityContractJsonArtifactCompiler.name) && + Objects.equals(this.version, solidityContractJsonArtifactCompiler.version)&& + Objects.equals(this.additionalProperties, solidityContractJsonArtifactCompiler.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, version, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactCompiler {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactCompiler + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactCompiler.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactCompiler is not found in the empty JSON string", SolidityContractJsonArtifactCompiler.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactCompiler.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactCompiler' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactCompiler.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactCompiler value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactCompiler read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + SolidityContractJsonArtifactCompiler instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactCompiler given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactCompiler + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactCompiler + */ + public static SolidityContractJsonArtifactCompiler fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactCompiler.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactCompiler to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java new file mode 100644 index 00000000000..b166f1e4295 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactGasEstimates + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactGasEstimates { + public static final String SERIALIZED_NAME_CREATION = "creation"; + @SerializedName(SERIALIZED_NAME_CREATION) + private SolidityContractJsonArtifactGasEstimatesCreation creation; + + public static final String SERIALIZED_NAME_EXTERNAL = "external"; + @SerializedName(SERIALIZED_NAME_EXTERNAL) + private Map external = new HashMap<>(); + + public SolidityContractJsonArtifactGasEstimates() { + } + + public SolidityContractJsonArtifactGasEstimates creation(SolidityContractJsonArtifactGasEstimatesCreation creation) { + + this.creation = creation; + return this; + } + + /** + * Get creation + * @return creation + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactGasEstimatesCreation getCreation() { + return creation; + } + + + public void setCreation(SolidityContractJsonArtifactGasEstimatesCreation creation) { + this.creation = creation; + } + + + public SolidityContractJsonArtifactGasEstimates external(Map external) { + + this.external = external; + return this; + } + + public SolidityContractJsonArtifactGasEstimates putExternalItem(String key, Object externalItem) { + if (this.external == null) { + this.external = new HashMap<>(); + } + this.external.put(key, externalItem); + return this; + } + + /** + * Get external + * @return external + **/ + @javax.annotation.Nullable + public Map getExternal() { + return external; + } + + + public void setExternal(Map external) { + this.external = external; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactGasEstimates solidityContractJsonArtifactGasEstimates = (SolidityContractJsonArtifactGasEstimates) o; + return Objects.equals(this.creation, solidityContractJsonArtifactGasEstimates.creation) && + Objects.equals(this.external, solidityContractJsonArtifactGasEstimates.external); + } + + @Override + public int hashCode() { + return Objects.hash(creation, external); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactGasEstimates {\n"); + sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); + sb.append(" external: ").append(toIndentedString(external)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("creation"); + openapiFields.add("external"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactGasEstimates + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactGasEstimates.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactGasEstimates is not found in the empty JSON string", SolidityContractJsonArtifactGasEstimates.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifactGasEstimates.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifactGasEstimates` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `creation` + if (jsonObj.get("creation") != null && !jsonObj.get("creation").isJsonNull()) { + SolidityContractJsonArtifactGasEstimatesCreation.validateJsonObject(jsonObj.getAsJsonObject("creation")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactGasEstimates.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactGasEstimates' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactGasEstimates.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactGasEstimates value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactGasEstimates read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactGasEstimates given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactGasEstimates + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactGasEstimates + */ + public static SolidityContractJsonArtifactGasEstimates fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactGasEstimates.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactGasEstimates to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java new file mode 100644 index 00000000000..666f8b270a2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java @@ -0,0 +1,270 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactGasEstimatesCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactGasEstimatesCreation { + public static final String SERIALIZED_NAME_CODE_DEPOSIT_COST = "codeDepositCost"; + @SerializedName(SERIALIZED_NAME_CODE_DEPOSIT_COST) + private String codeDepositCost; + + public static final String SERIALIZED_NAME_EXECUTION_COST = "executionCost"; + @SerializedName(SERIALIZED_NAME_EXECUTION_COST) + private String executionCost; + + public static final String SERIALIZED_NAME_TOTAL_COST = "totalCost"; + @SerializedName(SERIALIZED_NAME_TOTAL_COST) + private String totalCost; + + public SolidityContractJsonArtifactGasEstimatesCreation() { + } + + public SolidityContractJsonArtifactGasEstimatesCreation codeDepositCost(String codeDepositCost) { + + this.codeDepositCost = codeDepositCost; + return this; + } + + /** + * Get codeDepositCost + * @return codeDepositCost + **/ + @javax.annotation.Nullable + public String getCodeDepositCost() { + return codeDepositCost; + } + + + public void setCodeDepositCost(String codeDepositCost) { + this.codeDepositCost = codeDepositCost; + } + + + public SolidityContractJsonArtifactGasEstimatesCreation executionCost(String executionCost) { + + this.executionCost = executionCost; + return this; + } + + /** + * Get executionCost + * @return executionCost + **/ + @javax.annotation.Nullable + public String getExecutionCost() { + return executionCost; + } + + + public void setExecutionCost(String executionCost) { + this.executionCost = executionCost; + } + + + public SolidityContractJsonArtifactGasEstimatesCreation totalCost(String totalCost) { + + this.totalCost = totalCost; + return this; + } + + /** + * Get totalCost + * @return totalCost + **/ + @javax.annotation.Nullable + public String getTotalCost() { + return totalCost; + } + + + public void setTotalCost(String totalCost) { + this.totalCost = totalCost; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactGasEstimatesCreation solidityContractJsonArtifactGasEstimatesCreation = (SolidityContractJsonArtifactGasEstimatesCreation) o; + return Objects.equals(this.codeDepositCost, solidityContractJsonArtifactGasEstimatesCreation.codeDepositCost) && + Objects.equals(this.executionCost, solidityContractJsonArtifactGasEstimatesCreation.executionCost) && + Objects.equals(this.totalCost, solidityContractJsonArtifactGasEstimatesCreation.totalCost); + } + + @Override + public int hashCode() { + return Objects.hash(codeDepositCost, executionCost, totalCost); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactGasEstimatesCreation {\n"); + sb.append(" codeDepositCost: ").append(toIndentedString(codeDepositCost)).append("\n"); + sb.append(" executionCost: ").append(toIndentedString(executionCost)).append("\n"); + sb.append(" totalCost: ").append(toIndentedString(totalCost)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("codeDepositCost"); + openapiFields.add("executionCost"); + openapiFields.add("totalCost"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactGasEstimatesCreation + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactGasEstimatesCreation is not found in the empty JSON string", SolidityContractJsonArtifactGasEstimatesCreation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifactGasEstimatesCreation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("codeDepositCost") != null && !jsonObj.get("codeDepositCost").isJsonNull()) && !jsonObj.get("codeDepositCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `codeDepositCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("codeDepositCost").toString())); + } + if ((jsonObj.get("executionCost") != null && !jsonObj.get("executionCost").isJsonNull()) && !jsonObj.get("executionCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `executionCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("executionCost").toString())); + } + if ((jsonObj.get("totalCost") != null && !jsonObj.get("totalCost").isJsonNull()) && !jsonObj.get("totalCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `totalCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalCost").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactGasEstimatesCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactGasEstimatesCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactGasEstimatesCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactGasEstimatesCreation read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactGasEstimatesCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactGasEstimatesCreation + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactGasEstimatesCreation + */ + public static SolidityContractJsonArtifactGasEstimatesCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactGasEstimatesCreation.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactGasEstimatesCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java new file mode 100644 index 00000000000..ab193bc131d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets WatchBlocksV1 + */ +@JsonAdapter(WatchBlocksV1.Adapter.class) +public enum WatchBlocksV1 { + + Subscribe("org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Subscribe"), + + Next("org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Next"), + + Unsubscribe("org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Unsubscribe"), + + Error("org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Error"), + + Complete("org.hyperledger.cactus.api.async.besu.WatchBlocksV1.Complete"); + + private String value; + + WatchBlocksV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchBlocksV1 fromValue(String value) { + for (WatchBlocksV1 b : WatchBlocksV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchBlocksV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchBlocksV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchBlocksV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java new file mode 100644 index 00000000000..7c477b4837c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3BlockHeader; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WatchBlocksV1Progress + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1Progress { + public static final String SERIALIZED_NAME_BLOCK_HEADER = "blockHeader"; + @SerializedName(SERIALIZED_NAME_BLOCK_HEADER) + private Web3BlockHeader blockHeader; + + public WatchBlocksV1Progress() { + } + + public WatchBlocksV1Progress blockHeader(Web3BlockHeader blockHeader) { + + this.blockHeader = blockHeader; + return this; + } + + /** + * Get blockHeader + * @return blockHeader + **/ + @javax.annotation.Nonnull + public Web3BlockHeader getBlockHeader() { + return blockHeader; + } + + + public void setBlockHeader(Web3BlockHeader blockHeader) { + this.blockHeader = blockHeader; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1Progress watchBlocksV1Progress = (WatchBlocksV1Progress) o; + return Objects.equals(this.blockHeader, watchBlocksV1Progress.blockHeader); + } + + @Override + public int hashCode() { + return Objects.hash(blockHeader); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1Progress {\n"); + sb.append(" blockHeader: ").append(toIndentedString(blockHeader)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("blockHeader"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("blockHeader"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1Progress + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1Progress.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1Progress is not found in the empty JSON string", WatchBlocksV1Progress.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1Progress.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1Progress` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksV1Progress.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `blockHeader` + Web3BlockHeader.validateJsonObject(jsonObj.getAsJsonObject("blockHeader")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1Progress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1Progress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1Progress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1Progress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1Progress read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1Progress given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1Progress + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1Progress + */ + public static WatchBlocksV1Progress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1Progress.class); + } + + /** + * Convert an instance of WatchBlocksV1Progress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java new file mode 100644 index 00000000000..549349aeb6b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java @@ -0,0 +1,624 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.Web3BlockHeaderTimestamp; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3BlockHeader + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3BlockHeader { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private BigDecimal number; + + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_PARENT_HASH = "parentHash"; + @SerializedName(SERIALIZED_NAME_PARENT_HASH) + private String parentHash; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_SHA3_UNCLES = "sha3Uncles"; + @SerializedName(SERIALIZED_NAME_SHA3_UNCLES) + private String sha3Uncles; + + public static final String SERIALIZED_NAME_LOGS_BLOOM = "logsBloom"; + @SerializedName(SERIALIZED_NAME_LOGS_BLOOM) + private String logsBloom; + + public static final String SERIALIZED_NAME_TRANSACTION_ROOT = "transactionRoot"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_ROOT) + private String transactionRoot; + + public static final String SERIALIZED_NAME_STATE_ROOT = "stateRoot"; + @SerializedName(SERIALIZED_NAME_STATE_ROOT) + private String stateRoot; + + public static final String SERIALIZED_NAME_RECEIPT_ROOT = "receiptRoot"; + @SerializedName(SERIALIZED_NAME_RECEIPT_ROOT) + private String receiptRoot; + + public static final String SERIALIZED_NAME_MINER = "miner"; + @SerializedName(SERIALIZED_NAME_MINER) + private String miner; + + public static final String SERIALIZED_NAME_EXTRA_DATA = "extraData"; + @SerializedName(SERIALIZED_NAME_EXTRA_DATA) + private String extraData; + + public static final String SERIALIZED_NAME_GAS_LIMIT = "gasLimit"; + @SerializedName(SERIALIZED_NAME_GAS_LIMIT) + private Integer gasLimit; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private Integer gasUsed; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private Web3BlockHeaderTimestamp timestamp; + + public Web3BlockHeader() { + } + + public Web3BlockHeader number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @javax.annotation.Nonnull + public BigDecimal getNumber() { + return number; + } + + + public void setNumber(BigDecimal number) { + this.number = number; + } + + + public Web3BlockHeader hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + **/ + @javax.annotation.Nonnull + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public Web3BlockHeader parentHash(String parentHash) { + + this.parentHash = parentHash; + return this; + } + + /** + * Get parentHash + * @return parentHash + **/ + @javax.annotation.Nonnull + public String getParentHash() { + return parentHash; + } + + + public void setParentHash(String parentHash) { + this.parentHash = parentHash; + } + + + public Web3BlockHeader nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nonnull + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public Web3BlockHeader sha3Uncles(String sha3Uncles) { + + this.sha3Uncles = sha3Uncles; + return this; + } + + /** + * Get sha3Uncles + * @return sha3Uncles + **/ + @javax.annotation.Nonnull + public String getSha3Uncles() { + return sha3Uncles; + } + + + public void setSha3Uncles(String sha3Uncles) { + this.sha3Uncles = sha3Uncles; + } + + + public Web3BlockHeader logsBloom(String logsBloom) { + + this.logsBloom = logsBloom; + return this; + } + + /** + * Get logsBloom + * @return logsBloom + **/ + @javax.annotation.Nonnull + public String getLogsBloom() { + return logsBloom; + } + + + public void setLogsBloom(String logsBloom) { + this.logsBloom = logsBloom; + } + + + public Web3BlockHeader transactionRoot(String transactionRoot) { + + this.transactionRoot = transactionRoot; + return this; + } + + /** + * Get transactionRoot + * @return transactionRoot + **/ + @javax.annotation.Nonnull + public String getTransactionRoot() { + return transactionRoot; + } + + + public void setTransactionRoot(String transactionRoot) { + this.transactionRoot = transactionRoot; + } + + + public Web3BlockHeader stateRoot(String stateRoot) { + + this.stateRoot = stateRoot; + return this; + } + + /** + * Get stateRoot + * @return stateRoot + **/ + @javax.annotation.Nonnull + public String getStateRoot() { + return stateRoot; + } + + + public void setStateRoot(String stateRoot) { + this.stateRoot = stateRoot; + } + + + public Web3BlockHeader receiptRoot(String receiptRoot) { + + this.receiptRoot = receiptRoot; + return this; + } + + /** + * Get receiptRoot + * @return receiptRoot + **/ + @javax.annotation.Nonnull + public String getReceiptRoot() { + return receiptRoot; + } + + + public void setReceiptRoot(String receiptRoot) { + this.receiptRoot = receiptRoot; + } + + + public Web3BlockHeader miner(String miner) { + + this.miner = miner; + return this; + } + + /** + * Get miner + * @return miner + **/ + @javax.annotation.Nonnull + public String getMiner() { + return miner; + } + + + public void setMiner(String miner) { + this.miner = miner; + } + + + public Web3BlockHeader extraData(String extraData) { + + this.extraData = extraData; + return this; + } + + /** + * Get extraData + * @return extraData + **/ + @javax.annotation.Nonnull + public String getExtraData() { + return extraData; + } + + + public void setExtraData(String extraData) { + this.extraData = extraData; + } + + + public Web3BlockHeader gasLimit(Integer gasLimit) { + + this.gasLimit = gasLimit; + return this; + } + + /** + * Get gasLimit + * @return gasLimit + **/ + @javax.annotation.Nonnull + public Integer getGasLimit() { + return gasLimit; + } + + + public void setGasLimit(Integer gasLimit) { + this.gasLimit = gasLimit; + } + + + public Web3BlockHeader gasUsed(Integer gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + public Integer getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(Integer gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3BlockHeader timestamp(Web3BlockHeaderTimestamp timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nonnull + public Web3BlockHeaderTimestamp getTimestamp() { + return timestamp; + } + + + public void setTimestamp(Web3BlockHeaderTimestamp timestamp) { + this.timestamp = timestamp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3BlockHeader web3BlockHeader = (Web3BlockHeader) o; + return Objects.equals(this.number, web3BlockHeader.number) && + Objects.equals(this.hash, web3BlockHeader.hash) && + Objects.equals(this.parentHash, web3BlockHeader.parentHash) && + Objects.equals(this.nonce, web3BlockHeader.nonce) && + Objects.equals(this.sha3Uncles, web3BlockHeader.sha3Uncles) && + Objects.equals(this.logsBloom, web3BlockHeader.logsBloom) && + Objects.equals(this.transactionRoot, web3BlockHeader.transactionRoot) && + Objects.equals(this.stateRoot, web3BlockHeader.stateRoot) && + Objects.equals(this.receiptRoot, web3BlockHeader.receiptRoot) && + Objects.equals(this.miner, web3BlockHeader.miner) && + Objects.equals(this.extraData, web3BlockHeader.extraData) && + Objects.equals(this.gasLimit, web3BlockHeader.gasLimit) && + Objects.equals(this.gasUsed, web3BlockHeader.gasUsed) && + Objects.equals(this.timestamp, web3BlockHeader.timestamp); + } + + @Override + public int hashCode() { + return Objects.hash(number, hash, parentHash, nonce, sha3Uncles, logsBloom, transactionRoot, stateRoot, receiptRoot, miner, extraData, gasLimit, gasUsed, timestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3BlockHeader {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" parentHash: ").append(toIndentedString(parentHash)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" sha3Uncles: ").append(toIndentedString(sha3Uncles)).append("\n"); + sb.append(" logsBloom: ").append(toIndentedString(logsBloom)).append("\n"); + sb.append(" transactionRoot: ").append(toIndentedString(transactionRoot)).append("\n"); + sb.append(" stateRoot: ").append(toIndentedString(stateRoot)).append("\n"); + sb.append(" receiptRoot: ").append(toIndentedString(receiptRoot)).append("\n"); + sb.append(" miner: ").append(toIndentedString(miner)).append("\n"); + sb.append(" extraData: ").append(toIndentedString(extraData)).append("\n"); + sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).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(); + openapiFields.add("number"); + openapiFields.add("hash"); + openapiFields.add("parentHash"); + openapiFields.add("nonce"); + openapiFields.add("sha3Uncles"); + openapiFields.add("logsBloom"); + openapiFields.add("transactionRoot"); + openapiFields.add("stateRoot"); + openapiFields.add("receiptRoot"); + openapiFields.add("miner"); + openapiFields.add("extraData"); + openapiFields.add("gasLimit"); + openapiFields.add("gasUsed"); + openapiFields.add("timestamp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("number"); + openapiRequiredFields.add("hash"); + openapiRequiredFields.add("parentHash"); + openapiRequiredFields.add("nonce"); + openapiRequiredFields.add("sha3Uncles"); + openapiRequiredFields.add("logsBloom"); + openapiRequiredFields.add("transactionRoot"); + openapiRequiredFields.add("stateRoot"); + openapiRequiredFields.add("receiptRoot"); + openapiRequiredFields.add("miner"); + openapiRequiredFields.add("extraData"); + openapiRequiredFields.add("gasLimit"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("timestamp"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3BlockHeader + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3BlockHeader.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3BlockHeader is not found in the empty JSON string", Web3BlockHeader.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3BlockHeader.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3BlockHeader` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3BlockHeader.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if (!jsonObj.get("parentHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parentHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parentHash").toString())); + } + if (!jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if (!jsonObj.get("sha3Uncles").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sha3Uncles` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3Uncles").toString())); + } + if (!jsonObj.get("logsBloom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logsBloom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logsBloom").toString())); + } + if (!jsonObj.get("transactionRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionRoot").toString())); + } + if (!jsonObj.get("stateRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateRoot").toString())); + } + if (!jsonObj.get("receiptRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `receiptRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiptRoot").toString())); + } + if (!jsonObj.get("miner").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `miner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("miner").toString())); + } + if (!jsonObj.get("extraData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `extraData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraData").toString())); + } + // validate the required field `timestamp` + Web3BlockHeaderTimestamp.validateJsonObject(jsonObj.getAsJsonObject("timestamp")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3BlockHeader.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3BlockHeader' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3BlockHeader.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3BlockHeader value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3BlockHeader read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3BlockHeader given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3BlockHeader + * @throws IOException if the JSON string is invalid with respect to Web3BlockHeader + */ + public static Web3BlockHeader fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3BlockHeader.class); + } + + /** + * Convert an instance of Web3BlockHeader to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeaderTimestamp.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeaderTimestamp.java new file mode 100644 index 00000000000..a030d276ed7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeaderTimestamp.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import java.math.BigDecimal; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3BlockHeaderTimestamp extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Web3BlockHeaderTimestamp.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3BlockHeaderTimestamp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3BlockHeaderTimestamp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3BlockHeaderTimestamp value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonObject obj = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, String"); + } + + @Override + public Web3BlockHeaderTimestamp read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + BigDecimal.validateJsonObject(jsonObject); + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + Web3BlockHeaderTimestamp ret = new Web3BlockHeaderTimestamp(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Web3BlockHeaderTimestamp: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Web3BlockHeaderTimestamp() { + super("oneOf", Boolean.FALSE); + } + + public Web3BlockHeaderTimestamp(BigDecimal o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3BlockHeaderTimestamp(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BigDecimal", new GenericType() { + }); + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Web3BlockHeaderTimestamp.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, String"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, String + * + * @return The actual instance (BigDecimal, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3BlockHeaderTimestamp + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with BigDecimal + try { + BigDecimal.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Web3BlockHeaderTimestamp with oneOf schemas: BigDecimal, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Web3BlockHeaderTimestamp given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3BlockHeaderTimestamp + * @throws IOException if the JSON string is invalid with respect to Web3BlockHeaderTimestamp + */ + public static Web3BlockHeaderTimestamp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3BlockHeaderTimestamp.class); + } + + /** + * Convert an instance of Web3BlockHeaderTimestamp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java new file mode 100644 index 00000000000..31d09eef332 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java @@ -0,0 +1,338 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredential extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Web3SigningCredential.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWeb3SigningCredentialCactusKeychainRef = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + final TypeAdapter adapterWeb3SigningCredentialNone = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + final TypeAdapter adapterWeb3SigningCredentialPrivateKeyHex = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredential value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialCactusKeychainRef` + if (value.getActualInstance() instanceof Web3SigningCredentialCactusKeychainRef) { + JsonObject obj = adapterWeb3SigningCredentialCactusKeychainRef.toJsonTree((Web3SigningCredentialCactusKeychainRef)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialNone` + if (value.getActualInstance() instanceof Web3SigningCredentialNone) { + JsonObject obj = adapterWeb3SigningCredentialNone.toJsonTree((Web3SigningCredentialNone)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialPrivateKeyHex` + if (value.getActualInstance() instanceof Web3SigningCredentialPrivateKeyHex) { + JsonObject obj = adapterWeb3SigningCredentialPrivateKeyHex.toJsonTree((Web3SigningCredentialPrivateKeyHex)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + @Override + public Web3SigningCredential read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Web3SigningCredentialCactusKeychainRef + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialCactusKeychainRef; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialCactusKeychainRef'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialCactusKeychainRef'", e); + } + + // deserialize Web3SigningCredentialNone + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialNone.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialNone; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialNone'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialNone'", e); + } + + // deserialize Web3SigningCredentialPrivateKeyHex + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialPrivateKeyHex; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialPrivateKeyHex'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialPrivateKeyHex'", e); + } + + if (match == 1) { + Web3SigningCredential ret = new Web3SigningCredential(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Web3SigningCredential: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Web3SigningCredential() { + super("oneOf", Boolean.FALSE); + } + + public Web3SigningCredential(Web3SigningCredentialCactusKeychainRef o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialNone o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialPrivateKeyHex o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Web3SigningCredentialCactusKeychainRef", new GenericType() { + }); + schemas.put("Web3SigningCredentialNone", new GenericType() { + }); + schemas.put("Web3SigningCredentialPrivateKeyHex", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Web3SigningCredential.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Web3SigningCredentialCactusKeychainRef) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialNone) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialPrivateKeyHex) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + /** + * Get the actual instance, which can be the following: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * @return The actual instance (Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialCactusKeychainRef`. If the actual instance is not `Web3SigningCredentialCactusKeychainRef`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialCactusKeychainRef` + * @throws ClassCastException if the instance is not `Web3SigningCredentialCactusKeychainRef` + */ + public Web3SigningCredentialCactusKeychainRef getWeb3SigningCredentialCactusKeychainRef() throws ClassCastException { + return (Web3SigningCredentialCactusKeychainRef)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialNone`. If the actual instance is not `Web3SigningCredentialNone`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialNone` + * @throws ClassCastException if the instance is not `Web3SigningCredentialNone` + */ + public Web3SigningCredentialNone getWeb3SigningCredentialNone() throws ClassCastException { + return (Web3SigningCredentialNone)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialPrivateKeyHex`. If the actual instance is not `Web3SigningCredentialPrivateKeyHex`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialPrivateKeyHex` + * @throws ClassCastException if the instance is not `Web3SigningCredentialPrivateKeyHex` + */ + public Web3SigningCredentialPrivateKeyHex getWeb3SigningCredentialPrivateKeyHex() throws ClassCastException { + return (Web3SigningCredentialPrivateKeyHex)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Web3SigningCredentialCactusKeychainRef + try { + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialNone + try { + Web3SigningCredentialNone.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialPrivateKeyHex + try { + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Web3SigningCredential with oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Web3SigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredential + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredential + */ + public static Web3SigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredential.class); + } + + /** + * Convert an instance of Web3SigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java new file mode 100644 index 00000000000..0c4e5e1f574 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java @@ -0,0 +1,310 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialCactusKeychainRef + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialCactusKeychainRef { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY = "keychainEntryKey"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY) + private String keychainEntryKey; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public Web3SigningCredentialCactusKeychainRef() { + } + + public Web3SigningCredentialCactusKeychainRef type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialCactusKeychainRef ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialCactusKeychainRef keychainEntryKey(String keychainEntryKey) { + + this.keychainEntryKey = keychainEntryKey; + return this; + } + + /** + * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + * @return keychainEntryKey + **/ + @javax.annotation.Nonnull + public String getKeychainEntryKey() { + return keychainEntryKey; + } + + + public void setKeychainEntryKey(String keychainEntryKey) { + this.keychainEntryKey = keychainEntryKey; + } + + + public Web3SigningCredentialCactusKeychainRef keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialCactusKeychainRef web3SigningCredentialCactusKeychainRef = (Web3SigningCredentialCactusKeychainRef) o; + return Objects.equals(this.type, web3SigningCredentialCactusKeychainRef.type) && + Objects.equals(this.ethAccount, web3SigningCredentialCactusKeychainRef.ethAccount) && + Objects.equals(this.keychainEntryKey, web3SigningCredentialCactusKeychainRef.keychainEntryKey) && + Objects.equals(this.keychainId, web3SigningCredentialCactusKeychainRef.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, keychainEntryKey, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialCactusKeychainRef {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" keychainEntryKey: ").append(toIndentedString(keychainEntryKey)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("keychainEntryKey"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("keychainEntryKey"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialCactusKeychainRef is not found in the empty JSON string", Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialCactusKeychainRef.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialCactusKeychainRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialCactusKeychainRef.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("keychainEntryKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainEntryKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainEntryKey").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialCactusKeychainRef.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialCactusKeychainRef' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialCactusKeychainRef value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialCactusKeychainRef read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialCactusKeychainRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialCactusKeychainRef + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static Web3SigningCredentialCactusKeychainRef fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialCactusKeychainRef.class); + } + + /** + * Convert an instance of Web3SigningCredentialCactusKeychainRef to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java new file mode 100644 index 00000000000..56bf738f839 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Using this denotes that there is no signing required because the transaction is pre-signed. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialNone { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public Web3SigningCredentialNone() { + } + + public Web3SigningCredentialNone type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialNone web3SigningCredentialNone = (Web3SigningCredentialNone) o; + return Objects.equals(this.type, web3SigningCredentialNone.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialNone {\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(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialNone + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialNone.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialNone is not found in the empty JSON string", Web3SigningCredentialNone.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialNone.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialNone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialNone.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialNone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialNone' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialNone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialNone read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialNone given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialNone + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialNone + */ + public static Web3SigningCredentialNone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialNone.class); + } + + /** + * Convert an instance of Web3SigningCredentialNone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java new file mode 100644 index 00000000000..c63372d6ebc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialPrivateKeyHex + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialPrivateKeyHex { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialPrivateKeyHex() { + } + + public Web3SigningCredentialPrivateKeyHex type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialPrivateKeyHex ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialPrivateKeyHex secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * The HEX encoded private key of an eth account. + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialPrivateKeyHex web3SigningCredentialPrivateKeyHex = (Web3SigningCredentialPrivateKeyHex) o; + return Objects.equals(this.type, web3SigningCredentialPrivateKeyHex.type) && + Objects.equals(this.ethAccount, web3SigningCredentialPrivateKeyHex.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialPrivateKeyHex.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialPrivateKeyHex {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialPrivateKeyHex is not found in the empty JSON string", Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialPrivateKeyHex.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialPrivateKeyHex` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialPrivateKeyHex.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialPrivateKeyHex.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialPrivateKeyHex' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialPrivateKeyHex value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialPrivateKeyHex read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialPrivateKeyHex given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialPrivateKeyHex + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static Web3SigningCredentialPrivateKeyHex fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialPrivateKeyHex.class); + } + + /** + * Convert an instance of Web3SigningCredentialPrivateKeyHex to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java new file mode 100644 index 00000000000..cdc2bfdf27c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Web3SigningCredentialType + */ +@JsonAdapter(Web3SigningCredentialType.Adapter.class) +public enum Web3SigningCredentialType { + + CACTUS_KEYCHAIN_REF("CACTUS_KEYCHAIN_REF"), + + GETH_KEYCHAIN_PASSWORD("GETH_KEYCHAIN_PASSWORD"), + + PRIVATE_KEY_HEX("PRIVATE_KEY_HEX"), + + NONE("NONE"); + + private String value; + + Web3SigningCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Web3SigningCredentialType fromValue(String value) { + for (Web3SigningCredentialType b : Web3SigningCredentialType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Web3SigningCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Web3SigningCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Web3SigningCredentialType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java new file mode 100644 index 00000000000..a5de6613412 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java @@ -0,0 +1,547 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3TransactionReceipt + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3TransactionReceipt { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Boolean status; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private BigDecimal transactionIndex; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private BigDecimal blockNumber; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private BigDecimal gasUsed; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public Web3TransactionReceipt() { + } + + public Web3TransactionReceipt status(Boolean status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public Boolean getStatus() { + return status; + } + + + public void setStatus(Boolean status) { + this.status = status; + } + + + public Web3TransactionReceipt transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nonnull + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + public Web3TransactionReceipt transactionIndex(BigDecimal transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nonnull + public BigDecimal getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(BigDecimal transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public Web3TransactionReceipt blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nonnull + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public Web3TransactionReceipt blockNumber(BigDecimal blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(BigDecimal blockNumber) { + this.blockNumber = blockNumber; + } + + + public Web3TransactionReceipt gasUsed(BigDecimal gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + public BigDecimal getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(BigDecimal gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3TransactionReceipt contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Get contractAddress + * @return contractAddress + **/ + @javax.annotation.Nullable + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public Web3TransactionReceipt from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nonnull + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public Web3TransactionReceipt to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nonnull + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Web3TransactionReceipt instance itself + */ + public Web3TransactionReceipt putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3TransactionReceipt web3TransactionReceipt = (Web3TransactionReceipt) o; + return Objects.equals(this.status, web3TransactionReceipt.status) && + Objects.equals(this.transactionHash, web3TransactionReceipt.transactionHash) && + Objects.equals(this.transactionIndex, web3TransactionReceipt.transactionIndex) && + Objects.equals(this.blockHash, web3TransactionReceipt.blockHash) && + Objects.equals(this.blockNumber, web3TransactionReceipt.blockNumber) && + Objects.equals(this.gasUsed, web3TransactionReceipt.gasUsed) && + Objects.equals(this.contractAddress, web3TransactionReceipt.contractAddress) && + Objects.equals(this.from, web3TransactionReceipt.from) && + Objects.equals(this.to, web3TransactionReceipt.to)&& + Objects.equals(this.additionalProperties, web3TransactionReceipt.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, transactionHash, transactionIndex, blockHash, blockNumber, gasUsed, contractAddress, from, to, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3TransactionReceipt {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("transactionHash"); + openapiFields.add("transactionIndex"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("gasUsed"); + openapiFields.add("contractAddress"); + openapiFields.add("from"); + openapiFields.add("to"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("transactionHash"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("blockNumber"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("to"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3TransactionReceipt + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3TransactionReceipt.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3TransactionReceipt is not found in the empty JSON string", Web3TransactionReceipt.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3TransactionReceipt.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if ((jsonObj.get("contractAddress") != null && !jsonObj.get("contractAddress").isJsonNull()) && !jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if (!jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if (!jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3TransactionReceipt.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3TransactionReceipt' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3TransactionReceipt.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3TransactionReceipt value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Web3TransactionReceipt read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Web3TransactionReceipt instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3TransactionReceipt given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3TransactionReceipt + * @throws IOException if the JSON string is invalid with respect to Web3TransactionReceipt + */ + public static Web3TransactionReceipt fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3TransactionReceipt.class); + } + + /** + * Convert an instance of Web3TransactionReceipt to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..92e935bf70f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,183 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeployContractSolidityBytecodeV1Request; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Response; +import org.openapitools.client.model.GetBalanceV1Request; +import org.openapitools.client.model.GetBalanceV1Response; +import org.openapitools.client.model.GetBesuRecordV1Request; +import org.openapitools.client.model.GetBesuRecordV1Response; +import org.openapitools.client.model.GetBlockV1Request; +import org.openapitools.client.model.GetBlockV1Response; +import org.openapitools.client.model.GetPastLogsV1Request; +import org.openapitools.client.model.GetPastLogsV1Response; +import org.openapitools.client.model.GetTransactionV1Request; +import org.openapitools.client.model.GetTransactionV1Response; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.RunTransactionRequest; +import org.openapitools.client.model.RunTransactionResponse; +import org.openapitools.client.model.SignTransactionRequest; +import org.openapitools.client.model.SignTransactionResponse; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deploys the bytecode of a Solidity contract. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractSolBytecodeV1Test() throws ApiException { + DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request = null; + DeployContractSolidityBytecodeV1Response response = api.deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request); + // TODO: test validations + } + + /** + * Return balance of an address of a given block + * + * @throws ApiException if the Api call fails + */ + @Test + public void getBalanceV1Test() throws ApiException { + GetBalanceV1Request getBalanceV1Request = null; + GetBalanceV1Response response = api.getBalanceV1(getBalanceV1Request); + // TODO: test validations + } + + /** + * Retrieves an arbitrary record (any piece of information) from the ledger. Ledger records can be call outputs, transaction input, etc. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getBesuRecordV1Test() throws ApiException { + GetBesuRecordV1Request getBesuRecordV1Request = null; + GetBesuRecordV1Response response = api.getBesuRecordV1(getBesuRecordV1Request); + // TODO: test validations + } + + /** + * Returns a block matching the block + * + * @throws ApiException if the Api call fails + */ + @Test + public void getBlockV1Test() throws ApiException { + GetBlockV1Request getBlockV1Request = null; + GetBlockV1Response response = api.getBlockV1(getBlockV1Request); + // TODO: test validations + } + + /** + * Retrieves the .json file that contains the OpenAPI specification for the plugin. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getOpenApiSpecV1Test() throws ApiException { + String response = api.getOpenApiSpecV1(); + // TODO: test validations + } + + /** + * Gets past logs, matching the given options. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPastLogsV1Test() throws ApiException { + GetPastLogsV1Request getPastLogsV1Request = null; + GetPastLogsV1Response response = api.getPastLogsV1(getPastLogsV1Request); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Executes a transaction on a besu ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void getTransactionV1Test() throws ApiException { + GetTransactionV1Request getTransactionV1Request = null; + GetTransactionV1Response response = api.getTransactionV1(getTransactionV1Request); + // TODO: test validations + } + + /** + * Invokes a contract on a besu ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeContractV1Test() throws ApiException { + InvokeContractV1Request invokeContractV1Request = null; + InvokeContractV1Response response = api.invokeContractV1(invokeContractV1Request); + // TODO: test validations + } + + /** + * Executes a transaction on a besu ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void runTransactionV1Test() throws ApiException { + RunTransactionRequest runTransactionRequest = null; + RunTransactionResponse response = api.runTransactionV1(runTransactionRequest); + // TODO: test validations + } + + /** + * Obtain signatures of ledger from the corresponding transaction hash. + * + * Obtain signatures of ledger from the corresponding transaction hash. + * + * @throws ApiException if the Api call fails + */ + @Test + public void signTransactionV1Test() throws ApiException { + SignTransactionRequest signTransactionRequest = null; + SignTransactionResponse response = api.signTransactionV1(signTransactionRequest); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuPrivateTransactionConfigTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuPrivateTransactionConfigTest.java new file mode 100644 index 00000000000..ef7dbd4a624 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuPrivateTransactionConfigTest.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for BesuPrivateTransactionConfig + */ +public class BesuPrivateTransactionConfigTest { + private final BesuPrivateTransactionConfig model = new BesuPrivateTransactionConfig(); + + /** + * Model tests for BesuPrivateTransactionConfig + */ + @Test + public void testBesuPrivateTransactionConfig() { + // TODO: test BesuPrivateTransactionConfig + } + + /** + * Test the property 'privateFrom' + */ + @Test + public void privateFromTest() { + // TODO: test privateFrom + } + + /** + * Test the property 'privateFor' + */ + @Test + public void privateForTest() { + // TODO: test privateFor + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuTransactionConfigTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuTransactionConfigTest.java new file mode 100644 index 00000000000..92134aa66c7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuTransactionConfigTest.java @@ -0,0 +1,107 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.client.model.BesuTransactionConfigTo; +import org.openapitools.client.model.Web3BlockHeaderTimestamp; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for BesuTransactionConfig + */ +public class BesuTransactionConfigTest { + private final BesuTransactionConfig model = new BesuTransactionConfig(); + + /** + * Model tests for BesuTransactionConfig + */ + @Test + public void testBesuTransactionConfig() { + // TODO: test BesuTransactionConfig + } + + /** + * Test the property 'rawTransaction' + */ + @Test + public void rawTransactionTest() { + // TODO: test rawTransaction + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuTransactionConfigToTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuTransactionConfigToTest.java new file mode 100644 index 00000000000..8660ddee567 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BesuTransactionConfigToTest.java @@ -0,0 +1,34 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for BesuTransactionConfigTo + */ +public class BesuTransactionConfigToTest { + private final BesuTransactionConfigTo model = new BesuTransactionConfigTo(); + + /** + * Model tests for BesuTransactionConfigTo + */ + @Test + public void testBesuTransactionConfigTo() { + // TODO: test BesuTransactionConfigTo + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsistencyStrategyTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsistencyStrategyTest.java new file mode 100644 index 00000000000..0ea72f9c5a9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsistencyStrategyTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.ReceiptType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConsistencyStrategy + */ +public class ConsistencyStrategyTest { + private final ConsistencyStrategy model = new ConsistencyStrategy(); + + /** + * Model tests for ConsistencyStrategy + */ + @Test + public void testConsistencyStrategy() { + // TODO: test ConsistencyStrategy + } + + /** + * Test the property 'receiptType' + */ + @Test + public void receiptTypeTest() { + // TODO: test receiptType + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'blockConfirmations' + */ + @Test + public void blockConfirmationsTest() { + // TODO: test blockConfirmations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java new file mode 100644 index 00000000000..64a14f90e41 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java @@ -0,0 +1,125 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.BesuPrivateTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractSolidityBytecodeV1Request + */ +public class DeployContractSolidityBytecodeV1RequestTest { + private final DeployContractSolidityBytecodeV1Request model = new DeployContractSolidityBytecodeV1Request(); + + /** + * Model tests for DeployContractSolidityBytecodeV1Request + */ + @Test + public void testDeployContractSolidityBytecodeV1Request() { + // TODO: test DeployContractSolidityBytecodeV1Request + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'contractAbi' + */ + @Test + public void contractAbiTest() { + // TODO: test contractAbi + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'privateTransactionConfig' + */ + @Test + public void privateTransactionConfigTest() { + // TODO: test privateTransactionConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java new file mode 100644 index 00000000000..16f40a56146 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractSolidityBytecodeV1Response + */ +public class DeployContractSolidityBytecodeV1ResponseTest { + private final DeployContractSolidityBytecodeV1Response model = new DeployContractSolidityBytecodeV1Response(); + + /** + * Model tests for DeployContractSolidityBytecodeV1Response + */ + @Test + public void testDeployContractSolidityBytecodeV1Response() { + // TODO: test DeployContractSolidityBytecodeV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java new file mode 100644 index 00000000000..c16884079e2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EthContractInvocationType + */ +public class EthContractInvocationTypeTest { + /** + * Model tests for EthContractInvocationType + */ + @Test + public void testEthContractInvocationType() { + // TODO: test EthContractInvocationType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmBlockTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmBlockTest.java new file mode 100644 index 00000000000..1b3463ae597 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmBlockTest.java @@ -0,0 +1,188 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EvmBlock + */ +public class EvmBlockTest { + private final EvmBlock model = new EvmBlock(); + + /** + * Model tests for EvmBlock + */ + @Test + public void testEvmBlock() { + // TODO: test EvmBlock + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'parentHash' + */ + @Test + public void parentHashTest() { + // TODO: test parentHash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'sha3Uncles' + */ + @Test + public void sha3UnclesTest() { + // TODO: test sha3Uncles + } + + /** + * Test the property 'logsBloom' + */ + @Test + public void logsBloomTest() { + // TODO: test logsBloom + } + + /** + * Test the property 'transactionsRoot' + */ + @Test + public void transactionsRootTest() { + // TODO: test transactionsRoot + } + + /** + * Test the property 'stateRoot' + */ + @Test + public void stateRootTest() { + // TODO: test stateRoot + } + + /** + * Test the property 'miner' + */ + @Test + public void minerTest() { + // TODO: test miner + } + + /** + * Test the property 'difficulty' + */ + @Test + public void difficultyTest() { + // TODO: test difficulty + } + + /** + * Test the property 'totalDifficulty' + */ + @Test + public void totalDifficultyTest() { + // TODO: test totalDifficulty + } + + /** + * Test the property 'extraData' + */ + @Test + public void extraDataTest() { + // TODO: test extraData + } + + /** + * Test the property 'size' + */ + @Test + public void sizeTest() { + // TODO: test size + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + + /** + * Test the property 'transactions' + */ + @Test + public void transactionsTest() { + // TODO: test transactions + } + + /** + * Test the property 'uncles' + */ + @Test + public void unclesTest() { + // TODO: test uncles + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmLogTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmLogTest.java new file mode 100644 index 00000000000..530d90738e6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmLogTest.java @@ -0,0 +1,107 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EvmLog + */ +public class EvmLogTest { + private final EvmLog model = new EvmLog(); + + /** + * Model tests for EvmLog + */ + @Test + public void testEvmLog() { + // TODO: test EvmLog + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + + /** + * Test the property 'topics' + */ + @Test + public void topicsTest() { + // TODO: test topics + } + + /** + * Test the property 'logIndex' + */ + @Test + public void logIndexTest() { + // TODO: test logIndex + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmTransactionTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmTransactionTest.java new file mode 100644 index 00000000000..322da39bf6a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EvmTransactionTest.java @@ -0,0 +1,130 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EvmTransaction + */ +public class EvmTransactionTest { + private final EvmTransaction model = new EvmTransaction(); + + /** + * Model tests for EvmTransaction + */ + @Test + public void testEvmTransaction() { + // TODO: test EvmTransaction + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'input' + */ + @Test + public void inputTest() { + // TODO: test input + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBalanceV1RequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBalanceV1RequestTest.java new file mode 100644 index 00000000000..789e21f8c0e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBalanceV1RequestTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBalanceV1Request + */ +public class GetBalanceV1RequestTest { + private final GetBalanceV1Request model = new GetBalanceV1Request(); + + /** + * Model tests for GetBalanceV1Request + */ + @Test + public void testGetBalanceV1Request() { + // TODO: test GetBalanceV1Request + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'defaultBlock' + */ + @Test + public void defaultBlockTest() { + // TODO: test defaultBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBalanceV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBalanceV1ResponseTest.java new file mode 100644 index 00000000000..7dfe9f164b6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBalanceV1ResponseTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBalanceV1Response + */ +public class GetBalanceV1ResponseTest { + private final GetBalanceV1Response model = new GetBalanceV1Response(); + + /** + * Model tests for GetBalanceV1Response + */ + @Test + public void testGetBalanceV1Response() { + // TODO: test GetBalanceV1Response + } + + /** + * Test the property 'balance' + */ + @Test + public void balanceTest() { + // TODO: test balance + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBesuRecordV1RequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBesuRecordV1RequestTest.java new file mode 100644 index 00000000000..c1d7687b32b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBesuRecordV1RequestTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.InvokeContractV1Request; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBesuRecordV1Request + */ +public class GetBesuRecordV1RequestTest { + private final GetBesuRecordV1Request model = new GetBesuRecordV1Request(); + + /** + * Model tests for GetBesuRecordV1Request + */ + @Test + public void testGetBesuRecordV1Request() { + // TODO: test GetBesuRecordV1Request + } + + /** + * Test the property 'invokeCall' + */ + @Test + public void invokeCallTest() { + // TODO: test invokeCall + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBesuRecordV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBesuRecordV1ResponseTest.java new file mode 100644 index 00000000000..78edc769b57 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBesuRecordV1ResponseTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBesuRecordV1Response + */ +public class GetBesuRecordV1ResponseTest { + private final GetBesuRecordV1Response model = new GetBesuRecordV1Response(); + + /** + * Model tests for GetBesuRecordV1Response + */ + @Test + public void testGetBesuRecordV1Response() { + // TODO: test GetBesuRecordV1Response + } + + /** + * Test the property 'ledgerId' + */ + @Test + public void ledgerIdTest() { + // TODO: test ledgerId + } + + /** + * Test the property 'stateContract' + */ + @Test + public void stateContractTest() { + // TODO: test stateContract + } + + /** + * Test the property 'transactionInputData' + */ + @Test + public void transactionInputDataTest() { + // TODO: test transactionInputData + } + + /** + * Test the property 'callOutput' + */ + @Test + public void callOutputTest() { + // TODO: test callOutput + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockV1RequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockV1RequestTest.java new file mode 100644 index 00000000000..c8d2131c27b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockV1RequestTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockV1Request + */ +public class GetBlockV1RequestTest { + private final GetBlockV1Request model = new GetBlockV1Request(); + + /** + * Model tests for GetBlockV1Request + */ + @Test + public void testGetBlockV1Request() { + // TODO: test GetBlockV1Request + } + + /** + * Test the property 'blockHashOrBlockNumber' + */ + @Test + public void blockHashOrBlockNumberTest() { + // TODO: test blockHashOrBlockNumber + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockV1ResponseTest.java new file mode 100644 index 00000000000..d4e942c1a55 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockV1ResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.EvmBlock; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockV1Response + */ +public class GetBlockV1ResponseTest { + private final GetBlockV1Response model = new GetBlockV1Response(); + + /** + * Model tests for GetBlockV1Response + */ + @Test + public void testGetBlockV1Response() { + // TODO: test GetBlockV1Response + } + + /** + * Test the property 'block' + */ + @Test + public void blockTest() { + // TODO: test block + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPastLogsV1RequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPastLogsV1RequestTest.java new file mode 100644 index 00000000000..3c477069347 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPastLogsV1RequestTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetPastLogsV1Request + */ +public class GetPastLogsV1RequestTest { + private final GetPastLogsV1Request model = new GetPastLogsV1Request(); + + /** + * Model tests for GetPastLogsV1Request + */ + @Test + public void testGetPastLogsV1Request() { + // TODO: test GetPastLogsV1Request + } + + /** + * Test the property 'toBlock' + */ + @Test + public void toBlockTest() { + // TODO: test toBlock + } + + /** + * Test the property 'fromBlock' + */ + @Test + public void fromBlockTest() { + // TODO: test fromBlock + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'topics' + */ + @Test + public void topicsTest() { + // TODO: test topics + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPastLogsV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPastLogsV1ResponseTest.java new file mode 100644 index 00000000000..3d4497387b5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPastLogsV1ResponseTest.java @@ -0,0 +1,51 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.EvmLog; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetPastLogsV1Response + */ +public class GetPastLogsV1ResponseTest { + private final GetPastLogsV1Response model = new GetPastLogsV1Response(); + + /** + * Model tests for GetPastLogsV1Response + */ + @Test + public void testGetPastLogsV1Response() { + // TODO: test GetPastLogsV1Response + } + + /** + * Test the property 'logs' + */ + @Test + public void logsTest() { + // TODO: test logs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionV1RequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionV1RequestTest.java new file mode 100644 index 00000000000..ba5788e47d1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionV1RequestTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetTransactionV1Request + */ +public class GetTransactionV1RequestTest { + private final GetTransactionV1Request model = new GetTransactionV1Request(); + + /** + * Model tests for GetTransactionV1Request + */ + @Test + public void testGetTransactionV1Request() { + // TODO: test GetTransactionV1Request + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionV1ResponseTest.java new file mode 100644 index 00000000000..9e9e6dc9b8e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionV1ResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.EvmTransaction; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetTransactionV1Response + */ +public class GetTransactionV1ResponseTest { + private final GetTransactionV1Response model = new GetTransactionV1Response(); + + /** + * Model tests for GetTransactionV1Response + */ + @Test + public void testGetTransactionV1Response() { + // TODO: test GetTransactionV1Response + } + + /** + * Test the property 'transaction' + */ + @Test + public void transactionTest() { + // TODO: test transaction + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java new file mode 100644 index 00000000000..02f5bc4c2c7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java @@ -0,0 +1,159 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.BesuPrivateTransactionConfig; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.Web3BlockHeaderTimestamp; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Request + */ +public class InvokeContractV1RequestTest { + private final InvokeContractV1Request model = new InvokeContractV1Request(); + + /** + * Model tests for InvokeContractV1Request + */ + @Test + public void testInvokeContractV1Request() { + // TODO: test InvokeContractV1Request + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'signingCredential' + */ + @Test + public void signingCredentialTest() { + // TODO: test signingCredential + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'contractAbi' + */ + @Test + public void contractAbiTest() { + // TODO: test contractAbi + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'privateTransactionConfig' + */ + @Test + public void privateTransactionConfigTest() { + // TODO: test privateTransactionConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java new file mode 100644 index 00000000000..699b4c94555 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Response + */ +public class InvokeContractV1ResponseTest { + private final InvokeContractV1Response model = new InvokeContractV1Response(); + + /** + * Model tests for InvokeContractV1Response + */ + @Test + public void testInvokeContractV1Response() { + // TODO: test InvokeContractV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + + /** + * Test the property 'callOutput' + */ + @Test + public void callOutputTest() { + // TODO: test callOutput + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ReceiptTypeTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ReceiptTypeTest.java new file mode 100644 index 00000000000..02f239c7bfd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ReceiptTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ReceiptType + */ +public class ReceiptTypeTest { + /** + * Model tests for ReceiptType + */ + @Test + public void testReceiptType() { + // TODO: test ReceiptType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java new file mode 100644 index 00000000000..6ec3bba7a9b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.BesuPrivateTransactionConfig; +import org.openapitools.client.model.BesuTransactionConfig; +import org.openapitools.client.model.ConsistencyStrategy; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionRequest + */ +public class RunTransactionRequestTest { + private final RunTransactionRequest model = new RunTransactionRequest(); + + /** + * Model tests for RunTransactionRequest + */ + @Test + public void testRunTransactionRequest() { + // TODO: test RunTransactionRequest + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'transactionConfig' + */ + @Test + public void transactionConfigTest() { + // TODO: test transactionConfig + } + + /** + * Test the property 'consistencyStrategy' + */ + @Test + public void consistencyStrategyTest() { + // TODO: test consistencyStrategy + } + + /** + * Test the property 'privateTransactionConfig' + */ + @Test + public void privateTransactionConfigTest() { + // TODO: test privateTransactionConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java new file mode 100644 index 00000000000..c7c6bf37aab --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionResponse + */ +public class RunTransactionResponseTest { + private final RunTransactionResponse model = new RunTransactionResponse(); + + /** + * Model tests for RunTransactionResponse + */ + @Test + public void testRunTransactionResponse() { + // TODO: test RunTransactionResponse + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SignTransactionRequestTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SignTransactionRequestTest.java new file mode 100644 index 00000000000..0470d0ad40b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SignTransactionRequestTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SignTransactionRequest + */ +public class SignTransactionRequestTest { + private final SignTransactionRequest model = new SignTransactionRequest(); + + /** + * Model tests for SignTransactionRequest + */ + @Test + public void testSignTransactionRequest() { + // TODO: test SignTransactionRequest + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'keychainRef' + */ + @Test + public void keychainRefTest() { + // TODO: test keychainRef + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SignTransactionResponseTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SignTransactionResponseTest.java new file mode 100644 index 00000000000..e11dacf11e7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SignTransactionResponseTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SignTransactionResponse + */ +public class SignTransactionResponseTest { + private final SignTransactionResponse model = new SignTransactionResponse(); + + /** + * Model tests for SignTransactionResponse + */ + @Test + public void testSignTransactionResponse() { + // TODO: test SignTransactionResponse + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java new file mode 100644 index 00000000000..77ad28a2474 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactCompiler + */ +public class SolidityContractJsonArtifactCompilerTest { + private final SolidityContractJsonArtifactCompiler model = new SolidityContractJsonArtifactCompiler(); + + /** + * Model tests for SolidityContractJsonArtifactCompiler + */ + @Test + public void testSolidityContractJsonArtifactCompiler() { + // TODO: test SolidityContractJsonArtifactCompiler + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java new file mode 100644 index 00000000000..30793780c71 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactGasEstimatesCreation + */ +public class SolidityContractJsonArtifactGasEstimatesCreationTest { + private final SolidityContractJsonArtifactGasEstimatesCreation model = new SolidityContractJsonArtifactGasEstimatesCreation(); + + /** + * Model tests for SolidityContractJsonArtifactGasEstimatesCreation + */ + @Test + public void testSolidityContractJsonArtifactGasEstimatesCreation() { + // TODO: test SolidityContractJsonArtifactGasEstimatesCreation + } + + /** + * Test the property 'codeDepositCost' + */ + @Test + public void codeDepositCostTest() { + // TODO: test codeDepositCost + } + + /** + * Test the property 'executionCost' + */ + @Test + public void executionCostTest() { + // TODO: test executionCost + } + + /** + * Test the property 'totalCost' + */ + @Test + public void totalCostTest() { + // TODO: test totalCost + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java new file mode 100644 index 00000000000..1c5e13e2c50 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactGasEstimates + */ +public class SolidityContractJsonArtifactGasEstimatesTest { + private final SolidityContractJsonArtifactGasEstimates model = new SolidityContractJsonArtifactGasEstimates(); + + /** + * Model tests for SolidityContractJsonArtifactGasEstimates + */ + @Test + public void testSolidityContractJsonArtifactGasEstimates() { + // TODO: test SolidityContractJsonArtifactGasEstimates + } + + /** + * Test the property 'creation' + */ + @Test + public void creationTest() { + // TODO: test creation + } + + /** + * Test the property 'external' + */ + @Test + public void externalTest() { + // TODO: test external + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java new file mode 100644 index 00000000000..c42784cfe3d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java @@ -0,0 +1,124 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactCompiler; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifact + */ +public class SolidityContractJsonArtifactTest { + private final SolidityContractJsonArtifact model = new SolidityContractJsonArtifact(); + + /** + * Model tests for SolidityContractJsonArtifact + */ + @Test + public void testSolidityContractJsonArtifact() { + // TODO: test SolidityContractJsonArtifact + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'deployedBytecode' + */ + @Test + public void deployedBytecodeTest() { + // TODO: test deployedBytecode + } + + /** + * Test the property 'sourceMap' + */ + @Test + public void sourceMapTest() { + // TODO: test sourceMap + } + + /** + * Test the property 'deployedSourceMap' + */ + @Test + public void deployedSourceMapTest() { + // TODO: test deployedSourceMap + } + + /** + * Test the property 'sourcePath' + */ + @Test + public void sourcePathTest() { + // TODO: test sourcePath + } + + /** + * Test the property 'compiler' + */ + @Test + public void compilerTest() { + // TODO: test compiler + } + + /** + * Test the property 'functionHashes' + */ + @Test + public void functionHashesTest() { + // TODO: test functionHashes + } + + /** + * Test the property 'gasEstimates' + */ + @Test + public void gasEstimatesTest() { + // TODO: test gasEstimates + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java new file mode 100644 index 00000000000..473a6222757 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3BlockHeader; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1Progress + */ +public class WatchBlocksV1ProgressTest { + private final WatchBlocksV1Progress model = new WatchBlocksV1Progress(); + + /** + * Model tests for WatchBlocksV1Progress + */ + @Test + public void testWatchBlocksV1Progress() { + // TODO: test WatchBlocksV1Progress + } + + /** + * Test the property 'blockHeader' + */ + @Test + public void blockHeaderTest() { + // TODO: test blockHeader + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java new file mode 100644 index 00000000000..5fffa26ef34 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1 + */ +public class WatchBlocksV1Test { + /** + * Model tests for WatchBlocksV1 + */ + @Test + public void testWatchBlocksV1() { + // TODO: test WatchBlocksV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java new file mode 100644 index 00000000000..214d7ea8b8d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java @@ -0,0 +1,154 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.client.model.Web3BlockHeaderTimestamp; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3BlockHeader + */ +public class Web3BlockHeaderTest { + private final Web3BlockHeader model = new Web3BlockHeader(); + + /** + * Model tests for Web3BlockHeader + */ + @Test + public void testWeb3BlockHeader() { + // TODO: test Web3BlockHeader + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'parentHash' + */ + @Test + public void parentHashTest() { + // TODO: test parentHash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'sha3Uncles' + */ + @Test + public void sha3UnclesTest() { + // TODO: test sha3Uncles + } + + /** + * Test the property 'logsBloom' + */ + @Test + public void logsBloomTest() { + // TODO: test logsBloom + } + + /** + * Test the property 'transactionRoot' + */ + @Test + public void transactionRootTest() { + // TODO: test transactionRoot + } + + /** + * Test the property 'stateRoot' + */ + @Test + public void stateRootTest() { + // TODO: test stateRoot + } + + /** + * Test the property 'receiptRoot' + */ + @Test + public void receiptRootTest() { + // TODO: test receiptRoot + } + + /** + * Test the property 'miner' + */ + @Test + public void minerTest() { + // TODO: test miner + } + + /** + * Test the property 'extraData' + */ + @Test + public void extraDataTest() { + // TODO: test extraData + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTimestampTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTimestampTest.java new file mode 100644 index 00000000000..25d664a9806 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTimestampTest.java @@ -0,0 +1,35 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3BlockHeaderTimestamp + */ +public class Web3BlockHeaderTimestampTest { + private final Web3BlockHeaderTimestamp model = new Web3BlockHeaderTimestamp(); + + /** + * Model tests for Web3BlockHeaderTimestamp + */ + @Test + public void testWeb3BlockHeaderTimestamp() { + // TODO: test Web3BlockHeaderTimestamp + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java new file mode 100644 index 00000000000..5b6c24ecf8e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ +public class Web3SigningCredentialCactusKeychainRefTest { + private final Web3SigningCredentialCactusKeychainRef model = new Web3SigningCredentialCactusKeychainRef(); + + /** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ + @Test + public void testWeb3SigningCredentialCactusKeychainRef() { + // TODO: test Web3SigningCredentialCactusKeychainRef + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java new file mode 100644 index 00000000000..9f6ededb5e3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialNone + */ +public class Web3SigningCredentialNoneTest { + private final Web3SigningCredentialNone model = new Web3SigningCredentialNone(); + + /** + * Model tests for Web3SigningCredentialNone + */ + @Test + public void testWeb3SigningCredentialNone() { + // TODO: test Web3SigningCredentialNone + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java new file mode 100644 index 00000000000..d2ddda8a984 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ +public class Web3SigningCredentialPrivateKeyHexTest { + private final Web3SigningCredentialPrivateKeyHex model = new Web3SigningCredentialPrivateKeyHex(); + + /** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ + @Test + public void testWeb3SigningCredentialPrivateKeyHex() { + // TODO: test Web3SigningCredentialPrivateKeyHex + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java new file mode 100644 index 00000000000..929068706da --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredential + */ +public class Web3SigningCredentialTest { + private final Web3SigningCredential model = new Web3SigningCredential(); + + /** + * Model tests for Web3SigningCredential + */ + @Test + public void testWeb3SigningCredential() { + // TODO: test Web3SigningCredential + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java new file mode 100644 index 00000000000..93cdce040a1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialType + */ +public class Web3SigningCredentialTypeTest { + /** + * Model tests for Web3SigningCredentialType + */ + @Test + public void testWeb3SigningCredentialType() { + // TODO: test Web3SigningCredentialType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java new file mode 100644 index 00000000000..b95a8b7f864 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java @@ -0,0 +1,114 @@ +/* + * Hyperledger Cactus Plugin - Connector Besu + * Can perform basic tasks on a Besu ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3TransactionReceipt + */ +public class Web3TransactionReceiptTest { + private final Web3TransactionReceipt model = new Web3TransactionReceipt(); + + /** + * Model tests for Web3TransactionReceipt + */ + @Test + public void testWeb3TransactionReceipt() { + // TODO: test Web3TransactionReceipt + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/package.json b/packages/cactus-plugin-ledger-connector-corda/package.json index 146f763977b..1e79eeac17d 100644 --- a/packages/cactus-plugin-ledger-connector-corda/package.json +++ b/packages/cactus-plugin-ledger-connector-corda/package.json @@ -48,6 +48,8 @@ "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "generate-server": "yarn run --top-level openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin-spring -o ./src/main-server/kotlin/gen/kotlin-spring/ -c ./src/main-server/openapi-generator-config.yaml", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..c3960048287 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,46 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_clear_monitor_transactions_v1_request.go +model_clear_monitor_transactions_v1_response.go +model_corda_node_ssh_credentials.go +model_corda_rpc_credentials.go +model_corda_x500_name.go +model_cordapp_deployment_config.go +model_cordapp_info.go +model_deploy_contract_jars_bad_request_v1_response.go +model_deploy_contract_jars_success_v1_response.go +model_deploy_contract_jars_v1_request.go +model_diagnose_node_v1_request.go +model_diagnose_node_v1_response.go +model_flow_invocation_type.go +model_get_monitor_transactions_v1_request.go +model_get_monitor_transactions_v1_response.go +model_get_monitor_transactions_v1_response_tx_inner.go +model_invoke_contract_v1_request.go +model_invoke_contract_v1_response.go +model_jar_file.go +model_jvm_object.go +model_jvm_type.go +model_jvm_type_kind.go +model_list_flows_v1_request.go +model_list_flows_v1_response.go +model_network_host_and_port.go +model_node_diagnostic_info.go +model_node_info.go +model_party.go +model_public_key.go +model_sha256.go +model_start_monitor_v1_request.go +model_start_monitor_v1_response.go +model_stop_monitor_v1_request.go +model_stop_monitor_v1_response.go +model_x500_principal.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..4bb2c5bd602 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,155 @@ +# Go API client for cactus-plugin-ledger-connector-corda + +Can perform basic tasks on a Corda ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-corda "github.com/hyperledger/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-corda.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-corda.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-corda.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-corda.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**ClearMonitorTransactionsV1**](docs/DefaultApi.md#clearmonitortransactionsv1) | **Delete** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions | Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. +*DefaultApi* | [**DeployContractJarsV1**](docs/DefaultApi.md#deploycontractjarsv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars | Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). +*DefaultApi* | [**DiagnoseNodeV1**](docs/DefaultApi.md#diagnosenodev1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node | +*DefaultApi* | [**GetMonitorTransactionsV1**](docs/DefaultApi.md#getmonitortransactionsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions | Get transactions for monitored state classes. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**InvokeContractV1**](docs/DefaultApi.md#invokecontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract | Invokes a contract on a Corda ledger (e.g. a flow) +*DefaultApi* | [**ListFlowsV1**](docs/DefaultApi.md#listflowsv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows | +*DefaultApi* | [**NetworkMapV1**](docs/DefaultApi.md#networkmapv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map | +*DefaultApi* | [**StartMonitorV1**](docs/DefaultApi.md#startmonitorv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor | Start monitoring corda changes (transactions) of given state class +*DefaultApi* | [**StopMonitorV1**](docs/DefaultApi.md#stopmonitorv1) | **Delete** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor | Stop monitoring corda changes (transactions) of given state class + + +## Documentation For Models + + - [ClearMonitorTransactionsV1Request](docs/ClearMonitorTransactionsV1Request.md) + - [ClearMonitorTransactionsV1Response](docs/ClearMonitorTransactionsV1Response.md) + - [CordaNodeSshCredentials](docs/CordaNodeSshCredentials.md) + - [CordaRpcCredentials](docs/CordaRpcCredentials.md) + - [CordaX500Name](docs/CordaX500Name.md) + - [CordappDeploymentConfig](docs/CordappDeploymentConfig.md) + - [CordappInfo](docs/CordappInfo.md) + - [DeployContractJarsBadRequestV1Response](docs/DeployContractJarsBadRequestV1Response.md) + - [DeployContractJarsSuccessV1Response](docs/DeployContractJarsSuccessV1Response.md) + - [DeployContractJarsV1Request](docs/DeployContractJarsV1Request.md) + - [DiagnoseNodeV1Request](docs/DiagnoseNodeV1Request.md) + - [DiagnoseNodeV1Response](docs/DiagnoseNodeV1Response.md) + - [FlowInvocationType](docs/FlowInvocationType.md) + - [GetMonitorTransactionsV1Request](docs/GetMonitorTransactionsV1Request.md) + - [GetMonitorTransactionsV1Response](docs/GetMonitorTransactionsV1Response.md) + - [GetMonitorTransactionsV1ResponseTxInner](docs/GetMonitorTransactionsV1ResponseTxInner.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [JarFile](docs/JarFile.md) + - [JvmObject](docs/JvmObject.md) + - [JvmType](docs/JvmType.md) + - [JvmTypeKind](docs/JvmTypeKind.md) + - [ListFlowsV1Request](docs/ListFlowsV1Request.md) + - [ListFlowsV1Response](docs/ListFlowsV1Response.md) + - [NetworkHostAndPort](docs/NetworkHostAndPort.md) + - [NodeDiagnosticInfo](docs/NodeDiagnosticInfo.md) + - [NodeInfo](docs/NodeInfo.md) + - [Party](docs/Party.md) + - [PublicKey](docs/PublicKey.md) + - [SHA256](docs/SHA256.md) + - [StartMonitorV1Request](docs/StartMonitorV1Request.md) + - [StartMonitorV1Response](docs/StartMonitorV1Response.md) + - [StopMonitorV1Request](docs/StopMonitorV1Request.md) + - [StopMonitorV1Response](docs/StopMonitorV1Response.md) + - [X500Principal](docs/X500Principal.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..203cfafc294 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,1384 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Corda ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Corda + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars: + post: + operationId: deployContractJarsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsSuccessV1Response' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsBadRequestV1Response' + description: Bad Request + summary: "Deploys a set of jar files (Cordapps, e.g. the contracts in Corda\ + \ speak)." + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a Corda ledger (e.g. a flow) + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor: + post: + operationId: startMonitorV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StartMonitorV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StartMonitorV1Response' + description: OK + summary: Start monitoring corda changes (transactions) of given state class + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions: + get: + operationId: GetMonitorTransactionsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetMonitorTransactionsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetMonitorTransactionsV1Response' + description: OK + summary: Get transactions for monitored state classes. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions + verbLowerCase: get + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions: + delete: + operationId: ClearMonitorTransactionsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClearMonitorTransactionsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ClearMonitorTransactionsV1Response' + description: OK + summary: Clear transactions from internal store so they'll not be available + by GetMonitorTransactionsV1 anymore. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions + verbLowerCase: delete + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor: + delete: + operationId: stopMonitorV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StopMonitorV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StopMonitorV1Response' + description: OK + summary: Stop monitoring corda changes (transactions) of given state class + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor + verbLowerCase: delete + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map: + post: + description: "Responds with a snapshot of the network map as provided by the\ + \ Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun\ + \ networkMapSnapshot(): List" + operationId: networkMapV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkMapV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkMapV1Response' + description: OK + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows: + post: + description: Responds with a list of the flows on the Corda node. + operationId: listFlowsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ListFlowsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ListFlowsV1Response' + description: OK + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node: + post: + description: Responds with diagnostic information about the Corda node + operationId: diagnoseNodeV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DiagnoseNodeV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DiagnoseNodeV1Response' + description: OK + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node + verbLowerCase: post + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics +components: + schemas: + SHA256: + description: "SHA-256 is part of the SHA-2 hash function family. Generated hash\ + \ is fixed size, 256-bits (32-bytes)." + example: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + externalDocs: + description: Official Corda documentation of the SHA256 class. + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.crypto/-secure-hash/-s-h-a256/index.html + properties: + bytes: + example: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + type: string + offset: + example: 0 + type: integer + size: + example: 32 + type: integer + required: + - bytes + - offset + - size + type: object + CordappInfo: + description: A CordappInfo describes a single CorDapp currently installed on + the node + example: + licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + externalDocs: + description: Official Corda Documentation of the class CordappInfo + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.cordapp/-cordapp-info/index.html + properties: + jarHash: + $ref: '#/components/schemas/SHA256' + licence: + description: The name of the licence this CorDapp is released under + type: string + minimumPlatformVersion: + description: The minimum platform version the node must be at for the CorDapp + to run + type: integer + name: + description: The name of the JAR file that defines the CorDapp + type: string + shortName: + description: The name of the CorDapp + type: string + targetPlatformVersion: + description: The target platform version this CorDapp has been tested against + type: integer + type: + description: "A description of what sort of CorDapp this is - either a contract,\ + \ workflow, or a combination." + type: string + vendor: + description: The vendor of this CorDapp + type: string + version: + description: The version of this CorDapp + type: string + required: + - jarHash + - licence + - minimumPlatformVersion + - name + - shortName + - targetPlatformVersion + - type + - vendor + - version + type: object + NodeDiagnosticInfo: + description: A NodeDiagnosticInfo holds information about the current node version. + example: + vendor: vendor + platformVersion: 1 + version: version + cordapps: + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + revision: revision + externalDocs: + description: Official Corda Documentation of the class NodeDiagnosticInfo + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.node/-node-diagnostic-info/index.html + properties: + cordapps: + description: A list of CorDapps currently installed on this node + items: + $ref: '#/components/schemas/CordappInfo' + maxItems: 4096 + minItems: 0 + type: array + platformVersion: + description: "The platform version of this node. This number represents\ + \ a released API version, and should be used to make functionality decisions\ + \ (e.g. enabling an app feature only if an underlying platform feature\ + \ exists)" + type: integer + revision: + description: The git commit hash this node was built from + type: string + vendor: + description: The vendor of this node + type: string + version: + description: "The current node version string, e.g. 4.3, 4.4-SNAPSHOT. Note\ + \ that this string is effectively freeform, and so should only be used\ + \ for providing diagnostic information. It should not be used to make\ + \ functionality decisions (the platformVersion is a better fit for this)." + type: string + required: + - cordapps + - platformVersion + - revision + - vendor + - version + type: object + FlowInvocationType: + description: Determines which flow starting method will be used on the back-end + when invoking the flow. Based on the value here the plugin back-end might + invoke the rpc.startFlowDynamic() method or the rpc.startTrackedFlowDynamic() + method. Streamed responses are aggregated and returned in a single response + to HTTP callers who are not equipped to handle streams like WebSocket/gRPC/etc. + do. + enum: + - TRACKED_FLOW_DYNAMIC + - FLOW_DYNAMIC + nullable: false + type: string + JarFile: + additionalProperties: true + example: + filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + properties: + filename: + maxLength: 255 + minLength: 1 + nullable: false + type: string + hasDbMigrations: + description: Indicates whether the cordapp jar in question contains any + embedded migrations that Cactus can/should execute between copying the + jar into the cordapp directory and starting the node back up. + nullable: false + type: boolean + contentBase64: + format: base64 + maxLength: 1073741824 + minLength: 1 + nullable: false + type: string + required: + - contentBase64 + - filename + - hasDbMigrations + type: object + JvmType: + description: Represents a reference to a JVM type (such as a Java class) + example: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + properties: + fqClassName: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + constructorName: + description: This parameter is used to specify that the function used to + construct this JvmType is not a constructor function but instead is a + factory function. Setting this parameter will cause the plugin to look + up methods of the class denoted by fqClassName instead of its constructors. + maxLength: 65535 + minLength: 1 + nullable: false + type: string + invocationTarget: + $ref: '#/components/schemas/JvmObject' + required: + - fqClassName + type: object + JvmTypeKind: + enum: + - PRIMITIVE + - REFERENCE + nullable: false + type: string + JvmObject: + description: "Can represent JVM primitive and reference types as well. The jvmTypeKind\ + \ field indicates which one is being stored. If the jvmTypeKind field is set\ + \ to REFERENCE then the jvmCtorArgs array is expected to be filled, otherwise\ + \ (e.g. PRIMITIVE jvmTypeKind) it is expected that the primitiveValue property\ + \ is filled with a primitive data type supported by the JSON standard such\ + \ as strings, booleans, numbers, etc." + example: + jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + properties: + jvmTypeKind: + $ref: '#/components/schemas/JvmTypeKind' + primitiveValue: + type: object + jvmCtorArgs: + default: [] + items: + $ref: '#/components/schemas/JvmObject' + maxLength: 1024 + minLength: 0 + nullable: false + type: array + jvmType: + $ref: '#/components/schemas/JvmType' + required: + - jvmType + - jvmTypeKind + type: object + CordappDeploymentConfig: + example: + cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + sshCredentials: + $ref: '#/components/schemas/CordaNodeSshCredentials' + rpcCredentials: + $ref: '#/components/schemas/CordaRpcCredentials' + cordaNodeStartCmd: + description: The shell command to execute in order to start back up a Corda + node after having placed new jars in the cordapp directory of said node. + example: ./build/nodes/runNodes + maxLength: 65535 + minLength: 1 + nullable: false + type: string + cordappDir: + description: The absolute file system path where the Corda Node is expecting + deployed Cordapp jar files to be placed. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + cordaJarPath: + description: The absolute file system path where the corda.jar file of the + node can be found. This is used to execute database schema migrations + where applicable (H2 database in use in development environments). + maxLength: 2048 + minLength: 1 + nullable: false + type: string + nodeBaseDirPath: + description: The absolute file system path where the base directory of the + Corda node can be found. This is used to pass in to corda.jar when being + invoked for certain tasks such as executing database schema migrations + for a deployed contract. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + required: + - cordaJarPath + - cordaNodeStartCmd + - cordappDir + - nodeBaseDirPath + - rpcCredentials + - sshCredentials + type: object + CordaRpcCredentials: + example: + hostname: hostname + password: password + port: 39501 + username: username + properties: + hostname: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + port: + maximum: 65535 + minimum: 1 + nullable: false + type: integer + username: + maxLength: 1024 + minLength: 1 + nullable: false + type: string + password: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + required: + - hostname + - password + - port + - username + type: object + CordaNodeSshCredentials: + example: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + hostKeyEntry: + example: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + maxLength: 65535 + minLength: 1 + nullable: false + type: string + username: + maxLength: 32 + minLength: 1 + nullable: false + type: string + password: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + hostname: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + port: + maximum: 65535 + minimum: 1 + nullable: false + type: integer + required: + - hostKeyEntry + - hostname + - password + - port + - username + type: object + DeployContractJarsV1Request: + additionalProperties: false + example: + jarFiles: + - filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + - filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + cordappDeploymentConfigs: + - cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + - cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + cordappDeploymentConfigs: + default: [] + description: The list of deployment configurations pointing to the nodes + where the provided cordapp jar files are to be deployed . + items: + $ref: '#/components/schemas/CordappDeploymentConfig' + maxLength: 1024 + minLength: 0 + type: array + jarFiles: + items: + $ref: '#/components/schemas/JarFile' + nullable: false + type: array + required: + - cordappDeploymentConfigs + - jarFiles + type: object + DeployContractJarsSuccessV1Response: + example: + deployedJarFiles: + - deployedJarFiles + - deployedJarFiles + properties: + deployedJarFiles: + items: + minItems: 1 + nullable: false + type: string + type: array + required: + - deployedJarFiles + type: object + DeployContractJarsBadRequestV1Response: + properties: + errors: + items: + maxItems: 2048 + maxLength: 65535 + minItems: 1 + minLength: 1 + type: string + type: array + required: + - errors + type: object + InvokeContractV1Request: + additionalProperties: false + example: + flowInvocationType: null + timeoutMs: 0 + flowFullClassName: net.corda.samples.obligation.flows.IOUIssueFlow + params: + - jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + - jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + properties: + flowFullClassName: + description: The fully qualified name of the Corda flow to invoke + example: net.corda.samples.obligation.flows.IOUIssueFlow + maxLength: 1024 + minLength: 1 + nullable: false + type: string + flowInvocationType: + $ref: '#/components/schemas/FlowInvocationType' + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: + $ref: '#/components/schemas/JvmObject' + nullable: false + type: array + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. + minimum: 0 + nullable: false + type: integer + required: + - flowFullClassName + - flowInvocationType + - params + - signingCredential + type: object + InvokeContractV1Response: + example: + callOutput: "{}" + success: true + progress: + - progress + - progress + flowId: flowId + transactionId: transactionId + properties: + success: + nullable: false + type: boolean + callOutput: + description: Data returned from the JVM when no transaction is running + type: object + transactionId: + description: The net.corda.core.flows.StateMachineRunId value returned by + the flow execution. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + progress: + default: [] + description: "An array of strings representing the aggregated stream of\ + \ progress updates provided by a *tracked* flow invocation. If the flow\ + \ invocation was not tracked, this array is still returned, but as empty." + items: + maxItems: 10000000 + minItems: 0 + type: string + type: array + flowId: + description: The id for the flow handle + type: string + required: + - callOutput + - flowId + - success + type: object + StartMonitorV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + StartMonitorV1Response: + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if monitoring started correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + GetMonitorTransactionsV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + GetMonitorTransactionsV1Response: + example: + msg: msg + tx: + - data: data + index: index + - data: data + index: index + success: true + stateFullClassName: net.corda.samples.example.states.IOUState + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + tx: + default: [] + items: + $ref: '#/components/schemas/GetMonitorTransactionsV1Response_tx_inner' + type: array + required: + - msg + - success + type: object + ClearMonitorTransactionsV1Request: + additionalProperties: false + example: + txIndexes: + - txIndexes + - txIndexes + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + txIndexes: + default: [] + items: + type: string + type: array + required: + - clientAppId + - stateFullClassName + - txIndexes + type: object + ClearMonitorTransactionsV1Response: + additionalProperties: false + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + StopMonitorV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + StopMonitorV1Response: + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + ListFlowsV1Request: + additionalProperties: false + example: + filter: filter + properties: + filter: + type: string + type: object + ListFlowsV1Response: + example: + flowNames: + - net.corda.finance.flows.CashExitFlow + - net.corda.finance.flows.CashIssueAndPaymentFlow + - net.corda.finance.flows.CashIssueFlow + - net.corda.finance.flows.CashPaymentFlow + - net.corda.finance.internal.CashConfigDataFlow + - net.corda.samples.obligation.flows.IOUIssueFlow + - net.corda.samples.obligation.flows.IOUSettleFlow + - net.corda.samples.obligation.flows.IOUTransferFlow + - net.corda.samples.obligation.flows.SelfIssueCashFlow + properties: + flowNames: + default: [] + description: An array of strings storing the names of the flows as returned + by the flowList Corda RPC. + example: + - net.corda.finance.flows.CashExitFlow + - net.corda.finance.flows.CashIssueAndPaymentFlow + - net.corda.finance.flows.CashIssueFlow + - net.corda.finance.flows.CashPaymentFlow + - net.corda.finance.internal.CashConfigDataFlow + - net.corda.samples.obligation.flows.IOUIssueFlow + - net.corda.samples.obligation.flows.IOUSettleFlow + - net.corda.samples.obligation.flows.IOUTransferFlow + - net.corda.samples.obligation.flows.SelfIssueCashFlow + items: + maxItems: 10000000 + minItems: 0 + type: string + type: array + required: + - flowNames + type: object + NetworkHostAndPort: + example: + port: 0.8008281904610115 + host: host + properties: + host: + type: string + port: + type: number + required: + - host + - port + type: object + PartyAndCertificate: + type: object + PublicKey: + description: An instance of a java.security.PublicKey (which is an interface) + implementation such as org.hyperledger.cactus.plugin.ledger.connector.corda.server.impl.PublicKeyImpl + example: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + properties: + algorithm: + example: EdDSA + type: string + format: + example: X.509 + type: string + encoded: + example: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + type: string + required: + - algorithm + - encoded + - format + type: object + X500Principal: + example: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + properties: + name: + example: "O=PartyA,L=London,C=GB" + type: string + encoded: + description: Base64 encoded public key + example: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + type: string + required: + - encoded + - name + type: object + CordaX500Name: + example: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + properties: + commonName: + type: string + organisationUnit: + type: string + organisation: + example: PartyA + type: string + locality: + example: London + type: string + state: + type: string + country: + example: GB + type: string + x500Principal: + $ref: '#/components/schemas/X500Principal' + required: + - country + - locality + - organisation + - x500Principal + type: object + Party: + example: + owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + properties: + name: + $ref: '#/components/schemas/CordaX500Name' + owningKey: + $ref: '#/components/schemas/PublicKey' + required: + - name + - owningKey + type: object + NodeInfo: + example: + legalIdentities: + - owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + - owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + addresses: + - port: 0.8008281904610115 + host: host + - port: 0.8008281904610115 + host: host + serial: 1.4658129805029452 + platformVersion: 6 + legalIdentitiesAndCerts: + - null + - null + properties: + addresses: + items: + $ref: '#/components/schemas/NetworkHostAndPort' + type: array + platformVersion: + type: integer + serial: + type: number + legalIdentities: + items: + $ref: '#/components/schemas/Party' + type: array + legalIdentitiesAndCerts: + items: + $ref: '#/components/schemas/PartyAndCertificate' + type: array + required: + - addresses + - legalIdentities + - legalIdentitiesAndCerts + - platformVersion + - serial + type: object + NetworkMapV1Request: + type: object + NetworkMapV1Response: + items: + $ref: '#/components/schemas/NodeInfo' + maxItems: 2048 + minItems: 1 + nullable: false + type: array + DiagnoseNodeV1Request: + additionalProperties: false + example: + nodeIds: + - nodeIds + - nodeIds + - nodeIds + - nodeIds + - nodeIds + properties: + nodeIds: + default: [] + description: "Optional property specifying which Corda Node should be the\ + \ one being diagnosed in case the Connector has multiple connections established\ + \ for different nodes (which is not yet a supported feature, but we want\ + \ to keep this possibility open for the future)." + items: + nullable: false + type: string + maxItems: 1024 + minItems: 0 + type: array + type: object + DiagnoseNodeV1Response: + example: + nodeDiagnosticInfo: + vendor: vendor + platformVersion: 1 + version: version + cordapps: + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + revision: revision + properties: + nodeDiagnosticInfo: + $ref: '#/components/schemas/NodeDiagnosticInfo' + required: + - nodeDiagnosticInfo + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetMonitorTransactionsV1Response_tx_inner: + example: + data: data + index: index + properties: + index: + type: string + data: + maxItems: 10000000 + minItems: 0 + type: string + type: object diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..8da03ca9067 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,1081 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiClearMonitorTransactionsV1Request struct { + ctx context.Context + ApiService *DefaultApiService + clearMonitorTransactionsV1Request *ClearMonitorTransactionsV1Request +} + +func (r ApiClearMonitorTransactionsV1Request) ClearMonitorTransactionsV1Request(clearMonitorTransactionsV1Request ClearMonitorTransactionsV1Request) ApiClearMonitorTransactionsV1Request { + r.clearMonitorTransactionsV1Request = &clearMonitorTransactionsV1Request + return r +} + +func (r ApiClearMonitorTransactionsV1Request) Execute() (*ClearMonitorTransactionsV1Response, *http.Response, error) { + return r.ApiService.ClearMonitorTransactionsV1Execute(r) +} + +/* +ClearMonitorTransactionsV1 Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiClearMonitorTransactionsV1Request +*/ +func (a *DefaultApiService) ClearMonitorTransactionsV1(ctx context.Context) ApiClearMonitorTransactionsV1Request { + return ApiClearMonitorTransactionsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ClearMonitorTransactionsV1Response +func (a *DefaultApiService) ClearMonitorTransactionsV1Execute(r ApiClearMonitorTransactionsV1Request) (*ClearMonitorTransactionsV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ClearMonitorTransactionsV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ClearMonitorTransactionsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clearMonitorTransactionsV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeployContractJarsV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractJarsV1Request *DeployContractJarsV1Request +} + +func (r ApiDeployContractJarsV1Request) DeployContractJarsV1Request(deployContractJarsV1Request DeployContractJarsV1Request) ApiDeployContractJarsV1Request { + r.deployContractJarsV1Request = &deployContractJarsV1Request + return r +} + +func (r ApiDeployContractJarsV1Request) Execute() (*DeployContractJarsSuccessV1Response, *http.Response, error) { + return r.ApiService.DeployContractJarsV1Execute(r) +} + +/* +DeployContractJarsV1 Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractJarsV1Request +*/ +func (a *DefaultApiService) DeployContractJarsV1(ctx context.Context) ApiDeployContractJarsV1Request { + return ApiDeployContractJarsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractJarsSuccessV1Response +func (a *DefaultApiService) DeployContractJarsV1Execute(r ApiDeployContractJarsV1Request) (*DeployContractJarsSuccessV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractJarsSuccessV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractJarsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractJarsV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v DeployContractJarsBadRequestV1Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDiagnoseNodeV1Request struct { + ctx context.Context + ApiService *DefaultApiService + diagnoseNodeV1Request *DiagnoseNodeV1Request +} + +func (r ApiDiagnoseNodeV1Request) DiagnoseNodeV1Request(diagnoseNodeV1Request DiagnoseNodeV1Request) ApiDiagnoseNodeV1Request { + r.diagnoseNodeV1Request = &diagnoseNodeV1Request + return r +} + +func (r ApiDiagnoseNodeV1Request) Execute() (*DiagnoseNodeV1Response, *http.Response, error) { + return r.ApiService.DiagnoseNodeV1Execute(r) +} + +/* +DiagnoseNodeV1 Method for DiagnoseNodeV1 + +Responds with diagnostic information about the Corda node + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDiagnoseNodeV1Request +*/ +func (a *DefaultApiService) DiagnoseNodeV1(ctx context.Context) ApiDiagnoseNodeV1Request { + return ApiDiagnoseNodeV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DiagnoseNodeV1Response +func (a *DefaultApiService) DiagnoseNodeV1Execute(r ApiDiagnoseNodeV1Request) (*DiagnoseNodeV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DiagnoseNodeV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DiagnoseNodeV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.diagnoseNodeV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetMonitorTransactionsV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getMonitorTransactionsV1Request *GetMonitorTransactionsV1Request +} + +func (r ApiGetMonitorTransactionsV1Request) GetMonitorTransactionsV1Request(getMonitorTransactionsV1Request GetMonitorTransactionsV1Request) ApiGetMonitorTransactionsV1Request { + r.getMonitorTransactionsV1Request = &getMonitorTransactionsV1Request + return r +} + +func (r ApiGetMonitorTransactionsV1Request) Execute() (*GetMonitorTransactionsV1Response, *http.Response, error) { + return r.ApiService.GetMonitorTransactionsV1Execute(r) +} + +/* +GetMonitorTransactionsV1 Get transactions for monitored state classes. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetMonitorTransactionsV1Request +*/ +func (a *DefaultApiService) GetMonitorTransactionsV1(ctx context.Context) ApiGetMonitorTransactionsV1Request { + return ApiGetMonitorTransactionsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetMonitorTransactionsV1Response +func (a *DefaultApiService) GetMonitorTransactionsV1Execute(r ApiGetMonitorTransactionsV1Request) (*GetMonitorTransactionsV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetMonitorTransactionsV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetMonitorTransactionsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getMonitorTransactionsV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + invokeContractV1Request *InvokeContractV1Request +} + +func (r ApiInvokeContractV1Request) InvokeContractV1Request(invokeContractV1Request InvokeContractV1Request) ApiInvokeContractV1Request { + r.invokeContractV1Request = &invokeContractV1Request + return r +} + +func (r ApiInvokeContractV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.InvokeContractV1Execute(r) +} + +/* +InvokeContractV1 Invokes a contract on a Corda ledger (e.g. a flow) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeContractV1Request +*/ +func (a *DefaultApiService) InvokeContractV1(ctx context.Context) ApiInvokeContractV1Request { + return ApiInvokeContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) InvokeContractV1Execute(r ApiInvokeContractV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListFlowsV1Request struct { + ctx context.Context + ApiService *DefaultApiService + listFlowsV1Request *ListFlowsV1Request +} + +func (r ApiListFlowsV1Request) ListFlowsV1Request(listFlowsV1Request ListFlowsV1Request) ApiListFlowsV1Request { + r.listFlowsV1Request = &listFlowsV1Request + return r +} + +func (r ApiListFlowsV1Request) Execute() (*ListFlowsV1Response, *http.Response, error) { + return r.ApiService.ListFlowsV1Execute(r) +} + +/* +ListFlowsV1 Method for ListFlowsV1 + +Responds with a list of the flows on the Corda node. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListFlowsV1Request +*/ +func (a *DefaultApiService) ListFlowsV1(ctx context.Context) ApiListFlowsV1Request { + return ApiListFlowsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListFlowsV1Response +func (a *DefaultApiService) ListFlowsV1Execute(r ApiListFlowsV1Request) (*ListFlowsV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListFlowsV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListFlowsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.listFlowsV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiNetworkMapV1Request struct { + ctx context.Context + ApiService *DefaultApiService + body *map[string]interface{} +} + +func (r ApiNetworkMapV1Request) Body(body map[string]interface{}) ApiNetworkMapV1Request { + r.body = &body + return r +} + +func (r ApiNetworkMapV1Request) Execute() ([]NodeInfo, *http.Response, error) { + return r.ApiService.NetworkMapV1Execute(r) +} + +/* +NetworkMapV1 Method for NetworkMapV1 + +Responds with a snapshot of the network map as provided by the Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun networkMapSnapshot(): List + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiNetworkMapV1Request +*/ +func (a *DefaultApiService) NetworkMapV1(ctx context.Context) ApiNetworkMapV1Request { + return ApiNetworkMapV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []NodeInfo +func (a *DefaultApiService) NetworkMapV1Execute(r ApiNetworkMapV1Request) ([]NodeInfo, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []NodeInfo + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.NetworkMapV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStartMonitorV1Request struct { + ctx context.Context + ApiService *DefaultApiService + startMonitorV1Request *StartMonitorV1Request +} + +func (r ApiStartMonitorV1Request) StartMonitorV1Request(startMonitorV1Request StartMonitorV1Request) ApiStartMonitorV1Request { + r.startMonitorV1Request = &startMonitorV1Request + return r +} + +func (r ApiStartMonitorV1Request) Execute() (*StartMonitorV1Response, *http.Response, error) { + return r.ApiService.StartMonitorV1Execute(r) +} + +/* +StartMonitorV1 Start monitoring corda changes (transactions) of given state class + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStartMonitorV1Request +*/ +func (a *DefaultApiService) StartMonitorV1(ctx context.Context) ApiStartMonitorV1Request { + return ApiStartMonitorV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return StartMonitorV1Response +func (a *DefaultApiService) StartMonitorV1Execute(r ApiStartMonitorV1Request) (*StartMonitorV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *StartMonitorV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.StartMonitorV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.startMonitorV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStopMonitorV1Request struct { + ctx context.Context + ApiService *DefaultApiService + stopMonitorV1Request *StopMonitorV1Request +} + +func (r ApiStopMonitorV1Request) StopMonitorV1Request(stopMonitorV1Request StopMonitorV1Request) ApiStopMonitorV1Request { + r.stopMonitorV1Request = &stopMonitorV1Request + return r +} + +func (r ApiStopMonitorV1Request) Execute() (*StopMonitorV1Response, *http.Response, error) { + return r.ApiService.StopMonitorV1Execute(r) +} + +/* +StopMonitorV1 Stop monitoring corda changes (transactions) of given state class + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStopMonitorV1Request +*/ +func (a *DefaultApiService) StopMonitorV1(ctx context.Context) ApiStopMonitorV1Request { + return ApiStopMonitorV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return StopMonitorV1Response +func (a *DefaultApiService) StopMonitorV1Execute(r ApiStopMonitorV1Request) (*StopMonitorV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *StopMonitorV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.StopMonitorV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.stopMonitorV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..befe12babb4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Connector Corda API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..bcc61ce1c0b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..b77723a2067 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_clear_monitor_transactions_v1_request.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_clear_monitor_transactions_v1_request.go new file mode 100644 index 00000000000..79f374ee88e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_clear_monitor_transactions_v1_request.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the ClearMonitorTransactionsV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClearMonitorTransactionsV1Request{} + +// ClearMonitorTransactionsV1Request struct for ClearMonitorTransactionsV1Request +type ClearMonitorTransactionsV1Request struct { + // ID of a client application that wants to monitor the state changes + ClientAppId string `json:"clientAppId"` + // The fully qualified name of the Corda state to monitor + StateFullClassName string `json:"stateFullClassName"` + TxIndexes []string `json:"txIndexes"` +} + +// NewClearMonitorTransactionsV1Request instantiates a new ClearMonitorTransactionsV1Request 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 +// will change when the set of required properties is changed +func NewClearMonitorTransactionsV1Request(clientAppId string, stateFullClassName string, txIndexes []string) *ClearMonitorTransactionsV1Request { + this := ClearMonitorTransactionsV1Request{} + this.ClientAppId = clientAppId + this.StateFullClassName = stateFullClassName + this.TxIndexes = txIndexes + return &this +} + +// NewClearMonitorTransactionsV1RequestWithDefaults instantiates a new ClearMonitorTransactionsV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClearMonitorTransactionsV1RequestWithDefaults() *ClearMonitorTransactionsV1Request { + this := ClearMonitorTransactionsV1Request{} + return &this +} + +// GetClientAppId returns the ClientAppId field value +func (o *ClearMonitorTransactionsV1Request) GetClientAppId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientAppId +} + +// GetClientAppIdOk returns a tuple with the ClientAppId field value +// and a boolean to check if the value has been set. +func (o *ClearMonitorTransactionsV1Request) GetClientAppIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientAppId, true +} + +// SetClientAppId sets field value +func (o *ClearMonitorTransactionsV1Request) SetClientAppId(v string) { + o.ClientAppId = v +} + +// GetStateFullClassName returns the StateFullClassName field value +func (o *ClearMonitorTransactionsV1Request) GetStateFullClassName() string { + if o == nil { + var ret string + return ret + } + + return o.StateFullClassName +} + +// GetStateFullClassNameOk returns a tuple with the StateFullClassName field value +// and a boolean to check if the value has been set. +func (o *ClearMonitorTransactionsV1Request) GetStateFullClassNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateFullClassName, true +} + +// SetStateFullClassName sets field value +func (o *ClearMonitorTransactionsV1Request) SetStateFullClassName(v string) { + o.StateFullClassName = v +} + +// GetTxIndexes returns the TxIndexes field value +func (o *ClearMonitorTransactionsV1Request) GetTxIndexes() []string { + if o == nil { + var ret []string + return ret + } + + return o.TxIndexes +} + +// GetTxIndexesOk returns a tuple with the TxIndexes field value +// and a boolean to check if the value has been set. +func (o *ClearMonitorTransactionsV1Request) GetTxIndexesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.TxIndexes, true +} + +// SetTxIndexes sets field value +func (o *ClearMonitorTransactionsV1Request) SetTxIndexes(v []string) { + o.TxIndexes = v +} + +func (o ClearMonitorTransactionsV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClearMonitorTransactionsV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["clientAppId"] = o.ClientAppId + toSerialize["stateFullClassName"] = o.StateFullClassName + toSerialize["txIndexes"] = o.TxIndexes + return toSerialize, nil +} + +type NullableClearMonitorTransactionsV1Request struct { + value *ClearMonitorTransactionsV1Request + isSet bool +} + +func (v NullableClearMonitorTransactionsV1Request) Get() *ClearMonitorTransactionsV1Request { + return v.value +} + +func (v *NullableClearMonitorTransactionsV1Request) Set(val *ClearMonitorTransactionsV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableClearMonitorTransactionsV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableClearMonitorTransactionsV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClearMonitorTransactionsV1Request(val *ClearMonitorTransactionsV1Request) *NullableClearMonitorTransactionsV1Request { + return &NullableClearMonitorTransactionsV1Request{value: val, isSet: true} +} + +func (v NullableClearMonitorTransactionsV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClearMonitorTransactionsV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_clear_monitor_transactions_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_clear_monitor_transactions_v1_response.go new file mode 100644 index 00000000000..98bad0a6890 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_clear_monitor_transactions_v1_response.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the ClearMonitorTransactionsV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClearMonitorTransactionsV1Response{} + +// ClearMonitorTransactionsV1Response struct for ClearMonitorTransactionsV1Response +type ClearMonitorTransactionsV1Response struct { + // Flag set to true if operation completed correctly. + Success bool `json:"success"` + // Message describing operation status or any errors that occurred. + Msg string `json:"msg"` +} + +// NewClearMonitorTransactionsV1Response instantiates a new ClearMonitorTransactionsV1Response 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 +// will change when the set of required properties is changed +func NewClearMonitorTransactionsV1Response(success bool, msg string) *ClearMonitorTransactionsV1Response { + this := ClearMonitorTransactionsV1Response{} + this.Success = success + this.Msg = msg + return &this +} + +// NewClearMonitorTransactionsV1ResponseWithDefaults instantiates a new ClearMonitorTransactionsV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClearMonitorTransactionsV1ResponseWithDefaults() *ClearMonitorTransactionsV1Response { + this := ClearMonitorTransactionsV1Response{} + return &this +} + +// GetSuccess returns the Success field value +func (o *ClearMonitorTransactionsV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *ClearMonitorTransactionsV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *ClearMonitorTransactionsV1Response) SetSuccess(v bool) { + o.Success = v +} + +// GetMsg returns the Msg field value +func (o *ClearMonitorTransactionsV1Response) GetMsg() string { + if o == nil { + var ret string + return ret + } + + return o.Msg +} + +// GetMsgOk returns a tuple with the Msg field value +// and a boolean to check if the value has been set. +func (o *ClearMonitorTransactionsV1Response) GetMsgOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Msg, true +} + +// SetMsg sets field value +func (o *ClearMonitorTransactionsV1Response) SetMsg(v string) { + o.Msg = v +} + +func (o ClearMonitorTransactionsV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClearMonitorTransactionsV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["success"] = o.Success + toSerialize["msg"] = o.Msg + return toSerialize, nil +} + +type NullableClearMonitorTransactionsV1Response struct { + value *ClearMonitorTransactionsV1Response + isSet bool +} + +func (v NullableClearMonitorTransactionsV1Response) Get() *ClearMonitorTransactionsV1Response { + return v.value +} + +func (v *NullableClearMonitorTransactionsV1Response) Set(val *ClearMonitorTransactionsV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableClearMonitorTransactionsV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableClearMonitorTransactionsV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClearMonitorTransactionsV1Response(val *ClearMonitorTransactionsV1Response) *NullableClearMonitorTransactionsV1Response { + return &NullableClearMonitorTransactionsV1Response{value: val, isSet: true} +} + +func (v NullableClearMonitorTransactionsV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClearMonitorTransactionsV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_node_ssh_credentials.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_node_ssh_credentials.go new file mode 100644 index 00000000000..d1b6e0ff90d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_node_ssh_credentials.go @@ -0,0 +1,225 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the CordaNodeSshCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CordaNodeSshCredentials{} + +// CordaNodeSshCredentials struct for CordaNodeSshCredentials +type CordaNodeSshCredentials struct { + HostKeyEntry string `json:"hostKeyEntry"` + Username string `json:"username"` + Password string `json:"password"` + Hostname string `json:"hostname"` + Port int32 `json:"port"` +} + +// NewCordaNodeSshCredentials instantiates a new CordaNodeSshCredentials 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 +// will change when the set of required properties is changed +func NewCordaNodeSshCredentials(hostKeyEntry string, username string, password string, hostname string, port int32) *CordaNodeSshCredentials { + this := CordaNodeSshCredentials{} + this.HostKeyEntry = hostKeyEntry + this.Username = username + this.Password = password + this.Hostname = hostname + this.Port = port + return &this +} + +// NewCordaNodeSshCredentialsWithDefaults instantiates a new CordaNodeSshCredentials object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCordaNodeSshCredentialsWithDefaults() *CordaNodeSshCredentials { + this := CordaNodeSshCredentials{} + return &this +} + +// GetHostKeyEntry returns the HostKeyEntry field value +func (o *CordaNodeSshCredentials) GetHostKeyEntry() string { + if o == nil { + var ret string + return ret + } + + return o.HostKeyEntry +} + +// GetHostKeyEntryOk returns a tuple with the HostKeyEntry field value +// and a boolean to check if the value has been set. +func (o *CordaNodeSshCredentials) GetHostKeyEntryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HostKeyEntry, true +} + +// SetHostKeyEntry sets field value +func (o *CordaNodeSshCredentials) SetHostKeyEntry(v string) { + o.HostKeyEntry = v +} + +// GetUsername returns the Username field value +func (o *CordaNodeSshCredentials) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *CordaNodeSshCredentials) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *CordaNodeSshCredentials) SetUsername(v string) { + o.Username = v +} + +// GetPassword returns the Password field value +func (o *CordaNodeSshCredentials) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *CordaNodeSshCredentials) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *CordaNodeSshCredentials) SetPassword(v string) { + o.Password = v +} + +// GetHostname returns the Hostname field value +func (o *CordaNodeSshCredentials) GetHostname() string { + if o == nil { + var ret string + return ret + } + + return o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value +// and a boolean to check if the value has been set. +func (o *CordaNodeSshCredentials) GetHostnameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hostname, true +} + +// SetHostname sets field value +func (o *CordaNodeSshCredentials) SetHostname(v string) { + o.Hostname = v +} + +// GetPort returns the Port field value +func (o *CordaNodeSshCredentials) GetPort() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Port +} + +// GetPortOk returns a tuple with the Port field value +// and a boolean to check if the value has been set. +func (o *CordaNodeSshCredentials) GetPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Port, true +} + +// SetPort sets field value +func (o *CordaNodeSshCredentials) SetPort(v int32) { + o.Port = v +} + +func (o CordaNodeSshCredentials) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CordaNodeSshCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["hostKeyEntry"] = o.HostKeyEntry + toSerialize["username"] = o.Username + toSerialize["password"] = o.Password + toSerialize["hostname"] = o.Hostname + toSerialize["port"] = o.Port + return toSerialize, nil +} + +type NullableCordaNodeSshCredentials struct { + value *CordaNodeSshCredentials + isSet bool +} + +func (v NullableCordaNodeSshCredentials) Get() *CordaNodeSshCredentials { + return v.value +} + +func (v *NullableCordaNodeSshCredentials) Set(val *CordaNodeSshCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableCordaNodeSshCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableCordaNodeSshCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCordaNodeSshCredentials(val *CordaNodeSshCredentials) *NullableCordaNodeSshCredentials { + return &NullableCordaNodeSshCredentials{value: val, isSet: true} +} + +func (v NullableCordaNodeSshCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCordaNodeSshCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_rpc_credentials.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_rpc_credentials.go new file mode 100644 index 00000000000..bbfac9577ec --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_rpc_credentials.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the CordaRpcCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CordaRpcCredentials{} + +// CordaRpcCredentials struct for CordaRpcCredentials +type CordaRpcCredentials struct { + Hostname string `json:"hostname"` + Port int32 `json:"port"` + Username string `json:"username"` + Password string `json:"password"` +} + +// NewCordaRpcCredentials instantiates a new CordaRpcCredentials 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 +// will change when the set of required properties is changed +func NewCordaRpcCredentials(hostname string, port int32, username string, password string) *CordaRpcCredentials { + this := CordaRpcCredentials{} + this.Hostname = hostname + this.Port = port + this.Username = username + this.Password = password + return &this +} + +// NewCordaRpcCredentialsWithDefaults instantiates a new CordaRpcCredentials object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCordaRpcCredentialsWithDefaults() *CordaRpcCredentials { + this := CordaRpcCredentials{} + return &this +} + +// GetHostname returns the Hostname field value +func (o *CordaRpcCredentials) GetHostname() string { + if o == nil { + var ret string + return ret + } + + return o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value +// and a boolean to check if the value has been set. +func (o *CordaRpcCredentials) GetHostnameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hostname, true +} + +// SetHostname sets field value +func (o *CordaRpcCredentials) SetHostname(v string) { + o.Hostname = v +} + +// GetPort returns the Port field value +func (o *CordaRpcCredentials) GetPort() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Port +} + +// GetPortOk returns a tuple with the Port field value +// and a boolean to check if the value has been set. +func (o *CordaRpcCredentials) GetPortOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Port, true +} + +// SetPort sets field value +func (o *CordaRpcCredentials) SetPort(v int32) { + o.Port = v +} + +// GetUsername returns the Username field value +func (o *CordaRpcCredentials) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *CordaRpcCredentials) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *CordaRpcCredentials) SetUsername(v string) { + o.Username = v +} + +// GetPassword returns the Password field value +func (o *CordaRpcCredentials) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *CordaRpcCredentials) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *CordaRpcCredentials) SetPassword(v string) { + o.Password = v +} + +func (o CordaRpcCredentials) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CordaRpcCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["hostname"] = o.Hostname + toSerialize["port"] = o.Port + toSerialize["username"] = o.Username + toSerialize["password"] = o.Password + return toSerialize, nil +} + +type NullableCordaRpcCredentials struct { + value *CordaRpcCredentials + isSet bool +} + +func (v NullableCordaRpcCredentials) Get() *CordaRpcCredentials { + return v.value +} + +func (v *NullableCordaRpcCredentials) Set(val *CordaRpcCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableCordaRpcCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableCordaRpcCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCordaRpcCredentials(val *CordaRpcCredentials) *NullableCordaRpcCredentials { + return &NullableCordaRpcCredentials{value: val, isSet: true} +} + +func (v NullableCordaRpcCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCordaRpcCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_x500_name.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_x500_name.go new file mode 100644 index 00000000000..b22a60ef5de --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_corda_x500_name.go @@ -0,0 +1,306 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the CordaX500Name type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CordaX500Name{} + +// CordaX500Name struct for CordaX500Name +type CordaX500Name struct { + CommonName *string `json:"commonName,omitempty"` + OrganisationUnit *string `json:"organisationUnit,omitempty"` + Organisation string `json:"organisation"` + Locality string `json:"locality"` + State *string `json:"state,omitempty"` + Country string `json:"country"` + X500Principal X500Principal `json:"x500Principal"` +} + +// NewCordaX500Name instantiates a new CordaX500Name 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 +// will change when the set of required properties is changed +func NewCordaX500Name(organisation string, locality string, country string, x500Principal X500Principal) *CordaX500Name { + this := CordaX500Name{} + this.Organisation = organisation + this.Locality = locality + this.Country = country + this.X500Principal = x500Principal + return &this +} + +// NewCordaX500NameWithDefaults instantiates a new CordaX500Name object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCordaX500NameWithDefaults() *CordaX500Name { + this := CordaX500Name{} + return &this +} + +// GetCommonName returns the CommonName field value if set, zero value otherwise. +func (o *CordaX500Name) GetCommonName() string { + if o == nil || IsNil(o.CommonName) { + var ret string + return ret + } + return *o.CommonName +} + +// GetCommonNameOk returns a tuple with the CommonName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CordaX500Name) GetCommonNameOk() (*string, bool) { + if o == nil || IsNil(o.CommonName) { + return nil, false + } + return o.CommonName, true +} + +// HasCommonName returns a boolean if a field has been set. +func (o *CordaX500Name) HasCommonName() bool { + if o != nil && !IsNil(o.CommonName) { + return true + } + + return false +} + +// SetCommonName gets a reference to the given string and assigns it to the CommonName field. +func (o *CordaX500Name) SetCommonName(v string) { + o.CommonName = &v +} + +// GetOrganisationUnit returns the OrganisationUnit field value if set, zero value otherwise. +func (o *CordaX500Name) GetOrganisationUnit() string { + if o == nil || IsNil(o.OrganisationUnit) { + var ret string + return ret + } + return *o.OrganisationUnit +} + +// GetOrganisationUnitOk returns a tuple with the OrganisationUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CordaX500Name) GetOrganisationUnitOk() (*string, bool) { + if o == nil || IsNil(o.OrganisationUnit) { + return nil, false + } + return o.OrganisationUnit, true +} + +// HasOrganisationUnit returns a boolean if a field has been set. +func (o *CordaX500Name) HasOrganisationUnit() bool { + if o != nil && !IsNil(o.OrganisationUnit) { + return true + } + + return false +} + +// SetOrganisationUnit gets a reference to the given string and assigns it to the OrganisationUnit field. +func (o *CordaX500Name) SetOrganisationUnit(v string) { + o.OrganisationUnit = &v +} + +// GetOrganisation returns the Organisation field value +func (o *CordaX500Name) GetOrganisation() string { + if o == nil { + var ret string + return ret + } + + return o.Organisation +} + +// GetOrganisationOk returns a tuple with the Organisation field value +// and a boolean to check if the value has been set. +func (o *CordaX500Name) GetOrganisationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Organisation, true +} + +// SetOrganisation sets field value +func (o *CordaX500Name) SetOrganisation(v string) { + o.Organisation = v +} + +// GetLocality returns the Locality field value +func (o *CordaX500Name) GetLocality() string { + if o == nil { + var ret string + return ret + } + + return o.Locality +} + +// GetLocalityOk returns a tuple with the Locality field value +// and a boolean to check if the value has been set. +func (o *CordaX500Name) GetLocalityOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Locality, true +} + +// SetLocality sets field value +func (o *CordaX500Name) SetLocality(v string) { + o.Locality = v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *CordaX500Name) GetState() string { + if o == nil || IsNil(o.State) { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CordaX500Name) GetStateOk() (*string, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *CordaX500Name) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *CordaX500Name) SetState(v string) { + o.State = &v +} + +// GetCountry returns the Country field value +func (o *CordaX500Name) GetCountry() string { + if o == nil { + var ret string + return ret + } + + return o.Country +} + +// GetCountryOk returns a tuple with the Country field value +// and a boolean to check if the value has been set. +func (o *CordaX500Name) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Country, true +} + +// SetCountry sets field value +func (o *CordaX500Name) SetCountry(v string) { + o.Country = v +} + +// GetX500Principal returns the X500Principal field value +func (o *CordaX500Name) GetX500Principal() X500Principal { + if o == nil { + var ret X500Principal + return ret + } + + return o.X500Principal +} + +// GetX500PrincipalOk returns a tuple with the X500Principal field value +// and a boolean to check if the value has been set. +func (o *CordaX500Name) GetX500PrincipalOk() (*X500Principal, bool) { + if o == nil { + return nil, false + } + return &o.X500Principal, true +} + +// SetX500Principal sets field value +func (o *CordaX500Name) SetX500Principal(v X500Principal) { + o.X500Principal = v +} + +func (o CordaX500Name) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CordaX500Name) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CommonName) { + toSerialize["commonName"] = o.CommonName + } + if !IsNil(o.OrganisationUnit) { + toSerialize["organisationUnit"] = o.OrganisationUnit + } + toSerialize["organisation"] = o.Organisation + toSerialize["locality"] = o.Locality + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + toSerialize["country"] = o.Country + toSerialize["x500Principal"] = o.X500Principal + return toSerialize, nil +} + +type NullableCordaX500Name struct { + value *CordaX500Name + isSet bool +} + +func (v NullableCordaX500Name) Get() *CordaX500Name { + return v.value +} + +func (v *NullableCordaX500Name) Set(val *CordaX500Name) { + v.value = val + v.isSet = true +} + +func (v NullableCordaX500Name) IsSet() bool { + return v.isSet +} + +func (v *NullableCordaX500Name) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCordaX500Name(val *CordaX500Name) *NullableCordaX500Name { + return &NullableCordaX500Name{value: val, isSet: true} +} + +func (v NullableCordaX500Name) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCordaX500Name) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_cordapp_deployment_config.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_cordapp_deployment_config.go new file mode 100644 index 00000000000..ed2f8bc8c93 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_cordapp_deployment_config.go @@ -0,0 +1,256 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the CordappDeploymentConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CordappDeploymentConfig{} + +// CordappDeploymentConfig struct for CordappDeploymentConfig +type CordappDeploymentConfig struct { + SshCredentials CordaNodeSshCredentials `json:"sshCredentials"` + RpcCredentials CordaRpcCredentials `json:"rpcCredentials"` + // The shell command to execute in order to start back up a Corda node after having placed new jars in the cordapp directory of said node. + CordaNodeStartCmd string `json:"cordaNodeStartCmd"` + // The absolute file system path where the Corda Node is expecting deployed Cordapp jar files to be placed. + CordappDir string `json:"cordappDir"` + // The absolute file system path where the corda.jar file of the node can be found. This is used to execute database schema migrations where applicable (H2 database in use in development environments). + CordaJarPath string `json:"cordaJarPath"` + // The absolute file system path where the base directory of the Corda node can be found. This is used to pass in to corda.jar when being invoked for certain tasks such as executing database schema migrations for a deployed contract. + NodeBaseDirPath string `json:"nodeBaseDirPath"` +} + +// NewCordappDeploymentConfig instantiates a new CordappDeploymentConfig 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 +// will change when the set of required properties is changed +func NewCordappDeploymentConfig(sshCredentials CordaNodeSshCredentials, rpcCredentials CordaRpcCredentials, cordaNodeStartCmd string, cordappDir string, cordaJarPath string, nodeBaseDirPath string) *CordappDeploymentConfig { + this := CordappDeploymentConfig{} + this.SshCredentials = sshCredentials + this.RpcCredentials = rpcCredentials + this.CordaNodeStartCmd = cordaNodeStartCmd + this.CordappDir = cordappDir + this.CordaJarPath = cordaJarPath + this.NodeBaseDirPath = nodeBaseDirPath + return &this +} + +// NewCordappDeploymentConfigWithDefaults instantiates a new CordappDeploymentConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCordappDeploymentConfigWithDefaults() *CordappDeploymentConfig { + this := CordappDeploymentConfig{} + return &this +} + +// GetSshCredentials returns the SshCredentials field value +func (o *CordappDeploymentConfig) GetSshCredentials() CordaNodeSshCredentials { + if o == nil { + var ret CordaNodeSshCredentials + return ret + } + + return o.SshCredentials +} + +// GetSshCredentialsOk returns a tuple with the SshCredentials field value +// and a boolean to check if the value has been set. +func (o *CordappDeploymentConfig) GetSshCredentialsOk() (*CordaNodeSshCredentials, bool) { + if o == nil { + return nil, false + } + return &o.SshCredentials, true +} + +// SetSshCredentials sets field value +func (o *CordappDeploymentConfig) SetSshCredentials(v CordaNodeSshCredentials) { + o.SshCredentials = v +} + +// GetRpcCredentials returns the RpcCredentials field value +func (o *CordappDeploymentConfig) GetRpcCredentials() CordaRpcCredentials { + if o == nil { + var ret CordaRpcCredentials + return ret + } + + return o.RpcCredentials +} + +// GetRpcCredentialsOk returns a tuple with the RpcCredentials field value +// and a boolean to check if the value has been set. +func (o *CordappDeploymentConfig) GetRpcCredentialsOk() (*CordaRpcCredentials, bool) { + if o == nil { + return nil, false + } + return &o.RpcCredentials, true +} + +// SetRpcCredentials sets field value +func (o *CordappDeploymentConfig) SetRpcCredentials(v CordaRpcCredentials) { + o.RpcCredentials = v +} + +// GetCordaNodeStartCmd returns the CordaNodeStartCmd field value +func (o *CordappDeploymentConfig) GetCordaNodeStartCmd() string { + if o == nil { + var ret string + return ret + } + + return o.CordaNodeStartCmd +} + +// GetCordaNodeStartCmdOk returns a tuple with the CordaNodeStartCmd field value +// and a boolean to check if the value has been set. +func (o *CordappDeploymentConfig) GetCordaNodeStartCmdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CordaNodeStartCmd, true +} + +// SetCordaNodeStartCmd sets field value +func (o *CordappDeploymentConfig) SetCordaNodeStartCmd(v string) { + o.CordaNodeStartCmd = v +} + +// GetCordappDir returns the CordappDir field value +func (o *CordappDeploymentConfig) GetCordappDir() string { + if o == nil { + var ret string + return ret + } + + return o.CordappDir +} + +// GetCordappDirOk returns a tuple with the CordappDir field value +// and a boolean to check if the value has been set. +func (o *CordappDeploymentConfig) GetCordappDirOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CordappDir, true +} + +// SetCordappDir sets field value +func (o *CordappDeploymentConfig) SetCordappDir(v string) { + o.CordappDir = v +} + +// GetCordaJarPath returns the CordaJarPath field value +func (o *CordappDeploymentConfig) GetCordaJarPath() string { + if o == nil { + var ret string + return ret + } + + return o.CordaJarPath +} + +// GetCordaJarPathOk returns a tuple with the CordaJarPath field value +// and a boolean to check if the value has been set. +func (o *CordappDeploymentConfig) GetCordaJarPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CordaJarPath, true +} + +// SetCordaJarPath sets field value +func (o *CordappDeploymentConfig) SetCordaJarPath(v string) { + o.CordaJarPath = v +} + +// GetNodeBaseDirPath returns the NodeBaseDirPath field value +func (o *CordappDeploymentConfig) GetNodeBaseDirPath() string { + if o == nil { + var ret string + return ret + } + + return o.NodeBaseDirPath +} + +// GetNodeBaseDirPathOk returns a tuple with the NodeBaseDirPath field value +// and a boolean to check if the value has been set. +func (o *CordappDeploymentConfig) GetNodeBaseDirPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NodeBaseDirPath, true +} + +// SetNodeBaseDirPath sets field value +func (o *CordappDeploymentConfig) SetNodeBaseDirPath(v string) { + o.NodeBaseDirPath = v +} + +func (o CordappDeploymentConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CordappDeploymentConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sshCredentials"] = o.SshCredentials + toSerialize["rpcCredentials"] = o.RpcCredentials + toSerialize["cordaNodeStartCmd"] = o.CordaNodeStartCmd + toSerialize["cordappDir"] = o.CordappDir + toSerialize["cordaJarPath"] = o.CordaJarPath + toSerialize["nodeBaseDirPath"] = o.NodeBaseDirPath + return toSerialize, nil +} + +type NullableCordappDeploymentConfig struct { + value *CordappDeploymentConfig + isSet bool +} + +func (v NullableCordappDeploymentConfig) Get() *CordappDeploymentConfig { + return v.value +} + +func (v *NullableCordappDeploymentConfig) Set(val *CordappDeploymentConfig) { + v.value = val + v.isSet = true +} + +func (v NullableCordappDeploymentConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableCordappDeploymentConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCordappDeploymentConfig(val *CordappDeploymentConfig) *NullableCordappDeploymentConfig { + return &NullableCordappDeploymentConfig{value: val, isSet: true} +} + +func (v NullableCordappDeploymentConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCordappDeploymentConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_cordapp_info.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_cordapp_info.go new file mode 100644 index 00000000000..97c9d337a94 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_cordapp_info.go @@ -0,0 +1,341 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the CordappInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CordappInfo{} + +// CordappInfo A CordappInfo describes a single CorDapp currently installed on the node +type CordappInfo struct { + JarHash SHA256 `json:"jarHash"` + // The name of the licence this CorDapp is released under + Licence string `json:"licence"` + // The minimum platform version the node must be at for the CorDapp to run + MinimumPlatformVersion int32 `json:"minimumPlatformVersion"` + // The name of the JAR file that defines the CorDapp + Name string `json:"name"` + // The name of the CorDapp + ShortName string `json:"shortName"` + // The target platform version this CorDapp has been tested against + TargetPlatformVersion int32 `json:"targetPlatformVersion"` + // A description of what sort of CorDapp this is - either a contract, workflow, or a combination. + Type string `json:"type"` + // The vendor of this CorDapp + Vendor string `json:"vendor"` + // The version of this CorDapp + Version string `json:"version"` +} + +// NewCordappInfo instantiates a new CordappInfo 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 +// will change when the set of required properties is changed +func NewCordappInfo(jarHash SHA256, licence string, minimumPlatformVersion int32, name string, shortName string, targetPlatformVersion int32, type_ string, vendor string, version string) *CordappInfo { + this := CordappInfo{} + this.JarHash = jarHash + this.Licence = licence + this.MinimumPlatformVersion = minimumPlatformVersion + this.Name = name + this.ShortName = shortName + this.TargetPlatformVersion = targetPlatformVersion + this.Type = type_ + this.Vendor = vendor + this.Version = version + return &this +} + +// NewCordappInfoWithDefaults instantiates a new CordappInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCordappInfoWithDefaults() *CordappInfo { + this := CordappInfo{} + return &this +} + +// GetJarHash returns the JarHash field value +func (o *CordappInfo) GetJarHash() SHA256 { + if o == nil { + var ret SHA256 + return ret + } + + return o.JarHash +} + +// GetJarHashOk returns a tuple with the JarHash field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetJarHashOk() (SHA256, bool) { + if o == nil { + return SHA256{}, false + } + return o.JarHash, true +} + +// SetJarHash sets field value +func (o *CordappInfo) SetJarHash(v SHA256) { + o.JarHash = v +} + +// GetLicence returns the Licence field value +func (o *CordappInfo) GetLicence() string { + if o == nil { + var ret string + return ret + } + + return o.Licence +} + +// GetLicenceOk returns a tuple with the Licence field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetLicenceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Licence, true +} + +// SetLicence sets field value +func (o *CordappInfo) SetLicence(v string) { + o.Licence = v +} + +// GetMinimumPlatformVersion returns the MinimumPlatformVersion field value +func (o *CordappInfo) GetMinimumPlatformVersion() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MinimumPlatformVersion +} + +// GetMinimumPlatformVersionOk returns a tuple with the MinimumPlatformVersion field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetMinimumPlatformVersionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MinimumPlatformVersion, true +} + +// SetMinimumPlatformVersion sets field value +func (o *CordappInfo) SetMinimumPlatformVersion(v int32) { + o.MinimumPlatformVersion = v +} + +// GetName returns the Name field value +func (o *CordappInfo) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CordappInfo) SetName(v string) { + o.Name = v +} + +// GetShortName returns the ShortName field value +func (o *CordappInfo) GetShortName() string { + if o == nil { + var ret string + return ret + } + + return o.ShortName +} + +// GetShortNameOk returns a tuple with the ShortName field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetShortNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ShortName, true +} + +// SetShortName sets field value +func (o *CordappInfo) SetShortName(v string) { + o.ShortName = v +} + +// GetTargetPlatformVersion returns the TargetPlatformVersion field value +func (o *CordappInfo) GetTargetPlatformVersion() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TargetPlatformVersion +} + +// GetTargetPlatformVersionOk returns a tuple with the TargetPlatformVersion field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetTargetPlatformVersionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TargetPlatformVersion, true +} + +// SetTargetPlatformVersion sets field value +func (o *CordappInfo) SetTargetPlatformVersion(v int32) { + o.TargetPlatformVersion = v +} + +// GetType returns the Type field value +func (o *CordappInfo) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *CordappInfo) SetType(v string) { + o.Type = v +} + +// GetVendor returns the Vendor field value +func (o *CordappInfo) GetVendor() string { + if o == nil { + var ret string + return ret + } + + return o.Vendor +} + +// GetVendorOk returns a tuple with the Vendor field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetVendorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Vendor, true +} + +// SetVendor sets field value +func (o *CordappInfo) SetVendor(v string) { + o.Vendor = v +} + +// GetVersion returns the Version field value +func (o *CordappInfo) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *CordappInfo) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *CordappInfo) SetVersion(v string) { + o.Version = v +} + +func (o CordappInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CordappInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["jarHash"] = o.JarHash + toSerialize["licence"] = o.Licence + toSerialize["minimumPlatformVersion"] = o.MinimumPlatformVersion + toSerialize["name"] = o.Name + toSerialize["shortName"] = o.ShortName + toSerialize["targetPlatformVersion"] = o.TargetPlatformVersion + toSerialize["type"] = o.Type + toSerialize["vendor"] = o.Vendor + toSerialize["version"] = o.Version + return toSerialize, nil +} + +type NullableCordappInfo struct { + value *CordappInfo + isSet bool +} + +func (v NullableCordappInfo) Get() *CordappInfo { + return v.value +} + +func (v *NullableCordappInfo) Set(val *CordappInfo) { + v.value = val + v.isSet = true +} + +func (v NullableCordappInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableCordappInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCordappInfo(val *CordappInfo) *NullableCordappInfo { + return &NullableCordappInfo{value: val, isSet: true} +} + +func (v NullableCordappInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCordappInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_bad_request_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_bad_request_v1_response.go new file mode 100644 index 00000000000..7e3c0a98980 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_bad_request_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the DeployContractJarsBadRequestV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractJarsBadRequestV1Response{} + +// DeployContractJarsBadRequestV1Response struct for DeployContractJarsBadRequestV1Response +type DeployContractJarsBadRequestV1Response struct { + Errors []string `json:"errors"` +} + +// NewDeployContractJarsBadRequestV1Response instantiates a new DeployContractJarsBadRequestV1Response 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 +// will change when the set of required properties is changed +func NewDeployContractJarsBadRequestV1Response(errors []string) *DeployContractJarsBadRequestV1Response { + this := DeployContractJarsBadRequestV1Response{} + this.Errors = errors + return &this +} + +// NewDeployContractJarsBadRequestV1ResponseWithDefaults instantiates a new DeployContractJarsBadRequestV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractJarsBadRequestV1ResponseWithDefaults() *DeployContractJarsBadRequestV1Response { + this := DeployContractJarsBadRequestV1Response{} + return &this +} + +// GetErrors returns the Errors field value +func (o *DeployContractJarsBadRequestV1Response) GetErrors() []string { + if o == nil { + var ret []string + return ret + } + + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value +// and a boolean to check if the value has been set. +func (o *DeployContractJarsBadRequestV1Response) GetErrorsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Errors, true +} + +// SetErrors sets field value +func (o *DeployContractJarsBadRequestV1Response) SetErrors(v []string) { + o.Errors = v +} + +func (o DeployContractJarsBadRequestV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractJarsBadRequestV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["errors"] = o.Errors + return toSerialize, nil +} + +type NullableDeployContractJarsBadRequestV1Response struct { + value *DeployContractJarsBadRequestV1Response + isSet bool +} + +func (v NullableDeployContractJarsBadRequestV1Response) Get() *DeployContractJarsBadRequestV1Response { + return v.value +} + +func (v *NullableDeployContractJarsBadRequestV1Response) Set(val *DeployContractJarsBadRequestV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractJarsBadRequestV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractJarsBadRequestV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractJarsBadRequestV1Response(val *DeployContractJarsBadRequestV1Response) *NullableDeployContractJarsBadRequestV1Response { + return &NullableDeployContractJarsBadRequestV1Response{value: val, isSet: true} +} + +func (v NullableDeployContractJarsBadRequestV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractJarsBadRequestV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_success_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_success_v1_response.go new file mode 100644 index 00000000000..48421d80e68 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_success_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the DeployContractJarsSuccessV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractJarsSuccessV1Response{} + +// DeployContractJarsSuccessV1Response struct for DeployContractJarsSuccessV1Response +type DeployContractJarsSuccessV1Response struct { + DeployedJarFiles []string `json:"deployedJarFiles"` +} + +// NewDeployContractJarsSuccessV1Response instantiates a new DeployContractJarsSuccessV1Response 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 +// will change when the set of required properties is changed +func NewDeployContractJarsSuccessV1Response(deployedJarFiles []string) *DeployContractJarsSuccessV1Response { + this := DeployContractJarsSuccessV1Response{} + this.DeployedJarFiles = deployedJarFiles + return &this +} + +// NewDeployContractJarsSuccessV1ResponseWithDefaults instantiates a new DeployContractJarsSuccessV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractJarsSuccessV1ResponseWithDefaults() *DeployContractJarsSuccessV1Response { + this := DeployContractJarsSuccessV1Response{} + return &this +} + +// GetDeployedJarFiles returns the DeployedJarFiles field value +func (o *DeployContractJarsSuccessV1Response) GetDeployedJarFiles() []string { + if o == nil { + var ret []string + return ret + } + + return o.DeployedJarFiles +} + +// GetDeployedJarFilesOk returns a tuple with the DeployedJarFiles field value +// and a boolean to check if the value has been set. +func (o *DeployContractJarsSuccessV1Response) GetDeployedJarFilesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.DeployedJarFiles, true +} + +// SetDeployedJarFiles sets field value +func (o *DeployContractJarsSuccessV1Response) SetDeployedJarFiles(v []string) { + o.DeployedJarFiles = v +} + +func (o DeployContractJarsSuccessV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractJarsSuccessV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["deployedJarFiles"] = o.DeployedJarFiles + return toSerialize, nil +} + +type NullableDeployContractJarsSuccessV1Response struct { + value *DeployContractJarsSuccessV1Response + isSet bool +} + +func (v NullableDeployContractJarsSuccessV1Response) Get() *DeployContractJarsSuccessV1Response { + return v.value +} + +func (v *NullableDeployContractJarsSuccessV1Response) Set(val *DeployContractJarsSuccessV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractJarsSuccessV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractJarsSuccessV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractJarsSuccessV1Response(val *DeployContractJarsSuccessV1Response) *NullableDeployContractJarsSuccessV1Response { + return &NullableDeployContractJarsSuccessV1Response{value: val, isSet: true} +} + +func (v NullableDeployContractJarsSuccessV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractJarsSuccessV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_v1_request.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_v1_request.go new file mode 100644 index 00000000000..0baff183249 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_deploy_contract_jars_v1_request.go @@ -0,0 +1,145 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the DeployContractJarsV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractJarsV1Request{} + +// DeployContractJarsV1Request struct for DeployContractJarsV1Request +type DeployContractJarsV1Request struct { + // The list of deployment configurations pointing to the nodes where the provided cordapp jar files are to be deployed . + CordappDeploymentConfigs []CordappDeploymentConfig `json:"cordappDeploymentConfigs"` + JarFiles []JarFile `json:"jarFiles"` +} + +// NewDeployContractJarsV1Request instantiates a new DeployContractJarsV1Request 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 +// will change when the set of required properties is changed +func NewDeployContractJarsV1Request(cordappDeploymentConfigs []CordappDeploymentConfig, jarFiles []JarFile) *DeployContractJarsV1Request { + this := DeployContractJarsV1Request{} + this.CordappDeploymentConfigs = cordappDeploymentConfigs + this.JarFiles = jarFiles + return &this +} + +// NewDeployContractJarsV1RequestWithDefaults instantiates a new DeployContractJarsV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractJarsV1RequestWithDefaults() *DeployContractJarsV1Request { + this := DeployContractJarsV1Request{} + return &this +} + +// GetCordappDeploymentConfigs returns the CordappDeploymentConfigs field value +func (o *DeployContractJarsV1Request) GetCordappDeploymentConfigs() []CordappDeploymentConfig { + if o == nil { + var ret []CordappDeploymentConfig + return ret + } + + return o.CordappDeploymentConfigs +} + +// GetCordappDeploymentConfigsOk returns a tuple with the CordappDeploymentConfigs field value +// and a boolean to check if the value has been set. +func (o *DeployContractJarsV1Request) GetCordappDeploymentConfigsOk() ([]CordappDeploymentConfig, bool) { + if o == nil { + return nil, false + } + return o.CordappDeploymentConfigs, true +} + +// SetCordappDeploymentConfigs sets field value +func (o *DeployContractJarsV1Request) SetCordappDeploymentConfigs(v []CordappDeploymentConfig) { + o.CordappDeploymentConfigs = v +} + +// GetJarFiles returns the JarFiles field value +func (o *DeployContractJarsV1Request) GetJarFiles() []JarFile { + if o == nil { + var ret []JarFile + return ret + } + + return o.JarFiles +} + +// GetJarFilesOk returns a tuple with the JarFiles field value +// and a boolean to check if the value has been set. +func (o *DeployContractJarsV1Request) GetJarFilesOk() ([]JarFile, bool) { + if o == nil { + return nil, false + } + return o.JarFiles, true +} + +// SetJarFiles sets field value +func (o *DeployContractJarsV1Request) SetJarFiles(v []JarFile) { + o.JarFiles = v +} + +func (o DeployContractJarsV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractJarsV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cordappDeploymentConfigs"] = o.CordappDeploymentConfigs + toSerialize["jarFiles"] = o.JarFiles + return toSerialize, nil +} + +type NullableDeployContractJarsV1Request struct { + value *DeployContractJarsV1Request + isSet bool +} + +func (v NullableDeployContractJarsV1Request) Get() *DeployContractJarsV1Request { + return v.value +} + +func (v *NullableDeployContractJarsV1Request) Set(val *DeployContractJarsV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractJarsV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractJarsV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractJarsV1Request(val *DeployContractJarsV1Request) *NullableDeployContractJarsV1Request { + return &NullableDeployContractJarsV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractJarsV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractJarsV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_diagnose_node_v1_request.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_diagnose_node_v1_request.go new file mode 100644 index 00000000000..5b587d28caf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_diagnose_node_v1_request.go @@ -0,0 +1,127 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the DiagnoseNodeV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DiagnoseNodeV1Request{} + +// DiagnoseNodeV1Request struct for DiagnoseNodeV1Request +type DiagnoseNodeV1Request struct { + // Optional property specifying which Corda Node should be the one being diagnosed in case the Connector has multiple connections established for different nodes (which is not yet a supported feature, but we want to keep this possibility open for the future). + NodeIds []string `json:"nodeIds,omitempty"` +} + +// NewDiagnoseNodeV1Request instantiates a new DiagnoseNodeV1Request 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 +// will change when the set of required properties is changed +func NewDiagnoseNodeV1Request() *DiagnoseNodeV1Request { + this := DiagnoseNodeV1Request{} + return &this +} + +// NewDiagnoseNodeV1RequestWithDefaults instantiates a new DiagnoseNodeV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDiagnoseNodeV1RequestWithDefaults() *DiagnoseNodeV1Request { + this := DiagnoseNodeV1Request{} + return &this +} + +// GetNodeIds returns the NodeIds field value if set, zero value otherwise. +func (o *DiagnoseNodeV1Request) GetNodeIds() []string { + if o == nil || IsNil(o.NodeIds) { + var ret []string + return ret + } + return o.NodeIds +} + +// GetNodeIdsOk returns a tuple with the NodeIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DiagnoseNodeV1Request) GetNodeIdsOk() ([]string, bool) { + if o == nil || IsNil(o.NodeIds) { + return nil, false + } + return o.NodeIds, true +} + +// HasNodeIds returns a boolean if a field has been set. +func (o *DiagnoseNodeV1Request) HasNodeIds() bool { + if o != nil && !IsNil(o.NodeIds) { + return true + } + + return false +} + +// SetNodeIds gets a reference to the given []string and assigns it to the NodeIds field. +func (o *DiagnoseNodeV1Request) SetNodeIds(v []string) { + o.NodeIds = v +} + +func (o DiagnoseNodeV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DiagnoseNodeV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.NodeIds) { + toSerialize["nodeIds"] = o.NodeIds + } + return toSerialize, nil +} + +type NullableDiagnoseNodeV1Request struct { + value *DiagnoseNodeV1Request + isSet bool +} + +func (v NullableDiagnoseNodeV1Request) Get() *DiagnoseNodeV1Request { + return v.value +} + +func (v *NullableDiagnoseNodeV1Request) Set(val *DiagnoseNodeV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDiagnoseNodeV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDiagnoseNodeV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDiagnoseNodeV1Request(val *DiagnoseNodeV1Request) *NullableDiagnoseNodeV1Request { + return &NullableDiagnoseNodeV1Request{value: val, isSet: true} +} + +func (v NullableDiagnoseNodeV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDiagnoseNodeV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_diagnose_node_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_diagnose_node_v1_response.go new file mode 100644 index 00000000000..64dedc7c747 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_diagnose_node_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the DiagnoseNodeV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DiagnoseNodeV1Response{} + +// DiagnoseNodeV1Response struct for DiagnoseNodeV1Response +type DiagnoseNodeV1Response struct { + NodeDiagnosticInfo NodeDiagnosticInfo `json:"nodeDiagnosticInfo"` +} + +// NewDiagnoseNodeV1Response instantiates a new DiagnoseNodeV1Response 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 +// will change when the set of required properties is changed +func NewDiagnoseNodeV1Response(nodeDiagnosticInfo NodeDiagnosticInfo) *DiagnoseNodeV1Response { + this := DiagnoseNodeV1Response{} + this.NodeDiagnosticInfo = nodeDiagnosticInfo + return &this +} + +// NewDiagnoseNodeV1ResponseWithDefaults instantiates a new DiagnoseNodeV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDiagnoseNodeV1ResponseWithDefaults() *DiagnoseNodeV1Response { + this := DiagnoseNodeV1Response{} + return &this +} + +// GetNodeDiagnosticInfo returns the NodeDiagnosticInfo field value +func (o *DiagnoseNodeV1Response) GetNodeDiagnosticInfo() NodeDiagnosticInfo { + if o == nil { + var ret NodeDiagnosticInfo + return ret + } + + return o.NodeDiagnosticInfo +} + +// GetNodeDiagnosticInfoOk returns a tuple with the NodeDiagnosticInfo field value +// and a boolean to check if the value has been set. +func (o *DiagnoseNodeV1Response) GetNodeDiagnosticInfoOk() (*NodeDiagnosticInfo, bool) { + if o == nil { + return nil, false + } + return &o.NodeDiagnosticInfo, true +} + +// SetNodeDiagnosticInfo sets field value +func (o *DiagnoseNodeV1Response) SetNodeDiagnosticInfo(v NodeDiagnosticInfo) { + o.NodeDiagnosticInfo = v +} + +func (o DiagnoseNodeV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DiagnoseNodeV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["nodeDiagnosticInfo"] = o.NodeDiagnosticInfo + return toSerialize, nil +} + +type NullableDiagnoseNodeV1Response struct { + value *DiagnoseNodeV1Response + isSet bool +} + +func (v NullableDiagnoseNodeV1Response) Get() *DiagnoseNodeV1Response { + return v.value +} + +func (v *NullableDiagnoseNodeV1Response) Set(val *DiagnoseNodeV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableDiagnoseNodeV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDiagnoseNodeV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDiagnoseNodeV1Response(val *DiagnoseNodeV1Response) *NullableDiagnoseNodeV1Response { + return &NullableDiagnoseNodeV1Response{value: val, isSet: true} +} + +func (v NullableDiagnoseNodeV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDiagnoseNodeV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_flow_invocation_type.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_flow_invocation_type.go new file mode 100644 index 00000000000..eed9df1fe75 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_flow_invocation_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" + "fmt" +) + +// FlowInvocationType Determines which flow starting method will be used on the back-end when invoking the flow. Based on the value here the plugin back-end might invoke the rpc.startFlowDynamic() method or the rpc.startTrackedFlowDynamic() method. Streamed responses are aggregated and returned in a single response to HTTP callers who are not equipped to handle streams like WebSocket/gRPC/etc. do. +type FlowInvocationType string + +// List of FlowInvocationType +const ( + TRACKED_FLOW_DYNAMIC FlowInvocationType = "TRACKED_FLOW_DYNAMIC" + FLOW_DYNAMIC FlowInvocationType = "FLOW_DYNAMIC" +) + +// All allowed values of FlowInvocationType enum +var AllowedFlowInvocationTypeEnumValues = []FlowInvocationType{ + "TRACKED_FLOW_DYNAMIC", + "FLOW_DYNAMIC", +} + +func (v *FlowInvocationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FlowInvocationType(value) + for _, existing := range AllowedFlowInvocationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FlowInvocationType", value) +} + +// NewFlowInvocationTypeFromValue returns a pointer to a valid FlowInvocationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFlowInvocationTypeFromValue(v string) (*FlowInvocationType, error) { + ev := FlowInvocationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FlowInvocationType: valid values are %v", v, AllowedFlowInvocationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FlowInvocationType) IsValid() bool { + for _, existing := range AllowedFlowInvocationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FlowInvocationType value +func (v FlowInvocationType) Ptr() *FlowInvocationType { + return &v +} + +type NullableFlowInvocationType struct { + value *FlowInvocationType + isSet bool +} + +func (v NullableFlowInvocationType) Get() *FlowInvocationType { + return v.value +} + +func (v *NullableFlowInvocationType) Set(val *FlowInvocationType) { + v.value = val + v.isSet = true +} + +func (v NullableFlowInvocationType) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowInvocationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowInvocationType(val *FlowInvocationType) *NullableFlowInvocationType { + return &NullableFlowInvocationType{value: val, isSet: true} +} + +func (v NullableFlowInvocationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowInvocationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_request.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_request.go new file mode 100644 index 00000000000..175bf809438 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_request.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the GetMonitorTransactionsV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMonitorTransactionsV1Request{} + +// GetMonitorTransactionsV1Request struct for GetMonitorTransactionsV1Request +type GetMonitorTransactionsV1Request struct { + // ID of a client application that wants to monitor the state changes + ClientAppId string `json:"clientAppId"` + // The fully qualified name of the Corda state to monitor + StateFullClassName string `json:"stateFullClassName"` +} + +// NewGetMonitorTransactionsV1Request instantiates a new GetMonitorTransactionsV1Request 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 +// will change when the set of required properties is changed +func NewGetMonitorTransactionsV1Request(clientAppId string, stateFullClassName string) *GetMonitorTransactionsV1Request { + this := GetMonitorTransactionsV1Request{} + this.ClientAppId = clientAppId + this.StateFullClassName = stateFullClassName + return &this +} + +// NewGetMonitorTransactionsV1RequestWithDefaults instantiates a new GetMonitorTransactionsV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMonitorTransactionsV1RequestWithDefaults() *GetMonitorTransactionsV1Request { + this := GetMonitorTransactionsV1Request{} + return &this +} + +// GetClientAppId returns the ClientAppId field value +func (o *GetMonitorTransactionsV1Request) GetClientAppId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientAppId +} + +// GetClientAppIdOk returns a tuple with the ClientAppId field value +// and a boolean to check if the value has been set. +func (o *GetMonitorTransactionsV1Request) GetClientAppIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientAppId, true +} + +// SetClientAppId sets field value +func (o *GetMonitorTransactionsV1Request) SetClientAppId(v string) { + o.ClientAppId = v +} + +// GetStateFullClassName returns the StateFullClassName field value +func (o *GetMonitorTransactionsV1Request) GetStateFullClassName() string { + if o == nil { + var ret string + return ret + } + + return o.StateFullClassName +} + +// GetStateFullClassNameOk returns a tuple with the StateFullClassName field value +// and a boolean to check if the value has been set. +func (o *GetMonitorTransactionsV1Request) GetStateFullClassNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateFullClassName, true +} + +// SetStateFullClassName sets field value +func (o *GetMonitorTransactionsV1Request) SetStateFullClassName(v string) { + o.StateFullClassName = v +} + +func (o GetMonitorTransactionsV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMonitorTransactionsV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["clientAppId"] = o.ClientAppId + toSerialize["stateFullClassName"] = o.StateFullClassName + return toSerialize, nil +} + +type NullableGetMonitorTransactionsV1Request struct { + value *GetMonitorTransactionsV1Request + isSet bool +} + +func (v NullableGetMonitorTransactionsV1Request) Get() *GetMonitorTransactionsV1Request { + return v.value +} + +func (v *NullableGetMonitorTransactionsV1Request) Set(val *GetMonitorTransactionsV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableGetMonitorTransactionsV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMonitorTransactionsV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMonitorTransactionsV1Request(val *GetMonitorTransactionsV1Request) *NullableGetMonitorTransactionsV1Request { + return &NullableGetMonitorTransactionsV1Request{value: val, isSet: true} +} + +func (v NullableGetMonitorTransactionsV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMonitorTransactionsV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_response.go new file mode 100644 index 00000000000..ebd4a8ec1e9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_response.go @@ -0,0 +1,219 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the GetMonitorTransactionsV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMonitorTransactionsV1Response{} + +// GetMonitorTransactionsV1Response struct for GetMonitorTransactionsV1Response +type GetMonitorTransactionsV1Response struct { + // Flag set to true if operation completed correctly. + Success bool `json:"success"` + // Message describing operation status or any errors that occurred. + Msg string `json:"msg"` + // The fully qualified name of the Corda state to monitor + StateFullClassName *string `json:"stateFullClassName,omitempty"` + Tx []GetMonitorTransactionsV1ResponseTxInner `json:"tx,omitempty"` +} + +// NewGetMonitorTransactionsV1Response instantiates a new GetMonitorTransactionsV1Response 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 +// will change when the set of required properties is changed +func NewGetMonitorTransactionsV1Response(success bool, msg string) *GetMonitorTransactionsV1Response { + this := GetMonitorTransactionsV1Response{} + this.Success = success + this.Msg = msg + return &this +} + +// NewGetMonitorTransactionsV1ResponseWithDefaults instantiates a new GetMonitorTransactionsV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMonitorTransactionsV1ResponseWithDefaults() *GetMonitorTransactionsV1Response { + this := GetMonitorTransactionsV1Response{} + return &this +} + +// GetSuccess returns the Success field value +func (o *GetMonitorTransactionsV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *GetMonitorTransactionsV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *GetMonitorTransactionsV1Response) SetSuccess(v bool) { + o.Success = v +} + +// GetMsg returns the Msg field value +func (o *GetMonitorTransactionsV1Response) GetMsg() string { + if o == nil { + var ret string + return ret + } + + return o.Msg +} + +// GetMsgOk returns a tuple with the Msg field value +// and a boolean to check if the value has been set. +func (o *GetMonitorTransactionsV1Response) GetMsgOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Msg, true +} + +// SetMsg sets field value +func (o *GetMonitorTransactionsV1Response) SetMsg(v string) { + o.Msg = v +} + +// GetStateFullClassName returns the StateFullClassName field value if set, zero value otherwise. +func (o *GetMonitorTransactionsV1Response) GetStateFullClassName() string { + if o == nil || IsNil(o.StateFullClassName) { + var ret string + return ret + } + return *o.StateFullClassName +} + +// GetStateFullClassNameOk returns a tuple with the StateFullClassName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMonitorTransactionsV1Response) GetStateFullClassNameOk() (*string, bool) { + if o == nil || IsNil(o.StateFullClassName) { + return nil, false + } + return o.StateFullClassName, true +} + +// HasStateFullClassName returns a boolean if a field has been set. +func (o *GetMonitorTransactionsV1Response) HasStateFullClassName() bool { + if o != nil && !IsNil(o.StateFullClassName) { + return true + } + + return false +} + +// SetStateFullClassName gets a reference to the given string and assigns it to the StateFullClassName field. +func (o *GetMonitorTransactionsV1Response) SetStateFullClassName(v string) { + o.StateFullClassName = &v +} + +// GetTx returns the Tx field value if set, zero value otherwise. +func (o *GetMonitorTransactionsV1Response) GetTx() []GetMonitorTransactionsV1ResponseTxInner { + if o == nil || IsNil(o.Tx) { + var ret []GetMonitorTransactionsV1ResponseTxInner + return ret + } + return o.Tx +} + +// GetTxOk returns a tuple with the Tx field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMonitorTransactionsV1Response) GetTxOk() ([]GetMonitorTransactionsV1ResponseTxInner, bool) { + if o == nil || IsNil(o.Tx) { + return nil, false + } + return o.Tx, true +} + +// HasTx returns a boolean if a field has been set. +func (o *GetMonitorTransactionsV1Response) HasTx() bool { + if o != nil && !IsNil(o.Tx) { + return true + } + + return false +} + +// SetTx gets a reference to the given []GetMonitorTransactionsV1ResponseTxInner and assigns it to the Tx field. +func (o *GetMonitorTransactionsV1Response) SetTx(v []GetMonitorTransactionsV1ResponseTxInner) { + o.Tx = v +} + +func (o GetMonitorTransactionsV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMonitorTransactionsV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["success"] = o.Success + toSerialize["msg"] = o.Msg + if !IsNil(o.StateFullClassName) { + toSerialize["stateFullClassName"] = o.StateFullClassName + } + if !IsNil(o.Tx) { + toSerialize["tx"] = o.Tx + } + return toSerialize, nil +} + +type NullableGetMonitorTransactionsV1Response struct { + value *GetMonitorTransactionsV1Response + isSet bool +} + +func (v NullableGetMonitorTransactionsV1Response) Get() *GetMonitorTransactionsV1Response { + return v.value +} + +func (v *NullableGetMonitorTransactionsV1Response) Set(val *GetMonitorTransactionsV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetMonitorTransactionsV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMonitorTransactionsV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMonitorTransactionsV1Response(val *GetMonitorTransactionsV1Response) *NullableGetMonitorTransactionsV1Response { + return &NullableGetMonitorTransactionsV1Response{value: val, isSet: true} +} + +func (v NullableGetMonitorTransactionsV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMonitorTransactionsV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_response_tx_inner.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_response_tx_inner.go new file mode 100644 index 00000000000..2c33283e098 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_get_monitor_transactions_v1_response_tx_inner.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the GetMonitorTransactionsV1ResponseTxInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMonitorTransactionsV1ResponseTxInner{} + +// GetMonitorTransactionsV1ResponseTxInner struct for GetMonitorTransactionsV1ResponseTxInner +type GetMonitorTransactionsV1ResponseTxInner struct { + Index *string `json:"index,omitempty"` + Data *string `json:"data,omitempty"` +} + +// NewGetMonitorTransactionsV1ResponseTxInner instantiates a new GetMonitorTransactionsV1ResponseTxInner 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 +// will change when the set of required properties is changed +func NewGetMonitorTransactionsV1ResponseTxInner() *GetMonitorTransactionsV1ResponseTxInner { + this := GetMonitorTransactionsV1ResponseTxInner{} + return &this +} + +// NewGetMonitorTransactionsV1ResponseTxInnerWithDefaults instantiates a new GetMonitorTransactionsV1ResponseTxInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMonitorTransactionsV1ResponseTxInnerWithDefaults() *GetMonitorTransactionsV1ResponseTxInner { + this := GetMonitorTransactionsV1ResponseTxInner{} + return &this +} + +// GetIndex returns the Index field value if set, zero value otherwise. +func (o *GetMonitorTransactionsV1ResponseTxInner) GetIndex() string { + if o == nil || IsNil(o.Index) { + var ret string + return ret + } + return *o.Index +} + +// GetIndexOk returns a tuple with the Index field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMonitorTransactionsV1ResponseTxInner) GetIndexOk() (*string, bool) { + if o == nil || IsNil(o.Index) { + return nil, false + } + return o.Index, true +} + +// HasIndex returns a boolean if a field has been set. +func (o *GetMonitorTransactionsV1ResponseTxInner) HasIndex() bool { + if o != nil && !IsNil(o.Index) { + return true + } + + return false +} + +// SetIndex gets a reference to the given string and assigns it to the Index field. +func (o *GetMonitorTransactionsV1ResponseTxInner) SetIndex(v string) { + o.Index = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *GetMonitorTransactionsV1ResponseTxInner) GetData() string { + if o == nil || IsNil(o.Data) { + var ret string + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMonitorTransactionsV1ResponseTxInner) GetDataOk() (*string, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *GetMonitorTransactionsV1ResponseTxInner) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given string and assigns it to the Data field. +func (o *GetMonitorTransactionsV1ResponseTxInner) SetData(v string) { + o.Data = &v +} + +func (o GetMonitorTransactionsV1ResponseTxInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMonitorTransactionsV1ResponseTxInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Index) { + toSerialize["index"] = o.Index + } + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + return toSerialize, nil +} + +type NullableGetMonitorTransactionsV1ResponseTxInner struct { + value *GetMonitorTransactionsV1ResponseTxInner + isSet bool +} + +func (v NullableGetMonitorTransactionsV1ResponseTxInner) Get() *GetMonitorTransactionsV1ResponseTxInner { + return v.value +} + +func (v *NullableGetMonitorTransactionsV1ResponseTxInner) Set(val *GetMonitorTransactionsV1ResponseTxInner) { + v.value = val + v.isSet = true +} + +func (v NullableGetMonitorTransactionsV1ResponseTxInner) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMonitorTransactionsV1ResponseTxInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMonitorTransactionsV1ResponseTxInner(val *GetMonitorTransactionsV1ResponseTxInner) *NullableGetMonitorTransactionsV1ResponseTxInner { + return &NullableGetMonitorTransactionsV1ResponseTxInner{value: val, isSet: true} +} + +func (v NullableGetMonitorTransactionsV1ResponseTxInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMonitorTransactionsV1ResponseTxInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go new file mode 100644 index 00000000000..05d0207a1ff --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go @@ -0,0 +1,214 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Request{} + +// InvokeContractV1Request struct for InvokeContractV1Request +type InvokeContractV1Request struct { + // The fully qualified name of the Corda flow to invoke + FlowFullClassName string `json:"flowFullClassName"` + FlowInvocationType FlowInvocationType `json:"flowInvocationType"` + // The list of arguments to pass in to the contract method being invoked. + Params []JvmObject `json:"params"` + // The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. + TimeoutMs *int32 `json:"timeoutMs,omitempty"` +} + +// NewInvokeContractV1Request instantiates a new InvokeContractV1Request 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 +// will change when the set of required properties is changed +func NewInvokeContractV1Request(flowFullClassName string, flowInvocationType FlowInvocationType, params []JvmObject) *InvokeContractV1Request { + this := InvokeContractV1Request{} + this.FlowFullClassName = flowFullClassName + this.FlowInvocationType = flowInvocationType + this.Params = params + var timeoutMs int32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewInvokeContractV1RequestWithDefaults instantiates a new InvokeContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1RequestWithDefaults() *InvokeContractV1Request { + this := InvokeContractV1Request{} + var timeoutMs int32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetFlowFullClassName returns the FlowFullClassName field value +func (o *InvokeContractV1Request) GetFlowFullClassName() string { + if o == nil { + var ret string + return ret + } + + return o.FlowFullClassName +} + +// GetFlowFullClassNameOk returns a tuple with the FlowFullClassName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetFlowFullClassNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FlowFullClassName, true +} + +// SetFlowFullClassName sets field value +func (o *InvokeContractV1Request) SetFlowFullClassName(v string) { + o.FlowFullClassName = v +} + +// GetFlowInvocationType returns the FlowInvocationType field value +func (o *InvokeContractV1Request) GetFlowInvocationType() FlowInvocationType { + if o == nil { + var ret FlowInvocationType + return ret + } + + return o.FlowInvocationType +} + +// GetFlowInvocationTypeOk returns a tuple with the FlowInvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetFlowInvocationTypeOk() (*FlowInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.FlowInvocationType, true +} + +// SetFlowInvocationType sets field value +func (o *InvokeContractV1Request) SetFlowInvocationType(v FlowInvocationType) { + o.FlowInvocationType = v +} + +// GetParams returns the Params field value +func (o *InvokeContractV1Request) GetParams() []JvmObject { + if o == nil { + var ret []JvmObject + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetParamsOk() ([]JvmObject, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *InvokeContractV1Request) SetParams(v []JvmObject) { + o.Params = v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetTimeoutMs() int32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret int32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetTimeoutMsOk() (*int32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given int32 and assigns it to the TimeoutMs field. +func (o *InvokeContractV1Request) SetTimeoutMs(v int32) { + o.TimeoutMs = &v +} + +func (o InvokeContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["flowFullClassName"] = o.FlowFullClassName + toSerialize["flowInvocationType"] = o.FlowInvocationType + toSerialize["params"] = o.Params + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + return toSerialize, nil +} + +type NullableInvokeContractV1Request struct { + value *InvokeContractV1Request + isSet bool +} + +func (v NullableInvokeContractV1Request) Get() *InvokeContractV1Request { + return v.value +} + +func (v *NullableInvokeContractV1Request) Set(val *InvokeContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Request(val *InvokeContractV1Request) *NullableInvokeContractV1Request { + return &NullableInvokeContractV1Request{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go new file mode 100644 index 00000000000..54a4fb85f48 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go @@ -0,0 +1,247 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Response{} + +// InvokeContractV1Response struct for InvokeContractV1Response +type InvokeContractV1Response struct { + Success bool `json:"success"` + // Data returned from the JVM when no transaction is running + CallOutput map[string]interface{} `json:"callOutput"` + // The net.corda.core.flows.StateMachineRunId value returned by the flow execution. + TransactionId *string `json:"transactionId,omitempty"` + // An array of strings representing the aggregated stream of progress updates provided by a *tracked* flow invocation. If the flow invocation was not tracked, this array is still returned, but as empty. + Progress []string `json:"progress,omitempty"` + // The id for the flow handle + FlowId string `json:"flowId"` +} + +// NewInvokeContractV1Response instantiates a new InvokeContractV1Response 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 +// will change when the set of required properties is changed +func NewInvokeContractV1Response(success bool, callOutput map[string]interface{}, flowId string) *InvokeContractV1Response { + this := InvokeContractV1Response{} + this.Success = success + this.CallOutput = callOutput + this.FlowId = flowId + return &this +} + +// NewInvokeContractV1ResponseWithDefaults instantiates a new InvokeContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1ResponseWithDefaults() *InvokeContractV1Response { + this := InvokeContractV1Response{} + return &this +} + +// GetSuccess returns the Success field value +func (o *InvokeContractV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *InvokeContractV1Response) SetSuccess(v bool) { + o.Success = v +} + +// GetCallOutput returns the CallOutput field value +func (o *InvokeContractV1Response) GetCallOutput() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.CallOutput +} + +// GetCallOutputOk returns a tuple with the CallOutput field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetCallOutputOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.CallOutput, true +} + +// SetCallOutput sets field value +func (o *InvokeContractV1Response) SetCallOutput(v map[string]interface{}) { + o.CallOutput = v +} + +// GetTransactionId returns the TransactionId field value if set, zero value otherwise. +func (o *InvokeContractV1Response) GetTransactionId() string { + if o == nil || IsNil(o.TransactionId) { + var ret string + return ret + } + return *o.TransactionId +} + +// GetTransactionIdOk returns a tuple with the TransactionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetTransactionIdOk() (*string, bool) { + if o == nil || IsNil(o.TransactionId) { + return nil, false + } + return o.TransactionId, true +} + +// HasTransactionId returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasTransactionId() bool { + if o != nil && !IsNil(o.TransactionId) { + return true + } + + return false +} + +// SetTransactionId gets a reference to the given string and assigns it to the TransactionId field. +func (o *InvokeContractV1Response) SetTransactionId(v string) { + o.TransactionId = &v +} + +// GetProgress returns the Progress field value if set, zero value otherwise. +func (o *InvokeContractV1Response) GetProgress() []string { + if o == nil || IsNil(o.Progress) { + var ret []string + return ret + } + return o.Progress +} + +// GetProgressOk returns a tuple with the Progress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetProgressOk() ([]string, bool) { + if o == nil || IsNil(o.Progress) { + return nil, false + } + return o.Progress, true +} + +// HasProgress returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasProgress() bool { + if o != nil && !IsNil(o.Progress) { + return true + } + + return false +} + +// SetProgress gets a reference to the given []string and assigns it to the Progress field. +func (o *InvokeContractV1Response) SetProgress(v []string) { + o.Progress = v +} + +// GetFlowId returns the FlowId field value +func (o *InvokeContractV1Response) GetFlowId() string { + if o == nil { + var ret string + return ret + } + + return o.FlowId +} + +// GetFlowIdOk returns a tuple with the FlowId field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetFlowIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FlowId, true +} + +// SetFlowId sets field value +func (o *InvokeContractV1Response) SetFlowId(v string) { + o.FlowId = v +} + +func (o InvokeContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["success"] = o.Success + toSerialize["callOutput"] = o.CallOutput + if !IsNil(o.TransactionId) { + toSerialize["transactionId"] = o.TransactionId + } + if !IsNil(o.Progress) { + toSerialize["progress"] = o.Progress + } + toSerialize["flowId"] = o.FlowId + return toSerialize, nil +} + +type NullableInvokeContractV1Response struct { + value *InvokeContractV1Response + isSet bool +} + +func (v NullableInvokeContractV1Response) Get() *InvokeContractV1Response { + return v.value +} + +func (v *NullableInvokeContractV1Response) Set(val *InvokeContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Response(val *InvokeContractV1Response) *NullableInvokeContractV1Response { + return &NullableInvokeContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jar_file.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jar_file.go new file mode 100644 index 00000000000..5c44f86da52 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jar_file.go @@ -0,0 +1,199 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the JarFile type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JarFile{} + +// JarFile struct for JarFile +type JarFile struct { + Filename string `json:"filename"` + // Indicates whether the cordapp jar in question contains any embedded migrations that Cactus can/should execute between copying the jar into the cordapp directory and starting the node back up. + HasDbMigrations bool `json:"hasDbMigrations"` + ContentBase64 string `json:"contentBase64"` + AdditionalProperties map[string]interface{} +} + +type _JarFile JarFile + +// NewJarFile instantiates a new JarFile 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 +// will change when the set of required properties is changed +func NewJarFile(filename string, hasDbMigrations bool, contentBase64 string) *JarFile { + this := JarFile{} + this.Filename = filename + this.HasDbMigrations = hasDbMigrations + this.ContentBase64 = contentBase64 + return &this +} + +// NewJarFileWithDefaults instantiates a new JarFile object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJarFileWithDefaults() *JarFile { + this := JarFile{} + return &this +} + +// GetFilename returns the Filename field value +func (o *JarFile) GetFilename() string { + if o == nil { + var ret string + return ret + } + + return o.Filename +} + +// GetFilenameOk returns a tuple with the Filename field value +// and a boolean to check if the value has been set. +func (o *JarFile) GetFilenameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Filename, true +} + +// SetFilename sets field value +func (o *JarFile) SetFilename(v string) { + o.Filename = v +} + +// GetHasDbMigrations returns the HasDbMigrations field value +func (o *JarFile) GetHasDbMigrations() bool { + if o == nil { + var ret bool + return ret + } + + return o.HasDbMigrations +} + +// GetHasDbMigrationsOk returns a tuple with the HasDbMigrations field value +// and a boolean to check if the value has been set. +func (o *JarFile) GetHasDbMigrationsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HasDbMigrations, true +} + +// SetHasDbMigrations sets field value +func (o *JarFile) SetHasDbMigrations(v bool) { + o.HasDbMigrations = v +} + +// GetContentBase64 returns the ContentBase64 field value +func (o *JarFile) GetContentBase64() string { + if o == nil { + var ret string + return ret + } + + return o.ContentBase64 +} + +// GetContentBase64Ok returns a tuple with the ContentBase64 field value +// and a boolean to check if the value has been set. +func (o *JarFile) GetContentBase64Ok() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContentBase64, true +} + +// SetContentBase64 sets field value +func (o *JarFile) SetContentBase64(v string) { + o.ContentBase64 = v +} + +func (o JarFile) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JarFile) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["filename"] = o.Filename + toSerialize["hasDbMigrations"] = o.HasDbMigrations + toSerialize["contentBase64"] = o.ContentBase64 + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *JarFile) UnmarshalJSON(bytes []byte) (err error) { + varJarFile := _JarFile{} + + if err = json.Unmarshal(bytes, &varJarFile); err == nil { + *o = JarFile(varJarFile) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "filename") + delete(additionalProperties, "hasDbMigrations") + delete(additionalProperties, "contentBase64") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableJarFile struct { + value *JarFile + isSet bool +} + +func (v NullableJarFile) Get() *JarFile { + return v.value +} + +func (v *NullableJarFile) Set(val *JarFile) { + v.value = val + v.isSet = true +} + +func (v NullableJarFile) IsSet() bool { + return v.isSet +} + +func (v *NullableJarFile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJarFile(val *JarFile) *NullableJarFile { + return &NullableJarFile{value: val, isSet: true} +} + +func (v NullableJarFile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJarFile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_object.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_object.go new file mode 100644 index 00000000000..ffd053b24e1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_object.go @@ -0,0 +1,216 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the JvmObject type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JvmObject{} + +// JvmObject Can represent JVM primitive and reference types as well. The jvmTypeKind field indicates which one is being stored. If the jvmTypeKind field is set to REFERENCE then the jvmCtorArgs array is expected to be filled, otherwise (e.g. PRIMITIVE jvmTypeKind) it is expected that the primitiveValue property is filled with a primitive data type supported by the JSON standard such as strings, booleans, numbers, etc. +type JvmObject struct { + JvmTypeKind JvmTypeKind `json:"jvmTypeKind"` + PrimitiveValue map[string]interface{} `json:"primitiveValue,omitempty"` + JvmCtorArgs []JvmObject `json:"jvmCtorArgs,omitempty"` + JvmType JvmType `json:"jvmType"` +} + +// NewJvmObject instantiates a new JvmObject 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 +// will change when the set of required properties is changed +func NewJvmObject(jvmTypeKind JvmTypeKind, jvmType JvmType) *JvmObject { + this := JvmObject{} + this.JvmTypeKind = jvmTypeKind + this.JvmType = jvmType + return &this +} + +// NewJvmObjectWithDefaults instantiates a new JvmObject object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJvmObjectWithDefaults() *JvmObject { + this := JvmObject{} + return &this +} + +// GetJvmTypeKind returns the JvmTypeKind field value +func (o *JvmObject) GetJvmTypeKind() JvmTypeKind { + if o == nil { + var ret JvmTypeKind + return ret + } + + return o.JvmTypeKind +} + +// GetJvmTypeKindOk returns a tuple with the JvmTypeKind field value +// and a boolean to check if the value has been set. +func (o *JvmObject) GetJvmTypeKindOk() (*JvmTypeKind, bool) { + if o == nil { + return nil, false + } + return &o.JvmTypeKind, true +} + +// SetJvmTypeKind sets field value +func (o *JvmObject) SetJvmTypeKind(v JvmTypeKind) { + o.JvmTypeKind = v +} + +// GetPrimitiveValue returns the PrimitiveValue field value if set, zero value otherwise. +func (o *JvmObject) GetPrimitiveValue() map[string]interface{} { + if o == nil || IsNil(o.PrimitiveValue) { + var ret map[string]interface{} + return ret + } + return o.PrimitiveValue +} + +// GetPrimitiveValueOk returns a tuple with the PrimitiveValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JvmObject) GetPrimitiveValueOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.PrimitiveValue) { + return map[string]interface{}{}, false + } + return o.PrimitiveValue, true +} + +// HasPrimitiveValue returns a boolean if a field has been set. +func (o *JvmObject) HasPrimitiveValue() bool { + if o != nil && !IsNil(o.PrimitiveValue) { + return true + } + + return false +} + +// SetPrimitiveValue gets a reference to the given map[string]interface{} and assigns it to the PrimitiveValue field. +func (o *JvmObject) SetPrimitiveValue(v map[string]interface{}) { + o.PrimitiveValue = v +} + +// GetJvmCtorArgs returns the JvmCtorArgs field value if set, zero value otherwise. +func (o *JvmObject) GetJvmCtorArgs() []JvmObject { + if o == nil || IsNil(o.JvmCtorArgs) { + var ret []JvmObject + return ret + } + return o.JvmCtorArgs +} + +// GetJvmCtorArgsOk returns a tuple with the JvmCtorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JvmObject) GetJvmCtorArgsOk() ([]JvmObject, bool) { + if o == nil || IsNil(o.JvmCtorArgs) { + return nil, false + } + return o.JvmCtorArgs, true +} + +// HasJvmCtorArgs returns a boolean if a field has been set. +func (o *JvmObject) HasJvmCtorArgs() bool { + if o != nil && !IsNil(o.JvmCtorArgs) { + return true + } + + return false +} + +// SetJvmCtorArgs gets a reference to the given []JvmObject and assigns it to the JvmCtorArgs field. +func (o *JvmObject) SetJvmCtorArgs(v []JvmObject) { + o.JvmCtorArgs = v +} + +// GetJvmType returns the JvmType field value +func (o *JvmObject) GetJvmType() JvmType { + if o == nil { + var ret JvmType + return ret + } + + return o.JvmType +} + +// GetJvmTypeOk returns a tuple with the JvmType field value +// and a boolean to check if the value has been set. +func (o *JvmObject) GetJvmTypeOk() (*JvmType, bool) { + if o == nil { + return nil, false + } + return &o.JvmType, true +} + +// SetJvmType sets field value +func (o *JvmObject) SetJvmType(v JvmType) { + o.JvmType = v +} + +func (o JvmObject) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JvmObject) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["jvmTypeKind"] = o.JvmTypeKind + if !IsNil(o.PrimitiveValue) { + toSerialize["primitiveValue"] = o.PrimitiveValue + } + if !IsNil(o.JvmCtorArgs) { + toSerialize["jvmCtorArgs"] = o.JvmCtorArgs + } + toSerialize["jvmType"] = o.JvmType + return toSerialize, nil +} + +type NullableJvmObject struct { + value *JvmObject + isSet bool +} + +func (v NullableJvmObject) Get() *JvmObject { + return v.value +} + +func (v *NullableJvmObject) Set(val *JvmObject) { + v.value = val + v.isSet = true +} + +func (v NullableJvmObject) IsSet() bool { + return v.isSet +} + +func (v *NullableJvmObject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJvmObject(val *JvmObject) *NullableJvmObject { + return &NullableJvmObject{value: val, isSet: true} +} + +func (v NullableJvmObject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJvmObject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_type.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_type.go new file mode 100644 index 00000000000..83190a07811 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_type.go @@ -0,0 +1,190 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the JvmType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JvmType{} + +// JvmType Represents a reference to a JVM type (such as a Java class) +type JvmType struct { + FqClassName string `json:"fqClassName"` + // This parameter is used to specify that the function used to construct this JvmType is not a constructor function but instead is a factory function. Setting this parameter will cause the plugin to look up methods of the class denoted by fqClassName instead of its constructors. + ConstructorName *string `json:"constructorName,omitempty"` + InvocationTarget *JvmObject `json:"invocationTarget,omitempty"` +} + +// NewJvmType instantiates a new JvmType 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 +// will change when the set of required properties is changed +func NewJvmType(fqClassName string) *JvmType { + this := JvmType{} + this.FqClassName = fqClassName + return &this +} + +// NewJvmTypeWithDefaults instantiates a new JvmType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJvmTypeWithDefaults() *JvmType { + this := JvmType{} + return &this +} + +// GetFqClassName returns the FqClassName field value +func (o *JvmType) GetFqClassName() string { + if o == nil { + var ret string + return ret + } + + return o.FqClassName +} + +// GetFqClassNameOk returns a tuple with the FqClassName field value +// and a boolean to check if the value has been set. +func (o *JvmType) GetFqClassNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FqClassName, true +} + +// SetFqClassName sets field value +func (o *JvmType) SetFqClassName(v string) { + o.FqClassName = v +} + +// GetConstructorName returns the ConstructorName field value if set, zero value otherwise. +func (o *JvmType) GetConstructorName() string { + if o == nil || IsNil(o.ConstructorName) { + var ret string + return ret + } + return *o.ConstructorName +} + +// GetConstructorNameOk returns a tuple with the ConstructorName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JvmType) GetConstructorNameOk() (*string, bool) { + if o == nil || IsNil(o.ConstructorName) { + return nil, false + } + return o.ConstructorName, true +} + +// HasConstructorName returns a boolean if a field has been set. +func (o *JvmType) HasConstructorName() bool { + if o != nil && !IsNil(o.ConstructorName) { + return true + } + + return false +} + +// SetConstructorName gets a reference to the given string and assigns it to the ConstructorName field. +func (o *JvmType) SetConstructorName(v string) { + o.ConstructorName = &v +} + +// GetInvocationTarget returns the InvocationTarget field value if set, zero value otherwise. +func (o *JvmType) GetInvocationTarget() JvmObject { + if o == nil || IsNil(o.InvocationTarget) { + var ret JvmObject + return ret + } + return *o.InvocationTarget +} + +// GetInvocationTargetOk returns a tuple with the InvocationTarget field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JvmType) GetInvocationTargetOk() (*JvmObject, bool) { + if o == nil || IsNil(o.InvocationTarget) { + return nil, false + } + return o.InvocationTarget, true +} + +// HasInvocationTarget returns a boolean if a field has been set. +func (o *JvmType) HasInvocationTarget() bool { + if o != nil && !IsNil(o.InvocationTarget) { + return true + } + + return false +} + +// SetInvocationTarget gets a reference to the given JvmObject and assigns it to the InvocationTarget field. +func (o *JvmType) SetInvocationTarget(v JvmObject) { + o.InvocationTarget = &v +} + +func (o JvmType) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JvmType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["fqClassName"] = o.FqClassName + if !IsNil(o.ConstructorName) { + toSerialize["constructorName"] = o.ConstructorName + } + if !IsNil(o.InvocationTarget) { + toSerialize["invocationTarget"] = o.InvocationTarget + } + return toSerialize, nil +} + +type NullableJvmType struct { + value *JvmType + isSet bool +} + +func (v NullableJvmType) Get() *JvmType { + return v.value +} + +func (v *NullableJvmType) Set(val *JvmType) { + v.value = val + v.isSet = true +} + +func (v NullableJvmType) IsSet() bool { + return v.isSet +} + +func (v *NullableJvmType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJvmType(val *JvmType) *NullableJvmType { + return &NullableJvmType{value: val, isSet: true} +} + +func (v NullableJvmType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJvmType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_type_kind.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_type_kind.go new file mode 100644 index 00000000000..7a079e3b49d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_type_kind.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" + "fmt" +) + +// JvmTypeKind the model 'JvmTypeKind' +type JvmTypeKind string + +// List of JvmTypeKind +const ( + PRIMITIVE JvmTypeKind = "PRIMITIVE" + REFERENCE JvmTypeKind = "REFERENCE" +) + +// All allowed values of JvmTypeKind enum +var AllowedJvmTypeKindEnumValues = []JvmTypeKind{ + "PRIMITIVE", + "REFERENCE", +} + +func (v *JvmTypeKind) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := JvmTypeKind(value) + for _, existing := range AllowedJvmTypeKindEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid JvmTypeKind", value) +} + +// NewJvmTypeKindFromValue returns a pointer to a valid JvmTypeKind +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewJvmTypeKindFromValue(v string) (*JvmTypeKind, error) { + ev := JvmTypeKind(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for JvmTypeKind: valid values are %v", v, AllowedJvmTypeKindEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v JvmTypeKind) IsValid() bool { + for _, existing := range AllowedJvmTypeKindEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to JvmTypeKind value +func (v JvmTypeKind) Ptr() *JvmTypeKind { + return &v +} + +type NullableJvmTypeKind struct { + value *JvmTypeKind + isSet bool +} + +func (v NullableJvmTypeKind) Get() *JvmTypeKind { + return v.value +} + +func (v *NullableJvmTypeKind) Set(val *JvmTypeKind) { + v.value = val + v.isSet = true +} + +func (v NullableJvmTypeKind) IsSet() bool { + return v.isSet +} + +func (v *NullableJvmTypeKind) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJvmTypeKind(val *JvmTypeKind) *NullableJvmTypeKind { + return &NullableJvmTypeKind{value: val, isSet: true} +} + +func (v NullableJvmTypeKind) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJvmTypeKind) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_list_flows_v1_request.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_list_flows_v1_request.go new file mode 100644 index 00000000000..e1fc080c6ca --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_list_flows_v1_request.go @@ -0,0 +1,126 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the ListFlowsV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListFlowsV1Request{} + +// ListFlowsV1Request struct for ListFlowsV1Request +type ListFlowsV1Request struct { + Filter *string `json:"filter,omitempty"` +} + +// NewListFlowsV1Request instantiates a new ListFlowsV1Request 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 +// will change when the set of required properties is changed +func NewListFlowsV1Request() *ListFlowsV1Request { + this := ListFlowsV1Request{} + return &this +} + +// NewListFlowsV1RequestWithDefaults instantiates a new ListFlowsV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListFlowsV1RequestWithDefaults() *ListFlowsV1Request { + this := ListFlowsV1Request{} + return &this +} + +// GetFilter returns the Filter field value if set, zero value otherwise. +func (o *ListFlowsV1Request) GetFilter() string { + if o == nil || IsNil(o.Filter) { + var ret string + return ret + } + return *o.Filter +} + +// GetFilterOk returns a tuple with the Filter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListFlowsV1Request) GetFilterOk() (*string, bool) { + if o == nil || IsNil(o.Filter) { + return nil, false + } + return o.Filter, true +} + +// HasFilter returns a boolean if a field has been set. +func (o *ListFlowsV1Request) HasFilter() bool { + if o != nil && !IsNil(o.Filter) { + return true + } + + return false +} + +// SetFilter gets a reference to the given string and assigns it to the Filter field. +func (o *ListFlowsV1Request) SetFilter(v string) { + o.Filter = &v +} + +func (o ListFlowsV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListFlowsV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Filter) { + toSerialize["filter"] = o.Filter + } + return toSerialize, nil +} + +type NullableListFlowsV1Request struct { + value *ListFlowsV1Request + isSet bool +} + +func (v NullableListFlowsV1Request) Get() *ListFlowsV1Request { + return v.value +} + +func (v *NullableListFlowsV1Request) Set(val *ListFlowsV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableListFlowsV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableListFlowsV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListFlowsV1Request(val *ListFlowsV1Request) *NullableListFlowsV1Request { + return &NullableListFlowsV1Request{value: val, isSet: true} +} + +func (v NullableListFlowsV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListFlowsV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_list_flows_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_list_flows_v1_response.go new file mode 100644 index 00000000000..aebd2c65389 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_list_flows_v1_response.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the ListFlowsV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListFlowsV1Response{} + +// ListFlowsV1Response struct for ListFlowsV1Response +type ListFlowsV1Response struct { + // An array of strings storing the names of the flows as returned by the flowList Corda RPC. + FlowNames []string `json:"flowNames"` +} + +// NewListFlowsV1Response instantiates a new ListFlowsV1Response 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 +// will change when the set of required properties is changed +func NewListFlowsV1Response(flowNames []string) *ListFlowsV1Response { + this := ListFlowsV1Response{} + this.FlowNames = flowNames + return &this +} + +// NewListFlowsV1ResponseWithDefaults instantiates a new ListFlowsV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListFlowsV1ResponseWithDefaults() *ListFlowsV1Response { + this := ListFlowsV1Response{} + return &this +} + +// GetFlowNames returns the FlowNames field value +func (o *ListFlowsV1Response) GetFlowNames() []string { + if o == nil { + var ret []string + return ret + } + + return o.FlowNames +} + +// GetFlowNamesOk returns a tuple with the FlowNames field value +// and a boolean to check if the value has been set. +func (o *ListFlowsV1Response) GetFlowNamesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.FlowNames, true +} + +// SetFlowNames sets field value +func (o *ListFlowsV1Response) SetFlowNames(v []string) { + o.FlowNames = v +} + +func (o ListFlowsV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListFlowsV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["flowNames"] = o.FlowNames + return toSerialize, nil +} + +type NullableListFlowsV1Response struct { + value *ListFlowsV1Response + isSet bool +} + +func (v NullableListFlowsV1Response) Get() *ListFlowsV1Response { + return v.value +} + +func (v *NullableListFlowsV1Response) Set(val *ListFlowsV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableListFlowsV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableListFlowsV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListFlowsV1Response(val *ListFlowsV1Response) *NullableListFlowsV1Response { + return &NullableListFlowsV1Response{value: val, isSet: true} +} + +func (v NullableListFlowsV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListFlowsV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_network_host_and_port.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_network_host_and_port.go new file mode 100644 index 00000000000..ca9243bbba8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_network_host_and_port.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the NetworkHostAndPort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkHostAndPort{} + +// NetworkHostAndPort struct for NetworkHostAndPort +type NetworkHostAndPort struct { + Host string `json:"host"` + Port float32 `json:"port"` +} + +// NewNetworkHostAndPort instantiates a new NetworkHostAndPort 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 +// will change when the set of required properties is changed +func NewNetworkHostAndPort(host string, port float32) *NetworkHostAndPort { + this := NetworkHostAndPort{} + this.Host = host + this.Port = port + return &this +} + +// NewNetworkHostAndPortWithDefaults instantiates a new NetworkHostAndPort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkHostAndPortWithDefaults() *NetworkHostAndPort { + this := NetworkHostAndPort{} + return &this +} + +// GetHost returns the Host field value +func (o *NetworkHostAndPort) GetHost() string { + if o == nil { + var ret string + return ret + } + + return o.Host +} + +// GetHostOk returns a tuple with the Host field value +// and a boolean to check if the value has been set. +func (o *NetworkHostAndPort) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *NetworkHostAndPort) SetHost(v string) { + o.Host = v +} + +// GetPort returns the Port field value +func (o *NetworkHostAndPort) GetPort() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Port +} + +// GetPortOk returns a tuple with the Port field value +// and a boolean to check if the value has been set. +func (o *NetworkHostAndPort) GetPortOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Port, true +} + +// SetPort sets field value +func (o *NetworkHostAndPort) SetPort(v float32) { + o.Port = v +} + +func (o NetworkHostAndPort) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkHostAndPort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["host"] = o.Host + toSerialize["port"] = o.Port + return toSerialize, nil +} + +type NullableNetworkHostAndPort struct { + value *NetworkHostAndPort + isSet bool +} + +func (v NullableNetworkHostAndPort) Get() *NetworkHostAndPort { + return v.value +} + +func (v *NullableNetworkHostAndPort) Set(val *NetworkHostAndPort) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkHostAndPort) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkHostAndPort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkHostAndPort(val *NetworkHostAndPort) *NullableNetworkHostAndPort { + return &NullableNetworkHostAndPort{value: val, isSet: true} +} + +func (v NullableNetworkHostAndPort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkHostAndPort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_node_diagnostic_info.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_node_diagnostic_info.go new file mode 100644 index 00000000000..1581ec59ae1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_node_diagnostic_info.go @@ -0,0 +1,230 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the NodeDiagnosticInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NodeDiagnosticInfo{} + +// NodeDiagnosticInfo A NodeDiagnosticInfo holds information about the current node version. +type NodeDiagnosticInfo struct { + // A list of CorDapps currently installed on this node + Cordapps []CordappInfo `json:"cordapps"` + // The platform version of this node. This number represents a released API version, and should be used to make functionality decisions (e.g. enabling an app feature only if an underlying platform feature exists) + PlatformVersion int32 `json:"platformVersion"` + // The git commit hash this node was built from + Revision string `json:"revision"` + // The vendor of this node + Vendor string `json:"vendor"` + // The current node version string, e.g. 4.3, 4.4-SNAPSHOT. Note that this string is effectively freeform, and so should only be used for providing diagnostic information. It should not be used to make functionality decisions (the platformVersion is a better fit for this). + Version string `json:"version"` +} + +// NewNodeDiagnosticInfo instantiates a new NodeDiagnosticInfo 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 +// will change when the set of required properties is changed +func NewNodeDiagnosticInfo(cordapps []CordappInfo, platformVersion int32, revision string, vendor string, version string) *NodeDiagnosticInfo { + this := NodeDiagnosticInfo{} + this.Cordapps = cordapps + this.PlatformVersion = platformVersion + this.Revision = revision + this.Vendor = vendor + this.Version = version + return &this +} + +// NewNodeDiagnosticInfoWithDefaults instantiates a new NodeDiagnosticInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNodeDiagnosticInfoWithDefaults() *NodeDiagnosticInfo { + this := NodeDiagnosticInfo{} + return &this +} + +// GetCordapps returns the Cordapps field value +func (o *NodeDiagnosticInfo) GetCordapps() []CordappInfo { + if o == nil { + var ret []CordappInfo + return ret + } + + return o.Cordapps +} + +// GetCordappsOk returns a tuple with the Cordapps field value +// and a boolean to check if the value has been set. +func (o *NodeDiagnosticInfo) GetCordappsOk() ([]CordappInfo, bool) { + if o == nil { + return nil, false + } + return o.Cordapps, true +} + +// SetCordapps sets field value +func (o *NodeDiagnosticInfo) SetCordapps(v []CordappInfo) { + o.Cordapps = v +} + +// GetPlatformVersion returns the PlatformVersion field value +func (o *NodeDiagnosticInfo) GetPlatformVersion() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PlatformVersion +} + +// GetPlatformVersionOk returns a tuple with the PlatformVersion field value +// and a boolean to check if the value has been set. +func (o *NodeDiagnosticInfo) GetPlatformVersionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PlatformVersion, true +} + +// SetPlatformVersion sets field value +func (o *NodeDiagnosticInfo) SetPlatformVersion(v int32) { + o.PlatformVersion = v +} + +// GetRevision returns the Revision field value +func (o *NodeDiagnosticInfo) GetRevision() string { + if o == nil { + var ret string + return ret + } + + return o.Revision +} + +// GetRevisionOk returns a tuple with the Revision field value +// and a boolean to check if the value has been set. +func (o *NodeDiagnosticInfo) GetRevisionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Revision, true +} + +// SetRevision sets field value +func (o *NodeDiagnosticInfo) SetRevision(v string) { + o.Revision = v +} + +// GetVendor returns the Vendor field value +func (o *NodeDiagnosticInfo) GetVendor() string { + if o == nil { + var ret string + return ret + } + + return o.Vendor +} + +// GetVendorOk returns a tuple with the Vendor field value +// and a boolean to check if the value has been set. +func (o *NodeDiagnosticInfo) GetVendorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Vendor, true +} + +// SetVendor sets field value +func (o *NodeDiagnosticInfo) SetVendor(v string) { + o.Vendor = v +} + +// GetVersion returns the Version field value +func (o *NodeDiagnosticInfo) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *NodeDiagnosticInfo) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *NodeDiagnosticInfo) SetVersion(v string) { + o.Version = v +} + +func (o NodeDiagnosticInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NodeDiagnosticInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cordapps"] = o.Cordapps + toSerialize["platformVersion"] = o.PlatformVersion + toSerialize["revision"] = o.Revision + toSerialize["vendor"] = o.Vendor + toSerialize["version"] = o.Version + return toSerialize, nil +} + +type NullableNodeDiagnosticInfo struct { + value *NodeDiagnosticInfo + isSet bool +} + +func (v NullableNodeDiagnosticInfo) Get() *NodeDiagnosticInfo { + return v.value +} + +func (v *NullableNodeDiagnosticInfo) Set(val *NodeDiagnosticInfo) { + v.value = val + v.isSet = true +} + +func (v NullableNodeDiagnosticInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableNodeDiagnosticInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNodeDiagnosticInfo(val *NodeDiagnosticInfo) *NullableNodeDiagnosticInfo { + return &NullableNodeDiagnosticInfo{value: val, isSet: true} +} + +func (v NullableNodeDiagnosticInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNodeDiagnosticInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_node_info.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_node_info.go new file mode 100644 index 00000000000..f5773b84a64 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_node_info.go @@ -0,0 +1,225 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the NodeInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NodeInfo{} + +// NodeInfo struct for NodeInfo +type NodeInfo struct { + Addresses []NetworkHostAndPort `json:"addresses"` + PlatformVersion int32 `json:"platformVersion"` + Serial float32 `json:"serial"` + LegalIdentities []Party `json:"legalIdentities"` + LegalIdentitiesAndCerts []map[string]interface{} `json:"legalIdentitiesAndCerts"` +} + +// NewNodeInfo instantiates a new NodeInfo 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 +// will change when the set of required properties is changed +func NewNodeInfo(addresses []NetworkHostAndPort, platformVersion int32, serial float32, legalIdentities []Party, legalIdentitiesAndCerts []map[string]interface{}) *NodeInfo { + this := NodeInfo{} + this.Addresses = addresses + this.PlatformVersion = platformVersion + this.Serial = serial + this.LegalIdentities = legalIdentities + this.LegalIdentitiesAndCerts = legalIdentitiesAndCerts + return &this +} + +// NewNodeInfoWithDefaults instantiates a new NodeInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNodeInfoWithDefaults() *NodeInfo { + this := NodeInfo{} + return &this +} + +// GetAddresses returns the Addresses field value +func (o *NodeInfo) GetAddresses() []NetworkHostAndPort { + if o == nil { + var ret []NetworkHostAndPort + return ret + } + + return o.Addresses +} + +// GetAddressesOk returns a tuple with the Addresses field value +// and a boolean to check if the value has been set. +func (o *NodeInfo) GetAddressesOk() ([]NetworkHostAndPort, bool) { + if o == nil { + return nil, false + } + return o.Addresses, true +} + +// SetAddresses sets field value +func (o *NodeInfo) SetAddresses(v []NetworkHostAndPort) { + o.Addresses = v +} + +// GetPlatformVersion returns the PlatformVersion field value +func (o *NodeInfo) GetPlatformVersion() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PlatformVersion +} + +// GetPlatformVersionOk returns a tuple with the PlatformVersion field value +// and a boolean to check if the value has been set. +func (o *NodeInfo) GetPlatformVersionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PlatformVersion, true +} + +// SetPlatformVersion sets field value +func (o *NodeInfo) SetPlatformVersion(v int32) { + o.PlatformVersion = v +} + +// GetSerial returns the Serial field value +func (o *NodeInfo) GetSerial() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value +// and a boolean to check if the value has been set. +func (o *NodeInfo) GetSerialOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Serial, true +} + +// SetSerial sets field value +func (o *NodeInfo) SetSerial(v float32) { + o.Serial = v +} + +// GetLegalIdentities returns the LegalIdentities field value +func (o *NodeInfo) GetLegalIdentities() []Party { + if o == nil { + var ret []Party + return ret + } + + return o.LegalIdentities +} + +// GetLegalIdentitiesOk returns a tuple with the LegalIdentities field value +// and a boolean to check if the value has been set. +func (o *NodeInfo) GetLegalIdentitiesOk() ([]Party, bool) { + if o == nil { + return nil, false + } + return o.LegalIdentities, true +} + +// SetLegalIdentities sets field value +func (o *NodeInfo) SetLegalIdentities(v []Party) { + o.LegalIdentities = v +} + +// GetLegalIdentitiesAndCerts returns the LegalIdentitiesAndCerts field value +func (o *NodeInfo) GetLegalIdentitiesAndCerts() []map[string]interface{} { + if o == nil { + var ret []map[string]interface{} + return ret + } + + return o.LegalIdentitiesAndCerts +} + +// GetLegalIdentitiesAndCertsOk returns a tuple with the LegalIdentitiesAndCerts field value +// and a boolean to check if the value has been set. +func (o *NodeInfo) GetLegalIdentitiesAndCertsOk() ([]map[string]interface{}, bool) { + if o == nil { + return nil, false + } + return o.LegalIdentitiesAndCerts, true +} + +// SetLegalIdentitiesAndCerts sets field value +func (o *NodeInfo) SetLegalIdentitiesAndCerts(v []map[string]interface{}) { + o.LegalIdentitiesAndCerts = v +} + +func (o NodeInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NodeInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["addresses"] = o.Addresses + toSerialize["platformVersion"] = o.PlatformVersion + toSerialize["serial"] = o.Serial + toSerialize["legalIdentities"] = o.LegalIdentities + toSerialize["legalIdentitiesAndCerts"] = o.LegalIdentitiesAndCerts + return toSerialize, nil +} + +type NullableNodeInfo struct { + value *NodeInfo + isSet bool +} + +func (v NullableNodeInfo) Get() *NodeInfo { + return v.value +} + +func (v *NullableNodeInfo) Set(val *NodeInfo) { + v.value = val + v.isSet = true +} + +func (v NullableNodeInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableNodeInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNodeInfo(val *NodeInfo) *NullableNodeInfo { + return &NullableNodeInfo{value: val, isSet: true} +} + +func (v NullableNodeInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNodeInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_party.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_party.go new file mode 100644 index 00000000000..ecd255b2a1f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_party.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the Party type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Party{} + +// Party struct for Party +type Party struct { + Name CordaX500Name `json:"name"` + OwningKey PublicKey `json:"owningKey"` +} + +// NewParty instantiates a new Party 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 +// will change when the set of required properties is changed +func NewParty(name CordaX500Name, owningKey PublicKey) *Party { + this := Party{} + this.Name = name + this.OwningKey = owningKey + return &this +} + +// NewPartyWithDefaults instantiates a new Party object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartyWithDefaults() *Party { + this := Party{} + return &this +} + +// GetName returns the Name field value +func (o *Party) GetName() CordaX500Name { + if o == nil { + var ret CordaX500Name + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Party) GetNameOk() (*CordaX500Name, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Party) SetName(v CordaX500Name) { + o.Name = v +} + +// GetOwningKey returns the OwningKey field value +func (o *Party) GetOwningKey() PublicKey { + if o == nil { + var ret PublicKey + return ret + } + + return o.OwningKey +} + +// GetOwningKeyOk returns a tuple with the OwningKey field value +// and a boolean to check if the value has been set. +func (o *Party) GetOwningKeyOk() (*PublicKey, bool) { + if o == nil { + return nil, false + } + return &o.OwningKey, true +} + +// SetOwningKey sets field value +func (o *Party) SetOwningKey(v PublicKey) { + o.OwningKey = v +} + +func (o Party) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Party) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["owningKey"] = o.OwningKey + return toSerialize, nil +} + +type NullableParty struct { + value *Party + isSet bool +} + +func (v NullableParty) Get() *Party { + return v.value +} + +func (v *NullableParty) Set(val *Party) { + v.value = val + v.isSet = true +} + +func (v NullableParty) IsSet() bool { + return v.isSet +} + +func (v *NullableParty) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableParty(val *Party) *NullableParty { + return &NullableParty{value: val, isSet: true} +} + +func (v NullableParty) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableParty) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_public_key.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_public_key.go new file mode 100644 index 00000000000..dd37ff728f3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_public_key.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the PublicKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublicKey{} + +// PublicKey An instance of a java.security.PublicKey (which is an interface) implementation such as org.hyperledger.cactus.plugin.ledger.connector.corda.server.impl.PublicKeyImpl +type PublicKey struct { + Algorithm string `json:"algorithm"` + Format string `json:"format"` + Encoded string `json:"encoded"` +} + +// NewPublicKey instantiates a new PublicKey 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 +// will change when the set of required properties is changed +func NewPublicKey(algorithm string, format string, encoded string) *PublicKey { + this := PublicKey{} + this.Algorithm = algorithm + this.Format = format + this.Encoded = encoded + return &this +} + +// NewPublicKeyWithDefaults instantiates a new PublicKey object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPublicKeyWithDefaults() *PublicKey { + this := PublicKey{} + return &this +} + +// GetAlgorithm returns the Algorithm field value +func (o *PublicKey) GetAlgorithm() string { + if o == nil { + var ret string + return ret + } + + return o.Algorithm +} + +// GetAlgorithmOk returns a tuple with the Algorithm field value +// and a boolean to check if the value has been set. +func (o *PublicKey) GetAlgorithmOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Algorithm, true +} + +// SetAlgorithm sets field value +func (o *PublicKey) SetAlgorithm(v string) { + o.Algorithm = v +} + +// GetFormat returns the Format field value +func (o *PublicKey) GetFormat() string { + if o == nil { + var ret string + return ret + } + + return o.Format +} + +// GetFormatOk returns a tuple with the Format field value +// and a boolean to check if the value has been set. +func (o *PublicKey) GetFormatOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Format, true +} + +// SetFormat sets field value +func (o *PublicKey) SetFormat(v string) { + o.Format = v +} + +// GetEncoded returns the Encoded field value +func (o *PublicKey) GetEncoded() string { + if o == nil { + var ret string + return ret + } + + return o.Encoded +} + +// GetEncodedOk returns a tuple with the Encoded field value +// and a boolean to check if the value has been set. +func (o *PublicKey) GetEncodedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Encoded, true +} + +// SetEncoded sets field value +func (o *PublicKey) SetEncoded(v string) { + o.Encoded = v +} + +func (o PublicKey) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublicKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["algorithm"] = o.Algorithm + toSerialize["format"] = o.Format + toSerialize["encoded"] = o.Encoded + return toSerialize, nil +} + +type NullablePublicKey struct { + value *PublicKey + isSet bool +} + +func (v NullablePublicKey) Get() *PublicKey { + return v.value +} + +func (v *NullablePublicKey) Set(val *PublicKey) { + v.value = val + v.isSet = true +} + +func (v NullablePublicKey) IsSet() bool { + return v.isSet +} + +func (v *NullablePublicKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublicKey(val *PublicKey) *NullablePublicKey { + return &NullablePublicKey{value: val, isSet: true} +} + +func (v NullablePublicKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublicKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_sha256.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_sha256.go new file mode 100644 index 00000000000..1232532fd68 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_sha256.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the SHA256 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SHA256{} + +// SHA256 SHA-256 is part of the SHA-2 hash function family. Generated hash is fixed size, 256-bits (32-bytes). +type SHA256 struct { + Bytes string `json:"bytes"` + Offset int32 `json:"offset"` + Size int32 `json:"size"` +} + +// NewSHA256 instantiates a new SHA256 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 +// will change when the set of required properties is changed +func NewSHA256(bytes string, offset int32, size int32) *SHA256 { + this := SHA256{} + this.Bytes = bytes + this.Offset = offset + this.Size = size + return &this +} + +// NewSHA256WithDefaults instantiates a new SHA256 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSHA256WithDefaults() *SHA256 { + this := SHA256{} + return &this +} + +// GetBytes returns the Bytes field value +func (o *SHA256) GetBytes() string { + if o == nil { + var ret string + return ret + } + + return o.Bytes +} + +// GetBytesOk returns a tuple with the Bytes field value +// and a boolean to check if the value has been set. +func (o *SHA256) GetBytesOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bytes, true +} + +// SetBytes sets field value +func (o *SHA256) SetBytes(v string) { + o.Bytes = v +} + +// GetOffset returns the Offset field value +func (o *SHA256) GetOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Offset +} + +// GetOffsetOk returns a tuple with the Offset field value +// and a boolean to check if the value has been set. +func (o *SHA256) GetOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Offset, true +} + +// SetOffset sets field value +func (o *SHA256) SetOffset(v int32) { + o.Offset = v +} + +// GetSize returns the Size field value +func (o *SHA256) GetSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *SHA256) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *SHA256) SetSize(v int32) { + o.Size = v +} + +func (o SHA256) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SHA256) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["bytes"] = o.Bytes + toSerialize["offset"] = o.Offset + toSerialize["size"] = o.Size + return toSerialize, nil +} + +type NullableSHA256 struct { + value *SHA256 + isSet bool +} + +func (v NullableSHA256) Get() *SHA256 { + return v.value +} + +func (v *NullableSHA256) Set(val *SHA256) { + v.value = val + v.isSet = true +} + +func (v NullableSHA256) IsSet() bool { + return v.isSet +} + +func (v *NullableSHA256) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSHA256(val *SHA256) *NullableSHA256 { + return &NullableSHA256{value: val, isSet: true} +} + +func (v NullableSHA256) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSHA256) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_start_monitor_v1_request.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_start_monitor_v1_request.go new file mode 100644 index 00000000000..bc311d5edad --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_start_monitor_v1_request.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the StartMonitorV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StartMonitorV1Request{} + +// StartMonitorV1Request struct for StartMonitorV1Request +type StartMonitorV1Request struct { + // ID of a client application that wants to monitor the state changes + ClientAppId string `json:"clientAppId"` + // The fully qualified name of the Corda state to monitor + StateFullClassName string `json:"stateFullClassName"` +} + +// NewStartMonitorV1Request instantiates a new StartMonitorV1Request 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 +// will change when the set of required properties is changed +func NewStartMonitorV1Request(clientAppId string, stateFullClassName string) *StartMonitorV1Request { + this := StartMonitorV1Request{} + this.ClientAppId = clientAppId + this.StateFullClassName = stateFullClassName + return &this +} + +// NewStartMonitorV1RequestWithDefaults instantiates a new StartMonitorV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStartMonitorV1RequestWithDefaults() *StartMonitorV1Request { + this := StartMonitorV1Request{} + return &this +} + +// GetClientAppId returns the ClientAppId field value +func (o *StartMonitorV1Request) GetClientAppId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientAppId +} + +// GetClientAppIdOk returns a tuple with the ClientAppId field value +// and a boolean to check if the value has been set. +func (o *StartMonitorV1Request) GetClientAppIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientAppId, true +} + +// SetClientAppId sets field value +func (o *StartMonitorV1Request) SetClientAppId(v string) { + o.ClientAppId = v +} + +// GetStateFullClassName returns the StateFullClassName field value +func (o *StartMonitorV1Request) GetStateFullClassName() string { + if o == nil { + var ret string + return ret + } + + return o.StateFullClassName +} + +// GetStateFullClassNameOk returns a tuple with the StateFullClassName field value +// and a boolean to check if the value has been set. +func (o *StartMonitorV1Request) GetStateFullClassNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateFullClassName, true +} + +// SetStateFullClassName sets field value +func (o *StartMonitorV1Request) SetStateFullClassName(v string) { + o.StateFullClassName = v +} + +func (o StartMonitorV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StartMonitorV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["clientAppId"] = o.ClientAppId + toSerialize["stateFullClassName"] = o.StateFullClassName + return toSerialize, nil +} + +type NullableStartMonitorV1Request struct { + value *StartMonitorV1Request + isSet bool +} + +func (v NullableStartMonitorV1Request) Get() *StartMonitorV1Request { + return v.value +} + +func (v *NullableStartMonitorV1Request) Set(val *StartMonitorV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableStartMonitorV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableStartMonitorV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStartMonitorV1Request(val *StartMonitorV1Request) *NullableStartMonitorV1Request { + return &NullableStartMonitorV1Request{value: val, isSet: true} +} + +func (v NullableStartMonitorV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStartMonitorV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_start_monitor_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_start_monitor_v1_response.go new file mode 100644 index 00000000000..9d0b707eb0b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_start_monitor_v1_response.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the StartMonitorV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StartMonitorV1Response{} + +// StartMonitorV1Response struct for StartMonitorV1Response +type StartMonitorV1Response struct { + // Flag set to true if monitoring started correctly. + Success bool `json:"success"` + // Message describing operation status or any errors that occurred. + Msg string `json:"msg"` +} + +// NewStartMonitorV1Response instantiates a new StartMonitorV1Response 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 +// will change when the set of required properties is changed +func NewStartMonitorV1Response(success bool, msg string) *StartMonitorV1Response { + this := StartMonitorV1Response{} + this.Success = success + this.Msg = msg + return &this +} + +// NewStartMonitorV1ResponseWithDefaults instantiates a new StartMonitorV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStartMonitorV1ResponseWithDefaults() *StartMonitorV1Response { + this := StartMonitorV1Response{} + return &this +} + +// GetSuccess returns the Success field value +func (o *StartMonitorV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *StartMonitorV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *StartMonitorV1Response) SetSuccess(v bool) { + o.Success = v +} + +// GetMsg returns the Msg field value +func (o *StartMonitorV1Response) GetMsg() string { + if o == nil { + var ret string + return ret + } + + return o.Msg +} + +// GetMsgOk returns a tuple with the Msg field value +// and a boolean to check if the value has been set. +func (o *StartMonitorV1Response) GetMsgOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Msg, true +} + +// SetMsg sets field value +func (o *StartMonitorV1Response) SetMsg(v string) { + o.Msg = v +} + +func (o StartMonitorV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StartMonitorV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["success"] = o.Success + toSerialize["msg"] = o.Msg + return toSerialize, nil +} + +type NullableStartMonitorV1Response struct { + value *StartMonitorV1Response + isSet bool +} + +func (v NullableStartMonitorV1Response) Get() *StartMonitorV1Response { + return v.value +} + +func (v *NullableStartMonitorV1Response) Set(val *StartMonitorV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableStartMonitorV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableStartMonitorV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStartMonitorV1Response(val *StartMonitorV1Response) *NullableStartMonitorV1Response { + return &NullableStartMonitorV1Response{value: val, isSet: true} +} + +func (v NullableStartMonitorV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStartMonitorV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_stop_monitor_v1_request.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_stop_monitor_v1_request.go new file mode 100644 index 00000000000..a8e42033c3e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_stop_monitor_v1_request.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the StopMonitorV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StopMonitorV1Request{} + +// StopMonitorV1Request struct for StopMonitorV1Request +type StopMonitorV1Request struct { + // ID of a client application that wants to monitor the state changes + ClientAppId string `json:"clientAppId"` + // The fully qualified name of the Corda state to monitor + StateFullClassName string `json:"stateFullClassName"` +} + +// NewStopMonitorV1Request instantiates a new StopMonitorV1Request 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 +// will change when the set of required properties is changed +func NewStopMonitorV1Request(clientAppId string, stateFullClassName string) *StopMonitorV1Request { + this := StopMonitorV1Request{} + this.ClientAppId = clientAppId + this.StateFullClassName = stateFullClassName + return &this +} + +// NewStopMonitorV1RequestWithDefaults instantiates a new StopMonitorV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStopMonitorV1RequestWithDefaults() *StopMonitorV1Request { + this := StopMonitorV1Request{} + return &this +} + +// GetClientAppId returns the ClientAppId field value +func (o *StopMonitorV1Request) GetClientAppId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientAppId +} + +// GetClientAppIdOk returns a tuple with the ClientAppId field value +// and a boolean to check if the value has been set. +func (o *StopMonitorV1Request) GetClientAppIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientAppId, true +} + +// SetClientAppId sets field value +func (o *StopMonitorV1Request) SetClientAppId(v string) { + o.ClientAppId = v +} + +// GetStateFullClassName returns the StateFullClassName field value +func (o *StopMonitorV1Request) GetStateFullClassName() string { + if o == nil { + var ret string + return ret + } + + return o.StateFullClassName +} + +// GetStateFullClassNameOk returns a tuple with the StateFullClassName field value +// and a boolean to check if the value has been set. +func (o *StopMonitorV1Request) GetStateFullClassNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateFullClassName, true +} + +// SetStateFullClassName sets field value +func (o *StopMonitorV1Request) SetStateFullClassName(v string) { + o.StateFullClassName = v +} + +func (o StopMonitorV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StopMonitorV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["clientAppId"] = o.ClientAppId + toSerialize["stateFullClassName"] = o.StateFullClassName + return toSerialize, nil +} + +type NullableStopMonitorV1Request struct { + value *StopMonitorV1Request + isSet bool +} + +func (v NullableStopMonitorV1Request) Get() *StopMonitorV1Request { + return v.value +} + +func (v *NullableStopMonitorV1Request) Set(val *StopMonitorV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableStopMonitorV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableStopMonitorV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStopMonitorV1Request(val *StopMonitorV1Request) *NullableStopMonitorV1Request { + return &NullableStopMonitorV1Request{value: val, isSet: true} +} + +func (v NullableStopMonitorV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStopMonitorV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_stop_monitor_v1_response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_stop_monitor_v1_response.go new file mode 100644 index 00000000000..c679dec5048 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_stop_monitor_v1_response.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the StopMonitorV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StopMonitorV1Response{} + +// StopMonitorV1Response struct for StopMonitorV1Response +type StopMonitorV1Response struct { + // Flag set to true if operation completed correctly. + Success bool `json:"success"` + // Message describing operation status or any errors that occurred. + Msg string `json:"msg"` +} + +// NewStopMonitorV1Response instantiates a new StopMonitorV1Response 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 +// will change when the set of required properties is changed +func NewStopMonitorV1Response(success bool, msg string) *StopMonitorV1Response { + this := StopMonitorV1Response{} + this.Success = success + this.Msg = msg + return &this +} + +// NewStopMonitorV1ResponseWithDefaults instantiates a new StopMonitorV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStopMonitorV1ResponseWithDefaults() *StopMonitorV1Response { + this := StopMonitorV1Response{} + return &this +} + +// GetSuccess returns the Success field value +func (o *StopMonitorV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *StopMonitorV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *StopMonitorV1Response) SetSuccess(v bool) { + o.Success = v +} + +// GetMsg returns the Msg field value +func (o *StopMonitorV1Response) GetMsg() string { + if o == nil { + var ret string + return ret + } + + return o.Msg +} + +// GetMsgOk returns a tuple with the Msg field value +// and a boolean to check if the value has been set. +func (o *StopMonitorV1Response) GetMsgOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Msg, true +} + +// SetMsg sets field value +func (o *StopMonitorV1Response) SetMsg(v string) { + o.Msg = v +} + +func (o StopMonitorV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StopMonitorV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["success"] = o.Success + toSerialize["msg"] = o.Msg + return toSerialize, nil +} + +type NullableStopMonitorV1Response struct { + value *StopMonitorV1Response + isSet bool +} + +func (v NullableStopMonitorV1Response) Get() *StopMonitorV1Response { + return v.value +} + +func (v *NullableStopMonitorV1Response) Set(val *StopMonitorV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableStopMonitorV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableStopMonitorV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStopMonitorV1Response(val *StopMonitorV1Response) *NullableStopMonitorV1Response { + return &NullableStopMonitorV1Response{value: val, isSet: true} +} + +func (v NullableStopMonitorV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStopMonitorV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_x500_principal.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_x500_principal.go new file mode 100644 index 00000000000..83b5c1d8559 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_x500_principal.go @@ -0,0 +1,145 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the X500Principal type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &X500Principal{} + +// X500Principal struct for X500Principal +type X500Principal struct { + Name string `json:"name"` + // Base64 encoded public key + Encoded string `json:"encoded"` +} + +// NewX500Principal instantiates a new X500Principal 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 +// will change when the set of required properties is changed +func NewX500Principal(name string, encoded string) *X500Principal { + this := X500Principal{} + this.Name = name + this.Encoded = encoded + return &this +} + +// NewX500PrincipalWithDefaults instantiates a new X500Principal object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewX500PrincipalWithDefaults() *X500Principal { + this := X500Principal{} + return &this +} + +// GetName returns the Name field value +func (o *X500Principal) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *X500Principal) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *X500Principal) SetName(v string) { + o.Name = v +} + +// GetEncoded returns the Encoded field value +func (o *X500Principal) GetEncoded() string { + if o == nil { + var ret string + return ret + } + + return o.Encoded +} + +// GetEncodedOk returns a tuple with the Encoded field value +// and a boolean to check if the value has been set. +func (o *X500Principal) GetEncodedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Encoded, true +} + +// SetEncoded sets field value +func (o *X500Principal) SetEncoded(v string) { + o.Encoded = v +} + +func (o X500Principal) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o X500Principal) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["encoded"] = o.Encoded + return toSerialize, nil +} + +type NullableX500Principal struct { + value *X500Principal + isSet bool +} + +func (v NullableX500Principal) Get() *X500Principal { + return v.value +} + +func (v *NullableX500Principal) Set(val *X500Principal) { + v.value = val + v.isSet = true +} + +func (v NullableX500Principal) IsSet() bool { + return v.isSet +} + +func (v *NullableX500Principal) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableX500Principal(val *X500Principal) *NullableX500Principal { + return &NullableX500Principal{value: val, isSet: true} +} + +func (v NullableX500Principal) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableX500Principal) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..8032f809b29 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..064cfe602e2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,145 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-ledger-connector-corda + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-ledger-connector-corda_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService ClearMonitorTransactionsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.ClearMonitorTransactionsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService DeployContractJarsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeployContractJarsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService DiagnoseNodeV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DiagnoseNodeV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetMonitorTransactionsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetMonitorTransactionsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPrometheusMetricsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPrometheusMetricsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeContractV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeContractV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService ListFlowsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.ListFlowsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService NetworkMapV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.NetworkMapV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService StartMonitorV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.StartMonitorV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService StopMonitorV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.StopMonitorV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..fd529066317 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..85332d768ff --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - Connector Corda + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..7315626e7a2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,102 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Request.java +src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Response.java +src/main/java/org/openapitools/client/model/CordaNodeSshCredentials.java +src/main/java/org/openapitools/client/model/CordaRpcCredentials.java +src/main/java/org/openapitools/client/model/CordaX500Name.java +src/main/java/org/openapitools/client/model/CordappDeploymentConfig.java +src/main/java/org/openapitools/client/model/CordappInfo.java +src/main/java/org/openapitools/client/model/DeployContractJarsBadRequestV1Response.java +src/main/java/org/openapitools/client/model/DeployContractJarsSuccessV1Response.java +src/main/java/org/openapitools/client/model/DeployContractJarsV1Request.java +src/main/java/org/openapitools/client/model/DiagnoseNodeV1Request.java +src/main/java/org/openapitools/client/model/DiagnoseNodeV1Response.java +src/main/java/org/openapitools/client/model/FlowInvocationType.java +src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Request.java +src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Response.java +src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInner.java +src/main/java/org/openapitools/client/model/InvokeContractV1Request.java +src/main/java/org/openapitools/client/model/InvokeContractV1Response.java +src/main/java/org/openapitools/client/model/JarFile.java +src/main/java/org/openapitools/client/model/JvmObject.java +src/main/java/org/openapitools/client/model/JvmType.java +src/main/java/org/openapitools/client/model/JvmTypeKind.java +src/main/java/org/openapitools/client/model/ListFlowsV1Request.java +src/main/java/org/openapitools/client/model/ListFlowsV1Response.java +src/main/java/org/openapitools/client/model/NetworkHostAndPort.java +src/main/java/org/openapitools/client/model/NodeDiagnosticInfo.java +src/main/java/org/openapitools/client/model/NodeInfo.java +src/main/java/org/openapitools/client/model/Party.java +src/main/java/org/openapitools/client/model/PublicKey.java +src/main/java/org/openapitools/client/model/SHA256.java +src/main/java/org/openapitools/client/model/StartMonitorV1Request.java +src/main/java/org/openapitools/client/model/StartMonitorV1Response.java +src/main/java/org/openapitools/client/model/StopMonitorV1Request.java +src/main/java/org/openapitools/client/model/StopMonitorV1Response.java +src/main/java/org/openapitools/client/model/X500Principal.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/ClearMonitorTransactionsV1RequestTest.java +src/test/java/org/openapitools/client/model/ClearMonitorTransactionsV1ResponseTest.java +src/test/java/org/openapitools/client/model/CordaNodeSshCredentialsTest.java +src/test/java/org/openapitools/client/model/CordaRpcCredentialsTest.java +src/test/java/org/openapitools/client/model/CordaX500NameTest.java +src/test/java/org/openapitools/client/model/CordappDeploymentConfigTest.java +src/test/java/org/openapitools/client/model/CordappInfoTest.java +src/test/java/org/openapitools/client/model/DeployContractJarsBadRequestV1ResponseTest.java +src/test/java/org/openapitools/client/model/DeployContractJarsSuccessV1ResponseTest.java +src/test/java/org/openapitools/client/model/DeployContractJarsV1RequestTest.java +src/test/java/org/openapitools/client/model/DiagnoseNodeV1RequestTest.java +src/test/java/org/openapitools/client/model/DiagnoseNodeV1ResponseTest.java +src/test/java/org/openapitools/client/model/FlowInvocationTypeTest.java +src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1RequestTest.java +src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTest.java +src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInnerTest.java +src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java +src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java +src/test/java/org/openapitools/client/model/JarFileTest.java +src/test/java/org/openapitools/client/model/JvmObjectTest.java +src/test/java/org/openapitools/client/model/JvmTypeKindTest.java +src/test/java/org/openapitools/client/model/JvmTypeTest.java +src/test/java/org/openapitools/client/model/ListFlowsV1RequestTest.java +src/test/java/org/openapitools/client/model/ListFlowsV1ResponseTest.java +src/test/java/org/openapitools/client/model/NetworkHostAndPortTest.java +src/test/java/org/openapitools/client/model/NodeDiagnosticInfoTest.java +src/test/java/org/openapitools/client/model/NodeInfoTest.java +src/test/java/org/openapitools/client/model/PartyTest.java +src/test/java/org/openapitools/client/model/PublicKeyTest.java +src/test/java/org/openapitools/client/model/SHA256Test.java +src/test/java/org/openapitools/client/model/StartMonitorV1RequestTest.java +src/test/java/org/openapitools/client/model/StartMonitorV1ResponseTest.java +src/test/java/org/openapitools/client/model/StopMonitorV1RequestTest.java +src/test/java/org/openapitools/client/model/StopMonitorV1ResponseTest.java +src/test/java/org/openapitools/client/model/X500PrincipalTest.java diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..5715223532a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,180 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Connector Corda +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a Corda ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + ClearMonitorTransactionsV1Request clearMonitorTransactionsV1Request = new ClearMonitorTransactionsV1Request(); // ClearMonitorTransactionsV1Request | + try { + ClearMonitorTransactionsV1Response result = apiInstance.clearMonitorTransactionsV1(clearMonitorTransactionsV1Request); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#clearMonitorTransactionsV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**clearMonitorTransactionsV1**](docs/DefaultApi.md#clearMonitorTransactionsV1) | **DELETE** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions | Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. +*DefaultApi* | [**deployContractJarsV1**](docs/DefaultApi.md#deployContractJarsV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars | Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). +*DefaultApi* | [**diagnoseNodeV1**](docs/DefaultApi.md#diagnoseNodeV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node | +*DefaultApi* | [**getMonitorTransactionsV1**](docs/DefaultApi.md#getMonitorTransactionsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions | Get transactions for monitored state classes. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**invokeContractV1**](docs/DefaultApi.md#invokeContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract | Invokes a contract on a Corda ledger (e.g. a flow) +*DefaultApi* | [**listFlowsV1**](docs/DefaultApi.md#listFlowsV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows | +*DefaultApi* | [**networkMapV1**](docs/DefaultApi.md#networkMapV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map | +*DefaultApi* | [**startMonitorV1**](docs/DefaultApi.md#startMonitorV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor | Start monitoring corda changes (transactions) of given state class +*DefaultApi* | [**stopMonitorV1**](docs/DefaultApi.md#stopMonitorV1) | **DELETE** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor | Stop monitoring corda changes (transactions) of given state class + + +## Documentation for Models + + - [ClearMonitorTransactionsV1Request](docs/ClearMonitorTransactionsV1Request.md) + - [ClearMonitorTransactionsV1Response](docs/ClearMonitorTransactionsV1Response.md) + - [CordaNodeSshCredentials](docs/CordaNodeSshCredentials.md) + - [CordaRpcCredentials](docs/CordaRpcCredentials.md) + - [CordaX500Name](docs/CordaX500Name.md) + - [CordappDeploymentConfig](docs/CordappDeploymentConfig.md) + - [CordappInfo](docs/CordappInfo.md) + - [DeployContractJarsBadRequestV1Response](docs/DeployContractJarsBadRequestV1Response.md) + - [DeployContractJarsSuccessV1Response](docs/DeployContractJarsSuccessV1Response.md) + - [DeployContractJarsV1Request](docs/DeployContractJarsV1Request.md) + - [DiagnoseNodeV1Request](docs/DiagnoseNodeV1Request.md) + - [DiagnoseNodeV1Response](docs/DiagnoseNodeV1Response.md) + - [FlowInvocationType](docs/FlowInvocationType.md) + - [GetMonitorTransactionsV1Request](docs/GetMonitorTransactionsV1Request.md) + - [GetMonitorTransactionsV1Response](docs/GetMonitorTransactionsV1Response.md) + - [GetMonitorTransactionsV1ResponseTxInner](docs/GetMonitorTransactionsV1ResponseTxInner.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [JarFile](docs/JarFile.md) + - [JvmObject](docs/JvmObject.md) + - [JvmType](docs/JvmType.md) + - [JvmTypeKind](docs/JvmTypeKind.md) + - [ListFlowsV1Request](docs/ListFlowsV1Request.md) + - [ListFlowsV1Response](docs/ListFlowsV1Response.md) + - [NetworkHostAndPort](docs/NetworkHostAndPort.md) + - [NodeDiagnosticInfo](docs/NodeDiagnosticInfo.md) + - [NodeInfo](docs/NodeInfo.md) + - [Party](docs/Party.md) + - [PublicKey](docs/PublicKey.md) + - [SHA256](docs/SHA256.md) + - [StartMonitorV1Request](docs/StartMonitorV1Request.md) + - [StartMonitorV1Response](docs/StartMonitorV1Response.md) + - [StopMonitorV1Request](docs/StopMonitorV1Request.md) + - [StopMonitorV1Response](docs/StopMonitorV1Response.md) + - [X500Principal](docs/X500Principal.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..9f80352f722 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,1404 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Corda ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Corda + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars: + post: + operationId: deployContractJarsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsSuccessV1Response' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJarsBadRequestV1Response' + description: Bad Request + summary: "Deploys a set of jar files (Cordapps, e.g. the contracts in Corda\ + \ speak)." + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a Corda ledger (e.g. a flow) + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor: + post: + operationId: startMonitorV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StartMonitorV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StartMonitorV1Response' + description: OK + summary: Start monitoring corda changes (transactions) of given state class + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions: + get: + operationId: GetMonitorTransactionsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetMonitorTransactionsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetMonitorTransactionsV1Response' + description: OK + summary: Get transactions for monitored state classes. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions + verbLowerCase: get + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions: + delete: + operationId: ClearMonitorTransactionsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClearMonitorTransactionsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ClearMonitorTransactionsV1Response' + description: OK + summary: Clear transactions from internal store so they'll not be available + by GetMonitorTransactionsV1 anymore. + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions + verbLowerCase: delete + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor: + delete: + operationId: stopMonitorV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StopMonitorV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StopMonitorV1Response' + description: OK + summary: Stop monitoring corda changes (transactions) of given state class + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor + verbLowerCase: delete + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map: + post: + description: "Responds with a snapshot of the network map as provided by the\ + \ Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun\ + \ networkMapSnapshot(): List" + operationId: networkMapV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkMapV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkMapV1Response' + description: OK + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows: + post: + description: Responds with a list of the flows on the Corda node. + operationId: listFlowsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ListFlowsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ListFlowsV1Response' + description: OK + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node: + post: + description: Responds with diagnostic information about the Corda node + operationId: diagnoseNodeV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DiagnoseNodeV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DiagnoseNodeV1Response' + description: OK + x-hyperledger-cacti: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node + verbLowerCase: post + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics + x-accepts: text/plain +components: + schemas: + SHA256: + description: "SHA-256 is part of the SHA-2 hash function family. Generated hash\ + \ is fixed size, 256-bits (32-bytes)." + example: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + externalDocs: + description: Official Corda documentation of the SHA256 class. + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.crypto/-secure-hash/-s-h-a256/index.html + properties: + bytes: + example: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + type: string + offset: + example: 0 + type: integer + size: + example: 32 + type: integer + required: + - bytes + - offset + - size + type: object + CordappInfo: + description: A CordappInfo describes a single CorDapp currently installed on + the node + example: + licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + externalDocs: + description: Official Corda Documentation of the class CordappInfo + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.cordapp/-cordapp-info/index.html + properties: + jarHash: + $ref: '#/components/schemas/SHA256' + licence: + description: The name of the licence this CorDapp is released under + type: string + minimumPlatformVersion: + description: The minimum platform version the node must be at for the CorDapp + to run + type: integer + name: + description: The name of the JAR file that defines the CorDapp + type: string + shortName: + description: The name of the CorDapp + type: string + targetPlatformVersion: + description: The target platform version this CorDapp has been tested against + type: integer + type: + description: "A description of what sort of CorDapp this is - either a contract,\ + \ workflow, or a combination." + type: string + vendor: + description: The vendor of this CorDapp + type: string + version: + description: The version of this CorDapp + type: string + required: + - jarHash + - licence + - minimumPlatformVersion + - name + - shortName + - targetPlatformVersion + - type + - vendor + - version + type: object + NodeDiagnosticInfo: + description: A NodeDiagnosticInfo holds information about the current node version. + example: + vendor: vendor + platformVersion: 1 + version: version + cordapps: + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + revision: revision + externalDocs: + description: Official Corda Documentation of the class NodeDiagnosticInfo + url: https://api.corda.net/api/corda-os/4.6/html/api/kotlin/corda/net.corda.core.node/-node-diagnostic-info/index.html + properties: + cordapps: + description: A list of CorDapps currently installed on this node + items: + $ref: '#/components/schemas/CordappInfo' + maxItems: 4096 + minItems: 0 + type: array + platformVersion: + description: "The platform version of this node. This number represents\ + \ a released API version, and should be used to make functionality decisions\ + \ (e.g. enabling an app feature only if an underlying platform feature\ + \ exists)" + type: integer + revision: + description: The git commit hash this node was built from + type: string + vendor: + description: The vendor of this node + type: string + version: + description: "The current node version string, e.g. 4.3, 4.4-SNAPSHOT. Note\ + \ that this string is effectively freeform, and so should only be used\ + \ for providing diagnostic information. It should not be used to make\ + \ functionality decisions (the platformVersion is a better fit for this)." + type: string + required: + - cordapps + - platformVersion + - revision + - vendor + - version + type: object + FlowInvocationType: + description: Determines which flow starting method will be used on the back-end + when invoking the flow. Based on the value here the plugin back-end might + invoke the rpc.startFlowDynamic() method or the rpc.startTrackedFlowDynamic() + method. Streamed responses are aggregated and returned in a single response + to HTTP callers who are not equipped to handle streams like WebSocket/gRPC/etc. + do. + enum: + - TRACKED_FLOW_DYNAMIC + - FLOW_DYNAMIC + nullable: false + type: string + JarFile: + additionalProperties: true + example: + filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + properties: + filename: + maxLength: 255 + minLength: 1 + nullable: false + type: string + hasDbMigrations: + description: Indicates whether the cordapp jar in question contains any + embedded migrations that Cactus can/should execute between copying the + jar into the cordapp directory and starting the node back up. + nullable: false + type: boolean + contentBase64: + format: base64 + maxLength: 1073741824 + minLength: 1 + nullable: false + type: string + required: + - contentBase64 + - filename + - hasDbMigrations + type: object + JvmType: + description: Represents a reference to a JVM type (such as a Java class) + example: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + properties: + fqClassName: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + constructorName: + description: This parameter is used to specify that the function used to + construct this JvmType is not a constructor function but instead is a + factory function. Setting this parameter will cause the plugin to look + up methods of the class denoted by fqClassName instead of its constructors. + maxLength: 65535 + minLength: 1 + nullable: false + type: string + invocationTarget: + $ref: '#/components/schemas/JvmObject' + required: + - fqClassName + type: object + JvmTypeKind: + enum: + - PRIMITIVE + - REFERENCE + nullable: false + type: string + JvmObject: + description: "Can represent JVM primitive and reference types as well. The jvmTypeKind\ + \ field indicates which one is being stored. If the jvmTypeKind field is set\ + \ to REFERENCE then the jvmCtorArgs array is expected to be filled, otherwise\ + \ (e.g. PRIMITIVE jvmTypeKind) it is expected that the primitiveValue property\ + \ is filled with a primitive data type supported by the JSON standard such\ + \ as strings, booleans, numbers, etc." + example: + jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + properties: + jvmTypeKind: + $ref: '#/components/schemas/JvmTypeKind' + primitiveValue: + type: object + jvmCtorArgs: + default: [] + items: + $ref: '#/components/schemas/JvmObject' + maxLength: 1024 + minLength: 0 + nullable: false + type: array + jvmType: + $ref: '#/components/schemas/JvmType' + required: + - jvmType + - jvmTypeKind + type: object + CordappDeploymentConfig: + example: + cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + sshCredentials: + $ref: '#/components/schemas/CordaNodeSshCredentials' + rpcCredentials: + $ref: '#/components/schemas/CordaRpcCredentials' + cordaNodeStartCmd: + description: The shell command to execute in order to start back up a Corda + node after having placed new jars in the cordapp directory of said node. + example: ./build/nodes/runNodes + maxLength: 65535 + minLength: 1 + nullable: false + type: string + cordappDir: + description: The absolute file system path where the Corda Node is expecting + deployed Cordapp jar files to be placed. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + cordaJarPath: + description: The absolute file system path where the corda.jar file of the + node can be found. This is used to execute database schema migrations + where applicable (H2 database in use in development environments). + maxLength: 2048 + minLength: 1 + nullable: false + type: string + nodeBaseDirPath: + description: The absolute file system path where the base directory of the + Corda node can be found. This is used to pass in to corda.jar when being + invoked for certain tasks such as executing database schema migrations + for a deployed contract. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + required: + - cordaJarPath + - cordaNodeStartCmd + - cordappDir + - nodeBaseDirPath + - rpcCredentials + - sshCredentials + type: object + CordaRpcCredentials: + example: + hostname: hostname + password: password + port: 39501 + username: username + properties: + hostname: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + port: + maximum: 65535 + minimum: 1 + nullable: false + type: integer + username: + maxLength: 1024 + minLength: 1 + nullable: false + type: string + password: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + required: + - hostname + - password + - port + - username + type: object + CordaNodeSshCredentials: + example: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + hostKeyEntry: + example: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + maxLength: 65535 + minLength: 1 + nullable: false + type: string + username: + maxLength: 32 + minLength: 1 + nullable: false + type: string + password: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + hostname: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + port: + maximum: 65535 + minimum: 1 + nullable: false + type: integer + required: + - hostKeyEntry + - hostname + - password + - port + - username + type: object + DeployContractJarsV1Request: + additionalProperties: false + example: + jarFiles: + - filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + - filename: filename + contentBase64: contentBase64 + hasDbMigrations: true + cordappDeploymentConfigs: + - cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + - cordaJarPath: cordaJarPath + cordaNodeStartCmd: ./build/nodes/runNodes + cordappDir: cordappDir + nodeBaseDirPath: nodeBaseDirPath + rpcCredentials: + hostname: hostname + password: password + port: 39501 + username: username + sshCredentials: + password: password + hostname: hostname + port: 5249 + hostKeyEntry: localhost ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmhSBtMctNa4hsZt8QGlsYSE5/gMkjeand69Vj4ir13 + username: username + properties: + cordappDeploymentConfigs: + default: [] + description: The list of deployment configurations pointing to the nodes + where the provided cordapp jar files are to be deployed . + items: + $ref: '#/components/schemas/CordappDeploymentConfig' + maxLength: 1024 + minLength: 0 + type: array + jarFiles: + items: + $ref: '#/components/schemas/JarFile' + nullable: false + type: array + required: + - cordappDeploymentConfigs + - jarFiles + type: object + DeployContractJarsSuccessV1Response: + example: + deployedJarFiles: + - deployedJarFiles + - deployedJarFiles + properties: + deployedJarFiles: + items: + minItems: 1 + nullable: false + type: string + type: array + required: + - deployedJarFiles + type: object + DeployContractJarsBadRequestV1Response: + properties: + errors: + items: + maxItems: 2048 + maxLength: 65535 + minItems: 1 + minLength: 1 + type: string + type: array + required: + - errors + type: object + InvokeContractV1Request: + additionalProperties: false + example: + flowInvocationType: null + timeoutMs: 0 + flowFullClassName: net.corda.samples.obligation.flows.IOUIssueFlow + params: + - jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + - jvmCtorArgs: + - null + - null + jvmType: + constructorName: constructorName + invocationTarget: null + fqClassName: fqClassName + primitiveValue: "{}" + jvmTypeKind: null + properties: + flowFullClassName: + description: The fully qualified name of the Corda flow to invoke + example: net.corda.samples.obligation.flows.IOUIssueFlow + maxLength: 1024 + minLength: 1 + nullable: false + type: string + flowInvocationType: + $ref: '#/components/schemas/FlowInvocationType' + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: + $ref: '#/components/schemas/JvmObject' + nullable: false + type: array + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. + minimum: 0 + nullable: false + type: integer + required: + - flowFullClassName + - flowInvocationType + - params + - signingCredential + type: object + InvokeContractV1Response: + example: + callOutput: "{}" + success: true + progress: + - progress + - progress + flowId: flowId + transactionId: transactionId + properties: + success: + nullable: false + type: boolean + callOutput: + description: Data returned from the JVM when no transaction is running + type: object + transactionId: + description: The net.corda.core.flows.StateMachineRunId value returned by + the flow execution. + maxLength: 1024 + minLength: 1 + nullable: false + type: string + progress: + default: [] + description: "An array of strings representing the aggregated stream of\ + \ progress updates provided by a *tracked* flow invocation. If the flow\ + \ invocation was not tracked, this array is still returned, but as empty." + items: + maxItems: 10000000 + minItems: 0 + type: string + type: array + flowId: + description: The id for the flow handle + type: string + required: + - callOutput + - flowId + - success + type: object + StartMonitorV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + StartMonitorV1Response: + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if monitoring started correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + GetMonitorTransactionsV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + GetMonitorTransactionsV1Response: + example: + msg: msg + tx: + - data: data + index: index + - data: data + index: index + success: true + stateFullClassName: net.corda.samples.example.states.IOUState + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + tx: + default: [] + items: + $ref: '#/components/schemas/GetMonitorTransactionsV1Response_tx_inner' + type: array + required: + - msg + - success + type: object + ClearMonitorTransactionsV1Request: + additionalProperties: false + example: + txIndexes: + - txIndexes + - txIndexes + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + txIndexes: + default: [] + items: + type: string + type: array + required: + - clientAppId + - stateFullClassName + - txIndexes + type: object + ClearMonitorTransactionsV1Response: + additionalProperties: false + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + StopMonitorV1Request: + additionalProperties: false + example: + stateFullClassName: net.corda.samples.example.states.IOUState + clientAppId: frond_v1_x_7Hdg6s + properties: + clientAppId: + description: ID of a client application that wants to monitor the state + changes + example: frond_v1_x_7Hdg6s + maxLength: 1024 + minLength: 1 + nullable: false + type: string + stateFullClassName: + description: The fully qualified name of the Corda state to monitor + example: net.corda.samples.example.states.IOUState + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - clientAppId + - stateFullClassName + type: object + StopMonitorV1Response: + example: + msg: msg + success: true + properties: + success: + description: Flag set to true if operation completed correctly. + nullable: false + type: boolean + msg: + description: Message describing operation status or any errors that occurred. + nullable: false + type: string + required: + - msg + - success + type: object + ListFlowsV1Request: + additionalProperties: false + example: + filter: filter + properties: + filter: + type: string + type: object + ListFlowsV1Response: + example: + flowNames: + - net.corda.finance.flows.CashExitFlow + - net.corda.finance.flows.CashIssueAndPaymentFlow + - net.corda.finance.flows.CashIssueFlow + - net.corda.finance.flows.CashPaymentFlow + - net.corda.finance.internal.CashConfigDataFlow + - net.corda.samples.obligation.flows.IOUIssueFlow + - net.corda.samples.obligation.flows.IOUSettleFlow + - net.corda.samples.obligation.flows.IOUTransferFlow + - net.corda.samples.obligation.flows.SelfIssueCashFlow + properties: + flowNames: + default: [] + description: An array of strings storing the names of the flows as returned + by the flowList Corda RPC. + example: + - net.corda.finance.flows.CashExitFlow + - net.corda.finance.flows.CashIssueAndPaymentFlow + - net.corda.finance.flows.CashIssueFlow + - net.corda.finance.flows.CashPaymentFlow + - net.corda.finance.internal.CashConfigDataFlow + - net.corda.samples.obligation.flows.IOUIssueFlow + - net.corda.samples.obligation.flows.IOUSettleFlow + - net.corda.samples.obligation.flows.IOUTransferFlow + - net.corda.samples.obligation.flows.SelfIssueCashFlow + items: + maxItems: 10000000 + minItems: 0 + type: string + type: array + required: + - flowNames + type: object + NetworkHostAndPort: + example: + port: 0.8008281904610115 + host: host + properties: + host: + type: string + port: + type: number + required: + - host + - port + type: object + PartyAndCertificate: + type: object + PublicKey: + description: An instance of a java.security.PublicKey (which is an interface) + implementation such as org.hyperledger.cactus.plugin.ledger.connector.corda.server.impl.PublicKeyImpl + example: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + properties: + algorithm: + example: EdDSA + type: string + format: + example: X.509 + type: string + encoded: + example: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + type: string + required: + - algorithm + - encoded + - format + type: object + X500Principal: + example: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + properties: + name: + example: "O=PartyA,L=London,C=GB" + type: string + encoded: + description: Base64 encoded public key + example: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + type: string + required: + - encoded + - name + type: object + CordaX500Name: + example: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + properties: + commonName: + type: string + organisationUnit: + type: string + organisation: + example: PartyA + type: string + locality: + example: London + type: string + state: + type: string + country: + example: GB + type: string + x500Principal: + $ref: '#/components/schemas/X500Principal' + required: + - country + - locality + - organisation + - x500Principal + type: object + Party: + example: + owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + properties: + name: + $ref: '#/components/schemas/CordaX500Name' + owningKey: + $ref: '#/components/schemas/PublicKey' + required: + - name + - owningKey + type: object + NodeInfo: + example: + legalIdentities: + - owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + - owningKey: + format: X.509 + algorithm: EdDSA + encoded: MCowBQYDK2VwAyEAac1p4wLsAh70VJOcudQppu7NnKxyoKxVN0DbfTxF+54= + name: + commonName: commonName + country: GB + organisationUnit: organisationUnit + locality: London + x500Principal: + name: "O=PartyA,L=London,C=GB" + encoded: MC8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQHDAZMb25kb24xDzANBgNVBAoMBlBhcnR5QQ== + organisation: PartyA + state: state + addresses: + - port: 0.8008281904610115 + host: host + - port: 0.8008281904610115 + host: host + serial: 1.4658129805029452 + platformVersion: 6 + legalIdentitiesAndCerts: + - null + - null + properties: + addresses: + items: + $ref: '#/components/schemas/NetworkHostAndPort' + type: array + platformVersion: + type: integer + serial: + type: number + legalIdentities: + items: + $ref: '#/components/schemas/Party' + type: array + legalIdentitiesAndCerts: + items: + $ref: '#/components/schemas/PartyAndCertificate' + type: array + required: + - addresses + - legalIdentities + - legalIdentitiesAndCerts + - platformVersion + - serial + type: object + NetworkMapV1Request: + type: object + NetworkMapV1Response: + items: + $ref: '#/components/schemas/NodeInfo' + maxItems: 2048 + minItems: 1 + nullable: false + type: array + DiagnoseNodeV1Request: + additionalProperties: false + example: + nodeIds: + - nodeIds + - nodeIds + - nodeIds + - nodeIds + - nodeIds + properties: + nodeIds: + default: [] + description: "Optional property specifying which Corda Node should be the\ + \ one being diagnosed in case the Connector has multiple connections established\ + \ for different nodes (which is not yet a supported feature, but we want\ + \ to keep this possibility open for the future)." + items: + nullable: false + type: string + maxItems: 1024 + minItems: 0 + type: array + type: object + DiagnoseNodeV1Response: + example: + nodeDiagnosticInfo: + vendor: vendor + platformVersion: 1 + version: version + cordapps: + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + - licence: licence + targetPlatformVersion: 6 + vendor: vendor + name: name + jarHash: + offset: 0 + size: 32 + bytes: Vf9MllnrC7vrWxrlDE94OzPMZW7At1HhTETL/XjiAmc= + shortName: shortName + type: type + version: version + minimumPlatformVersion: 0 + revision: revision + properties: + nodeDiagnosticInfo: + $ref: '#/components/schemas/NodeDiagnosticInfo' + required: + - nodeDiagnosticInfo + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + GetMonitorTransactionsV1Response_tx_inner: + example: + data: data + index: index + properties: + index: + type: string + data: + maxItems: 10000000 + minItems: 0 + type: string + type: object + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..59711fcaefc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..e4a514eb780 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..163aefa16dc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..9b3d7a788c0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..a68eb0cf2d7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..255efad5c5e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..44a8243c61b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,433 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.ClearMonitorTransactionsV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ClearMonitorTransactionsV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CordaNodeSshCredentials.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CordaRpcCredentials.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CordaX500Name.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CordappDeploymentConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CordappInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractJarsBadRequestV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractJarsSuccessV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractJarsV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DiagnoseNodeV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DiagnoseNodeV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetMonitorTransactionsV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetMonitorTransactionsV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetMonitorTransactionsV1ResponseTxInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.JarFile.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.JvmObject.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.JvmType.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ListFlowsV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ListFlowsV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NetworkHostAndPort.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NodeDiagnosticInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NodeInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Party.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PublicKey.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SHA256.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.StartMonitorV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.StartMonitorV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.StopMonitorV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.StopMonitorV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.X500Principal.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); + } + } + } + + /** + * 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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..803b76c4f82 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..f959c4aa727 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..38564f42e0b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..fb93a4e9caf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..0fa383e9a3d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,1272 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.ClearMonitorTransactionsV1Request; +import org.openapitools.client.model.ClearMonitorTransactionsV1Response; +import org.openapitools.client.model.DeployContractJarsBadRequestV1Response; +import org.openapitools.client.model.DeployContractJarsSuccessV1Response; +import org.openapitools.client.model.DeployContractJarsV1Request; +import org.openapitools.client.model.DiagnoseNodeV1Request; +import org.openapitools.client.model.DiagnoseNodeV1Response; +import org.openapitools.client.model.GetMonitorTransactionsV1Request; +import org.openapitools.client.model.GetMonitorTransactionsV1Response; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.ListFlowsV1Request; +import org.openapitools.client.model.ListFlowsV1Response; +import org.openapitools.client.model.NodeInfo; +import org.openapitools.client.model.StartMonitorV1Request; +import org.openapitools.client.model.StartMonitorV1Response; +import org.openapitools.client.model.StopMonitorV1Request; +import org.openapitools.client.model.StopMonitorV1Response; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 clearMonitorTransactionsV1 + * @param clearMonitorTransactionsV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call clearMonitorTransactionsV1Call(ClearMonitorTransactionsV1Request clearMonitorTransactionsV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = clearMonitorTransactionsV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/clear-monitor-transactions"; + + 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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call clearMonitorTransactionsV1ValidateBeforeCall(ClearMonitorTransactionsV1Request clearMonitorTransactionsV1Request, final ApiCallback _callback) throws ApiException { + return clearMonitorTransactionsV1Call(clearMonitorTransactionsV1Request, _callback); + + } + + /** + * Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. + * + * @param clearMonitorTransactionsV1Request (optional) + * @return ClearMonitorTransactionsV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ClearMonitorTransactionsV1Response clearMonitorTransactionsV1(ClearMonitorTransactionsV1Request clearMonitorTransactionsV1Request) throws ApiException { + ApiResponse localVarResp = clearMonitorTransactionsV1WithHttpInfo(clearMonitorTransactionsV1Request); + return localVarResp.getData(); + } + + /** + * Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. + * + * @param clearMonitorTransactionsV1Request (optional) + * @return ApiResponse<ClearMonitorTransactionsV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse clearMonitorTransactionsV1WithHttpInfo(ClearMonitorTransactionsV1Request clearMonitorTransactionsV1Request) throws ApiException { + okhttp3.Call localVarCall = clearMonitorTransactionsV1ValidateBeforeCall(clearMonitorTransactionsV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. (asynchronously) + * + * @param clearMonitorTransactionsV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call clearMonitorTransactionsV1Async(ClearMonitorTransactionsV1Request clearMonitorTransactionsV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = clearMonitorTransactionsV1ValidateBeforeCall(clearMonitorTransactionsV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deployContractJarsV1 + * @param deployContractJarsV1Request (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 + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ */ + public okhttp3.Call deployContractJarsV1Call(DeployContractJarsV1Request deployContractJarsV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractJarsV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/deploy-contract-jars"; + + 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 deployContractJarsV1ValidateBeforeCall(DeployContractJarsV1Request deployContractJarsV1Request, final ApiCallback _callback) throws ApiException { + return deployContractJarsV1Call(deployContractJarsV1Request, _callback); + + } + + /** + * Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). + * + * @param deployContractJarsV1Request (optional) + * @return DeployContractJarsSuccessV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ */ + public DeployContractJarsSuccessV1Response deployContractJarsV1(DeployContractJarsV1Request deployContractJarsV1Request) throws ApiException { + ApiResponse localVarResp = deployContractJarsV1WithHttpInfo(deployContractJarsV1Request); + return localVarResp.getData(); + } + + /** + * Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). + * + * @param deployContractJarsV1Request (optional) + * @return ApiResponse<DeployContractJarsSuccessV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ */ + public ApiResponse deployContractJarsV1WithHttpInfo(DeployContractJarsV1Request deployContractJarsV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractJarsV1ValidateBeforeCall(deployContractJarsV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). (asynchronously) + * + * @param deployContractJarsV1Request (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 + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ */ + public okhttp3.Call deployContractJarsV1Async(DeployContractJarsV1Request deployContractJarsV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractJarsV1ValidateBeforeCall(deployContractJarsV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for diagnoseNodeV1 + * @param diagnoseNodeV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call diagnoseNodeV1Call(DiagnoseNodeV1Request diagnoseNodeV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = diagnoseNodeV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/diagnose-node"; + + 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 diagnoseNodeV1ValidateBeforeCall(DiagnoseNodeV1Request diagnoseNodeV1Request, final ApiCallback _callback) throws ApiException { + return diagnoseNodeV1Call(diagnoseNodeV1Request, _callback); + + } + + /** + * + * Responds with diagnostic information about the Corda node + * @param diagnoseNodeV1Request (optional) + * @return DiagnoseNodeV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DiagnoseNodeV1Response diagnoseNodeV1(DiagnoseNodeV1Request diagnoseNodeV1Request) throws ApiException { + ApiResponse localVarResp = diagnoseNodeV1WithHttpInfo(diagnoseNodeV1Request); + return localVarResp.getData(); + } + + /** + * + * Responds with diagnostic information about the Corda node + * @param diagnoseNodeV1Request (optional) + * @return ApiResponse<DiagnoseNodeV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse diagnoseNodeV1WithHttpInfo(DiagnoseNodeV1Request diagnoseNodeV1Request) throws ApiException { + okhttp3.Call localVarCall = diagnoseNodeV1ValidateBeforeCall(diagnoseNodeV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Responds with diagnostic information about the Corda node + * @param diagnoseNodeV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call diagnoseNodeV1Async(DiagnoseNodeV1Request diagnoseNodeV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = diagnoseNodeV1ValidateBeforeCall(diagnoseNodeV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getMonitorTransactionsV1 + * @param getMonitorTransactionsV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getMonitorTransactionsV1Call(GetMonitorTransactionsV1Request getMonitorTransactionsV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getMonitorTransactionsV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-monitor-transactions"; + + 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, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMonitorTransactionsV1ValidateBeforeCall(GetMonitorTransactionsV1Request getMonitorTransactionsV1Request, final ApiCallback _callback) throws ApiException { + return getMonitorTransactionsV1Call(getMonitorTransactionsV1Request, _callback); + + } + + /** + * Get transactions for monitored state classes. + * + * @param getMonitorTransactionsV1Request (optional) + * @return GetMonitorTransactionsV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public GetMonitorTransactionsV1Response getMonitorTransactionsV1(GetMonitorTransactionsV1Request getMonitorTransactionsV1Request) throws ApiException { + ApiResponse localVarResp = getMonitorTransactionsV1WithHttpInfo(getMonitorTransactionsV1Request); + return localVarResp.getData(); + } + + /** + * Get transactions for monitored state classes. + * + * @param getMonitorTransactionsV1Request (optional) + * @return ApiResponse<GetMonitorTransactionsV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getMonitorTransactionsV1WithHttpInfo(GetMonitorTransactionsV1Request getMonitorTransactionsV1Request) throws ApiException { + okhttp3.Call localVarCall = getMonitorTransactionsV1ValidateBeforeCall(getMonitorTransactionsV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get transactions for monitored state classes. (asynchronously) + * + * @param getMonitorTransactionsV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getMonitorTransactionsV1Async(GetMonitorTransactionsV1Request getMonitorTransactionsV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getMonitorTransactionsV1ValidateBeforeCall(getMonitorTransactionsV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + 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 getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeContractV1 + * @param invokeContractV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Call(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/invoke-contract"; + + 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 invokeContractV1ValidateBeforeCall(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + return invokeContractV1Call(invokeContractV1Request, _callback); + + } + + /** + * Invokes a contract on a Corda ledger (e.g. a flow) + * + * @param invokeContractV1Request (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response invokeContractV1(InvokeContractV1Request invokeContractV1Request) throws ApiException { + ApiResponse localVarResp = invokeContractV1WithHttpInfo(invokeContractV1Request); + return localVarResp.getData(); + } + + /** + * Invokes a contract on a Corda ledger (e.g. a flow) + * + * @param invokeContractV1Request (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeContractV1WithHttpInfo(InvokeContractV1Request invokeContractV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invokes a contract on a Corda ledger (e.g. a flow) (asynchronously) + * + * @param invokeContractV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Async(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listFlowsV1 + * @param listFlowsV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call listFlowsV1Call(ListFlowsV1Request listFlowsV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = listFlowsV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows"; + + 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 listFlowsV1ValidateBeforeCall(ListFlowsV1Request listFlowsV1Request, final ApiCallback _callback) throws ApiException { + return listFlowsV1Call(listFlowsV1Request, _callback); + + } + + /** + * + * Responds with a list of the flows on the Corda node. + * @param listFlowsV1Request (optional) + * @return ListFlowsV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ListFlowsV1Response listFlowsV1(ListFlowsV1Request listFlowsV1Request) throws ApiException { + ApiResponse localVarResp = listFlowsV1WithHttpInfo(listFlowsV1Request); + return localVarResp.getData(); + } + + /** + * + * Responds with a list of the flows on the Corda node. + * @param listFlowsV1Request (optional) + * @return ApiResponse<ListFlowsV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse listFlowsV1WithHttpInfo(ListFlowsV1Request listFlowsV1Request) throws ApiException { + okhttp3.Call localVarCall = listFlowsV1ValidateBeforeCall(listFlowsV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Responds with a list of the flows on the Corda node. + * @param listFlowsV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call listFlowsV1Async(ListFlowsV1Request listFlowsV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listFlowsV1ValidateBeforeCall(listFlowsV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for networkMapV1 + * @param body (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call networkMapV1Call(Object body, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/network-map"; + + 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 networkMapV1ValidateBeforeCall(Object body, final ApiCallback _callback) throws ApiException { + return networkMapV1Call(body, _callback); + + } + + /** + * + * Responds with a snapshot of the network map as provided by the Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun networkMapSnapshot(): List<NodeInfo> + * @param body (optional) + * @return List<NodeInfo> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public List networkMapV1(Object body) throws ApiException { + ApiResponse> localVarResp = networkMapV1WithHttpInfo(body); + return localVarResp.getData(); + } + + /** + * + * Responds with a snapshot of the network map as provided by the Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun networkMapSnapshot(): List<NodeInfo> + * @param body (optional) + * @return ApiResponse<List<NodeInfo>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse> networkMapV1WithHttpInfo(Object body) throws ApiException { + okhttp3.Call localVarCall = networkMapV1ValidateBeforeCall(body, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Responds with a snapshot of the network map as provided by the Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun networkMapSnapshot(): List<NodeInfo> + * @param body (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call networkMapV1Async(Object body, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = networkMapV1ValidateBeforeCall(body, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for startMonitorV1 + * @param startMonitorV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call startMonitorV1Call(StartMonitorV1Request startMonitorV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = startMonitorV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/start-monitor"; + + 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 startMonitorV1ValidateBeforeCall(StartMonitorV1Request startMonitorV1Request, final ApiCallback _callback) throws ApiException { + return startMonitorV1Call(startMonitorV1Request, _callback); + + } + + /** + * Start monitoring corda changes (transactions) of given state class + * + * @param startMonitorV1Request (optional) + * @return StartMonitorV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public StartMonitorV1Response startMonitorV1(StartMonitorV1Request startMonitorV1Request) throws ApiException { + ApiResponse localVarResp = startMonitorV1WithHttpInfo(startMonitorV1Request); + return localVarResp.getData(); + } + + /** + * Start monitoring corda changes (transactions) of given state class + * + * @param startMonitorV1Request (optional) + * @return ApiResponse<StartMonitorV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse startMonitorV1WithHttpInfo(StartMonitorV1Request startMonitorV1Request) throws ApiException { + okhttp3.Call localVarCall = startMonitorV1ValidateBeforeCall(startMonitorV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Start monitoring corda changes (transactions) of given state class (asynchronously) + * + * @param startMonitorV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call startMonitorV1Async(StartMonitorV1Request startMonitorV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = startMonitorV1ValidateBeforeCall(startMonitorV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for stopMonitorV1 + * @param stopMonitorV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call stopMonitorV1Call(StopMonitorV1Request stopMonitorV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = stopMonitorV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/stop-monitor"; + + 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, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call stopMonitorV1ValidateBeforeCall(StopMonitorV1Request stopMonitorV1Request, final ApiCallback _callback) throws ApiException { + return stopMonitorV1Call(stopMonitorV1Request, _callback); + + } + + /** + * Stop monitoring corda changes (transactions) of given state class + * + * @param stopMonitorV1Request (optional) + * @return StopMonitorV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public StopMonitorV1Response stopMonitorV1(StopMonitorV1Request stopMonitorV1Request) throws ApiException { + ApiResponse localVarResp = stopMonitorV1WithHttpInfo(stopMonitorV1Request); + return localVarResp.getData(); + } + + /** + * Stop monitoring corda changes (transactions) of given state class + * + * @param stopMonitorV1Request (optional) + * @return ApiResponse<StopMonitorV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse stopMonitorV1WithHttpInfo(StopMonitorV1Request stopMonitorV1Request) throws ApiException { + okhttp3.Call localVarCall = stopMonitorV1ValidateBeforeCall(stopMonitorV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Stop monitoring corda changes (transactions) of given state class (asynchronously) + * + * @param stopMonitorV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call stopMonitorV1Async(StopMonitorV1Request stopMonitorV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = stopMonitorV1ValidateBeforeCall(stopMonitorV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..8625c8ceb40 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..f2e55e265cc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..ea528a12a1a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..2b00f430dc8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..be906590902 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Request.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Request.java new file mode 100644 index 00000000000..f13fa01fd7a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Request.java @@ -0,0 +1,293 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ClearMonitorTransactionsV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ClearMonitorTransactionsV1Request { + public static final String SERIALIZED_NAME_CLIENT_APP_ID = "clientAppId"; + @SerializedName(SERIALIZED_NAME_CLIENT_APP_ID) + private String clientAppId; + + public static final String SERIALIZED_NAME_STATE_FULL_CLASS_NAME = "stateFullClassName"; + @SerializedName(SERIALIZED_NAME_STATE_FULL_CLASS_NAME) + private String stateFullClassName; + + public static final String SERIALIZED_NAME_TX_INDEXES = "txIndexes"; + @SerializedName(SERIALIZED_NAME_TX_INDEXES) + private List txIndexes = null; + + public ClearMonitorTransactionsV1Request() { + } + + public ClearMonitorTransactionsV1Request clientAppId(String clientAppId) { + + this.clientAppId = clientAppId; + return this; + } + + /** + * ID of a client application that wants to monitor the state changes + * @return clientAppId + **/ + @javax.annotation.Nonnull + public String getClientAppId() { + return clientAppId; + } + + + public void setClientAppId(String clientAppId) { + this.clientAppId = clientAppId; + } + + + public ClearMonitorTransactionsV1Request stateFullClassName(String stateFullClassName) { + + this.stateFullClassName = stateFullClassName; + return this; + } + + /** + * The fully qualified name of the Corda state to monitor + * @return stateFullClassName + **/ + @javax.annotation.Nonnull + public String getStateFullClassName() { + return stateFullClassName; + } + + + public void setStateFullClassName(String stateFullClassName) { + this.stateFullClassName = stateFullClassName; + } + + + public ClearMonitorTransactionsV1Request txIndexes(List txIndexes) { + + this.txIndexes = txIndexes; + return this; + } + + public ClearMonitorTransactionsV1Request addTxIndexesItem(String txIndexesItem) { + if (this.txIndexes == null) { + this.txIndexes = null; + } + this.txIndexes.add(txIndexesItem); + return this; + } + + /** + * Get txIndexes + * @return txIndexes + **/ + @javax.annotation.Nonnull + public List getTxIndexes() { + return txIndexes; + } + + + public void setTxIndexes(List txIndexes) { + this.txIndexes = txIndexes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClearMonitorTransactionsV1Request clearMonitorTransactionsV1Request = (ClearMonitorTransactionsV1Request) o; + return Objects.equals(this.clientAppId, clearMonitorTransactionsV1Request.clientAppId) && + Objects.equals(this.stateFullClassName, clearMonitorTransactionsV1Request.stateFullClassName) && + Objects.equals(this.txIndexes, clearMonitorTransactionsV1Request.txIndexes); + } + + @Override + public int hashCode() { + return Objects.hash(clientAppId, stateFullClassName, txIndexes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClearMonitorTransactionsV1Request {\n"); + sb.append(" clientAppId: ").append(toIndentedString(clientAppId)).append("\n"); + sb.append(" stateFullClassName: ").append(toIndentedString(stateFullClassName)).append("\n"); + sb.append(" txIndexes: ").append(toIndentedString(txIndexes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("clientAppId"); + openapiFields.add("stateFullClassName"); + openapiFields.add("txIndexes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("clientAppId"); + openapiRequiredFields.add("stateFullClassName"); + openapiRequiredFields.add("txIndexes"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ClearMonitorTransactionsV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ClearMonitorTransactionsV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ClearMonitorTransactionsV1Request is not found in the empty JSON string", ClearMonitorTransactionsV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ClearMonitorTransactionsV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClearMonitorTransactionsV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ClearMonitorTransactionsV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("clientAppId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientAppId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientAppId").toString())); + } + if (!jsonObj.get("stateFullClassName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateFullClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateFullClassName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("txIndexes") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("txIndexes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `txIndexes` to be an array in the JSON string but got `%s`", jsonObj.get("txIndexes").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ClearMonitorTransactionsV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ClearMonitorTransactionsV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ClearMonitorTransactionsV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ClearMonitorTransactionsV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ClearMonitorTransactionsV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ClearMonitorTransactionsV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClearMonitorTransactionsV1Request + * @throws IOException if the JSON string is invalid with respect to ClearMonitorTransactionsV1Request + */ + public static ClearMonitorTransactionsV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClearMonitorTransactionsV1Request.class); + } + + /** + * Convert an instance of ClearMonitorTransactionsV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Response.java new file mode 100644 index 00000000000..08d23ca50e1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClearMonitorTransactionsV1Response.java @@ -0,0 +1,245 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ClearMonitorTransactionsV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ClearMonitorTransactionsV1Response { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_MSG = "msg"; + @SerializedName(SERIALIZED_NAME_MSG) + private String msg; + + public ClearMonitorTransactionsV1Response() { + } + + public ClearMonitorTransactionsV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Flag set to true if operation completed correctly. + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public ClearMonitorTransactionsV1Response msg(String msg) { + + this.msg = msg; + return this; + } + + /** + * Message describing operation status or any errors that occurred. + * @return msg + **/ + @javax.annotation.Nonnull + public String getMsg() { + return msg; + } + + + public void setMsg(String msg) { + this.msg = msg; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClearMonitorTransactionsV1Response clearMonitorTransactionsV1Response = (ClearMonitorTransactionsV1Response) o; + return Objects.equals(this.success, clearMonitorTransactionsV1Response.success) && + Objects.equals(this.msg, clearMonitorTransactionsV1Response.msg); + } + + @Override + public int hashCode() { + return Objects.hash(success, msg); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClearMonitorTransactionsV1Response {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("msg"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("msg"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ClearMonitorTransactionsV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ClearMonitorTransactionsV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ClearMonitorTransactionsV1Response is not found in the empty JSON string", ClearMonitorTransactionsV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ClearMonitorTransactionsV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClearMonitorTransactionsV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ClearMonitorTransactionsV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `msg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("msg").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ClearMonitorTransactionsV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ClearMonitorTransactionsV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ClearMonitorTransactionsV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ClearMonitorTransactionsV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ClearMonitorTransactionsV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ClearMonitorTransactionsV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClearMonitorTransactionsV1Response + * @throws IOException if the JSON string is invalid with respect to ClearMonitorTransactionsV1Response + */ + public static ClearMonitorTransactionsV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClearMonitorTransactionsV1Response.class); + } + + /** + * Convert an instance of ClearMonitorTransactionsV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaNodeSshCredentials.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaNodeSshCredentials.java new file mode 100644 index 00000000000..9e2831b07d2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaNodeSshCredentials.java @@ -0,0 +1,343 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CordaNodeSshCredentials + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CordaNodeSshCredentials { + public static final String SERIALIZED_NAME_HOST_KEY_ENTRY = "hostKeyEntry"; + @SerializedName(SERIALIZED_NAME_HOST_KEY_ENTRY) + private String hostKeyEntry; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + private String password; + + public static final String SERIALIZED_NAME_HOSTNAME = "hostname"; + @SerializedName(SERIALIZED_NAME_HOSTNAME) + private String hostname; + + public static final String SERIALIZED_NAME_PORT = "port"; + @SerializedName(SERIALIZED_NAME_PORT) + private Integer port; + + public CordaNodeSshCredentials() { + } + + public CordaNodeSshCredentials hostKeyEntry(String hostKeyEntry) { + + this.hostKeyEntry = hostKeyEntry; + return this; + } + + /** + * Get hostKeyEntry + * @return hostKeyEntry + **/ + @javax.annotation.Nonnull + public String getHostKeyEntry() { + return hostKeyEntry; + } + + + public void setHostKeyEntry(String hostKeyEntry) { + this.hostKeyEntry = hostKeyEntry; + } + + + public CordaNodeSshCredentials username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + + public void setUsername(String username) { + this.username = username; + } + + + public CordaNodeSshCredentials password(String password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + + public CordaNodeSshCredentials hostname(String hostname) { + + this.hostname = hostname; + return this; + } + + /** + * Get hostname + * @return hostname + **/ + @javax.annotation.Nonnull + public String getHostname() { + return hostname; + } + + + public void setHostname(String hostname) { + this.hostname = hostname; + } + + + public CordaNodeSshCredentials port(Integer port) { + + this.port = port; + return this; + } + + /** + * Get port + * minimum: 1 + * maximum: 65535 + * @return port + **/ + @javax.annotation.Nonnull + public Integer getPort() { + return port; + } + + + public void setPort(Integer port) { + this.port = port; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CordaNodeSshCredentials cordaNodeSshCredentials = (CordaNodeSshCredentials) o; + return Objects.equals(this.hostKeyEntry, cordaNodeSshCredentials.hostKeyEntry) && + Objects.equals(this.username, cordaNodeSshCredentials.username) && + Objects.equals(this.password, cordaNodeSshCredentials.password) && + Objects.equals(this.hostname, cordaNodeSshCredentials.hostname) && + Objects.equals(this.port, cordaNodeSshCredentials.port); + } + + @Override + public int hashCode() { + return Objects.hash(hostKeyEntry, username, password, hostname, port); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CordaNodeSshCredentials {\n"); + sb.append(" hostKeyEntry: ").append(toIndentedString(hostKeyEntry)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" hostname: ").append(toIndentedString(hostname)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hostKeyEntry"); + openapiFields.add("username"); + openapiFields.add("password"); + openapiFields.add("hostname"); + openapiFields.add("port"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("hostKeyEntry"); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("password"); + openapiRequiredFields.add("hostname"); + openapiRequiredFields.add("port"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CordaNodeSshCredentials + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CordaNodeSshCredentials.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CordaNodeSshCredentials is not found in the empty JSON string", CordaNodeSshCredentials.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CordaNodeSshCredentials.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CordaNodeSshCredentials` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CordaNodeSshCredentials.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("hostKeyEntry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hostKeyEntry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hostKeyEntry").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + if (!jsonObj.get("hostname").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hostname` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hostname").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CordaNodeSshCredentials.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CordaNodeSshCredentials' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CordaNodeSshCredentials.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CordaNodeSshCredentials value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CordaNodeSshCredentials read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CordaNodeSshCredentials given an JSON string + * + * @param jsonString JSON string + * @return An instance of CordaNodeSshCredentials + * @throws IOException if the JSON string is invalid with respect to CordaNodeSshCredentials + */ + public static CordaNodeSshCredentials fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CordaNodeSshCredentials.class); + } + + /** + * Convert an instance of CordaNodeSshCredentials to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaRpcCredentials.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaRpcCredentials.java new file mode 100644 index 00000000000..2a627fc902b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaRpcCredentials.java @@ -0,0 +1,311 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CordaRpcCredentials + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CordaRpcCredentials { + public static final String SERIALIZED_NAME_HOSTNAME = "hostname"; + @SerializedName(SERIALIZED_NAME_HOSTNAME) + private String hostname; + + public static final String SERIALIZED_NAME_PORT = "port"; + @SerializedName(SERIALIZED_NAME_PORT) + private Integer port; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + private String password; + + public CordaRpcCredentials() { + } + + public CordaRpcCredentials hostname(String hostname) { + + this.hostname = hostname; + return this; + } + + /** + * Get hostname + * @return hostname + **/ + @javax.annotation.Nonnull + public String getHostname() { + return hostname; + } + + + public void setHostname(String hostname) { + this.hostname = hostname; + } + + + public CordaRpcCredentials port(Integer port) { + + this.port = port; + return this; + } + + /** + * Get port + * minimum: 1 + * maximum: 65535 + * @return port + **/ + @javax.annotation.Nonnull + public Integer getPort() { + return port; + } + + + public void setPort(Integer port) { + this.port = port; + } + + + public CordaRpcCredentials username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + + public void setUsername(String username) { + this.username = username; + } + + + public CordaRpcCredentials password(String password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CordaRpcCredentials cordaRpcCredentials = (CordaRpcCredentials) o; + return Objects.equals(this.hostname, cordaRpcCredentials.hostname) && + Objects.equals(this.port, cordaRpcCredentials.port) && + Objects.equals(this.username, cordaRpcCredentials.username) && + Objects.equals(this.password, cordaRpcCredentials.password); + } + + @Override + public int hashCode() { + return Objects.hash(hostname, port, username, password); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CordaRpcCredentials {\n"); + sb.append(" hostname: ").append(toIndentedString(hostname)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hostname"); + openapiFields.add("port"); + openapiFields.add("username"); + openapiFields.add("password"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("hostname"); + openapiRequiredFields.add("port"); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("password"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CordaRpcCredentials + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CordaRpcCredentials.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CordaRpcCredentials is not found in the empty JSON string", CordaRpcCredentials.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CordaRpcCredentials.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CordaRpcCredentials` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CordaRpcCredentials.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("hostname").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hostname` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hostname").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CordaRpcCredentials.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CordaRpcCredentials' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CordaRpcCredentials.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CordaRpcCredentials value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CordaRpcCredentials read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CordaRpcCredentials given an JSON string + * + * @param jsonString JSON string + * @return An instance of CordaRpcCredentials + * @throws IOException if the JSON string is invalid with respect to CordaRpcCredentials + */ + public static CordaRpcCredentials fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CordaRpcCredentials.class); + } + + /** + * Convert an instance of CordaRpcCredentials to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaX500Name.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaX500Name.java new file mode 100644 index 00000000000..c3fbff07199 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordaX500Name.java @@ -0,0 +1,405 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.X500Principal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CordaX500Name + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CordaX500Name { + public static final String SERIALIZED_NAME_COMMON_NAME = "commonName"; + @SerializedName(SERIALIZED_NAME_COMMON_NAME) + private String commonName; + + public static final String SERIALIZED_NAME_ORGANISATION_UNIT = "organisationUnit"; + @SerializedName(SERIALIZED_NAME_ORGANISATION_UNIT) + private String organisationUnit; + + public static final String SERIALIZED_NAME_ORGANISATION = "organisation"; + @SerializedName(SERIALIZED_NAME_ORGANISATION) + private String organisation; + + public static final String SERIALIZED_NAME_LOCALITY = "locality"; + @SerializedName(SERIALIZED_NAME_LOCALITY) + private String locality; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private String state; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; + + public static final String SERIALIZED_NAME_X500_PRINCIPAL = "x500Principal"; + @SerializedName(SERIALIZED_NAME_X500_PRINCIPAL) + private X500Principal x500Principal; + + public CordaX500Name() { + } + + public CordaX500Name commonName(String commonName) { + + this.commonName = commonName; + return this; + } + + /** + * Get commonName + * @return commonName + **/ + @javax.annotation.Nullable + public String getCommonName() { + return commonName; + } + + + public void setCommonName(String commonName) { + this.commonName = commonName; + } + + + public CordaX500Name organisationUnit(String organisationUnit) { + + this.organisationUnit = organisationUnit; + return this; + } + + /** + * Get organisationUnit + * @return organisationUnit + **/ + @javax.annotation.Nullable + public String getOrganisationUnit() { + return organisationUnit; + } + + + public void setOrganisationUnit(String organisationUnit) { + this.organisationUnit = organisationUnit; + } + + + public CordaX500Name organisation(String organisation) { + + this.organisation = organisation; + return this; + } + + /** + * Get organisation + * @return organisation + **/ + @javax.annotation.Nonnull + public String getOrganisation() { + return organisation; + } + + + public void setOrganisation(String organisation) { + this.organisation = organisation; + } + + + public CordaX500Name locality(String locality) { + + this.locality = locality; + return this; + } + + /** + * Get locality + * @return locality + **/ + @javax.annotation.Nonnull + public String getLocality() { + return locality; + } + + + public void setLocality(String locality) { + this.locality = locality; + } + + + public CordaX500Name state(String state) { + + this.state = state; + return this; + } + + /** + * Get state + * @return state + **/ + @javax.annotation.Nullable + public String getState() { + return state; + } + + + public void setState(String state) { + this.state = state; + } + + + public CordaX500Name country(String country) { + + this.country = country; + return this; + } + + /** + * Get country + * @return country + **/ + @javax.annotation.Nonnull + public String getCountry() { + return country; + } + + + public void setCountry(String country) { + this.country = country; + } + + + public CordaX500Name x500Principal(X500Principal x500Principal) { + + this.x500Principal = x500Principal; + return this; + } + + /** + * Get x500Principal + * @return x500Principal + **/ + @javax.annotation.Nonnull + public X500Principal getX500Principal() { + return x500Principal; + } + + + public void setX500Principal(X500Principal x500Principal) { + this.x500Principal = x500Principal; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CordaX500Name cordaX500Name = (CordaX500Name) o; + return Objects.equals(this.commonName, cordaX500Name.commonName) && + Objects.equals(this.organisationUnit, cordaX500Name.organisationUnit) && + Objects.equals(this.organisation, cordaX500Name.organisation) && + Objects.equals(this.locality, cordaX500Name.locality) && + Objects.equals(this.state, cordaX500Name.state) && + Objects.equals(this.country, cordaX500Name.country) && + Objects.equals(this.x500Principal, cordaX500Name.x500Principal); + } + + @Override + public int hashCode() { + return Objects.hash(commonName, organisationUnit, organisation, locality, state, country, x500Principal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CordaX500Name {\n"); + sb.append(" commonName: ").append(toIndentedString(commonName)).append("\n"); + sb.append(" organisationUnit: ").append(toIndentedString(organisationUnit)).append("\n"); + sb.append(" organisation: ").append(toIndentedString(organisation)).append("\n"); + sb.append(" locality: ").append(toIndentedString(locality)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" x500Principal: ").append(toIndentedString(x500Principal)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("commonName"); + openapiFields.add("organisationUnit"); + openapiFields.add("organisation"); + openapiFields.add("locality"); + openapiFields.add("state"); + openapiFields.add("country"); + openapiFields.add("x500Principal"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("organisation"); + openapiRequiredFields.add("locality"); + openapiRequiredFields.add("country"); + openapiRequiredFields.add("x500Principal"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CordaX500Name + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CordaX500Name.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CordaX500Name is not found in the empty JSON string", CordaX500Name.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CordaX500Name.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CordaX500Name` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CordaX500Name.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("commonName") != null && !jsonObj.get("commonName").isJsonNull()) && !jsonObj.get("commonName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commonName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commonName").toString())); + } + if ((jsonObj.get("organisationUnit") != null && !jsonObj.get("organisationUnit").isJsonNull()) && !jsonObj.get("organisationUnit").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `organisationUnit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organisationUnit").toString())); + } + if (!jsonObj.get("organisation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `organisation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organisation").toString())); + } + if (!jsonObj.get("locality").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `locality` to be a primitive type in the JSON string but got `%s`", jsonObj.get("locality").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if (!jsonObj.get("country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + // validate the required field `x500Principal` + X500Principal.validateJsonObject(jsonObj.getAsJsonObject("x500Principal")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CordaX500Name.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CordaX500Name' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CordaX500Name.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CordaX500Name value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CordaX500Name read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CordaX500Name given an JSON string + * + * @param jsonString JSON string + * @return An instance of CordaX500Name + * @throws IOException if the JSON string is invalid with respect to CordaX500Name + */ + public static CordaX500Name fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CordaX500Name.class); + } + + /** + * Convert an instance of CordaX500Name to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordappDeploymentConfig.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordappDeploymentConfig.java new file mode 100644 index 00000000000..9250be7d586 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordappDeploymentConfig.java @@ -0,0 +1,376 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.CordaNodeSshCredentials; +import org.openapitools.client.model.CordaRpcCredentials; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CordappDeploymentConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CordappDeploymentConfig { + public static final String SERIALIZED_NAME_SSH_CREDENTIALS = "sshCredentials"; + @SerializedName(SERIALIZED_NAME_SSH_CREDENTIALS) + private CordaNodeSshCredentials sshCredentials; + + public static final String SERIALIZED_NAME_RPC_CREDENTIALS = "rpcCredentials"; + @SerializedName(SERIALIZED_NAME_RPC_CREDENTIALS) + private CordaRpcCredentials rpcCredentials; + + public static final String SERIALIZED_NAME_CORDA_NODE_START_CMD = "cordaNodeStartCmd"; + @SerializedName(SERIALIZED_NAME_CORDA_NODE_START_CMD) + private String cordaNodeStartCmd; + + public static final String SERIALIZED_NAME_CORDAPP_DIR = "cordappDir"; + @SerializedName(SERIALIZED_NAME_CORDAPP_DIR) + private String cordappDir; + + public static final String SERIALIZED_NAME_CORDA_JAR_PATH = "cordaJarPath"; + @SerializedName(SERIALIZED_NAME_CORDA_JAR_PATH) + private String cordaJarPath; + + public static final String SERIALIZED_NAME_NODE_BASE_DIR_PATH = "nodeBaseDirPath"; + @SerializedName(SERIALIZED_NAME_NODE_BASE_DIR_PATH) + private String nodeBaseDirPath; + + public CordappDeploymentConfig() { + } + + public CordappDeploymentConfig sshCredentials(CordaNodeSshCredentials sshCredentials) { + + this.sshCredentials = sshCredentials; + return this; + } + + /** + * Get sshCredentials + * @return sshCredentials + **/ + @javax.annotation.Nonnull + public CordaNodeSshCredentials getSshCredentials() { + return sshCredentials; + } + + + public void setSshCredentials(CordaNodeSshCredentials sshCredentials) { + this.sshCredentials = sshCredentials; + } + + + public CordappDeploymentConfig rpcCredentials(CordaRpcCredentials rpcCredentials) { + + this.rpcCredentials = rpcCredentials; + return this; + } + + /** + * Get rpcCredentials + * @return rpcCredentials + **/ + @javax.annotation.Nonnull + public CordaRpcCredentials getRpcCredentials() { + return rpcCredentials; + } + + + public void setRpcCredentials(CordaRpcCredentials rpcCredentials) { + this.rpcCredentials = rpcCredentials; + } + + + public CordappDeploymentConfig cordaNodeStartCmd(String cordaNodeStartCmd) { + + this.cordaNodeStartCmd = cordaNodeStartCmd; + return this; + } + + /** + * The shell command to execute in order to start back up a Corda node after having placed new jars in the cordapp directory of said node. + * @return cordaNodeStartCmd + **/ + @javax.annotation.Nonnull + public String getCordaNodeStartCmd() { + return cordaNodeStartCmd; + } + + + public void setCordaNodeStartCmd(String cordaNodeStartCmd) { + this.cordaNodeStartCmd = cordaNodeStartCmd; + } + + + public CordappDeploymentConfig cordappDir(String cordappDir) { + + this.cordappDir = cordappDir; + return this; + } + + /** + * The absolute file system path where the Corda Node is expecting deployed Cordapp jar files to be placed. + * @return cordappDir + **/ + @javax.annotation.Nonnull + public String getCordappDir() { + return cordappDir; + } + + + public void setCordappDir(String cordappDir) { + this.cordappDir = cordappDir; + } + + + public CordappDeploymentConfig cordaJarPath(String cordaJarPath) { + + this.cordaJarPath = cordaJarPath; + return this; + } + + /** + * The absolute file system path where the corda.jar file of the node can be found. This is used to execute database schema migrations where applicable (H2 database in use in development environments). + * @return cordaJarPath + **/ + @javax.annotation.Nonnull + public String getCordaJarPath() { + return cordaJarPath; + } + + + public void setCordaJarPath(String cordaJarPath) { + this.cordaJarPath = cordaJarPath; + } + + + public CordappDeploymentConfig nodeBaseDirPath(String nodeBaseDirPath) { + + this.nodeBaseDirPath = nodeBaseDirPath; + return this; + } + + /** + * The absolute file system path where the base directory of the Corda node can be found. This is used to pass in to corda.jar when being invoked for certain tasks such as executing database schema migrations for a deployed contract. + * @return nodeBaseDirPath + **/ + @javax.annotation.Nonnull + public String getNodeBaseDirPath() { + return nodeBaseDirPath; + } + + + public void setNodeBaseDirPath(String nodeBaseDirPath) { + this.nodeBaseDirPath = nodeBaseDirPath; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CordappDeploymentConfig cordappDeploymentConfig = (CordappDeploymentConfig) o; + return Objects.equals(this.sshCredentials, cordappDeploymentConfig.sshCredentials) && + Objects.equals(this.rpcCredentials, cordappDeploymentConfig.rpcCredentials) && + Objects.equals(this.cordaNodeStartCmd, cordappDeploymentConfig.cordaNodeStartCmd) && + Objects.equals(this.cordappDir, cordappDeploymentConfig.cordappDir) && + Objects.equals(this.cordaJarPath, cordappDeploymentConfig.cordaJarPath) && + Objects.equals(this.nodeBaseDirPath, cordappDeploymentConfig.nodeBaseDirPath); + } + + @Override + public int hashCode() { + return Objects.hash(sshCredentials, rpcCredentials, cordaNodeStartCmd, cordappDir, cordaJarPath, nodeBaseDirPath); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CordappDeploymentConfig {\n"); + sb.append(" sshCredentials: ").append(toIndentedString(sshCredentials)).append("\n"); + sb.append(" rpcCredentials: ").append(toIndentedString(rpcCredentials)).append("\n"); + sb.append(" cordaNodeStartCmd: ").append(toIndentedString(cordaNodeStartCmd)).append("\n"); + sb.append(" cordappDir: ").append(toIndentedString(cordappDir)).append("\n"); + sb.append(" cordaJarPath: ").append(toIndentedString(cordaJarPath)).append("\n"); + sb.append(" nodeBaseDirPath: ").append(toIndentedString(nodeBaseDirPath)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sshCredentials"); + openapiFields.add("rpcCredentials"); + openapiFields.add("cordaNodeStartCmd"); + openapiFields.add("cordappDir"); + openapiFields.add("cordaJarPath"); + openapiFields.add("nodeBaseDirPath"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sshCredentials"); + openapiRequiredFields.add("rpcCredentials"); + openapiRequiredFields.add("cordaNodeStartCmd"); + openapiRequiredFields.add("cordappDir"); + openapiRequiredFields.add("cordaJarPath"); + openapiRequiredFields.add("nodeBaseDirPath"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CordappDeploymentConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CordappDeploymentConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CordappDeploymentConfig is not found in the empty JSON string", CordappDeploymentConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CordappDeploymentConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CordappDeploymentConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CordappDeploymentConfig.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `sshCredentials` + CordaNodeSshCredentials.validateJsonObject(jsonObj.getAsJsonObject("sshCredentials")); + // validate the required field `rpcCredentials` + CordaRpcCredentials.validateJsonObject(jsonObj.getAsJsonObject("rpcCredentials")); + if (!jsonObj.get("cordaNodeStartCmd").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cordaNodeStartCmd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cordaNodeStartCmd").toString())); + } + if (!jsonObj.get("cordappDir").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cordappDir` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cordappDir").toString())); + } + if (!jsonObj.get("cordaJarPath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cordaJarPath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cordaJarPath").toString())); + } + if (!jsonObj.get("nodeBaseDirPath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nodeBaseDirPath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nodeBaseDirPath").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CordappDeploymentConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CordappDeploymentConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CordappDeploymentConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CordappDeploymentConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CordappDeploymentConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CordappDeploymentConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of CordappDeploymentConfig + * @throws IOException if the JSON string is invalid with respect to CordappDeploymentConfig + */ + public static CordappDeploymentConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CordappDeploymentConfig.class); + } + + /** + * Convert an instance of CordappDeploymentConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordappInfo.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordappInfo.java new file mode 100644 index 00000000000..1198497c9e0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CordappInfo.java @@ -0,0 +1,464 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.SHA256; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * A CordappInfo describes a single CorDapp currently installed on the node + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CordappInfo { + public static final String SERIALIZED_NAME_JAR_HASH = "jarHash"; + @SerializedName(SERIALIZED_NAME_JAR_HASH) + private SHA256 jarHash; + + public static final String SERIALIZED_NAME_LICENCE = "licence"; + @SerializedName(SERIALIZED_NAME_LICENCE) + private String licence; + + public static final String SERIALIZED_NAME_MINIMUM_PLATFORM_VERSION = "minimumPlatformVersion"; + @SerializedName(SERIALIZED_NAME_MINIMUM_PLATFORM_VERSION) + private Integer minimumPlatformVersion; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SHORT_NAME = "shortName"; + @SerializedName(SERIALIZED_NAME_SHORT_NAME) + private String shortName; + + public static final String SERIALIZED_NAME_TARGET_PLATFORM_VERSION = "targetPlatformVersion"; + @SerializedName(SERIALIZED_NAME_TARGET_PLATFORM_VERSION) + private Integer targetPlatformVersion; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_VENDOR = "vendor"; + @SerializedName(SERIALIZED_NAME_VENDOR) + private String vendor; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public CordappInfo() { + } + + public CordappInfo jarHash(SHA256 jarHash) { + + this.jarHash = jarHash; + return this; + } + + /** + * Get jarHash + * @return jarHash + **/ + @javax.annotation.Nonnull + public SHA256 getJarHash() { + return jarHash; + } + + + public void setJarHash(SHA256 jarHash) { + this.jarHash = jarHash; + } + + + public CordappInfo licence(String licence) { + + this.licence = licence; + return this; + } + + /** + * The name of the licence this CorDapp is released under + * @return licence + **/ + @javax.annotation.Nonnull + public String getLicence() { + return licence; + } + + + public void setLicence(String licence) { + this.licence = licence; + } + + + public CordappInfo minimumPlatformVersion(Integer minimumPlatformVersion) { + + this.minimumPlatformVersion = minimumPlatformVersion; + return this; + } + + /** + * The minimum platform version the node must be at for the CorDapp to run + * @return minimumPlatformVersion + **/ + @javax.annotation.Nonnull + public Integer getMinimumPlatformVersion() { + return minimumPlatformVersion; + } + + + public void setMinimumPlatformVersion(Integer minimumPlatformVersion) { + this.minimumPlatformVersion = minimumPlatformVersion; + } + + + public CordappInfo name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the JAR file that defines the CorDapp + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public CordappInfo shortName(String shortName) { + + this.shortName = shortName; + return this; + } + + /** + * The name of the CorDapp + * @return shortName + **/ + @javax.annotation.Nonnull + public String getShortName() { + return shortName; + } + + + public void setShortName(String shortName) { + this.shortName = shortName; + } + + + public CordappInfo targetPlatformVersion(Integer targetPlatformVersion) { + + this.targetPlatformVersion = targetPlatformVersion; + return this; + } + + /** + * The target platform version this CorDapp has been tested against + * @return targetPlatformVersion + **/ + @javax.annotation.Nonnull + public Integer getTargetPlatformVersion() { + return targetPlatformVersion; + } + + + public void setTargetPlatformVersion(Integer targetPlatformVersion) { + this.targetPlatformVersion = targetPlatformVersion; + } + + + public CordappInfo type(String type) { + + this.type = type; + return this; + } + + /** + * A description of what sort of CorDapp this is - either a contract, workflow, or a combination. + * @return type + **/ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public CordappInfo vendor(String vendor) { + + this.vendor = vendor; + return this; + } + + /** + * The vendor of this CorDapp + * @return vendor + **/ + @javax.annotation.Nonnull + public String getVendor() { + return vendor; + } + + + public void setVendor(String vendor) { + this.vendor = vendor; + } + + + public CordappInfo version(String version) { + + this.version = version; + return this; + } + + /** + * The version of this CorDapp + * @return version + **/ + @javax.annotation.Nonnull + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CordappInfo cordappInfo = (CordappInfo) o; + return Objects.equals(this.jarHash, cordappInfo.jarHash) && + Objects.equals(this.licence, cordappInfo.licence) && + Objects.equals(this.minimumPlatformVersion, cordappInfo.minimumPlatformVersion) && + Objects.equals(this.name, cordappInfo.name) && + Objects.equals(this.shortName, cordappInfo.shortName) && + Objects.equals(this.targetPlatformVersion, cordappInfo.targetPlatformVersion) && + Objects.equals(this.type, cordappInfo.type) && + Objects.equals(this.vendor, cordappInfo.vendor) && + Objects.equals(this.version, cordappInfo.version); + } + + @Override + public int hashCode() { + return Objects.hash(jarHash, licence, minimumPlatformVersion, name, shortName, targetPlatformVersion, type, vendor, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CordappInfo {\n"); + sb.append(" jarHash: ").append(toIndentedString(jarHash)).append("\n"); + sb.append(" licence: ").append(toIndentedString(licence)).append("\n"); + sb.append(" minimumPlatformVersion: ").append(toIndentedString(minimumPlatformVersion)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" shortName: ").append(toIndentedString(shortName)).append("\n"); + sb.append(" targetPlatformVersion: ").append(toIndentedString(targetPlatformVersion)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" vendor: ").append(toIndentedString(vendor)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("jarHash"); + openapiFields.add("licence"); + openapiFields.add("minimumPlatformVersion"); + openapiFields.add("name"); + openapiFields.add("shortName"); + openapiFields.add("targetPlatformVersion"); + openapiFields.add("type"); + openapiFields.add("vendor"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("jarHash"); + openapiRequiredFields.add("licence"); + openapiRequiredFields.add("minimumPlatformVersion"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("shortName"); + openapiRequiredFields.add("targetPlatformVersion"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("vendor"); + openapiRequiredFields.add("version"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CordappInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CordappInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CordappInfo is not found in the empty JSON string", CordappInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CordappInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CordappInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CordappInfo.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("licence").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `licence` to be a primitive type in the JSON string but got `%s`", jsonObj.get("licence").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("shortName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shortName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shortName").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if (!jsonObj.get("vendor").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vendor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vendor").toString())); + } + if (!jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CordappInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CordappInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CordappInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CordappInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CordappInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CordappInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of CordappInfo + * @throws IOException if the JSON string is invalid with respect to CordappInfo + */ + public static CordappInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CordappInfo.class); + } + + /** + * Convert an instance of CordappInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsBadRequestV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsBadRequestV1Response.java new file mode 100644 index 00000000000..4b72b5413a4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsBadRequestV1Response.java @@ -0,0 +1,229 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractJarsBadRequestV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractJarsBadRequestV1Response { + public static final String SERIALIZED_NAME_ERRORS = "errors"; + @SerializedName(SERIALIZED_NAME_ERRORS) + private List errors = new ArrayList<>(); + + public DeployContractJarsBadRequestV1Response() { + } + + public DeployContractJarsBadRequestV1Response errors(List errors) { + + this.errors = errors; + return this; + } + + public DeployContractJarsBadRequestV1Response addErrorsItem(String errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * Get errors + * @return errors + **/ + @javax.annotation.Nonnull + public List getErrors() { + return errors; + } + + + public void setErrors(List errors) { + this.errors = errors; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractJarsBadRequestV1Response deployContractJarsBadRequestV1Response = (DeployContractJarsBadRequestV1Response) o; + return Objects.equals(this.errors, deployContractJarsBadRequestV1Response.errors); + } + + @Override + public int hashCode() { + return Objects.hash(errors); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractJarsBadRequestV1Response {\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("errors"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("errors"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractJarsBadRequestV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractJarsBadRequestV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractJarsBadRequestV1Response is not found in the empty JSON string", DeployContractJarsBadRequestV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractJarsBadRequestV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractJarsBadRequestV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractJarsBadRequestV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("errors") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("errors").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractJarsBadRequestV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractJarsBadRequestV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractJarsBadRequestV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractJarsBadRequestV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractJarsBadRequestV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractJarsBadRequestV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractJarsBadRequestV1Response + * @throws IOException if the JSON string is invalid with respect to DeployContractJarsBadRequestV1Response + */ + public static DeployContractJarsBadRequestV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractJarsBadRequestV1Response.class); + } + + /** + * Convert an instance of DeployContractJarsBadRequestV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsSuccessV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsSuccessV1Response.java new file mode 100644 index 00000000000..915eeba2260 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsSuccessV1Response.java @@ -0,0 +1,229 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractJarsSuccessV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractJarsSuccessV1Response { + public static final String SERIALIZED_NAME_DEPLOYED_JAR_FILES = "deployedJarFiles"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_JAR_FILES) + private List deployedJarFiles = new ArrayList<>(); + + public DeployContractJarsSuccessV1Response() { + } + + public DeployContractJarsSuccessV1Response deployedJarFiles(List deployedJarFiles) { + + this.deployedJarFiles = deployedJarFiles; + return this; + } + + public DeployContractJarsSuccessV1Response addDeployedJarFilesItem(String deployedJarFilesItem) { + if (this.deployedJarFiles == null) { + this.deployedJarFiles = new ArrayList<>(); + } + this.deployedJarFiles.add(deployedJarFilesItem); + return this; + } + + /** + * Get deployedJarFiles + * @return deployedJarFiles + **/ + @javax.annotation.Nonnull + public List getDeployedJarFiles() { + return deployedJarFiles; + } + + + public void setDeployedJarFiles(List deployedJarFiles) { + this.deployedJarFiles = deployedJarFiles; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractJarsSuccessV1Response deployContractJarsSuccessV1Response = (DeployContractJarsSuccessV1Response) o; + return Objects.equals(this.deployedJarFiles, deployContractJarsSuccessV1Response.deployedJarFiles); + } + + @Override + public int hashCode() { + return Objects.hash(deployedJarFiles); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractJarsSuccessV1Response {\n"); + sb.append(" deployedJarFiles: ").append(toIndentedString(deployedJarFiles)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("deployedJarFiles"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("deployedJarFiles"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractJarsSuccessV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractJarsSuccessV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractJarsSuccessV1Response is not found in the empty JSON string", DeployContractJarsSuccessV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractJarsSuccessV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractJarsSuccessV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractJarsSuccessV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("deployedJarFiles") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("deployedJarFiles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedJarFiles` to be an array in the JSON string but got `%s`", jsonObj.get("deployedJarFiles").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractJarsSuccessV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractJarsSuccessV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractJarsSuccessV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractJarsSuccessV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractJarsSuccessV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractJarsSuccessV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractJarsSuccessV1Response + * @throws IOException if the JSON string is invalid with respect to DeployContractJarsSuccessV1Response + */ + public static DeployContractJarsSuccessV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractJarsSuccessV1Response.class); + } + + /** + * Convert an instance of DeployContractJarsSuccessV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsV1Request.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsV1Request.java new file mode 100644 index 00000000000..8a7bbf3b1ed --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJarsV1Request.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.CordappDeploymentConfig; +import org.openapitools.client.model.JarFile; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractJarsV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractJarsV1Request { + public static final String SERIALIZED_NAME_CORDAPP_DEPLOYMENT_CONFIGS = "cordappDeploymentConfigs"; + @SerializedName(SERIALIZED_NAME_CORDAPP_DEPLOYMENT_CONFIGS) + private List cordappDeploymentConfigs = null; + + public static final String SERIALIZED_NAME_JAR_FILES = "jarFiles"; + @SerializedName(SERIALIZED_NAME_JAR_FILES) + private List jarFiles = new ArrayList<>(); + + public DeployContractJarsV1Request() { + } + + public DeployContractJarsV1Request cordappDeploymentConfigs(List cordappDeploymentConfigs) { + + this.cordappDeploymentConfigs = cordappDeploymentConfigs; + return this; + } + + public DeployContractJarsV1Request addCordappDeploymentConfigsItem(CordappDeploymentConfig cordappDeploymentConfigsItem) { + if (this.cordappDeploymentConfigs == null) { + this.cordappDeploymentConfigs = null; + } + this.cordappDeploymentConfigs.add(cordappDeploymentConfigsItem); + return this; + } + + /** + * The list of deployment configurations pointing to the nodes where the provided cordapp jar files are to be deployed . + * @return cordappDeploymentConfigs + **/ + @javax.annotation.Nonnull + public List getCordappDeploymentConfigs() { + return cordappDeploymentConfigs; + } + + + public void setCordappDeploymentConfigs(List cordappDeploymentConfigs) { + this.cordappDeploymentConfigs = cordappDeploymentConfigs; + } + + + public DeployContractJarsV1Request jarFiles(List jarFiles) { + + this.jarFiles = jarFiles; + return this; + } + + public DeployContractJarsV1Request addJarFilesItem(JarFile jarFilesItem) { + if (this.jarFiles == null) { + this.jarFiles = new ArrayList<>(); + } + this.jarFiles.add(jarFilesItem); + return this; + } + + /** + * Get jarFiles + * @return jarFiles + **/ + @javax.annotation.Nonnull + public List getJarFiles() { + return jarFiles; + } + + + public void setJarFiles(List jarFiles) { + this.jarFiles = jarFiles; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractJarsV1Request deployContractJarsV1Request = (DeployContractJarsV1Request) o; + return Objects.equals(this.cordappDeploymentConfigs, deployContractJarsV1Request.cordappDeploymentConfigs) && + Objects.equals(this.jarFiles, deployContractJarsV1Request.jarFiles); + } + + @Override + public int hashCode() { + return Objects.hash(cordappDeploymentConfigs, jarFiles); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractJarsV1Request {\n"); + sb.append(" cordappDeploymentConfigs: ").append(toIndentedString(cordappDeploymentConfigs)).append("\n"); + sb.append(" jarFiles: ").append(toIndentedString(jarFiles)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cordappDeploymentConfigs"); + openapiFields.add("jarFiles"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("cordappDeploymentConfigs"); + openapiRequiredFields.add("jarFiles"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractJarsV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractJarsV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractJarsV1Request is not found in the empty JSON string", DeployContractJarsV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractJarsV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractJarsV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractJarsV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("cordappDeploymentConfigs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `cordappDeploymentConfigs` to be an array in the JSON string but got `%s`", jsonObj.get("cordappDeploymentConfigs").toString())); + } + + JsonArray jsonArraycordappDeploymentConfigs = jsonObj.getAsJsonArray("cordappDeploymentConfigs"); + // validate the required field `cordappDeploymentConfigs` (array) + for (int i = 0; i < jsonArraycordappDeploymentConfigs.size(); i++) { + CordappDeploymentConfig.validateJsonObject(jsonArraycordappDeploymentConfigs.get(i).getAsJsonObject()); + }; + // ensure the required json array is present + if (jsonObj.get("jarFiles") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("jarFiles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `jarFiles` to be an array in the JSON string but got `%s`", jsonObj.get("jarFiles").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractJarsV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractJarsV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractJarsV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractJarsV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractJarsV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractJarsV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractJarsV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractJarsV1Request + */ + public static DeployContractJarsV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractJarsV1Request.class); + } + + /** + * Convert an instance of DeployContractJarsV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DiagnoseNodeV1Request.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DiagnoseNodeV1Request.java new file mode 100644 index 00000000000..daadddccd8f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DiagnoseNodeV1Request.java @@ -0,0 +1,219 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DiagnoseNodeV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DiagnoseNodeV1Request { + public static final String SERIALIZED_NAME_NODE_IDS = "nodeIds"; + @SerializedName(SERIALIZED_NAME_NODE_IDS) + private List nodeIds = null; + + public DiagnoseNodeV1Request() { + } + + public DiagnoseNodeV1Request nodeIds(List nodeIds) { + + this.nodeIds = nodeIds; + return this; + } + + public DiagnoseNodeV1Request addNodeIdsItem(String nodeIdsItem) { + if (this.nodeIds == null) { + this.nodeIds = null; + } + this.nodeIds.add(nodeIdsItem); + return this; + } + + /** + * Optional property specifying which Corda Node should be the one being diagnosed in case the Connector has multiple connections established for different nodes (which is not yet a supported feature, but we want to keep this possibility open for the future). + * @return nodeIds + **/ + @javax.annotation.Nullable + public List getNodeIds() { + return nodeIds; + } + + + public void setNodeIds(List nodeIds) { + this.nodeIds = nodeIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DiagnoseNodeV1Request diagnoseNodeV1Request = (DiagnoseNodeV1Request) o; + return Objects.equals(this.nodeIds, diagnoseNodeV1Request.nodeIds); + } + + @Override + public int hashCode() { + return Objects.hash(nodeIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DiagnoseNodeV1Request {\n"); + sb.append(" nodeIds: ").append(toIndentedString(nodeIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("nodeIds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DiagnoseNodeV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DiagnoseNodeV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DiagnoseNodeV1Request is not found in the empty JSON string", DiagnoseNodeV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DiagnoseNodeV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DiagnoseNodeV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("nodeIds") != null && !jsonObj.get("nodeIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `nodeIds` to be an array in the JSON string but got `%s`", jsonObj.get("nodeIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DiagnoseNodeV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DiagnoseNodeV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DiagnoseNodeV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DiagnoseNodeV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DiagnoseNodeV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DiagnoseNodeV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DiagnoseNodeV1Request + * @throws IOException if the JSON string is invalid with respect to DiagnoseNodeV1Request + */ + public static DiagnoseNodeV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DiagnoseNodeV1Request.class); + } + + /** + * Convert an instance of DiagnoseNodeV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DiagnoseNodeV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DiagnoseNodeV1Response.java new file mode 100644 index 00000000000..e06e489a11b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DiagnoseNodeV1Response.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.NodeDiagnosticInfo; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DiagnoseNodeV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DiagnoseNodeV1Response { + public static final String SERIALIZED_NAME_NODE_DIAGNOSTIC_INFO = "nodeDiagnosticInfo"; + @SerializedName(SERIALIZED_NAME_NODE_DIAGNOSTIC_INFO) + private NodeDiagnosticInfo nodeDiagnosticInfo; + + public DiagnoseNodeV1Response() { + } + + public DiagnoseNodeV1Response nodeDiagnosticInfo(NodeDiagnosticInfo nodeDiagnosticInfo) { + + this.nodeDiagnosticInfo = nodeDiagnosticInfo; + return this; + } + + /** + * Get nodeDiagnosticInfo + * @return nodeDiagnosticInfo + **/ + @javax.annotation.Nonnull + public NodeDiagnosticInfo getNodeDiagnosticInfo() { + return nodeDiagnosticInfo; + } + + + public void setNodeDiagnosticInfo(NodeDiagnosticInfo nodeDiagnosticInfo) { + this.nodeDiagnosticInfo = nodeDiagnosticInfo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DiagnoseNodeV1Response diagnoseNodeV1Response = (DiagnoseNodeV1Response) o; + return Objects.equals(this.nodeDiagnosticInfo, diagnoseNodeV1Response.nodeDiagnosticInfo); + } + + @Override + public int hashCode() { + return Objects.hash(nodeDiagnosticInfo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DiagnoseNodeV1Response {\n"); + sb.append(" nodeDiagnosticInfo: ").append(toIndentedString(nodeDiagnosticInfo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("nodeDiagnosticInfo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("nodeDiagnosticInfo"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DiagnoseNodeV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DiagnoseNodeV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DiagnoseNodeV1Response is not found in the empty JSON string", DiagnoseNodeV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DiagnoseNodeV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DiagnoseNodeV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DiagnoseNodeV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `nodeDiagnosticInfo` + NodeDiagnosticInfo.validateJsonObject(jsonObj.getAsJsonObject("nodeDiagnosticInfo")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DiagnoseNodeV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DiagnoseNodeV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DiagnoseNodeV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DiagnoseNodeV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DiagnoseNodeV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DiagnoseNodeV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DiagnoseNodeV1Response + * @throws IOException if the JSON string is invalid with respect to DiagnoseNodeV1Response + */ + public static DiagnoseNodeV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DiagnoseNodeV1Response.class); + } + + /** + * Convert an instance of DiagnoseNodeV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FlowInvocationType.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FlowInvocationType.java new file mode 100644 index 00000000000..0991f49ce93 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FlowInvocationType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Determines which flow starting method will be used on the back-end when invoking the flow. Based on the value here the plugin back-end might invoke the rpc.startFlowDynamic() method or the rpc.startTrackedFlowDynamic() method. Streamed responses are aggregated and returned in a single response to HTTP callers who are not equipped to handle streams like WebSocket/gRPC/etc. do. + */ +@JsonAdapter(FlowInvocationType.Adapter.class) +public enum FlowInvocationType { + + TRACKED_FLOW_DYNAMIC("TRACKED_FLOW_DYNAMIC"), + + FLOW_DYNAMIC("FLOW_DYNAMIC"); + + private String value; + + FlowInvocationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FlowInvocationType fromValue(String value) { + for (FlowInvocationType b : FlowInvocationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FlowInvocationType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FlowInvocationType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FlowInvocationType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Request.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Request.java new file mode 100644 index 00000000000..a186aa4b235 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Request.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetMonitorTransactionsV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetMonitorTransactionsV1Request { + public static final String SERIALIZED_NAME_CLIENT_APP_ID = "clientAppId"; + @SerializedName(SERIALIZED_NAME_CLIENT_APP_ID) + private String clientAppId; + + public static final String SERIALIZED_NAME_STATE_FULL_CLASS_NAME = "stateFullClassName"; + @SerializedName(SERIALIZED_NAME_STATE_FULL_CLASS_NAME) + private String stateFullClassName; + + public GetMonitorTransactionsV1Request() { + } + + public GetMonitorTransactionsV1Request clientAppId(String clientAppId) { + + this.clientAppId = clientAppId; + return this; + } + + /** + * ID of a client application that wants to monitor the state changes + * @return clientAppId + **/ + @javax.annotation.Nonnull + public String getClientAppId() { + return clientAppId; + } + + + public void setClientAppId(String clientAppId) { + this.clientAppId = clientAppId; + } + + + public GetMonitorTransactionsV1Request stateFullClassName(String stateFullClassName) { + + this.stateFullClassName = stateFullClassName; + return this; + } + + /** + * The fully qualified name of the Corda state to monitor + * @return stateFullClassName + **/ + @javax.annotation.Nonnull + public String getStateFullClassName() { + return stateFullClassName; + } + + + public void setStateFullClassName(String stateFullClassName) { + this.stateFullClassName = stateFullClassName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMonitorTransactionsV1Request getMonitorTransactionsV1Request = (GetMonitorTransactionsV1Request) o; + return Objects.equals(this.clientAppId, getMonitorTransactionsV1Request.clientAppId) && + Objects.equals(this.stateFullClassName, getMonitorTransactionsV1Request.stateFullClassName); + } + + @Override + public int hashCode() { + return Objects.hash(clientAppId, stateFullClassName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMonitorTransactionsV1Request {\n"); + sb.append(" clientAppId: ").append(toIndentedString(clientAppId)).append("\n"); + sb.append(" stateFullClassName: ").append(toIndentedString(stateFullClassName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("clientAppId"); + openapiFields.add("stateFullClassName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("clientAppId"); + openapiRequiredFields.add("stateFullClassName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetMonitorTransactionsV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetMonitorTransactionsV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetMonitorTransactionsV1Request is not found in the empty JSON string", GetMonitorTransactionsV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetMonitorTransactionsV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetMonitorTransactionsV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetMonitorTransactionsV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("clientAppId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientAppId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientAppId").toString())); + } + if (!jsonObj.get("stateFullClassName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateFullClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateFullClassName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetMonitorTransactionsV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetMonitorTransactionsV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetMonitorTransactionsV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetMonitorTransactionsV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetMonitorTransactionsV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetMonitorTransactionsV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetMonitorTransactionsV1Request + * @throws IOException if the JSON string is invalid with respect to GetMonitorTransactionsV1Request + */ + public static GetMonitorTransactionsV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetMonitorTransactionsV1Request.class); + } + + /** + * Convert an instance of GetMonitorTransactionsV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Response.java new file mode 100644 index 00000000000..d6c5e4b8942 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1Response.java @@ -0,0 +1,329 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.GetMonitorTransactionsV1ResponseTxInner; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetMonitorTransactionsV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetMonitorTransactionsV1Response { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_MSG = "msg"; + @SerializedName(SERIALIZED_NAME_MSG) + private String msg; + + public static final String SERIALIZED_NAME_STATE_FULL_CLASS_NAME = "stateFullClassName"; + @SerializedName(SERIALIZED_NAME_STATE_FULL_CLASS_NAME) + private String stateFullClassName; + + public static final String SERIALIZED_NAME_TX = "tx"; + @SerializedName(SERIALIZED_NAME_TX) + private List tx = null; + + public GetMonitorTransactionsV1Response() { + } + + public GetMonitorTransactionsV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Flag set to true if operation completed correctly. + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public GetMonitorTransactionsV1Response msg(String msg) { + + this.msg = msg; + return this; + } + + /** + * Message describing operation status or any errors that occurred. + * @return msg + **/ + @javax.annotation.Nonnull + public String getMsg() { + return msg; + } + + + public void setMsg(String msg) { + this.msg = msg; + } + + + public GetMonitorTransactionsV1Response stateFullClassName(String stateFullClassName) { + + this.stateFullClassName = stateFullClassName; + return this; + } + + /** + * The fully qualified name of the Corda state to monitor + * @return stateFullClassName + **/ + @javax.annotation.Nullable + public String getStateFullClassName() { + return stateFullClassName; + } + + + public void setStateFullClassName(String stateFullClassName) { + this.stateFullClassName = stateFullClassName; + } + + + public GetMonitorTransactionsV1Response tx(List tx) { + + this.tx = tx; + return this; + } + + public GetMonitorTransactionsV1Response addTxItem(GetMonitorTransactionsV1ResponseTxInner txItem) { + if (this.tx == null) { + this.tx = null; + } + this.tx.add(txItem); + return this; + } + + /** + * Get tx + * @return tx + **/ + @javax.annotation.Nullable + public List getTx() { + return tx; + } + + + public void setTx(List tx) { + this.tx = tx; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMonitorTransactionsV1Response getMonitorTransactionsV1Response = (GetMonitorTransactionsV1Response) o; + return Objects.equals(this.success, getMonitorTransactionsV1Response.success) && + Objects.equals(this.msg, getMonitorTransactionsV1Response.msg) && + Objects.equals(this.stateFullClassName, getMonitorTransactionsV1Response.stateFullClassName) && + Objects.equals(this.tx, getMonitorTransactionsV1Response.tx); + } + + @Override + public int hashCode() { + return Objects.hash(success, msg, stateFullClassName, tx); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMonitorTransactionsV1Response {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append(" stateFullClassName: ").append(toIndentedString(stateFullClassName)).append("\n"); + sb.append(" tx: ").append(toIndentedString(tx)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("msg"); + openapiFields.add("stateFullClassName"); + openapiFields.add("tx"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("msg"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetMonitorTransactionsV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetMonitorTransactionsV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetMonitorTransactionsV1Response is not found in the empty JSON string", GetMonitorTransactionsV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetMonitorTransactionsV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetMonitorTransactionsV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetMonitorTransactionsV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `msg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("msg").toString())); + } + if ((jsonObj.get("stateFullClassName") != null && !jsonObj.get("stateFullClassName").isJsonNull()) && !jsonObj.get("stateFullClassName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateFullClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateFullClassName").toString())); + } + if (jsonObj.get("tx") != null && !jsonObj.get("tx").isJsonNull()) { + JsonArray jsonArraytx = jsonObj.getAsJsonArray("tx"); + if (jsonArraytx != null) { + // ensure the json data is an array + if (!jsonObj.get("tx").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tx` to be an array in the JSON string but got `%s`", jsonObj.get("tx").toString())); + } + + // validate the optional field `tx` (array) + for (int i = 0; i < jsonArraytx.size(); i++) { + GetMonitorTransactionsV1ResponseTxInner.validateJsonObject(jsonArraytx.get(i).getAsJsonObject()); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetMonitorTransactionsV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetMonitorTransactionsV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetMonitorTransactionsV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetMonitorTransactionsV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetMonitorTransactionsV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetMonitorTransactionsV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetMonitorTransactionsV1Response + * @throws IOException if the JSON string is invalid with respect to GetMonitorTransactionsV1Response + */ + public static GetMonitorTransactionsV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetMonitorTransactionsV1Response.class); + } + + /** + * Convert an instance of GetMonitorTransactionsV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInner.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInner.java new file mode 100644 index 00000000000..6a1869aa618 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInner.java @@ -0,0 +1,239 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetMonitorTransactionsV1ResponseTxInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetMonitorTransactionsV1ResponseTxInner { + public static final String SERIALIZED_NAME_INDEX = "index"; + @SerializedName(SERIALIZED_NAME_INDEX) + private String index; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private String data; + + public GetMonitorTransactionsV1ResponseTxInner() { + } + + public GetMonitorTransactionsV1ResponseTxInner index(String index) { + + this.index = index; + return this; + } + + /** + * Get index + * @return index + **/ + @javax.annotation.Nullable + public String getIndex() { + return index; + } + + + public void setIndex(String index) { + this.index = index; + } + + + public GetMonitorTransactionsV1ResponseTxInner data(String data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + public String getData() { + return data; + } + + + public void setData(String data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMonitorTransactionsV1ResponseTxInner getMonitorTransactionsV1ResponseTxInner = (GetMonitorTransactionsV1ResponseTxInner) o; + return Objects.equals(this.index, getMonitorTransactionsV1ResponseTxInner.index) && + Objects.equals(this.data, getMonitorTransactionsV1ResponseTxInner.data); + } + + @Override + public int hashCode() { + return Objects.hash(index, data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMonitorTransactionsV1ResponseTxInner {\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("index"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetMonitorTransactionsV1ResponseTxInner + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetMonitorTransactionsV1ResponseTxInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetMonitorTransactionsV1ResponseTxInner is not found in the empty JSON string", GetMonitorTransactionsV1ResponseTxInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetMonitorTransactionsV1ResponseTxInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetMonitorTransactionsV1ResponseTxInner` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("index") != null && !jsonObj.get("index").isJsonNull()) && !jsonObj.get("index").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `index` to be a primitive type in the JSON string but got `%s`", jsonObj.get("index").toString())); + } + if ((jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) && !jsonObj.get("data").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetMonitorTransactionsV1ResponseTxInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetMonitorTransactionsV1ResponseTxInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetMonitorTransactionsV1ResponseTxInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetMonitorTransactionsV1ResponseTxInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetMonitorTransactionsV1ResponseTxInner read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetMonitorTransactionsV1ResponseTxInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetMonitorTransactionsV1ResponseTxInner + * @throws IOException if the JSON string is invalid with respect to GetMonitorTransactionsV1ResponseTxInner + */ + public static GetMonitorTransactionsV1ResponseTxInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetMonitorTransactionsV1ResponseTxInner.class); + } + + /** + * Convert an instance of GetMonitorTransactionsV1ResponseTxInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java new file mode 100644 index 00000000000..ac72d4cc0b8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java @@ -0,0 +1,325 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.FlowInvocationType; +import org.openapitools.client.model.JvmObject; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Request { + public static final String SERIALIZED_NAME_FLOW_FULL_CLASS_NAME = "flowFullClassName"; + @SerializedName(SERIALIZED_NAME_FLOW_FULL_CLASS_NAME) + private String flowFullClassName; + + public static final String SERIALIZED_NAME_FLOW_INVOCATION_TYPE = "flowInvocationType"; + @SerializedName(SERIALIZED_NAME_FLOW_INVOCATION_TYPE) + private FlowInvocationType flowInvocationType; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private Integer timeoutMs = 60000; + + public InvokeContractV1Request() { + } + + public InvokeContractV1Request flowFullClassName(String flowFullClassName) { + + this.flowFullClassName = flowFullClassName; + return this; + } + + /** + * The fully qualified name of the Corda flow to invoke + * @return flowFullClassName + **/ + @javax.annotation.Nonnull + public String getFlowFullClassName() { + return flowFullClassName; + } + + + public void setFlowFullClassName(String flowFullClassName) { + this.flowFullClassName = flowFullClassName; + } + + + public InvokeContractV1Request flowInvocationType(FlowInvocationType flowInvocationType) { + + this.flowInvocationType = flowInvocationType; + return this; + } + + /** + * Get flowInvocationType + * @return flowInvocationType + **/ + @javax.annotation.Nonnull + public FlowInvocationType getFlowInvocationType() { + return flowInvocationType; + } + + + public void setFlowInvocationType(FlowInvocationType flowInvocationType) { + this.flowInvocationType = flowInvocationType; + } + + + public InvokeContractV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeContractV1Request addParamsItem(JvmObject paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeContractV1Request timeoutMs(Integer timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public Integer getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(Integer timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Request invokeContractV1Request = (InvokeContractV1Request) o; + return Objects.equals(this.flowFullClassName, invokeContractV1Request.flowFullClassName) && + Objects.equals(this.flowInvocationType, invokeContractV1Request.flowInvocationType) && + Objects.equals(this.params, invokeContractV1Request.params) && + Objects.equals(this.timeoutMs, invokeContractV1Request.timeoutMs); + } + + @Override + public int hashCode() { + return Objects.hash(flowFullClassName, flowInvocationType, params, timeoutMs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Request {\n"); + sb.append(" flowFullClassName: ").append(toIndentedString(flowFullClassName)).append("\n"); + sb.append(" flowInvocationType: ").append(toIndentedString(flowInvocationType)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("flowFullClassName"); + openapiFields.add("flowInvocationType"); + openapiFields.add("params"); + openapiFields.add("timeoutMs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("flowFullClassName"); + openapiRequiredFields.add("flowInvocationType"); + openapiRequiredFields.add("params"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Request is not found in the empty JSON string", InvokeContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("flowFullClassName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `flowFullClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("flowFullClassName").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + + JsonArray jsonArrayparams = jsonObj.getAsJsonArray("params"); + // validate the required field `params` (array) + for (int i = 0; i < jsonArrayparams.size(); i++) { + JvmObject.validateJsonObject(jsonArrayparams.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Request + */ + public static InvokeContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Request.class); + } + + /** + * Convert an instance of InvokeContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java new file mode 100644 index 00000000000..65c355485a3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java @@ -0,0 +1,347 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Response { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_CALL_OUTPUT = "callOutput"; + @SerializedName(SERIALIZED_NAME_CALL_OUTPUT) + private Object callOutput; + + public static final String SERIALIZED_NAME_TRANSACTION_ID = "transactionId"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_ID) + private String transactionId; + + public static final String SERIALIZED_NAME_PROGRESS = "progress"; + @SerializedName(SERIALIZED_NAME_PROGRESS) + private List progress = null; + + public static final String SERIALIZED_NAME_FLOW_ID = "flowId"; + @SerializedName(SERIALIZED_NAME_FLOW_ID) + private String flowId; + + public InvokeContractV1Response() { + } + + public InvokeContractV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public InvokeContractV1Response callOutput(Object callOutput) { + + this.callOutput = callOutput; + return this; + } + + /** + * Data returned from the JVM when no transaction is running + * @return callOutput + **/ + @javax.annotation.Nonnull + public Object getCallOutput() { + return callOutput; + } + + + public void setCallOutput(Object callOutput) { + this.callOutput = callOutput; + } + + + public InvokeContractV1Response transactionId(String transactionId) { + + this.transactionId = transactionId; + return this; + } + + /** + * The net.corda.core.flows.StateMachineRunId value returned by the flow execution. + * @return transactionId + **/ + @javax.annotation.Nullable + public String getTransactionId() { + return transactionId; + } + + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + + public InvokeContractV1Response progress(List progress) { + + this.progress = progress; + return this; + } + + public InvokeContractV1Response addProgressItem(String progressItem) { + if (this.progress == null) { + this.progress = null; + } + this.progress.add(progressItem); + return this; + } + + /** + * An array of strings representing the aggregated stream of progress updates provided by a *tracked* flow invocation. If the flow invocation was not tracked, this array is still returned, but as empty. + * @return progress + **/ + @javax.annotation.Nullable + public List getProgress() { + return progress; + } + + + public void setProgress(List progress) { + this.progress = progress; + } + + + public InvokeContractV1Response flowId(String flowId) { + + this.flowId = flowId; + return this; + } + + /** + * The id for the flow handle + * @return flowId + **/ + @javax.annotation.Nonnull + public String getFlowId() { + return flowId; + } + + + public void setFlowId(String flowId) { + this.flowId = flowId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Response invokeContractV1Response = (InvokeContractV1Response) o; + return Objects.equals(this.success, invokeContractV1Response.success) && + Objects.equals(this.callOutput, invokeContractV1Response.callOutput) && + Objects.equals(this.transactionId, invokeContractV1Response.transactionId) && + Objects.equals(this.progress, invokeContractV1Response.progress) && + Objects.equals(this.flowId, invokeContractV1Response.flowId); + } + + @Override + public int hashCode() { + return Objects.hash(success, callOutput, transactionId, progress, flowId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Response {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" callOutput: ").append(toIndentedString(callOutput)).append("\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" progress: ").append(toIndentedString(progress)).append("\n"); + sb.append(" flowId: ").append(toIndentedString(flowId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("callOutput"); + openapiFields.add("transactionId"); + openapiFields.add("progress"); + openapiFields.add("flowId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("callOutput"); + openapiRequiredFields.add("flowId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Response is not found in the empty JSON string", InvokeContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("transactionId") != null && !jsonObj.get("transactionId").isJsonNull()) && !jsonObj.get("transactionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("progress") != null && !jsonObj.get("progress").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `progress` to be an array in the JSON string but got `%s`", jsonObj.get("progress").toString())); + } + if (!jsonObj.get("flowId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `flowId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("flowId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Response + */ + public static InvokeContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Response.class); + } + + /** + * Convert an instance of InvokeContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JarFile.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JarFile.java new file mode 100644 index 00000000000..efb56ca9ff0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JarFile.java @@ -0,0 +1,352 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * JarFile + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JarFile { + public static final String SERIALIZED_NAME_FILENAME = "filename"; + @SerializedName(SERIALIZED_NAME_FILENAME) + private String filename; + + public static final String SERIALIZED_NAME_HAS_DB_MIGRATIONS = "hasDbMigrations"; + @SerializedName(SERIALIZED_NAME_HAS_DB_MIGRATIONS) + private Boolean hasDbMigrations; + + public static final String SERIALIZED_NAME_CONTENT_BASE64 = "contentBase64"; + @SerializedName(SERIALIZED_NAME_CONTENT_BASE64) + private String contentBase64; + + public JarFile() { + } + + public JarFile filename(String filename) { + + this.filename = filename; + return this; + } + + /** + * Get filename + * @return filename + **/ + @javax.annotation.Nonnull + public String getFilename() { + return filename; + } + + + public void setFilename(String filename) { + this.filename = filename; + } + + + public JarFile hasDbMigrations(Boolean hasDbMigrations) { + + this.hasDbMigrations = hasDbMigrations; + return this; + } + + /** + * Indicates whether the cordapp jar in question contains any embedded migrations that Cactus can/should execute between copying the jar into the cordapp directory and starting the node back up. + * @return hasDbMigrations + **/ + @javax.annotation.Nonnull + public Boolean getHasDbMigrations() { + return hasDbMigrations; + } + + + public void setHasDbMigrations(Boolean hasDbMigrations) { + this.hasDbMigrations = hasDbMigrations; + } + + + public JarFile contentBase64(String contentBase64) { + + this.contentBase64 = contentBase64; + return this; + } + + /** + * Get contentBase64 + * @return contentBase64 + **/ + @javax.annotation.Nonnull + public String getContentBase64() { + return contentBase64; + } + + + public void setContentBase64(String contentBase64) { + this.contentBase64 = contentBase64; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JarFile instance itself + */ + public JarFile putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JarFile jarFile = (JarFile) o; + return Objects.equals(this.filename, jarFile.filename) && + Objects.equals(this.hasDbMigrations, jarFile.hasDbMigrations) && + Objects.equals(this.contentBase64, jarFile.contentBase64)&& + Objects.equals(this.additionalProperties, jarFile.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(filename, hasDbMigrations, contentBase64, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JarFile {\n"); + sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); + sb.append(" hasDbMigrations: ").append(toIndentedString(hasDbMigrations)).append("\n"); + sb.append(" contentBase64: ").append(toIndentedString(contentBase64)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filename"); + openapiFields.add("hasDbMigrations"); + openapiFields.add("contentBase64"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("filename"); + openapiRequiredFields.add("hasDbMigrations"); + openapiRequiredFields.add("contentBase64"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JarFile + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!JarFile.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JarFile is not found in the empty JSON string", JarFile.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JarFile.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("filename").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `filename` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filename").toString())); + } + if (!jsonObj.get("contentBase64").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contentBase64` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contentBase64").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JarFile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JarFile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JarFile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JarFile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JarFile read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + JarFile instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JarFile given an JSON string + * + * @param jsonString JSON string + * @return An instance of JarFile + * @throws IOException if the JSON string is invalid with respect to JarFile + */ + public static JarFile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JarFile.class); + } + + /** + * Convert an instance of JarFile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmObject.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmObject.java new file mode 100644 index 00000000000..4bfd7ff3afb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmObject.java @@ -0,0 +1,326 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.JvmType; +import org.openapitools.client.model.JvmTypeKind; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Can represent JVM primitive and reference types as well. The jvmTypeKind field indicates which one is being stored. If the jvmTypeKind field is set to REFERENCE then the jvmCtorArgs array is expected to be filled, otherwise (e.g. PRIMITIVE jvmTypeKind) it is expected that the primitiveValue property is filled with a primitive data type supported by the JSON standard such as strings, booleans, numbers, etc. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JvmObject { + public static final String SERIALIZED_NAME_JVM_TYPE_KIND = "jvmTypeKind"; + @SerializedName(SERIALIZED_NAME_JVM_TYPE_KIND) + private JvmTypeKind jvmTypeKind; + + public static final String SERIALIZED_NAME_PRIMITIVE_VALUE = "primitiveValue"; + @SerializedName(SERIALIZED_NAME_PRIMITIVE_VALUE) + private Object primitiveValue; + + public static final String SERIALIZED_NAME_JVM_CTOR_ARGS = "jvmCtorArgs"; + @SerializedName(SERIALIZED_NAME_JVM_CTOR_ARGS) + private List jvmCtorArgs = null; + + public static final String SERIALIZED_NAME_JVM_TYPE = "jvmType"; + @SerializedName(SERIALIZED_NAME_JVM_TYPE) + private JvmType jvmType; + + public JvmObject() { + } + + public JvmObject jvmTypeKind(JvmTypeKind jvmTypeKind) { + + this.jvmTypeKind = jvmTypeKind; + return this; + } + + /** + * Get jvmTypeKind + * @return jvmTypeKind + **/ + @javax.annotation.Nonnull + public JvmTypeKind getJvmTypeKind() { + return jvmTypeKind; + } + + + public void setJvmTypeKind(JvmTypeKind jvmTypeKind) { + this.jvmTypeKind = jvmTypeKind; + } + + + public JvmObject primitiveValue(Object primitiveValue) { + + this.primitiveValue = primitiveValue; + return this; + } + + /** + * Get primitiveValue + * @return primitiveValue + **/ + @javax.annotation.Nullable + public Object getPrimitiveValue() { + return primitiveValue; + } + + + public void setPrimitiveValue(Object primitiveValue) { + this.primitiveValue = primitiveValue; + } + + + public JvmObject jvmCtorArgs(List jvmCtorArgs) { + + this.jvmCtorArgs = jvmCtorArgs; + return this; + } + + public JvmObject addJvmCtorArgsItem(JvmObject jvmCtorArgsItem) { + if (this.jvmCtorArgs == null) { + this.jvmCtorArgs = null; + } + this.jvmCtorArgs.add(jvmCtorArgsItem); + return this; + } + + /** + * Get jvmCtorArgs + * @return jvmCtorArgs + **/ + @javax.annotation.Nullable + public List getJvmCtorArgs() { + return jvmCtorArgs; + } + + + public void setJvmCtorArgs(List jvmCtorArgs) { + this.jvmCtorArgs = jvmCtorArgs; + } + + + public JvmObject jvmType(JvmType jvmType) { + + this.jvmType = jvmType; + return this; + } + + /** + * Get jvmType + * @return jvmType + **/ + @javax.annotation.Nonnull + public JvmType getJvmType() { + return jvmType; + } + + + public void setJvmType(JvmType jvmType) { + this.jvmType = jvmType; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JvmObject jvmObject = (JvmObject) o; + return Objects.equals(this.jvmTypeKind, jvmObject.jvmTypeKind) && + Objects.equals(this.primitiveValue, jvmObject.primitiveValue) && + Objects.equals(this.jvmCtorArgs, jvmObject.jvmCtorArgs) && + Objects.equals(this.jvmType, jvmObject.jvmType); + } + + @Override + public int hashCode() { + return Objects.hash(jvmTypeKind, primitiveValue, jvmCtorArgs, jvmType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JvmObject {\n"); + sb.append(" jvmTypeKind: ").append(toIndentedString(jvmTypeKind)).append("\n"); + sb.append(" primitiveValue: ").append(toIndentedString(primitiveValue)).append("\n"); + sb.append(" jvmCtorArgs: ").append(toIndentedString(jvmCtorArgs)).append("\n"); + sb.append(" jvmType: ").append(toIndentedString(jvmType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("jvmTypeKind"); + openapiFields.add("primitiveValue"); + openapiFields.add("jvmCtorArgs"); + openapiFields.add("jvmType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("jvmTypeKind"); + openapiRequiredFields.add("jvmType"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JvmObject + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!JvmObject.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JvmObject is not found in the empty JSON string", JvmObject.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JvmObject.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JvmObject` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JvmObject.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (jsonObj.get("jvmCtorArgs") != null && !jsonObj.get("jvmCtorArgs").isJsonNull()) { + JsonArray jsonArrayjvmCtorArgs = jsonObj.getAsJsonArray("jvmCtorArgs"); + if (jsonArrayjvmCtorArgs != null) { + // ensure the json data is an array + if (!jsonObj.get("jvmCtorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `jvmCtorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("jvmCtorArgs").toString())); + } + + // validate the optional field `jvmCtorArgs` (array) + for (int i = 0; i < jsonArrayjvmCtorArgs.size(); i++) { + JvmObject.validateJsonObject(jsonArrayjvmCtorArgs.get(i).getAsJsonObject()); + }; + } + } + // validate the required field `jvmType` + JvmType.validateJsonObject(jsonObj.getAsJsonObject("jvmType")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JvmObject.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JvmObject' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JvmObject.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JvmObject value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JvmObject read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JvmObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of JvmObject + * @throws IOException if the JSON string is invalid with respect to JvmObject + */ + public static JvmObject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JvmObject.class); + } + + /** + * Convert an instance of JvmObject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmType.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmType.java new file mode 100644 index 00000000000..dd62bdf598b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmType.java @@ -0,0 +1,280 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.JvmObject; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Represents a reference to a JVM type (such as a Java class) + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JvmType { + public static final String SERIALIZED_NAME_FQ_CLASS_NAME = "fqClassName"; + @SerializedName(SERIALIZED_NAME_FQ_CLASS_NAME) + private String fqClassName; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_NAME = "constructorName"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_NAME) + private String constructorName; + + public static final String SERIALIZED_NAME_INVOCATION_TARGET = "invocationTarget"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TARGET) + private JvmObject invocationTarget; + + public JvmType() { + } + + public JvmType fqClassName(String fqClassName) { + + this.fqClassName = fqClassName; + return this; + } + + /** + * Get fqClassName + * @return fqClassName + **/ + @javax.annotation.Nonnull + public String getFqClassName() { + return fqClassName; + } + + + public void setFqClassName(String fqClassName) { + this.fqClassName = fqClassName; + } + + + public JvmType constructorName(String constructorName) { + + this.constructorName = constructorName; + return this; + } + + /** + * This parameter is used to specify that the function used to construct this JvmType is not a constructor function but instead is a factory function. Setting this parameter will cause the plugin to look up methods of the class denoted by fqClassName instead of its constructors. + * @return constructorName + **/ + @javax.annotation.Nullable + public String getConstructorName() { + return constructorName; + } + + + public void setConstructorName(String constructorName) { + this.constructorName = constructorName; + } + + + public JvmType invocationTarget(JvmObject invocationTarget) { + + this.invocationTarget = invocationTarget; + return this; + } + + /** + * Get invocationTarget + * @return invocationTarget + **/ + @javax.annotation.Nullable + public JvmObject getInvocationTarget() { + return invocationTarget; + } + + + public void setInvocationTarget(JvmObject invocationTarget) { + this.invocationTarget = invocationTarget; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JvmType jvmType = (JvmType) o; + return Objects.equals(this.fqClassName, jvmType.fqClassName) && + Objects.equals(this.constructorName, jvmType.constructorName) && + Objects.equals(this.invocationTarget, jvmType.invocationTarget); + } + + @Override + public int hashCode() { + return Objects.hash(fqClassName, constructorName, invocationTarget); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JvmType {\n"); + sb.append(" fqClassName: ").append(toIndentedString(fqClassName)).append("\n"); + sb.append(" constructorName: ").append(toIndentedString(constructorName)).append("\n"); + sb.append(" invocationTarget: ").append(toIndentedString(invocationTarget)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("fqClassName"); + openapiFields.add("constructorName"); + openapiFields.add("invocationTarget"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("fqClassName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JvmType + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!JvmType.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JvmType is not found in the empty JSON string", JvmType.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JvmType.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JvmType` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JvmType.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("fqClassName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fqClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fqClassName").toString())); + } + if ((jsonObj.get("constructorName") != null && !jsonObj.get("constructorName").isJsonNull()) && !jsonObj.get("constructorName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("constructorName").toString())); + } + // validate the optional field `invocationTarget` + if (jsonObj.get("invocationTarget") != null && !jsonObj.get("invocationTarget").isJsonNull()) { + JvmObject.validateJsonObject(jsonObj.getAsJsonObject("invocationTarget")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JvmType.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JvmType' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JvmType.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JvmType value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JvmType read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JvmType given an JSON string + * + * @param jsonString JSON string + * @return An instance of JvmType + * @throws IOException if the JSON string is invalid with respect to JvmType + */ + public static JvmType fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JvmType.class); + } + + /** + * Convert an instance of JvmType to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmTypeKind.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmTypeKind.java new file mode 100644 index 00000000000..a40efbc27a5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/JvmTypeKind.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets JvmTypeKind + */ +@JsonAdapter(JvmTypeKind.Adapter.class) +public enum JvmTypeKind { + + PRIMITIVE("PRIMITIVE"), + + REFERENCE("REFERENCE"); + + private String value; + + JvmTypeKind(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static JvmTypeKind fromValue(String value) { + for (JvmTypeKind b : JvmTypeKind.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final JvmTypeKind enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public JvmTypeKind read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return JvmTypeKind.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ListFlowsV1Request.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ListFlowsV1Request.java new file mode 100644 index 00000000000..e2dcae57978 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ListFlowsV1Request.java @@ -0,0 +1,208 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ListFlowsV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListFlowsV1Request { + public static final String SERIALIZED_NAME_FILTER = "filter"; + @SerializedName(SERIALIZED_NAME_FILTER) + private String filter; + + public ListFlowsV1Request() { + } + + public ListFlowsV1Request filter(String filter) { + + this.filter = filter; + return this; + } + + /** + * Get filter + * @return filter + **/ + @javax.annotation.Nullable + public String getFilter() { + return filter; + } + + + public void setFilter(String filter) { + this.filter = filter; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListFlowsV1Request listFlowsV1Request = (ListFlowsV1Request) o; + return Objects.equals(this.filter, listFlowsV1Request.filter); + } + + @Override + public int hashCode() { + return Objects.hash(filter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListFlowsV1Request {\n"); + sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filter"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ListFlowsV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListFlowsV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ListFlowsV1Request is not found in the empty JSON string", ListFlowsV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListFlowsV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListFlowsV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("filter") != null && !jsonObj.get("filter").isJsonNull()) && !jsonObj.get("filter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `filter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filter").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListFlowsV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListFlowsV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListFlowsV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListFlowsV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListFlowsV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListFlowsV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListFlowsV1Request + * @throws IOException if the JSON string is invalid with respect to ListFlowsV1Request + */ + public static ListFlowsV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListFlowsV1Request.class); + } + + /** + * Convert an instance of ListFlowsV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ListFlowsV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ListFlowsV1Response.java new file mode 100644 index 00000000000..0859908cd7d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ListFlowsV1Response.java @@ -0,0 +1,229 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ListFlowsV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ListFlowsV1Response { + public static final String SERIALIZED_NAME_FLOW_NAMES = "flowNames"; + @SerializedName(SERIALIZED_NAME_FLOW_NAMES) + private List flowNames = null; + + public ListFlowsV1Response() { + } + + public ListFlowsV1Response flowNames(List flowNames) { + + this.flowNames = flowNames; + return this; + } + + public ListFlowsV1Response addFlowNamesItem(String flowNamesItem) { + if (this.flowNames == null) { + this.flowNames = null; + } + this.flowNames.add(flowNamesItem); + return this; + } + + /** + * An array of strings storing the names of the flows as returned by the flowList Corda RPC. + * @return flowNames + **/ + @javax.annotation.Nonnull + public List getFlowNames() { + return flowNames; + } + + + public void setFlowNames(List flowNames) { + this.flowNames = flowNames; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListFlowsV1Response listFlowsV1Response = (ListFlowsV1Response) o; + return Objects.equals(this.flowNames, listFlowsV1Response.flowNames); + } + + @Override + public int hashCode() { + return Objects.hash(flowNames); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListFlowsV1Response {\n"); + sb.append(" flowNames: ").append(toIndentedString(flowNames)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("flowNames"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("flowNames"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ListFlowsV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ListFlowsV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ListFlowsV1Response is not found in the empty JSON string", ListFlowsV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ListFlowsV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListFlowsV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListFlowsV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("flowNames") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("flowNames").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `flowNames` to be an array in the JSON string but got `%s`", jsonObj.get("flowNames").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ListFlowsV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ListFlowsV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ListFlowsV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ListFlowsV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ListFlowsV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ListFlowsV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of ListFlowsV1Response + * @throws IOException if the JSON string is invalid with respect to ListFlowsV1Response + */ + public static ListFlowsV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ListFlowsV1Response.class); + } + + /** + * Convert an instance of ListFlowsV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NetworkHostAndPort.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NetworkHostAndPort.java new file mode 100644 index 00000000000..5cf9a89a9b5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NetworkHostAndPort.java @@ -0,0 +1,246 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * NetworkHostAndPort + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NetworkHostAndPort { + public static final String SERIALIZED_NAME_HOST = "host"; + @SerializedName(SERIALIZED_NAME_HOST) + private String host; + + public static final String SERIALIZED_NAME_PORT = "port"; + @SerializedName(SERIALIZED_NAME_PORT) + private BigDecimal port; + + public NetworkHostAndPort() { + } + + public NetworkHostAndPort host(String host) { + + this.host = host; + return this; + } + + /** + * Get host + * @return host + **/ + @javax.annotation.Nonnull + public String getHost() { + return host; + } + + + public void setHost(String host) { + this.host = host; + } + + + public NetworkHostAndPort port(BigDecimal port) { + + this.port = port; + return this; + } + + /** + * Get port + * @return port + **/ + @javax.annotation.Nonnull + public BigDecimal getPort() { + return port; + } + + + public void setPort(BigDecimal port) { + this.port = port; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NetworkHostAndPort networkHostAndPort = (NetworkHostAndPort) o; + return Objects.equals(this.host, networkHostAndPort.host) && + Objects.equals(this.port, networkHostAndPort.port); + } + + @Override + public int hashCode() { + return Objects.hash(host, port); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NetworkHostAndPort {\n"); + sb.append(" host: ").append(toIndentedString(host)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("host"); + openapiFields.add("port"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("host"); + openapiRequiredFields.add("port"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NetworkHostAndPort + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!NetworkHostAndPort.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NetworkHostAndPort is not found in the empty JSON string", NetworkHostAndPort.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NetworkHostAndPort.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NetworkHostAndPort` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NetworkHostAndPort.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("host").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `host` to be a primitive type in the JSON string but got `%s`", jsonObj.get("host").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NetworkHostAndPort.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NetworkHostAndPort' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NetworkHostAndPort.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NetworkHostAndPort value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NetworkHostAndPort read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NetworkHostAndPort given an JSON string + * + * @param jsonString JSON string + * @return An instance of NetworkHostAndPort + * @throws IOException if the JSON string is invalid with respect to NetworkHostAndPort + */ + public static NetworkHostAndPort fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NetworkHostAndPort.class); + } + + /** + * Convert an instance of NetworkHostAndPort to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NodeDiagnosticInfo.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NodeDiagnosticInfo.java new file mode 100644 index 00000000000..de2888e8369 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NodeDiagnosticInfo.java @@ -0,0 +1,359 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.CordappInfo; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * A NodeDiagnosticInfo holds information about the current node version. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NodeDiagnosticInfo { + public static final String SERIALIZED_NAME_CORDAPPS = "cordapps"; + @SerializedName(SERIALIZED_NAME_CORDAPPS) + private List cordapps = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PLATFORM_VERSION = "platformVersion"; + @SerializedName(SERIALIZED_NAME_PLATFORM_VERSION) + private Integer platformVersion; + + public static final String SERIALIZED_NAME_REVISION = "revision"; + @SerializedName(SERIALIZED_NAME_REVISION) + private String revision; + + public static final String SERIALIZED_NAME_VENDOR = "vendor"; + @SerializedName(SERIALIZED_NAME_VENDOR) + private String vendor; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public NodeDiagnosticInfo() { + } + + public NodeDiagnosticInfo cordapps(List cordapps) { + + this.cordapps = cordapps; + return this; + } + + public NodeDiagnosticInfo addCordappsItem(CordappInfo cordappsItem) { + if (this.cordapps == null) { + this.cordapps = new ArrayList<>(); + } + this.cordapps.add(cordappsItem); + return this; + } + + /** + * A list of CorDapps currently installed on this node + * @return cordapps + **/ + @javax.annotation.Nonnull + public List getCordapps() { + return cordapps; + } + + + public void setCordapps(List cordapps) { + this.cordapps = cordapps; + } + + + public NodeDiagnosticInfo platformVersion(Integer platformVersion) { + + this.platformVersion = platformVersion; + return this; + } + + /** + * The platform version of this node. This number represents a released API version, and should be used to make functionality decisions (e.g. enabling an app feature only if an underlying platform feature exists) + * @return platformVersion + **/ + @javax.annotation.Nonnull + public Integer getPlatformVersion() { + return platformVersion; + } + + + public void setPlatformVersion(Integer platformVersion) { + this.platformVersion = platformVersion; + } + + + public NodeDiagnosticInfo revision(String revision) { + + this.revision = revision; + return this; + } + + /** + * The git commit hash this node was built from + * @return revision + **/ + @javax.annotation.Nonnull + public String getRevision() { + return revision; + } + + + public void setRevision(String revision) { + this.revision = revision; + } + + + public NodeDiagnosticInfo vendor(String vendor) { + + this.vendor = vendor; + return this; + } + + /** + * The vendor of this node + * @return vendor + **/ + @javax.annotation.Nonnull + public String getVendor() { + return vendor; + } + + + public void setVendor(String vendor) { + this.vendor = vendor; + } + + + public NodeDiagnosticInfo version(String version) { + + this.version = version; + return this; + } + + /** + * The current node version string, e.g. 4.3, 4.4-SNAPSHOT. Note that this string is effectively freeform, and so should only be used for providing diagnostic information. It should not be used to make functionality decisions (the platformVersion is a better fit for this). + * @return version + **/ + @javax.annotation.Nonnull + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NodeDiagnosticInfo nodeDiagnosticInfo = (NodeDiagnosticInfo) o; + return Objects.equals(this.cordapps, nodeDiagnosticInfo.cordapps) && + Objects.equals(this.platformVersion, nodeDiagnosticInfo.platformVersion) && + Objects.equals(this.revision, nodeDiagnosticInfo.revision) && + Objects.equals(this.vendor, nodeDiagnosticInfo.vendor) && + Objects.equals(this.version, nodeDiagnosticInfo.version); + } + + @Override + public int hashCode() { + return Objects.hash(cordapps, platformVersion, revision, vendor, version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NodeDiagnosticInfo {\n"); + sb.append(" cordapps: ").append(toIndentedString(cordapps)).append("\n"); + sb.append(" platformVersion: ").append(toIndentedString(platformVersion)).append("\n"); + sb.append(" revision: ").append(toIndentedString(revision)).append("\n"); + sb.append(" vendor: ").append(toIndentedString(vendor)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cordapps"); + openapiFields.add("platformVersion"); + openapiFields.add("revision"); + openapiFields.add("vendor"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("cordapps"); + openapiRequiredFields.add("platformVersion"); + openapiRequiredFields.add("revision"); + openapiRequiredFields.add("vendor"); + openapiRequiredFields.add("version"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeDiagnosticInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!NodeDiagnosticInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeDiagnosticInfo is not found in the empty JSON string", NodeDiagnosticInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeDiagnosticInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeDiagnosticInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NodeDiagnosticInfo.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("cordapps").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `cordapps` to be an array in the JSON string but got `%s`", jsonObj.get("cordapps").toString())); + } + + JsonArray jsonArraycordapps = jsonObj.getAsJsonArray("cordapps"); + // validate the required field `cordapps` (array) + for (int i = 0; i < jsonArraycordapps.size(); i++) { + CordappInfo.validateJsonObject(jsonArraycordapps.get(i).getAsJsonObject()); + }; + if (!jsonObj.get("revision").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `revision` to be a primitive type in the JSON string but got `%s`", jsonObj.get("revision").toString())); + } + if (!jsonObj.get("vendor").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vendor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vendor").toString())); + } + if (!jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeDiagnosticInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeDiagnosticInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeDiagnosticInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeDiagnosticInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeDiagnosticInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeDiagnosticInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeDiagnosticInfo + * @throws IOException if the JSON string is invalid with respect to NodeDiagnosticInfo + */ + public static NodeDiagnosticInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeDiagnosticInfo.class); + } + + /** + * Convert an instance of NodeDiagnosticInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NodeInfo.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NodeInfo.java new file mode 100644 index 00000000000..6f2708acebb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/NodeInfo.java @@ -0,0 +1,384 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.NetworkHostAndPort; +import org.openapitools.client.model.Party; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * NodeInfo + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NodeInfo { + public static final String SERIALIZED_NAME_ADDRESSES = "addresses"; + @SerializedName(SERIALIZED_NAME_ADDRESSES) + private List addresses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PLATFORM_VERSION = "platformVersion"; + @SerializedName(SERIALIZED_NAME_PLATFORM_VERSION) + private Integer platformVersion; + + public static final String SERIALIZED_NAME_SERIAL = "serial"; + @SerializedName(SERIALIZED_NAME_SERIAL) + private BigDecimal serial; + + public static final String SERIALIZED_NAME_LEGAL_IDENTITIES = "legalIdentities"; + @SerializedName(SERIALIZED_NAME_LEGAL_IDENTITIES) + private List legalIdentities = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LEGAL_IDENTITIES_AND_CERTS = "legalIdentitiesAndCerts"; + @SerializedName(SERIALIZED_NAME_LEGAL_IDENTITIES_AND_CERTS) + private List legalIdentitiesAndCerts = new ArrayList<>(); + + public NodeInfo() { + } + + public NodeInfo addresses(List addresses) { + + this.addresses = addresses; + return this; + } + + public NodeInfo addAddressesItem(NetworkHostAndPort addressesItem) { + if (this.addresses == null) { + this.addresses = new ArrayList<>(); + } + this.addresses.add(addressesItem); + return this; + } + + /** + * Get addresses + * @return addresses + **/ + @javax.annotation.Nonnull + public List getAddresses() { + return addresses; + } + + + public void setAddresses(List addresses) { + this.addresses = addresses; + } + + + public NodeInfo platformVersion(Integer platformVersion) { + + this.platformVersion = platformVersion; + return this; + } + + /** + * Get platformVersion + * @return platformVersion + **/ + @javax.annotation.Nonnull + public Integer getPlatformVersion() { + return platformVersion; + } + + + public void setPlatformVersion(Integer platformVersion) { + this.platformVersion = platformVersion; + } + + + public NodeInfo serial(BigDecimal serial) { + + this.serial = serial; + return this; + } + + /** + * Get serial + * @return serial + **/ + @javax.annotation.Nonnull + public BigDecimal getSerial() { + return serial; + } + + + public void setSerial(BigDecimal serial) { + this.serial = serial; + } + + + public NodeInfo legalIdentities(List legalIdentities) { + + this.legalIdentities = legalIdentities; + return this; + } + + public NodeInfo addLegalIdentitiesItem(Party legalIdentitiesItem) { + if (this.legalIdentities == null) { + this.legalIdentities = new ArrayList<>(); + } + this.legalIdentities.add(legalIdentitiesItem); + return this; + } + + /** + * Get legalIdentities + * @return legalIdentities + **/ + @javax.annotation.Nonnull + public List getLegalIdentities() { + return legalIdentities; + } + + + public void setLegalIdentities(List legalIdentities) { + this.legalIdentities = legalIdentities; + } + + + public NodeInfo legalIdentitiesAndCerts(List legalIdentitiesAndCerts) { + + this.legalIdentitiesAndCerts = legalIdentitiesAndCerts; + return this; + } + + public NodeInfo addLegalIdentitiesAndCertsItem(Object legalIdentitiesAndCertsItem) { + if (this.legalIdentitiesAndCerts == null) { + this.legalIdentitiesAndCerts = new ArrayList<>(); + } + this.legalIdentitiesAndCerts.add(legalIdentitiesAndCertsItem); + return this; + } + + /** + * Get legalIdentitiesAndCerts + * @return legalIdentitiesAndCerts + **/ + @javax.annotation.Nonnull + public List getLegalIdentitiesAndCerts() { + return legalIdentitiesAndCerts; + } + + + public void setLegalIdentitiesAndCerts(List legalIdentitiesAndCerts) { + this.legalIdentitiesAndCerts = legalIdentitiesAndCerts; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NodeInfo nodeInfo = (NodeInfo) o; + return Objects.equals(this.addresses, nodeInfo.addresses) && + Objects.equals(this.platformVersion, nodeInfo.platformVersion) && + Objects.equals(this.serial, nodeInfo.serial) && + Objects.equals(this.legalIdentities, nodeInfo.legalIdentities) && + Objects.equals(this.legalIdentitiesAndCerts, nodeInfo.legalIdentitiesAndCerts); + } + + @Override + public int hashCode() { + return Objects.hash(addresses, platformVersion, serial, legalIdentities, legalIdentitiesAndCerts); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NodeInfo {\n"); + sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); + sb.append(" platformVersion: ").append(toIndentedString(platformVersion)).append("\n"); + sb.append(" serial: ").append(toIndentedString(serial)).append("\n"); + sb.append(" legalIdentities: ").append(toIndentedString(legalIdentities)).append("\n"); + sb.append(" legalIdentitiesAndCerts: ").append(toIndentedString(legalIdentitiesAndCerts)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("addresses"); + openapiFields.add("platformVersion"); + openapiFields.add("serial"); + openapiFields.add("legalIdentities"); + openapiFields.add("legalIdentitiesAndCerts"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("addresses"); + openapiRequiredFields.add("platformVersion"); + openapiRequiredFields.add("serial"); + openapiRequiredFields.add("legalIdentities"); + openapiRequiredFields.add("legalIdentitiesAndCerts"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NodeInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!NodeInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NodeInfo is not found in the empty JSON string", NodeInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NodeInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NodeInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NodeInfo.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `addresses` to be an array in the JSON string but got `%s`", jsonObj.get("addresses").toString())); + } + + JsonArray jsonArrayaddresses = jsonObj.getAsJsonArray("addresses"); + // validate the required field `addresses` (array) + for (int i = 0; i < jsonArrayaddresses.size(); i++) { + NetworkHostAndPort.validateJsonObject(jsonArrayaddresses.get(i).getAsJsonObject()); + }; + // ensure the json data is an array + if (!jsonObj.get("legalIdentities").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `legalIdentities` to be an array in the JSON string but got `%s`", jsonObj.get("legalIdentities").toString())); + } + + JsonArray jsonArraylegalIdentities = jsonObj.getAsJsonArray("legalIdentities"); + // validate the required field `legalIdentities` (array) + for (int i = 0; i < jsonArraylegalIdentities.size(); i++) { + Party.validateJsonObject(jsonArraylegalIdentities.get(i).getAsJsonObject()); + }; + // ensure the required json array is present + if (jsonObj.get("legalIdentitiesAndCerts") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("legalIdentitiesAndCerts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `legalIdentitiesAndCerts` to be an array in the JSON string but got `%s`", jsonObj.get("legalIdentitiesAndCerts").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NodeInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NodeInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NodeInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NodeInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NodeInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NodeInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of NodeInfo + * @throws IOException if the JSON string is invalid with respect to NodeInfo + */ + public static NodeInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NodeInfo.class); + } + + /** + * Convert an instance of NodeInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Party.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Party.java new file mode 100644 index 00000000000..8cba8cd97a2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Party.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.CordaX500Name; +import org.openapitools.client.model.PublicKey; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Party + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Party { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private CordaX500Name name; + + public static final String SERIALIZED_NAME_OWNING_KEY = "owningKey"; + @SerializedName(SERIALIZED_NAME_OWNING_KEY) + private PublicKey owningKey; + + public Party() { + } + + public Party name(CordaX500Name name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public CordaX500Name getName() { + return name; + } + + + public void setName(CordaX500Name name) { + this.name = name; + } + + + public Party owningKey(PublicKey owningKey) { + + this.owningKey = owningKey; + return this; + } + + /** + * Get owningKey + * @return owningKey + **/ + @javax.annotation.Nonnull + public PublicKey getOwningKey() { + return owningKey; + } + + + public void setOwningKey(PublicKey owningKey) { + this.owningKey = owningKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Party party = (Party) o; + return Objects.equals(this.name, party.name) && + Objects.equals(this.owningKey, party.owningKey); + } + + @Override + public int hashCode() { + return Objects.hash(name, owningKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Party {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" owningKey: ").append(toIndentedString(owningKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("owningKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("owningKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Party + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Party.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Party is not found in the empty JSON string", Party.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Party.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Party` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Party.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `name` + CordaX500Name.validateJsonObject(jsonObj.getAsJsonObject("name")); + // validate the required field `owningKey` + PublicKey.validateJsonObject(jsonObj.getAsJsonObject("owningKey")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Party.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Party' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Party.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Party value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Party read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Party given an JSON string + * + * @param jsonString JSON string + * @return An instance of Party + * @throws IOException if the JSON string is invalid with respect to Party + */ + public static Party fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Party.class); + } + + /** + * Convert an instance of Party to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PublicKey.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PublicKey.java new file mode 100644 index 00000000000..238bdbf2700 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PublicKey.java @@ -0,0 +1,280 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * An instance of a java.security.PublicKey (which is an interface) implementation such as org.hyperledger.cactus.plugin.ledger.connector.corda.server.impl.PublicKeyImpl + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PublicKey { + public static final String SERIALIZED_NAME_ALGORITHM = "algorithm"; + @SerializedName(SERIALIZED_NAME_ALGORITHM) + private String algorithm; + + public static final String SERIALIZED_NAME_FORMAT = "format"; + @SerializedName(SERIALIZED_NAME_FORMAT) + private String format; + + public static final String SERIALIZED_NAME_ENCODED = "encoded"; + @SerializedName(SERIALIZED_NAME_ENCODED) + private String encoded; + + public PublicKey() { + } + + public PublicKey algorithm(String algorithm) { + + this.algorithm = algorithm; + return this; + } + + /** + * Get algorithm + * @return algorithm + **/ + @javax.annotation.Nonnull + public String getAlgorithm() { + return algorithm; + } + + + public void setAlgorithm(String algorithm) { + this.algorithm = algorithm; + } + + + public PublicKey format(String format) { + + this.format = format; + return this; + } + + /** + * Get format + * @return format + **/ + @javax.annotation.Nonnull + public String getFormat() { + return format; + } + + + public void setFormat(String format) { + this.format = format; + } + + + public PublicKey encoded(String encoded) { + + this.encoded = encoded; + return this; + } + + /** + * Get encoded + * @return encoded + **/ + @javax.annotation.Nonnull + public String getEncoded() { + return encoded; + } + + + public void setEncoded(String encoded) { + this.encoded = encoded; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicKey publicKey = (PublicKey) o; + return Objects.equals(this.algorithm, publicKey.algorithm) && + Objects.equals(this.format, publicKey.format) && + Objects.equals(this.encoded, publicKey.encoded); + } + + @Override + public int hashCode() { + return Objects.hash(algorithm, format, encoded); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicKey {\n"); + sb.append(" algorithm: ").append(toIndentedString(algorithm)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" encoded: ").append(toIndentedString(encoded)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("algorithm"); + openapiFields.add("format"); + openapiFields.add("encoded"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("algorithm"); + openapiRequiredFields.add("format"); + openapiRequiredFields.add("encoded"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PublicKey + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PublicKey.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PublicKey is not found in the empty JSON string", PublicKey.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PublicKey.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PublicKey` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PublicKey.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("algorithm").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `algorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("algorithm").toString())); + } + if (!jsonObj.get("format").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `format` to be a primitive type in the JSON string but got `%s`", jsonObj.get("format").toString())); + } + if (!jsonObj.get("encoded").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `encoded` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encoded").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PublicKey.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicKey' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PublicKey.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PublicKey value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PublicKey read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PublicKey given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicKey + * @throws IOException if the JSON string is invalid with respect to PublicKey + */ + public static PublicKey fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicKey.class); + } + + /** + * Convert an instance of PublicKey to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SHA256.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SHA256.java new file mode 100644 index 00000000000..5f4f5bd14fd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SHA256.java @@ -0,0 +1,274 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SHA-256 is part of the SHA-2 hash function family. Generated hash is fixed size, 256-bits (32-bytes). + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SHA256 { + public static final String SERIALIZED_NAME_BYTES = "bytes"; + @SerializedName(SERIALIZED_NAME_BYTES) + private String bytes; + + public static final String SERIALIZED_NAME_OFFSET = "offset"; + @SerializedName(SERIALIZED_NAME_OFFSET) + private Integer offset; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private Integer size; + + public SHA256() { + } + + public SHA256 bytes(String bytes) { + + this.bytes = bytes; + return this; + } + + /** + * Get bytes + * @return bytes + **/ + @javax.annotation.Nonnull + public String getBytes() { + return bytes; + } + + + public void setBytes(String bytes) { + this.bytes = bytes; + } + + + public SHA256 offset(Integer offset) { + + this.offset = offset; + return this; + } + + /** + * Get offset + * @return offset + **/ + @javax.annotation.Nonnull + public Integer getOffset() { + return offset; + } + + + public void setOffset(Integer offset) { + this.offset = offset; + } + + + public SHA256 size(Integer size) { + + this.size = size; + return this; + } + + /** + * Get size + * @return size + **/ + @javax.annotation.Nonnull + public Integer getSize() { + return size; + } + + + public void setSize(Integer size) { + this.size = size; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SHA256 SHA256 = (SHA256) o; + return Objects.equals(this.bytes, SHA256.bytes) && + Objects.equals(this.offset, SHA256.offset) && + Objects.equals(this.size, SHA256.size); + } + + @Override + public int hashCode() { + return Objects.hash(bytes, offset, size); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SHA256 {\n"); + sb.append(" bytes: ").append(toIndentedString(bytes)).append("\n"); + sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bytes"); + openapiFields.add("offset"); + openapiFields.add("size"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("bytes"); + openapiRequiredFields.add("offset"); + openapiRequiredFields.add("size"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SHA256 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SHA256.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SHA256 is not found in the empty JSON string", SHA256.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SHA256.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SHA256` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SHA256.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("bytes").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytes").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SHA256.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SHA256' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SHA256.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SHA256 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SHA256 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SHA256 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SHA256 + * @throws IOException if the JSON string is invalid with respect to SHA256 + */ + public static SHA256 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SHA256.class); + } + + /** + * Convert an instance of SHA256 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StartMonitorV1Request.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StartMonitorV1Request.java new file mode 100644 index 00000000000..96b4f89a9fd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StartMonitorV1Request.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * StartMonitorV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StartMonitorV1Request { + public static final String SERIALIZED_NAME_CLIENT_APP_ID = "clientAppId"; + @SerializedName(SERIALIZED_NAME_CLIENT_APP_ID) + private String clientAppId; + + public static final String SERIALIZED_NAME_STATE_FULL_CLASS_NAME = "stateFullClassName"; + @SerializedName(SERIALIZED_NAME_STATE_FULL_CLASS_NAME) + private String stateFullClassName; + + public StartMonitorV1Request() { + } + + public StartMonitorV1Request clientAppId(String clientAppId) { + + this.clientAppId = clientAppId; + return this; + } + + /** + * ID of a client application that wants to monitor the state changes + * @return clientAppId + **/ + @javax.annotation.Nonnull + public String getClientAppId() { + return clientAppId; + } + + + public void setClientAppId(String clientAppId) { + this.clientAppId = clientAppId; + } + + + public StartMonitorV1Request stateFullClassName(String stateFullClassName) { + + this.stateFullClassName = stateFullClassName; + return this; + } + + /** + * The fully qualified name of the Corda state to monitor + * @return stateFullClassName + **/ + @javax.annotation.Nonnull + public String getStateFullClassName() { + return stateFullClassName; + } + + + public void setStateFullClassName(String stateFullClassName) { + this.stateFullClassName = stateFullClassName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartMonitorV1Request startMonitorV1Request = (StartMonitorV1Request) o; + return Objects.equals(this.clientAppId, startMonitorV1Request.clientAppId) && + Objects.equals(this.stateFullClassName, startMonitorV1Request.stateFullClassName); + } + + @Override + public int hashCode() { + return Objects.hash(clientAppId, stateFullClassName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StartMonitorV1Request {\n"); + sb.append(" clientAppId: ").append(toIndentedString(clientAppId)).append("\n"); + sb.append(" stateFullClassName: ").append(toIndentedString(stateFullClassName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("clientAppId"); + openapiFields.add("stateFullClassName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("clientAppId"); + openapiRequiredFields.add("stateFullClassName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StartMonitorV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!StartMonitorV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StartMonitorV1Request is not found in the empty JSON string", StartMonitorV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StartMonitorV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StartMonitorV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StartMonitorV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("clientAppId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientAppId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientAppId").toString())); + } + if (!jsonObj.get("stateFullClassName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateFullClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateFullClassName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StartMonitorV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StartMonitorV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StartMonitorV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StartMonitorV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StartMonitorV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StartMonitorV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of StartMonitorV1Request + * @throws IOException if the JSON string is invalid with respect to StartMonitorV1Request + */ + public static StartMonitorV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StartMonitorV1Request.class); + } + + /** + * Convert an instance of StartMonitorV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StartMonitorV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StartMonitorV1Response.java new file mode 100644 index 00000000000..93f960b61d2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StartMonitorV1Response.java @@ -0,0 +1,245 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * StartMonitorV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StartMonitorV1Response { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_MSG = "msg"; + @SerializedName(SERIALIZED_NAME_MSG) + private String msg; + + public StartMonitorV1Response() { + } + + public StartMonitorV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Flag set to true if monitoring started correctly. + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public StartMonitorV1Response msg(String msg) { + + this.msg = msg; + return this; + } + + /** + * Message describing operation status or any errors that occurred. + * @return msg + **/ + @javax.annotation.Nonnull + public String getMsg() { + return msg; + } + + + public void setMsg(String msg) { + this.msg = msg; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartMonitorV1Response startMonitorV1Response = (StartMonitorV1Response) o; + return Objects.equals(this.success, startMonitorV1Response.success) && + Objects.equals(this.msg, startMonitorV1Response.msg); + } + + @Override + public int hashCode() { + return Objects.hash(success, msg); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StartMonitorV1Response {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("msg"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("msg"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StartMonitorV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!StartMonitorV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StartMonitorV1Response is not found in the empty JSON string", StartMonitorV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StartMonitorV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StartMonitorV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StartMonitorV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `msg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("msg").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StartMonitorV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StartMonitorV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StartMonitorV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StartMonitorV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StartMonitorV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StartMonitorV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of StartMonitorV1Response + * @throws IOException if the JSON string is invalid with respect to StartMonitorV1Response + */ + public static StartMonitorV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StartMonitorV1Response.class); + } + + /** + * Convert an instance of StartMonitorV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StopMonitorV1Request.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StopMonitorV1Request.java new file mode 100644 index 00000000000..52d5e84f2d1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StopMonitorV1Request.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * StopMonitorV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StopMonitorV1Request { + public static final String SERIALIZED_NAME_CLIENT_APP_ID = "clientAppId"; + @SerializedName(SERIALIZED_NAME_CLIENT_APP_ID) + private String clientAppId; + + public static final String SERIALIZED_NAME_STATE_FULL_CLASS_NAME = "stateFullClassName"; + @SerializedName(SERIALIZED_NAME_STATE_FULL_CLASS_NAME) + private String stateFullClassName; + + public StopMonitorV1Request() { + } + + public StopMonitorV1Request clientAppId(String clientAppId) { + + this.clientAppId = clientAppId; + return this; + } + + /** + * ID of a client application that wants to monitor the state changes + * @return clientAppId + **/ + @javax.annotation.Nonnull + public String getClientAppId() { + return clientAppId; + } + + + public void setClientAppId(String clientAppId) { + this.clientAppId = clientAppId; + } + + + public StopMonitorV1Request stateFullClassName(String stateFullClassName) { + + this.stateFullClassName = stateFullClassName; + return this; + } + + /** + * The fully qualified name of the Corda state to monitor + * @return stateFullClassName + **/ + @javax.annotation.Nonnull + public String getStateFullClassName() { + return stateFullClassName; + } + + + public void setStateFullClassName(String stateFullClassName) { + this.stateFullClassName = stateFullClassName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StopMonitorV1Request stopMonitorV1Request = (StopMonitorV1Request) o; + return Objects.equals(this.clientAppId, stopMonitorV1Request.clientAppId) && + Objects.equals(this.stateFullClassName, stopMonitorV1Request.stateFullClassName); + } + + @Override + public int hashCode() { + return Objects.hash(clientAppId, stateFullClassName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StopMonitorV1Request {\n"); + sb.append(" clientAppId: ").append(toIndentedString(clientAppId)).append("\n"); + sb.append(" stateFullClassName: ").append(toIndentedString(stateFullClassName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("clientAppId"); + openapiFields.add("stateFullClassName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("clientAppId"); + openapiRequiredFields.add("stateFullClassName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StopMonitorV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!StopMonitorV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StopMonitorV1Request is not found in the empty JSON string", StopMonitorV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StopMonitorV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StopMonitorV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StopMonitorV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("clientAppId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientAppId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientAppId").toString())); + } + if (!jsonObj.get("stateFullClassName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateFullClassName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateFullClassName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StopMonitorV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StopMonitorV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StopMonitorV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StopMonitorV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StopMonitorV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StopMonitorV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of StopMonitorV1Request + * @throws IOException if the JSON string is invalid with respect to StopMonitorV1Request + */ + public static StopMonitorV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StopMonitorV1Request.class); + } + + /** + * Convert an instance of StopMonitorV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StopMonitorV1Response.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StopMonitorV1Response.java new file mode 100644 index 00000000000..c9f137776ec --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StopMonitorV1Response.java @@ -0,0 +1,245 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * StopMonitorV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StopMonitorV1Response { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_MSG = "msg"; + @SerializedName(SERIALIZED_NAME_MSG) + private String msg; + + public StopMonitorV1Response() { + } + + public StopMonitorV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Flag set to true if operation completed correctly. + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public StopMonitorV1Response msg(String msg) { + + this.msg = msg; + return this; + } + + /** + * Message describing operation status or any errors that occurred. + * @return msg + **/ + @javax.annotation.Nonnull + public String getMsg() { + return msg; + } + + + public void setMsg(String msg) { + this.msg = msg; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StopMonitorV1Response stopMonitorV1Response = (StopMonitorV1Response) o; + return Objects.equals(this.success, stopMonitorV1Response.success) && + Objects.equals(this.msg, stopMonitorV1Response.msg); + } + + @Override + public int hashCode() { + return Objects.hash(success, msg); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StopMonitorV1Response {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("msg"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("msg"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StopMonitorV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!StopMonitorV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StopMonitorV1Response is not found in the empty JSON string", StopMonitorV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StopMonitorV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StopMonitorV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StopMonitorV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `msg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("msg").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StopMonitorV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StopMonitorV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StopMonitorV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StopMonitorV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StopMonitorV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StopMonitorV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of StopMonitorV1Response + * @throws IOException if the JSON string is invalid with respect to StopMonitorV1Response + */ + public static StopMonitorV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StopMonitorV1Response.class); + } + + /** + * Convert an instance of StopMonitorV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/X500Principal.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/X500Principal.java new file mode 100644 index 00000000000..0d9a86dab07 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/X500Principal.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * X500Principal + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class X500Principal { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ENCODED = "encoded"; + @SerializedName(SERIALIZED_NAME_ENCODED) + private String encoded; + + public X500Principal() { + } + + public X500Principal name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public X500Principal encoded(String encoded) { + + this.encoded = encoded; + return this; + } + + /** + * Base64 encoded public key + * @return encoded + **/ + @javax.annotation.Nonnull + public String getEncoded() { + return encoded; + } + + + public void setEncoded(String encoded) { + this.encoded = encoded; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + X500Principal x500Principal = (X500Principal) o; + return Objects.equals(this.name, x500Principal.name) && + Objects.equals(this.encoded, x500Principal.encoded); + } + + @Override + public int hashCode() { + return Objects.hash(name, encoded); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class X500Principal {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" encoded: ").append(toIndentedString(encoded)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("encoded"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("encoded"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to X500Principal + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!X500Principal.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in X500Principal is not found in the empty JSON string", X500Principal.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!X500Principal.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `X500Principal` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : X500Principal.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("encoded").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `encoded` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encoded").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!X500Principal.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'X500Principal' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(X500Principal.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, X500Principal value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public X500Principal read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of X500Principal given an JSON string + * + * @param jsonString JSON string + * @return An instance of X500Principal + * @throws IOException if the JSON string is invalid with respect to X500Principal + */ + public static X500Principal fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, X500Principal.class); + } + + /** + * Convert an instance of X500Principal to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..b5473f3b704 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,170 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.ClearMonitorTransactionsV1Request; +import org.openapitools.client.model.ClearMonitorTransactionsV1Response; +import org.openapitools.client.model.DeployContractJarsBadRequestV1Response; +import org.openapitools.client.model.DeployContractJarsSuccessV1Response; +import org.openapitools.client.model.DeployContractJarsV1Request; +import org.openapitools.client.model.DiagnoseNodeV1Request; +import org.openapitools.client.model.DiagnoseNodeV1Response; +import org.openapitools.client.model.GetMonitorTransactionsV1Request; +import org.openapitools.client.model.GetMonitorTransactionsV1Response; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.ListFlowsV1Request; +import org.openapitools.client.model.ListFlowsV1Response; +import org.openapitools.client.model.NodeInfo; +import org.openapitools.client.model.StartMonitorV1Request; +import org.openapitools.client.model.StartMonitorV1Response; +import org.openapitools.client.model.StopMonitorV1Request; +import org.openapitools.client.model.StopMonitorV1Response; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Clear transactions from internal store so they'll not be available by GetMonitorTransactionsV1 anymore. + * + * @throws ApiException if the Api call fails + */ + @Test + public void clearMonitorTransactionsV1Test() throws ApiException { + ClearMonitorTransactionsV1Request clearMonitorTransactionsV1Request = null; + ClearMonitorTransactionsV1Response response = api.clearMonitorTransactionsV1(clearMonitorTransactionsV1Request); + // TODO: test validations + } + + /** + * Deploys a set of jar files (Cordapps, e.g. the contracts in Corda speak). + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractJarsV1Test() throws ApiException { + DeployContractJarsV1Request deployContractJarsV1Request = null; + DeployContractJarsSuccessV1Response response = api.deployContractJarsV1(deployContractJarsV1Request); + // TODO: test validations + } + + /** + * Responds with diagnostic information about the Corda node + * + * @throws ApiException if the Api call fails + */ + @Test + public void diagnoseNodeV1Test() throws ApiException { + DiagnoseNodeV1Request diagnoseNodeV1Request = null; + DiagnoseNodeV1Response response = api.diagnoseNodeV1(diagnoseNodeV1Request); + // TODO: test validations + } + + /** + * Get transactions for monitored state classes. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getMonitorTransactionsV1Test() throws ApiException { + GetMonitorTransactionsV1Request getMonitorTransactionsV1Request = null; + GetMonitorTransactionsV1Response response = api.getMonitorTransactionsV1(getMonitorTransactionsV1Request); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Invokes a contract on a Corda ledger (e.g. a flow) + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeContractV1Test() throws ApiException { + InvokeContractV1Request invokeContractV1Request = null; + InvokeContractV1Response response = api.invokeContractV1(invokeContractV1Request); + // TODO: test validations + } + + /** + * Responds with a list of the flows on the Corda node. + * + * @throws ApiException if the Api call fails + */ + @Test + public void listFlowsV1Test() throws ApiException { + ListFlowsV1Request listFlowsV1Request = null; + ListFlowsV1Response response = api.listFlowsV1(listFlowsV1Request); + // TODO: test validations + } + + /** + * Responds with a snapshot of the network map as provided by the Corda RPC call: net.corda.core.messaging.CordaRPCOps public abstract fun networkMapSnapshot(): List<NodeInfo> + * + * @throws ApiException if the Api call fails + */ + @Test + public void networkMapV1Test() throws ApiException { + Object body = null; + List response = api.networkMapV1(body); + // TODO: test validations + } + + /** + * Start monitoring corda changes (transactions) of given state class + * + * @throws ApiException if the Api call fails + */ + @Test + public void startMonitorV1Test() throws ApiException { + StartMonitorV1Request startMonitorV1Request = null; + StartMonitorV1Response response = api.startMonitorV1(startMonitorV1Request); + // TODO: test validations + } + + /** + * Stop monitoring corda changes (transactions) of given state class + * + * @throws ApiException if the Api call fails + */ + @Test + public void stopMonitorV1Test() throws ApiException { + StopMonitorV1Request stopMonitorV1Request = null; + StopMonitorV1Response response = api.stopMonitorV1(stopMonitorV1Request); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClearMonitorTransactionsV1RequestTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClearMonitorTransactionsV1RequestTest.java new file mode 100644 index 00000000000..55289c5f51c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClearMonitorTransactionsV1RequestTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ClearMonitorTransactionsV1Request + */ +public class ClearMonitorTransactionsV1RequestTest { + private final ClearMonitorTransactionsV1Request model = new ClearMonitorTransactionsV1Request(); + + /** + * Model tests for ClearMonitorTransactionsV1Request + */ + @Test + public void testClearMonitorTransactionsV1Request() { + // TODO: test ClearMonitorTransactionsV1Request + } + + /** + * Test the property 'clientAppId' + */ + @Test + public void clientAppIdTest() { + // TODO: test clientAppId + } + + /** + * Test the property 'stateFullClassName' + */ + @Test + public void stateFullClassNameTest() { + // TODO: test stateFullClassName + } + + /** + * Test the property 'txIndexes' + */ + @Test + public void txIndexesTest() { + // TODO: test txIndexes + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClearMonitorTransactionsV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClearMonitorTransactionsV1ResponseTest.java new file mode 100644 index 00000000000..3aa3b18d1c7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClearMonitorTransactionsV1ResponseTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ClearMonitorTransactionsV1Response + */ +public class ClearMonitorTransactionsV1ResponseTest { + private final ClearMonitorTransactionsV1Response model = new ClearMonitorTransactionsV1Response(); + + /** + * Model tests for ClearMonitorTransactionsV1Response + */ + @Test + public void testClearMonitorTransactionsV1Response() { + // TODO: test ClearMonitorTransactionsV1Response + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'msg' + */ + @Test + public void msgTest() { + // TODO: test msg + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaNodeSshCredentialsTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaNodeSshCredentialsTest.java new file mode 100644 index 00000000000..762a5936fe3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaNodeSshCredentialsTest.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CordaNodeSshCredentials + */ +public class CordaNodeSshCredentialsTest { + private final CordaNodeSshCredentials model = new CordaNodeSshCredentials(); + + /** + * Model tests for CordaNodeSshCredentials + */ + @Test + public void testCordaNodeSshCredentials() { + // TODO: test CordaNodeSshCredentials + } + + /** + * Test the property 'hostKeyEntry' + */ + @Test + public void hostKeyEntryTest() { + // TODO: test hostKeyEntry + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'hostname' + */ + @Test + public void hostnameTest() { + // TODO: test hostname + } + + /** + * Test the property 'port' + */ + @Test + public void portTest() { + // TODO: test port + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaRpcCredentialsTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaRpcCredentialsTest.java new file mode 100644 index 00000000000..8fa2ac1208a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaRpcCredentialsTest.java @@ -0,0 +1,72 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CordaRpcCredentials + */ +public class CordaRpcCredentialsTest { + private final CordaRpcCredentials model = new CordaRpcCredentials(); + + /** + * Model tests for CordaRpcCredentials + */ + @Test + public void testCordaRpcCredentials() { + // TODO: test CordaRpcCredentials + } + + /** + * Test the property 'hostname' + */ + @Test + public void hostnameTest() { + // TODO: test hostname + } + + /** + * Test the property 'port' + */ + @Test + public void portTest() { + // TODO: test port + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaX500NameTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaX500NameTest.java new file mode 100644 index 00000000000..dfcf9ec90bb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordaX500NameTest.java @@ -0,0 +1,97 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.X500Principal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CordaX500Name + */ +public class CordaX500NameTest { + private final CordaX500Name model = new CordaX500Name(); + + /** + * Model tests for CordaX500Name + */ + @Test + public void testCordaX500Name() { + // TODO: test CordaX500Name + } + + /** + * Test the property 'commonName' + */ + @Test + public void commonNameTest() { + // TODO: test commonName + } + + /** + * Test the property 'organisationUnit' + */ + @Test + public void organisationUnitTest() { + // TODO: test organisationUnit + } + + /** + * Test the property 'organisation' + */ + @Test + public void organisationTest() { + // TODO: test organisation + } + + /** + * Test the property 'locality' + */ + @Test + public void localityTest() { + // TODO: test locality + } + + /** + * Test the property 'state' + */ + @Test + public void stateTest() { + // TODO: test state + } + + /** + * Test the property 'country' + */ + @Test + public void countryTest() { + // TODO: test country + } + + /** + * Test the property 'x500Principal' + */ + @Test + public void x500PrincipalTest() { + // TODO: test x500Principal + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordappDeploymentConfigTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordappDeploymentConfigTest.java new file mode 100644 index 00000000000..ff76104cd49 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordappDeploymentConfigTest.java @@ -0,0 +1,90 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.CordaNodeSshCredentials; +import org.openapitools.client.model.CordaRpcCredentials; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CordappDeploymentConfig + */ +public class CordappDeploymentConfigTest { + private final CordappDeploymentConfig model = new CordappDeploymentConfig(); + + /** + * Model tests for CordappDeploymentConfig + */ + @Test + public void testCordappDeploymentConfig() { + // TODO: test CordappDeploymentConfig + } + + /** + * Test the property 'sshCredentials' + */ + @Test + public void sshCredentialsTest() { + // TODO: test sshCredentials + } + + /** + * Test the property 'rpcCredentials' + */ + @Test + public void rpcCredentialsTest() { + // TODO: test rpcCredentials + } + + /** + * Test the property 'cordaNodeStartCmd' + */ + @Test + public void cordaNodeStartCmdTest() { + // TODO: test cordaNodeStartCmd + } + + /** + * Test the property 'cordappDir' + */ + @Test + public void cordappDirTest() { + // TODO: test cordappDir + } + + /** + * Test the property 'cordaJarPath' + */ + @Test + public void cordaJarPathTest() { + // TODO: test cordaJarPath + } + + /** + * Test the property 'nodeBaseDirPath' + */ + @Test + public void nodeBaseDirPathTest() { + // TODO: test nodeBaseDirPath + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordappInfoTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordappInfoTest.java new file mode 100644 index 00000000000..c16f656f108 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CordappInfoTest.java @@ -0,0 +1,113 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.SHA256; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CordappInfo + */ +public class CordappInfoTest { + private final CordappInfo model = new CordappInfo(); + + /** + * Model tests for CordappInfo + */ + @Test + public void testCordappInfo() { + // TODO: test CordappInfo + } + + /** + * Test the property 'jarHash' + */ + @Test + public void jarHashTest() { + // TODO: test jarHash + } + + /** + * Test the property 'licence' + */ + @Test + public void licenceTest() { + // TODO: test licence + } + + /** + * Test the property 'minimumPlatformVersion' + */ + @Test + public void minimumPlatformVersionTest() { + // TODO: test minimumPlatformVersion + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'shortName' + */ + @Test + public void shortNameTest() { + // TODO: test shortName + } + + /** + * Test the property 'targetPlatformVersion' + */ + @Test + public void targetPlatformVersionTest() { + // TODO: test targetPlatformVersion + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'vendor' + */ + @Test + public void vendorTest() { + // TODO: test vendor + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsBadRequestV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsBadRequestV1ResponseTest.java new file mode 100644 index 00000000000..c52b1776209 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsBadRequestV1ResponseTest.java @@ -0,0 +1,50 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractJarsBadRequestV1Response + */ +public class DeployContractJarsBadRequestV1ResponseTest { + private final DeployContractJarsBadRequestV1Response model = new DeployContractJarsBadRequestV1Response(); + + /** + * Model tests for DeployContractJarsBadRequestV1Response + */ + @Test + public void testDeployContractJarsBadRequestV1Response() { + // TODO: test DeployContractJarsBadRequestV1Response + } + + /** + * Test the property 'errors' + */ + @Test + public void errorsTest() { + // TODO: test errors + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsSuccessV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsSuccessV1ResponseTest.java new file mode 100644 index 00000000000..b1ca85ae229 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsSuccessV1ResponseTest.java @@ -0,0 +1,50 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractJarsSuccessV1Response + */ +public class DeployContractJarsSuccessV1ResponseTest { + private final DeployContractJarsSuccessV1Response model = new DeployContractJarsSuccessV1Response(); + + /** + * Model tests for DeployContractJarsSuccessV1Response + */ + @Test + public void testDeployContractJarsSuccessV1Response() { + // TODO: test DeployContractJarsSuccessV1Response + } + + /** + * Test the property 'deployedJarFiles' + */ + @Test + public void deployedJarFilesTest() { + // TODO: test deployedJarFiles + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsV1RequestTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsV1RequestTest.java new file mode 100644 index 00000000000..90c1623776a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJarsV1RequestTest.java @@ -0,0 +1,60 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.CordappDeploymentConfig; +import org.openapitools.client.model.JarFile; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractJarsV1Request + */ +public class DeployContractJarsV1RequestTest { + private final DeployContractJarsV1Request model = new DeployContractJarsV1Request(); + + /** + * Model tests for DeployContractJarsV1Request + */ + @Test + public void testDeployContractJarsV1Request() { + // TODO: test DeployContractJarsV1Request + } + + /** + * Test the property 'cordappDeploymentConfigs' + */ + @Test + public void cordappDeploymentConfigsTest() { + // TODO: test cordappDeploymentConfigs + } + + /** + * Test the property 'jarFiles' + */ + @Test + public void jarFilesTest() { + // TODO: test jarFiles + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DiagnoseNodeV1RequestTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DiagnoseNodeV1RequestTest.java new file mode 100644 index 00000000000..65578e6c6ef --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DiagnoseNodeV1RequestTest.java @@ -0,0 +1,50 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DiagnoseNodeV1Request + */ +public class DiagnoseNodeV1RequestTest { + private final DiagnoseNodeV1Request model = new DiagnoseNodeV1Request(); + + /** + * Model tests for DiagnoseNodeV1Request + */ + @Test + public void testDiagnoseNodeV1Request() { + // TODO: test DiagnoseNodeV1Request + } + + /** + * Test the property 'nodeIds' + */ + @Test + public void nodeIdsTest() { + // TODO: test nodeIds + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DiagnoseNodeV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DiagnoseNodeV1ResponseTest.java new file mode 100644 index 00000000000..bbac0db1d06 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DiagnoseNodeV1ResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.NodeDiagnosticInfo; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DiagnoseNodeV1Response + */ +public class DiagnoseNodeV1ResponseTest { + private final DiagnoseNodeV1Response model = new DiagnoseNodeV1Response(); + + /** + * Model tests for DiagnoseNodeV1Response + */ + @Test + public void testDiagnoseNodeV1Response() { + // TODO: test DiagnoseNodeV1Response + } + + /** + * Test the property 'nodeDiagnosticInfo' + */ + @Test + public void nodeDiagnosticInfoTest() { + // TODO: test nodeDiagnosticInfo + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FlowInvocationTypeTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FlowInvocationTypeTest.java new file mode 100644 index 00000000000..d0bf4aaca93 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FlowInvocationTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FlowInvocationType + */ +public class FlowInvocationTypeTest { + /** + * Model tests for FlowInvocationType + */ + @Test + public void testFlowInvocationType() { + // TODO: test FlowInvocationType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1RequestTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1RequestTest.java new file mode 100644 index 00000000000..82f57805075 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1RequestTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetMonitorTransactionsV1Request + */ +public class GetMonitorTransactionsV1RequestTest { + private final GetMonitorTransactionsV1Request model = new GetMonitorTransactionsV1Request(); + + /** + * Model tests for GetMonitorTransactionsV1Request + */ + @Test + public void testGetMonitorTransactionsV1Request() { + // TODO: test GetMonitorTransactionsV1Request + } + + /** + * Test the property 'clientAppId' + */ + @Test + public void clientAppIdTest() { + // TODO: test clientAppId + } + + /** + * Test the property 'stateFullClassName' + */ + @Test + public void stateFullClassNameTest() { + // TODO: test stateFullClassName + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTest.java new file mode 100644 index 00000000000..15e3320f0bc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.GetMonitorTransactionsV1ResponseTxInner; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetMonitorTransactionsV1Response + */ +public class GetMonitorTransactionsV1ResponseTest { + private final GetMonitorTransactionsV1Response model = new GetMonitorTransactionsV1Response(); + + /** + * Model tests for GetMonitorTransactionsV1Response + */ + @Test + public void testGetMonitorTransactionsV1Response() { + // TODO: test GetMonitorTransactionsV1Response + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'msg' + */ + @Test + public void msgTest() { + // TODO: test msg + } + + /** + * Test the property 'stateFullClassName' + */ + @Test + public void stateFullClassNameTest() { + // TODO: test stateFullClassName + } + + /** + * Test the property 'tx' + */ + @Test + public void txTest() { + // TODO: test tx + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInnerTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInnerTest.java new file mode 100644 index 00000000000..a206e59fdd5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetMonitorTransactionsV1ResponseTxInnerTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetMonitorTransactionsV1ResponseTxInner + */ +public class GetMonitorTransactionsV1ResponseTxInnerTest { + private final GetMonitorTransactionsV1ResponseTxInner model = new GetMonitorTransactionsV1ResponseTxInner(); + + /** + * Model tests for GetMonitorTransactionsV1ResponseTxInner + */ + @Test + public void testGetMonitorTransactionsV1ResponseTxInner() { + // TODO: test GetMonitorTransactionsV1ResponseTxInner + } + + /** + * Test the property 'index' + */ + @Test + public void indexTest() { + // TODO: test index + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java new file mode 100644 index 00000000000..418df3476d4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.FlowInvocationType; +import org.openapitools.client.model.JvmObject; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Request + */ +public class InvokeContractV1RequestTest { + private final InvokeContractV1Request model = new InvokeContractV1Request(); + + /** + * Model tests for InvokeContractV1Request + */ + @Test + public void testInvokeContractV1Request() { + // TODO: test InvokeContractV1Request + } + + /** + * Test the property 'flowFullClassName' + */ + @Test + public void flowFullClassNameTest() { + // TODO: test flowFullClassName + } + + /** + * Test the property 'flowInvocationType' + */ + @Test + public void flowInvocationTypeTest() { + // TODO: test flowInvocationType + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java new file mode 100644 index 00000000000..1c812c4351e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java @@ -0,0 +1,82 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Response + */ +public class InvokeContractV1ResponseTest { + private final InvokeContractV1Response model = new InvokeContractV1Response(); + + /** + * Model tests for InvokeContractV1Response + */ + @Test + public void testInvokeContractV1Response() { + // TODO: test InvokeContractV1Response + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'callOutput' + */ + @Test + public void callOutputTest() { + // TODO: test callOutput + } + + /** + * Test the property 'transactionId' + */ + @Test + public void transactionIdTest() { + // TODO: test transactionId + } + + /** + * Test the property 'progress' + */ + @Test + public void progressTest() { + // TODO: test progress + } + + /** + * Test the property 'flowId' + */ + @Test + public void flowIdTest() { + // TODO: test flowId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JarFileTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JarFileTest.java new file mode 100644 index 00000000000..b947b4ed94a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JarFileTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for JarFile + */ +public class JarFileTest { + private final JarFile model = new JarFile(); + + /** + * Model tests for JarFile + */ + @Test + public void testJarFile() { + // TODO: test JarFile + } + + /** + * Test the property 'filename' + */ + @Test + public void filenameTest() { + // TODO: test filename + } + + /** + * Test the property 'hasDbMigrations' + */ + @Test + public void hasDbMigrationsTest() { + // TODO: test hasDbMigrations + } + + /** + * Test the property 'contentBase64' + */ + @Test + public void contentBase64Test() { + // TODO: test contentBase64 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmObjectTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmObjectTest.java new file mode 100644 index 00000000000..f902a7d4943 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmObjectTest.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.JvmType; +import org.openapitools.client.model.JvmTypeKind; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for JvmObject + */ +public class JvmObjectTest { + private final JvmObject model = new JvmObject(); + + /** + * Model tests for JvmObject + */ + @Test + public void testJvmObject() { + // TODO: test JvmObject + } + + /** + * Test the property 'jvmTypeKind' + */ + @Test + public void jvmTypeKindTest() { + // TODO: test jvmTypeKind + } + + /** + * Test the property 'primitiveValue' + */ + @Test + public void primitiveValueTest() { + // TODO: test primitiveValue + } + + /** + * Test the property 'jvmCtorArgs' + */ + @Test + public void jvmCtorArgsTest() { + // TODO: test jvmCtorArgs + } + + /** + * Test the property 'jvmType' + */ + @Test + public void jvmTypeTest() { + // TODO: test jvmType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmTypeKindTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmTypeKindTest.java new file mode 100644 index 00000000000..e9bcc4ee4b6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmTypeKindTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for JvmTypeKind + */ +public class JvmTypeKindTest { + /** + * Model tests for JvmTypeKind + */ + @Test + public void testJvmTypeKind() { + // TODO: test JvmTypeKind + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmTypeTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmTypeTest.java new file mode 100644 index 00000000000..673af4c11a9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/JvmTypeTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.JvmObject; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for JvmType + */ +public class JvmTypeTest { + private final JvmType model = new JvmType(); + + /** + * Model tests for JvmType + */ + @Test + public void testJvmType() { + // TODO: test JvmType + } + + /** + * Test the property 'fqClassName' + */ + @Test + public void fqClassNameTest() { + // TODO: test fqClassName + } + + /** + * Test the property 'constructorName' + */ + @Test + public void constructorNameTest() { + // TODO: test constructorName + } + + /** + * Test the property 'invocationTarget' + */ + @Test + public void invocationTargetTest() { + // TODO: test invocationTarget + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ListFlowsV1RequestTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ListFlowsV1RequestTest.java new file mode 100644 index 00000000000..99721e12235 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ListFlowsV1RequestTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ListFlowsV1Request + */ +public class ListFlowsV1RequestTest { + private final ListFlowsV1Request model = new ListFlowsV1Request(); + + /** + * Model tests for ListFlowsV1Request + */ + @Test + public void testListFlowsV1Request() { + // TODO: test ListFlowsV1Request + } + + /** + * Test the property 'filter' + */ + @Test + public void filterTest() { + // TODO: test filter + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ListFlowsV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ListFlowsV1ResponseTest.java new file mode 100644 index 00000000000..47a4d7f3784 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ListFlowsV1ResponseTest.java @@ -0,0 +1,50 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ListFlowsV1Response + */ +public class ListFlowsV1ResponseTest { + private final ListFlowsV1Response model = new ListFlowsV1Response(); + + /** + * Model tests for ListFlowsV1Response + */ + @Test + public void testListFlowsV1Response() { + // TODO: test ListFlowsV1Response + } + + /** + * Test the property 'flowNames' + */ + @Test + public void flowNamesTest() { + // TODO: test flowNames + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NetworkHostAndPortTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NetworkHostAndPortTest.java new file mode 100644 index 00000000000..d4433f1ac91 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NetworkHostAndPortTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NetworkHostAndPort + */ +public class NetworkHostAndPortTest { + private final NetworkHostAndPort model = new NetworkHostAndPort(); + + /** + * Model tests for NetworkHostAndPort + */ + @Test + public void testNetworkHostAndPort() { + // TODO: test NetworkHostAndPort + } + + /** + * Test the property 'host' + */ + @Test + public void hostTest() { + // TODO: test host + } + + /** + * Test the property 'port' + */ + @Test + public void portTest() { + // TODO: test port + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NodeDiagnosticInfoTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NodeDiagnosticInfoTest.java new file mode 100644 index 00000000000..3af6584f52c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NodeDiagnosticInfoTest.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.CordappInfo; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NodeDiagnosticInfo + */ +public class NodeDiagnosticInfoTest { + private final NodeDiagnosticInfo model = new NodeDiagnosticInfo(); + + /** + * Model tests for NodeDiagnosticInfo + */ + @Test + public void testNodeDiagnosticInfo() { + // TODO: test NodeDiagnosticInfo + } + + /** + * Test the property 'cordapps' + */ + @Test + public void cordappsTest() { + // TODO: test cordapps + } + + /** + * Test the property 'platformVersion' + */ + @Test + public void platformVersionTest() { + // TODO: test platformVersion + } + + /** + * Test the property 'revision' + */ + @Test + public void revisionTest() { + // TODO: test revision + } + + /** + * Test the property 'vendor' + */ + @Test + public void vendorTest() { + // TODO: test vendor + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NodeInfoTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NodeInfoTest.java new file mode 100644 index 00000000000..d8ad2d09d29 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/NodeInfoTest.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.NetworkHostAndPort; +import org.openapitools.client.model.Party; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NodeInfo + */ +public class NodeInfoTest { + private final NodeInfo model = new NodeInfo(); + + /** + * Model tests for NodeInfo + */ + @Test + public void testNodeInfo() { + // TODO: test NodeInfo + } + + /** + * Test the property 'addresses' + */ + @Test + public void addressesTest() { + // TODO: test addresses + } + + /** + * Test the property 'platformVersion' + */ + @Test + public void platformVersionTest() { + // TODO: test platformVersion + } + + /** + * Test the property 'serial' + */ + @Test + public void serialTest() { + // TODO: test serial + } + + /** + * Test the property 'legalIdentities' + */ + @Test + public void legalIdentitiesTest() { + // TODO: test legalIdentities + } + + /** + * Test the property 'legalIdentitiesAndCerts' + */ + @Test + public void legalIdentitiesAndCertsTest() { + // TODO: test legalIdentitiesAndCerts + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PartyTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PartyTest.java new file mode 100644 index 00000000000..dc105aa2582 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PartyTest.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.CordaX500Name; +import org.openapitools.client.model.PublicKey; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Party + */ +public class PartyTest { + private final Party model = new Party(); + + /** + * Model tests for Party + */ + @Test + public void testParty() { + // TODO: test Party + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'owningKey' + */ + @Test + public void owningKeyTest() { + // TODO: test owningKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PublicKeyTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PublicKeyTest.java new file mode 100644 index 00000000000..6e282953bd6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PublicKeyTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for PublicKey + */ +public class PublicKeyTest { + private final PublicKey model = new PublicKey(); + + /** + * Model tests for PublicKey + */ + @Test + public void testPublicKey() { + // TODO: test PublicKey + } + + /** + * Test the property 'algorithm' + */ + @Test + public void algorithmTest() { + // TODO: test algorithm + } + + /** + * Test the property 'format' + */ + @Test + public void formatTest() { + // TODO: test format + } + + /** + * Test the property 'encoded' + */ + @Test + public void encodedTest() { + // TODO: test encoded + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SHA256Test.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SHA256Test.java new file mode 100644 index 00000000000..6d10f9c6bf8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SHA256Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SHA256 + */ +public class SHA256Test { + private final SHA256 model = new SHA256(); + + /** + * Model tests for SHA256 + */ + @Test + public void testSHA256() { + // TODO: test SHA256 + } + + /** + * Test the property 'bytes' + */ + @Test + public void bytesTest() { + // TODO: test bytes + } + + /** + * Test the property 'offset' + */ + @Test + public void offsetTest() { + // TODO: test offset + } + + /** + * Test the property 'size' + */ + @Test + public void sizeTest() { + // TODO: test size + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StartMonitorV1RequestTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StartMonitorV1RequestTest.java new file mode 100644 index 00000000000..e5c14c8b213 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StartMonitorV1RequestTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for StartMonitorV1Request + */ +public class StartMonitorV1RequestTest { + private final StartMonitorV1Request model = new StartMonitorV1Request(); + + /** + * Model tests for StartMonitorV1Request + */ + @Test + public void testStartMonitorV1Request() { + // TODO: test StartMonitorV1Request + } + + /** + * Test the property 'clientAppId' + */ + @Test + public void clientAppIdTest() { + // TODO: test clientAppId + } + + /** + * Test the property 'stateFullClassName' + */ + @Test + public void stateFullClassNameTest() { + // TODO: test stateFullClassName + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StartMonitorV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StartMonitorV1ResponseTest.java new file mode 100644 index 00000000000..c4fae193207 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StartMonitorV1ResponseTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for StartMonitorV1Response + */ +public class StartMonitorV1ResponseTest { + private final StartMonitorV1Response model = new StartMonitorV1Response(); + + /** + * Model tests for StartMonitorV1Response + */ + @Test + public void testStartMonitorV1Response() { + // TODO: test StartMonitorV1Response + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'msg' + */ + @Test + public void msgTest() { + // TODO: test msg + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StopMonitorV1RequestTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StopMonitorV1RequestTest.java new file mode 100644 index 00000000000..504878521f0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StopMonitorV1RequestTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for StopMonitorV1Request + */ +public class StopMonitorV1RequestTest { + private final StopMonitorV1Request model = new StopMonitorV1Request(); + + /** + * Model tests for StopMonitorV1Request + */ + @Test + public void testStopMonitorV1Request() { + // TODO: test StopMonitorV1Request + } + + /** + * Test the property 'clientAppId' + */ + @Test + public void clientAppIdTest() { + // TODO: test clientAppId + } + + /** + * Test the property 'stateFullClassName' + */ + @Test + public void stateFullClassNameTest() { + // TODO: test stateFullClassName + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StopMonitorV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StopMonitorV1ResponseTest.java new file mode 100644 index 00000000000..52125086e3a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StopMonitorV1ResponseTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for StopMonitorV1Response + */ +public class StopMonitorV1ResponseTest { + private final StopMonitorV1Response model = new StopMonitorV1Response(); + + /** + * Model tests for StopMonitorV1Response + */ + @Test + public void testStopMonitorV1Response() { + // TODO: test StopMonitorV1Response + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'msg' + */ + @Test + public void msgTest() { + // TODO: test msg + } + +} diff --git a/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/X500PrincipalTest.java b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/X500PrincipalTest.java new file mode 100644 index 00000000000..eb264e7db59 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/X500PrincipalTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Corda + * Can perform basic tasks on a Corda ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for X500Principal + */ +public class X500PrincipalTest { + private final X500Principal model = new X500Principal(); + + /** + * Model tests for X500Principal + */ + @Test + public void testX500Principal() { + // TODO: test X500Principal + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'encoded' + */ + @Test + public void encodedTest() { + // TODO: test encoded + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/package.json b/packages/cactus-plugin-ledger-connector-ethereum/package.json index 37450f88bbd..2798b9f5a96 100644 --- a/packages/cactus-plugin-ledger-connector-ethereum/package.json +++ b/packages/cactus-plugin-ledger-connector-ethereum/package.json @@ -58,6 +58,8 @@ "copy-artillery-config": "cp -af ./src/test/typescript/benchmark/setup/geth-benchmark-config.yaml ./src/test/typescript/benchmark/setup/artillery-helper-functions.js ./dist/lib/test/typescript/benchmark/setup", "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..3382f7ce0a3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,47 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_contract_json.go +model_contract_json_definition.go +model_contract_keychain_definition.go +model_deploy_contract_v1_request.go +model_deploy_contract_v1_request_contract.go +model_deployed_contract_json_definition.go +model_error_exception_response_v1.go +model_eth_contract_invocation_type.go +model_eth_contract_invocation_web3_method.go +model_ethereum_transaction_config.go +model_gas_transaction_config.go +model_gas_transaction_config_eip1559.go +model_gas_transaction_config_legacy.go +model_invoke_contract_v1_request.go +model_invoke_contract_v1_request_contract.go +model_invoke_contract_v1_response.go +model_invoke_raw_web3_eth_contract_v1_request.go +model_invoke_raw_web3_eth_contract_v1_response.go +model_invoke_raw_web3_eth_method_v1_request.go +model_invoke_raw_web3_eth_method_v1_response.go +model_run_transaction_request.go +model_run_transaction_response.go +model_watch_blocks_v1.go +model_watch_blocks_v1_block_data.go +model_watch_blocks_v1_block_data_timestamp.go +model_watch_blocks_v1_options.go +model_watch_blocks_v1_progress.go +model_web3_block_header.go +model_web3_signing_credential.go +model_web3_signing_credential_cacti_keychain_ref.go +model_web3_signing_credential_geth_keychain_password.go +model_web3_signing_credential_none.go +model_web3_signing_credential_private_key_hex.go +model_web3_signing_credential_type.go +model_web3_transaction.go +model_web3_transaction_receipt.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..e7e42a4b585 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..6b772850740 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,152 @@ +# Go API client for cactus-plugin-ledger-connector-ethereum + +Can perform basic tasks on a Ethereum ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-ethereum "github.com/hyperledger/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-ethereum.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-ethereum.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-ethereum.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-ethereum.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeployContract**](docs/DefaultApi.md#deploycontract) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract | Deploys the contract to ethereum ledger. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**InvokeContractV1**](docs/DefaultApi.md#invokecontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract | Invokes a contract on an ethereum ledger +*DefaultApi* | [**InvokeRawWeb3EthContractV1**](docs/DefaultApi.md#invokerawweb3ethcontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-contract | Low-level endpoint to invoke a method on deployed contract. +*DefaultApi* | [**InvokeWeb3EthMethodV1**](docs/DefaultApi.md#invokeweb3ethmethodv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-method | Invoke any method from web3.eth (low-level) +*DefaultApi* | [**RunTransactionV1**](docs/DefaultApi.md#runtransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/run-transaction | Executes a transaction on a ethereum ledger + + +## Documentation For Models + + - [ContractJSON](docs/ContractJSON.md) + - [ContractJsonDefinition](docs/ContractJsonDefinition.md) + - [ContractKeychainDefinition](docs/ContractKeychainDefinition.md) + - [DeployContractV1Request](docs/DeployContractV1Request.md) + - [DeployContractV1RequestContract](docs/DeployContractV1RequestContract.md) + - [DeployedContractJsonDefinition](docs/DeployedContractJsonDefinition.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [EthContractInvocationType](docs/EthContractInvocationType.md) + - [EthContractInvocationWeb3Method](docs/EthContractInvocationWeb3Method.md) + - [EthereumTransactionConfig](docs/EthereumTransactionConfig.md) + - [GasTransactionConfig](docs/GasTransactionConfig.md) + - [GasTransactionConfigEIP1559](docs/GasTransactionConfigEIP1559.md) + - [GasTransactionConfigLegacy](docs/GasTransactionConfigLegacy.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1RequestContract](docs/InvokeContractV1RequestContract.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [InvokeRawWeb3EthContractV1Request](docs/InvokeRawWeb3EthContractV1Request.md) + - [InvokeRawWeb3EthContractV1Response](docs/InvokeRawWeb3EthContractV1Response.md) + - [InvokeRawWeb3EthMethodV1Request](docs/InvokeRawWeb3EthMethodV1Request.md) + - [InvokeRawWeb3EthMethodV1Response](docs/InvokeRawWeb3EthMethodV1Response.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WatchBlocksV1BlockData](docs/WatchBlocksV1BlockData.md) + - [WatchBlocksV1BlockDataTimestamp](docs/WatchBlocksV1BlockDataTimestamp.md) + - [WatchBlocksV1Options](docs/WatchBlocksV1Options.md) + - [WatchBlocksV1Progress](docs/WatchBlocksV1Progress.md) + - [Web3BlockHeader](docs/Web3BlockHeader.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactiKeychainRef](docs/Web3SigningCredentialCactiKeychainRef.md) + - [Web3SigningCredentialGethKeychainPassword](docs/Web3SigningCredentialGethKeychainPassword.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3Transaction](docs/Web3Transaction.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + + +## Documentation For Authorization + + Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..4c8970aa29c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,1003 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Ethereum ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cacti Plugin - Connector Ethereum + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract: + post: + operationId: deployContract + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Deploys the contract to ethereum ledger. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Executes a transaction on a ethereum ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/run-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Invokes a contract on an ethereum ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/get-prometheus-exporter-metrics + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-method: + post: + operationId: invokeWeb3EthMethodV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthMethodV1Request' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthMethodV1Response' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Invoke any method from web3.eth (low-level) + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-method + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-contract: + post: + operationId: invokeRawWeb3EthContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthContractV1Request' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthContractV1Response' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Low-level endpoint to invoke a method on deployed contract. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-contract + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/json-rpc: + summary: Proxy endpoint to pass JSON-RPC requests to remote ethereum node. +components: + schemas: + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialGethKeychainPassword' + - $ref: '#/components/schemas/Web3SigningCredentialCactiKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialGethKeychainPassword: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + secret: + description: A geth keychain unlock password. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialCactiKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - type + type: object + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialType: + enum: + - CACTI_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + EthContractInvocationType: + enum: + - SEND + - CALL + type: string + EthContractInvocationWeb3Method: + enum: + - send + - call + - encodeABI + - estimateGas + type: string + GasTransactionConfigLegacy: + description: Transaction gas settings in networks before EIP-1559 (London fork). + properties: + gas: + description: A maximum amount of gas a user is willing to provide for the + execution of the transaction. (gasLimit) + type: string + gasPrice: + description: "A price (in Wei) a user is willing to pay for each unit of\ + \ gas used during the execution of the transaction. In EIP-1559 (London\ + \ fork) networks, it will be set as both maxFeePerGas and maxPriorityFeePerGas." + type: string + type: object + GasTransactionConfigEIP1559: + description: Transaction gas settings in networks after EIP-1559 (London fork). + properties: + gasLimit: + description: A maximum amount of gas a user is willing to provide for the + execution of the transaction. + nullable: false + type: string + maxFeePerGas: + description: A maximum fee (including the base fee and the tip) a user is + willing to pay per unit of gas. + nullable: false + type: string + maxPriorityFeePerGas: + description: A maximum tip amount a user is willing to pay per unit of gas. + nullable: false + type: string + type: object + GasTransactionConfig: + description: Transaction gas settings. + oneOf: + - $ref: '#/components/schemas/GasTransactionConfigLegacy' + - $ref: '#/components/schemas/GasTransactionConfigEIP1559' + type: object + EthereumTransactionConfig: + example: + gasConfig: null + rawTransaction: rawTransaction + data: data + from: from + to: to + value: value + nonce: nonce + properties: + rawTransaction: + nullable: false + type: string + from: + type: string + to: + type: string + value: + type: string + nonce: + type: string + data: + type: string + gasConfig: + $ref: '#/components/schemas/GasTransactionConfig' + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: transactionIndex + commitmentHash: commitmentHash + type: type + transactionHash: transactionHash + output: output + gasUsed: gasUsed + blockNumber: blockNumber + cumulativeGasUsed: cumulativeGasUsed + from: from + to: to + revertReason: revertReason + effectiveGasPrice: effectiveGasPrice + logs: + - "" + - "" + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: string + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: string + gasUsed: + nullable: false + type: string + effectiveGasPrice: + nullable: false + type: string + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + logs: + default: [] + items: {} + nullable: false + type: array + logsBloom: + nullable: false + type: string + revertReason: + nullable: false + type: string + output: + nullable: false + type: string + commitmentHash: + nullable: false + type: string + cumulativeGasUsed: + nullable: false + type: string + type: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + ContractJSON: + additionalProperties: true + properties: + contractName: + nullable: false + type: string + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + abi: + description: "The application binary interface of the solidity contract,\ + \ optional parameter" + items: {} + nullable: false + type: array + metadata: + type: string + deployedBytecode: + type: string + sourceMap: + type: string + deployedSourceMap: + type: string + sourcePath: + type: string + compiler: + type: object + networks: + type: object + ast: + type: object + functionHashes: + type: object + gasEstimates: + type: object + required: + - abi + - bytecode + - contractName + type: object + ContractJsonDefinition: + additionalProperties: false + properties: + contractJSON: + $ref: '#/components/schemas/ContractJSON' + required: + - contractJSON + type: object + DeployedContractJsonDefinition: + additionalProperties: false + properties: + contractJSON: + $ref: '#/components/schemas/ContractJSON' + contractAddress: + nullable: false + type: string + required: + - contractAddress + - contractJSON + type: object + ContractKeychainDefinition: + additionalProperties: false + properties: + contractName: + description: The contract name for retrieve the contracts json on the keychain. + maxLength: 100 + minLength: 1 + nullable: false + type: string + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + nullable: false + type: string + required: + - contractName + - keychainId + type: object + RunTransactionRequest: + additionalProperties: false + example: + timeoutMs: 0.08008281904610115 + transactionConfig: + gasConfig: null + rawTransaction: rawTransaction + data: data + from: from + to: to + value: value + nonce: nonce + web3SigningCredential: + type: null + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + transactionConfig: + $ref: '#/components/schemas/EthereumTransactionConfig' + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with thehash of the transaction(which indicates successful execution) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + required: + - transactionConfig + - web3SigningCredential + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: transactionIndex + commitmentHash: commitmentHash + type: type + transactionHash: transactionHash + output: output + gasUsed: gasUsed + blockNumber: blockNumber + cumulativeGasUsed: cumulativeGasUsed + from: from + to: to + revertReason: revertReason + effectiveGasPrice: effectiveGasPrice + logs: + - "" + - "" + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractV1Request: + additionalProperties: false + example: + gasConfig: null + constructorArgs: + - "" + - "" + contract: null + web3SigningCredential: + type: null + value: value + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + contract: + $ref: '#/components/schemas/DeployContractV1Request_contract' + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + gasConfig: + $ref: '#/components/schemas/GasTransactionConfig' + value: + description: Ether balance to send on deployment. + nullable: false + type: string + required: + - contract + - web3SigningCredential + type: object + InvokeContractV1Request: + additionalProperties: false + example: + gasConfig: null + invocationType: null + timeoutMs: 0.08008281904610115 + contract: null + methodName: methodName + web3SigningCredential: + type: null + params: + - "" + - "" + value: value + properties: + contract: + $ref: '#/components/schemas/InvokeContractV1Request_contract' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gasConfig: + $ref: '#/components/schemas/GasTransactionConfig' + value: + type: string + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + before returning an error. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + required: + - contract + - invocationType + - methodName + - params + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: transactionIndex + commitmentHash: commitmentHash + type: type + transactionHash: transactionHash + output: output + gasUsed: gasUsed + blockNumber: blockNumber + cumulativeGasUsed: cumulativeGasUsed + from: from + to: to + revertReason: revertReason + effectiveGasPrice: effectiveGasPrice + logs: + - "" + - "" + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + InvokeRawWeb3EthMethodV1Request: + additionalProperties: false + example: + methodName: methodName + params: + - "" + - "" + properties: + methodName: + description: The name of the web3.eth method to invoke + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass to web3.eth method specified + in methodName + items: {} + type: array + required: + - methodName + type: object + InvokeRawWeb3EthMethodV1Response: + additionalProperties: false + example: + data: "" + errorDetail: errorDetail + status: 0.8008281904610115 + properties: + status: + description: Status code of the operation + nullable: false + type: number + data: + description: Output of requested web3.eth method + errorDetail: + description: Error details + nullable: false + type: string + required: + - status + type: object + InvokeRawWeb3EthContractV1Request: + additionalProperties: false + example: + invocationType: null + address: address + abi: "" + contractMethodArgs: + - "" + - "" + contractMethod: contractMethod + invocationParams: "{}" + properties: + abi: + description: The application binary interface of the solidity contract + address: + description: Deployed solidity contract address + type: string + invocationType: + $ref: '#/components/schemas/EthContractInvocationWeb3Method' + invocationParams: + default: {} + description: "The list of arguments for contract invocation method (send,\ + \ call, etc...)" + type: object + contractMethod: + description: Method of deployed solidity contract to execute + type: string + contractMethodArgs: + default: [] + description: The list of arguments for deployed solidity contract method + items: {} + type: array + required: + - abi + - address + - contractMethod + - invocationType + type: object + InvokeRawWeb3EthContractV1Response: + additionalProperties: false + example: + data: "" + errorDetail: errorDetail + status: 0.8008281904610115 + properties: + status: + description: Status code of the operation + type: number + data: + description: Output of contract invocation method + errorDetail: + description: Error details + type: string + required: + - status + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + WatchBlocksV1: + enum: + - org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Subscribe + - org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Next + - org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Unsubscribe + - org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Error + - org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + WatchBlocksV1Options: + properties: + getBlockData: + type: boolean + type: object + Web3BlockHeader: + properties: + number: + type: string + parentHash: + type: string + sha3Uncles: + type: string + transactionsRoot: + type: string + receiptsRoot: + type: string + difficulty: + type: string + mixHash: + type: string + miner: + type: string + gasLimit: + type: string + gasUsed: + type: string + stateRoot: + type: string + logsBloom: + type: string + extraData: + type: string + nonce: + type: string + timestamp: + type: string + required: + - gasLimit + - gasUsed + - sha3Uncles + - transactionRoot + type: object + Web3Transaction: + properties: + hash: + type: string + nonce: + type: string + blockHash: + type: string + blockNumber: + type: string + transactionIndex: + type: string + from: + type: string + to: + type: string + value: + type: string + gasPrice: + type: string + gas: + type: string + input: + type: string + type: + type: string + chainId: + type: string + v: + type: string + r: + type: string + s: + type: string + required: + - blockHash + - blockNumber + - chainId + - from + - gas + - gasPrice + - hash + - input + - nonce + - to + - transactionIndex + - type + - value + type: object + WatchBlocksV1BlockData: + properties: + number: + type: string + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionsRoot: + type: string + stateRoot: + type: string + receiptsRoot: + type: string + difficulty: + type: string + mixHash: + type: string + miner: + type: string + extraData: + type: string + gasLimit: + type: string + gasUsed: + type: string + timestamp: + $ref: '#/components/schemas/WatchBlocksV1BlockData_timestamp' + size: + type: string + totalDifficulty: + type: string + uncles: + items: + type: string + type: array + baseFeePerGas: + type: string + transactions: + items: + $ref: '#/components/schemas/Web3Transaction' + type: array + required: + - extraData + - gasLimit + - gasUsed + - miner + - nonce + - number + - parentHash + - receiptRoot + - sha3Uncles + - size + - stateRoot + - timestamp + - totalDifficulty + - transactionRoot + - transactions + - uncles + type: object + WatchBlocksV1Progress: + properties: + blockHeader: + $ref: '#/components/schemas/Web3BlockHeader' + blockData: + $ref: '#/components/schemas/WatchBlocksV1BlockData' + type: object + ErrorExceptionResponseV1: + description: Error response from the connector. + properties: + message: + description: Short error description message. + nullable: false + type: string + error: + description: Detailed error information. + nullable: false + type: string + required: + - error + - message + type: object + DeployContractV1Request_contract: + nullable: false + oneOf: + - $ref: '#/components/schemas/ContractJsonDefinition' + - $ref: '#/components/schemas/ContractKeychainDefinition' + InvokeContractV1Request_contract: + nullable: false + oneOf: + - $ref: '#/components/schemas/DeployedContractJsonDefinition' + - $ref: '#/components/schemas/ContractKeychainDefinition' + WatchBlocksV1BlockData_timestamp: + oneOf: + - type: string + - type: number diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..1b21508b7dc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,695 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeployContractRequest struct { + ctx context.Context + ApiService *DefaultApiService + deployContractV1Request *DeployContractV1Request +} + +func (r ApiDeployContractRequest) DeployContractV1Request(deployContractV1Request DeployContractV1Request) ApiDeployContractRequest { + r.deployContractV1Request = &deployContractV1Request + return r +} + +func (r ApiDeployContractRequest) Execute() (*RunTransactionResponse, *http.Response, error) { + return r.ApiService.DeployContractExecute(r) +} + +/* +DeployContract Deploys the contract to ethereum ledger. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractRequest +*/ +func (a *DefaultApiService) DeployContract(ctx context.Context) ApiDeployContractRequest { + return ApiDeployContractRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionResponse +func (a *DefaultApiService) DeployContractExecute(r ApiDeployContractRequest) (*RunTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContract") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + invokeContractV1Request *InvokeContractV1Request +} + +func (r ApiInvokeContractV1Request) InvokeContractV1Request(invokeContractV1Request InvokeContractV1Request) ApiInvokeContractV1Request { + r.invokeContractV1Request = &invokeContractV1Request + return r +} + +func (r ApiInvokeContractV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.InvokeContractV1Execute(r) +} + +/* +InvokeContractV1 Invokes a contract on an ethereum ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeContractV1Request +*/ +func (a *DefaultApiService) InvokeContractV1(ctx context.Context) ApiInvokeContractV1Request { + return ApiInvokeContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) InvokeContractV1Execute(r ApiInvokeContractV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeRawWeb3EthContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + invokeRawWeb3EthContractV1Request *InvokeRawWeb3EthContractV1Request +} + +func (r ApiInvokeRawWeb3EthContractV1Request) InvokeRawWeb3EthContractV1Request(invokeRawWeb3EthContractV1Request InvokeRawWeb3EthContractV1Request) ApiInvokeRawWeb3EthContractV1Request { + r.invokeRawWeb3EthContractV1Request = &invokeRawWeb3EthContractV1Request + return r +} + +func (r ApiInvokeRawWeb3EthContractV1Request) Execute() (*InvokeRawWeb3EthContractV1Response, *http.Response, error) { + return r.ApiService.InvokeRawWeb3EthContractV1Execute(r) +} + +/* +InvokeRawWeb3EthContractV1 Low-level endpoint to invoke a method on deployed contract. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeRawWeb3EthContractV1Request +*/ +func (a *DefaultApiService) InvokeRawWeb3EthContractV1(ctx context.Context) ApiInvokeRawWeb3EthContractV1Request { + return ApiInvokeRawWeb3EthContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeRawWeb3EthContractV1Response +func (a *DefaultApiService) InvokeRawWeb3EthContractV1Execute(r ApiInvokeRawWeb3EthContractV1Request) (*InvokeRawWeb3EthContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeRawWeb3EthContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeRawWeb3EthContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeRawWeb3EthContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeWeb3EthMethodV1Request struct { + ctx context.Context + ApiService *DefaultApiService + invokeRawWeb3EthMethodV1Request *InvokeRawWeb3EthMethodV1Request +} + +func (r ApiInvokeWeb3EthMethodV1Request) InvokeRawWeb3EthMethodV1Request(invokeRawWeb3EthMethodV1Request InvokeRawWeb3EthMethodV1Request) ApiInvokeWeb3EthMethodV1Request { + r.invokeRawWeb3EthMethodV1Request = &invokeRawWeb3EthMethodV1Request + return r +} + +func (r ApiInvokeWeb3EthMethodV1Request) Execute() (*InvokeRawWeb3EthMethodV1Response, *http.Response, error) { + return r.ApiService.InvokeWeb3EthMethodV1Execute(r) +} + +/* +InvokeWeb3EthMethodV1 Invoke any method from web3.eth (low-level) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeWeb3EthMethodV1Request +*/ +func (a *DefaultApiService) InvokeWeb3EthMethodV1(ctx context.Context) ApiInvokeWeb3EthMethodV1Request { + return ApiInvokeWeb3EthMethodV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeRawWeb3EthMethodV1Response +func (a *DefaultApiService) InvokeWeb3EthMethodV1Execute(r ApiInvokeWeb3EthMethodV1Request) (*InvokeRawWeb3EthMethodV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeRawWeb3EthMethodV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeWeb3EthMethodV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-method" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeRawWeb3EthMethodV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRunTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + runTransactionRequest *RunTransactionRequest +} + +func (r ApiRunTransactionV1Request) RunTransactionRequest(runTransactionRequest RunTransactionRequest) ApiRunTransactionV1Request { + r.runTransactionRequest = &runTransactionRequest + return r +} + +func (r ApiRunTransactionV1Request) Execute() (*RunTransactionResponse, *http.Response, error) { + return r.ApiService.RunTransactionV1Execute(r) +} + +/* +RunTransactionV1 Executes a transaction on a ethereum ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRunTransactionV1Request +*/ +func (a *DefaultApiService) RunTransactionV1(ctx context.Context) ApiRunTransactionV1Request { + return ApiRunTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionResponse +func (a *DefaultApiService) RunTransactionV1Execute(r ApiRunTransactionV1Request) (*RunTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RunTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/run-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.runTransactionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..f99d9711458 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,655 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "io/ioutil" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cacti Plugin - Connector Ethereum API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToQuery adds the provided object to the url query supporting deep object syntax +func parameterAddToQuery(queryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToQuery(queryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToQuery(queryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = ioutil.TempFile("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = ioutil.TempFile("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + + // status title (detail) + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..5c2b985418e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..3999793dfed --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client + +go 1.13 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_contract_json.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_contract_json.go new file mode 100644 index 00000000000..8000e14ab89 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_contract_json.go @@ -0,0 +1,570 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the ContractJSON type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContractJSON{} + +// ContractJSON struct for ContractJSON +type ContractJSON struct { + ContractName string `json:"contractName"` + // See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + Bytecode string `json:"bytecode"` + // The application binary interface of the solidity contract, optional parameter + Abi []interface{} `json:"abi"` + Metadata *string `json:"metadata,omitempty"` + DeployedBytecode *string `json:"deployedBytecode,omitempty"` + SourceMap *string `json:"sourceMap,omitempty"` + DeployedSourceMap *string `json:"deployedSourceMap,omitempty"` + SourcePath *string `json:"sourcePath,omitempty"` + Compiler map[string]interface{} `json:"compiler,omitempty"` + Networks map[string]interface{} `json:"networks,omitempty"` + Ast map[string]interface{} `json:"ast,omitempty"` + FunctionHashes map[string]interface{} `json:"functionHashes,omitempty"` + GasEstimates map[string]interface{} `json:"gasEstimates,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ContractJSON ContractJSON + +// NewContractJSON instantiates a new ContractJSON 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 +// will change when the set of required properties is changed +func NewContractJSON(contractName string, bytecode string, abi []interface{}) *ContractJSON { + this := ContractJSON{} + this.ContractName = contractName + this.Bytecode = bytecode + this.Abi = abi + return &this +} + +// NewContractJSONWithDefaults instantiates a new ContractJSON object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContractJSONWithDefaults() *ContractJSON { + this := ContractJSON{} + return &this +} + +// GetContractName returns the ContractName field value +func (o *ContractJSON) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *ContractJSON) SetContractName(v string) { + o.ContractName = v +} + +// GetBytecode returns the Bytecode field value +func (o *ContractJSON) GetBytecode() string { + if o == nil { + var ret string + return ret + } + + return o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetBytecodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bytecode, true +} + +// SetBytecode sets field value +func (o *ContractJSON) SetBytecode(v string) { + o.Bytecode = v +} + +// GetAbi returns the Abi field value +func (o *ContractJSON) GetAbi() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Abi +} + +// GetAbiOk returns a tuple with the Abi field value +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetAbiOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Abi, true +} + +// SetAbi sets field value +func (o *ContractJSON) SetAbi(v []interface{}) { + o.Abi = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *ContractJSON) GetMetadata() string { + if o == nil || isNil(o.Metadata) { + var ret string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetMetadataOk() (*string, bool) { + if o == nil || isNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *ContractJSON) HasMetadata() bool { + if o != nil && !isNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given string and assigns it to the Metadata field. +func (o *ContractJSON) SetMetadata(v string) { + o.Metadata = &v +} + +// GetDeployedBytecode returns the DeployedBytecode field value if set, zero value otherwise. +func (o *ContractJSON) GetDeployedBytecode() string { + if o == nil || isNil(o.DeployedBytecode) { + var ret string + return ret + } + return *o.DeployedBytecode +} + +// GetDeployedBytecodeOk returns a tuple with the DeployedBytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetDeployedBytecodeOk() (*string, bool) { + if o == nil || isNil(o.DeployedBytecode) { + return nil, false + } + return o.DeployedBytecode, true +} + +// HasDeployedBytecode returns a boolean if a field has been set. +func (o *ContractJSON) HasDeployedBytecode() bool { + if o != nil && !isNil(o.DeployedBytecode) { + return true + } + + return false +} + +// SetDeployedBytecode gets a reference to the given string and assigns it to the DeployedBytecode field. +func (o *ContractJSON) SetDeployedBytecode(v string) { + o.DeployedBytecode = &v +} + +// GetSourceMap returns the SourceMap field value if set, zero value otherwise. +func (o *ContractJSON) GetSourceMap() string { + if o == nil || isNil(o.SourceMap) { + var ret string + return ret + } + return *o.SourceMap +} + +// GetSourceMapOk returns a tuple with the SourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetSourceMapOk() (*string, bool) { + if o == nil || isNil(o.SourceMap) { + return nil, false + } + return o.SourceMap, true +} + +// HasSourceMap returns a boolean if a field has been set. +func (o *ContractJSON) HasSourceMap() bool { + if o != nil && !isNil(o.SourceMap) { + return true + } + + return false +} + +// SetSourceMap gets a reference to the given string and assigns it to the SourceMap field. +func (o *ContractJSON) SetSourceMap(v string) { + o.SourceMap = &v +} + +// GetDeployedSourceMap returns the DeployedSourceMap field value if set, zero value otherwise. +func (o *ContractJSON) GetDeployedSourceMap() string { + if o == nil || isNil(o.DeployedSourceMap) { + var ret string + return ret + } + return *o.DeployedSourceMap +} + +// GetDeployedSourceMapOk returns a tuple with the DeployedSourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetDeployedSourceMapOk() (*string, bool) { + if o == nil || isNil(o.DeployedSourceMap) { + return nil, false + } + return o.DeployedSourceMap, true +} + +// HasDeployedSourceMap returns a boolean if a field has been set. +func (o *ContractJSON) HasDeployedSourceMap() bool { + if o != nil && !isNil(o.DeployedSourceMap) { + return true + } + + return false +} + +// SetDeployedSourceMap gets a reference to the given string and assigns it to the DeployedSourceMap field. +func (o *ContractJSON) SetDeployedSourceMap(v string) { + o.DeployedSourceMap = &v +} + +// GetSourcePath returns the SourcePath field value if set, zero value otherwise. +func (o *ContractJSON) GetSourcePath() string { + if o == nil || isNil(o.SourcePath) { + var ret string + return ret + } + return *o.SourcePath +} + +// GetSourcePathOk returns a tuple with the SourcePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetSourcePathOk() (*string, bool) { + if o == nil || isNil(o.SourcePath) { + return nil, false + } + return o.SourcePath, true +} + +// HasSourcePath returns a boolean if a field has been set. +func (o *ContractJSON) HasSourcePath() bool { + if o != nil && !isNil(o.SourcePath) { + return true + } + + return false +} + +// SetSourcePath gets a reference to the given string and assigns it to the SourcePath field. +func (o *ContractJSON) SetSourcePath(v string) { + o.SourcePath = &v +} + +// GetCompiler returns the Compiler field value if set, zero value otherwise. +func (o *ContractJSON) GetCompiler() map[string]interface{} { + if o == nil || isNil(o.Compiler) { + var ret map[string]interface{} + return ret + } + return o.Compiler +} + +// GetCompilerOk returns a tuple with the Compiler field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetCompilerOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.Compiler) { + return map[string]interface{}{}, false + } + return o.Compiler, true +} + +// HasCompiler returns a boolean if a field has been set. +func (o *ContractJSON) HasCompiler() bool { + if o != nil && !isNil(o.Compiler) { + return true + } + + return false +} + +// SetCompiler gets a reference to the given map[string]interface{} and assigns it to the Compiler field. +func (o *ContractJSON) SetCompiler(v map[string]interface{}) { + o.Compiler = v +} + +// GetNetworks returns the Networks field value if set, zero value otherwise. +func (o *ContractJSON) GetNetworks() map[string]interface{} { + if o == nil || isNil(o.Networks) { + var ret map[string]interface{} + return ret + } + return o.Networks +} + +// GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetNetworksOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.Networks) { + return map[string]interface{}{}, false + } + return o.Networks, true +} + +// HasNetworks returns a boolean if a field has been set. +func (o *ContractJSON) HasNetworks() bool { + if o != nil && !isNil(o.Networks) { + return true + } + + return false +} + +// SetNetworks gets a reference to the given map[string]interface{} and assigns it to the Networks field. +func (o *ContractJSON) SetNetworks(v map[string]interface{}) { + o.Networks = v +} + +// GetAst returns the Ast field value if set, zero value otherwise. +func (o *ContractJSON) GetAst() map[string]interface{} { + if o == nil || isNil(o.Ast) { + var ret map[string]interface{} + return ret + } + return o.Ast +} + +// GetAstOk returns a tuple with the Ast field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetAstOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.Ast) { + return map[string]interface{}{}, false + } + return o.Ast, true +} + +// HasAst returns a boolean if a field has been set. +func (o *ContractJSON) HasAst() bool { + if o != nil && !isNil(o.Ast) { + return true + } + + return false +} + +// SetAst gets a reference to the given map[string]interface{} and assigns it to the Ast field. +func (o *ContractJSON) SetAst(v map[string]interface{}) { + o.Ast = v +} + +// GetFunctionHashes returns the FunctionHashes field value if set, zero value otherwise. +func (o *ContractJSON) GetFunctionHashes() map[string]interface{} { + if o == nil || isNil(o.FunctionHashes) { + var ret map[string]interface{} + return ret + } + return o.FunctionHashes +} + +// GetFunctionHashesOk returns a tuple with the FunctionHashes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetFunctionHashesOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.FunctionHashes) { + return map[string]interface{}{}, false + } + return o.FunctionHashes, true +} + +// HasFunctionHashes returns a boolean if a field has been set. +func (o *ContractJSON) HasFunctionHashes() bool { + if o != nil && !isNil(o.FunctionHashes) { + return true + } + + return false +} + +// SetFunctionHashes gets a reference to the given map[string]interface{} and assigns it to the FunctionHashes field. +func (o *ContractJSON) SetFunctionHashes(v map[string]interface{}) { + o.FunctionHashes = v +} + +// GetGasEstimates returns the GasEstimates field value if set, zero value otherwise. +func (o *ContractJSON) GetGasEstimates() map[string]interface{} { + if o == nil || isNil(o.GasEstimates) { + var ret map[string]interface{} + return ret + } + return o.GasEstimates +} + +// GetGasEstimatesOk returns a tuple with the GasEstimates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetGasEstimatesOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.GasEstimates) { + return map[string]interface{}{}, false + } + return o.GasEstimates, true +} + +// HasGasEstimates returns a boolean if a field has been set. +func (o *ContractJSON) HasGasEstimates() bool { + if o != nil && !isNil(o.GasEstimates) { + return true + } + + return false +} + +// SetGasEstimates gets a reference to the given map[string]interface{} and assigns it to the GasEstimates field. +func (o *ContractJSON) SetGasEstimates(v map[string]interface{}) { + o.GasEstimates = v +} + +func (o ContractJSON) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContractJSON) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + toSerialize["bytecode"] = o.Bytecode + toSerialize["abi"] = o.Abi + if !isNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !isNil(o.DeployedBytecode) { + toSerialize["deployedBytecode"] = o.DeployedBytecode + } + if !isNil(o.SourceMap) { + toSerialize["sourceMap"] = o.SourceMap + } + if !isNil(o.DeployedSourceMap) { + toSerialize["deployedSourceMap"] = o.DeployedSourceMap + } + if !isNil(o.SourcePath) { + toSerialize["sourcePath"] = o.SourcePath + } + if !isNil(o.Compiler) { + toSerialize["compiler"] = o.Compiler + } + if !isNil(o.Networks) { + toSerialize["networks"] = o.Networks + } + if !isNil(o.Ast) { + toSerialize["ast"] = o.Ast + } + if !isNil(o.FunctionHashes) { + toSerialize["functionHashes"] = o.FunctionHashes + } + if !isNil(o.GasEstimates) { + toSerialize["gasEstimates"] = o.GasEstimates + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContractJSON) UnmarshalJSON(bytes []byte) (err error) { + varContractJSON := _ContractJSON{} + + if err = json.Unmarshal(bytes, &varContractJSON); err == nil { + *o = ContractJSON(varContractJSON) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "contractName") + delete(additionalProperties, "bytecode") + delete(additionalProperties, "abi") + delete(additionalProperties, "metadata") + delete(additionalProperties, "deployedBytecode") + delete(additionalProperties, "sourceMap") + delete(additionalProperties, "deployedSourceMap") + delete(additionalProperties, "sourcePath") + delete(additionalProperties, "compiler") + delete(additionalProperties, "networks") + delete(additionalProperties, "ast") + delete(additionalProperties, "functionHashes") + delete(additionalProperties, "gasEstimates") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContractJSON struct { + value *ContractJSON + isSet bool +} + +func (v NullableContractJSON) Get() *ContractJSON { + return v.value +} + +func (v *NullableContractJSON) Set(val *ContractJSON) { + v.value = val + v.isSet = true +} + +func (v NullableContractJSON) IsSet() bool { + return v.isSet +} + +func (v *NullableContractJSON) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContractJSON(val *ContractJSON) *NullableContractJSON { + return &NullableContractJSON{value: val, isSet: true} +} + +func (v NullableContractJSON) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContractJSON) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_contract_json_definition.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_contract_json_definition.go new file mode 100644 index 00000000000..021a1114cab --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_contract_json_definition.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the ContractJsonDefinition type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContractJsonDefinition{} + +// ContractJsonDefinition struct for ContractJsonDefinition +type ContractJsonDefinition struct { + ContractJSON ContractJSON `json:"contractJSON"` +} + +// NewContractJsonDefinition instantiates a new ContractJsonDefinition 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 +// will change when the set of required properties is changed +func NewContractJsonDefinition(contractJSON ContractJSON) *ContractJsonDefinition { + this := ContractJsonDefinition{} + this.ContractJSON = contractJSON + return &this +} + +// NewContractJsonDefinitionWithDefaults instantiates a new ContractJsonDefinition object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContractJsonDefinitionWithDefaults() *ContractJsonDefinition { + this := ContractJsonDefinition{} + return &this +} + +// GetContractJSON returns the ContractJSON field value +func (o *ContractJsonDefinition) GetContractJSON() ContractJSON { + if o == nil { + var ret ContractJSON + return ret + } + + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value +// and a boolean to check if the value has been set. +func (o *ContractJsonDefinition) GetContractJSONOk() (*ContractJSON, bool) { + if o == nil { + return nil, false + } + return &o.ContractJSON, true +} + +// SetContractJSON sets field value +func (o *ContractJsonDefinition) SetContractJSON(v ContractJSON) { + o.ContractJSON = v +} + +func (o ContractJsonDefinition) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContractJsonDefinition) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractJSON"] = o.ContractJSON + return toSerialize, nil +} + +type NullableContractJsonDefinition struct { + value *ContractJsonDefinition + isSet bool +} + +func (v NullableContractJsonDefinition) Get() *ContractJsonDefinition { + return v.value +} + +func (v *NullableContractJsonDefinition) Set(val *ContractJsonDefinition) { + v.value = val + v.isSet = true +} + +func (v NullableContractJsonDefinition) IsSet() bool { + return v.isSet +} + +func (v *NullableContractJsonDefinition) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContractJsonDefinition(val *ContractJsonDefinition) *NullableContractJsonDefinition { + return &NullableContractJsonDefinition{value: val, isSet: true} +} + +func (v NullableContractJsonDefinition) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContractJsonDefinition) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_contract_keychain_definition.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_contract_keychain_definition.go new file mode 100644 index 00000000000..c069b0a03c7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_contract_keychain_definition.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the ContractKeychainDefinition type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContractKeychainDefinition{} + +// ContractKeychainDefinition struct for ContractKeychainDefinition +type ContractKeychainDefinition struct { + // The contract name for retrieve the contracts json on the keychain. + ContractName string `json:"contractName"` + // The keychainId for retrieve the contracts json. + KeychainId string `json:"keychainId"` +} + +// NewContractKeychainDefinition instantiates a new ContractKeychainDefinition 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 +// will change when the set of required properties is changed +func NewContractKeychainDefinition(contractName string, keychainId string) *ContractKeychainDefinition { + this := ContractKeychainDefinition{} + this.ContractName = contractName + this.KeychainId = keychainId + return &this +} + +// NewContractKeychainDefinitionWithDefaults instantiates a new ContractKeychainDefinition object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContractKeychainDefinitionWithDefaults() *ContractKeychainDefinition { + this := ContractKeychainDefinition{} + return &this +} + +// GetContractName returns the ContractName field value +func (o *ContractKeychainDefinition) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *ContractKeychainDefinition) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *ContractKeychainDefinition) SetContractName(v string) { + o.ContractName = v +} + +// GetKeychainId returns the KeychainId field value +func (o *ContractKeychainDefinition) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *ContractKeychainDefinition) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *ContractKeychainDefinition) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o ContractKeychainDefinition) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContractKeychainDefinition) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableContractKeychainDefinition struct { + value *ContractKeychainDefinition + isSet bool +} + +func (v NullableContractKeychainDefinition) Get() *ContractKeychainDefinition { + return v.value +} + +func (v *NullableContractKeychainDefinition) Set(val *ContractKeychainDefinition) { + v.value = val + v.isSet = true +} + +func (v NullableContractKeychainDefinition) IsSet() bool { + return v.isSet +} + +func (v *NullableContractKeychainDefinition) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContractKeychainDefinition(val *ContractKeychainDefinition) *NullableContractKeychainDefinition { + return &NullableContractKeychainDefinition{value: val, isSet: true} +} + +func (v NullableContractKeychainDefinition) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContractKeychainDefinition) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go new file mode 100644 index 00000000000..b191755e896 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go @@ -0,0 +1,254 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the DeployContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractV1Request{} + +// DeployContractV1Request struct for DeployContractV1Request +type DeployContractV1Request struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + Contract DeployContractV1RequestContract `json:"contract"` + // The list of arguments to pass in to the constructor of the contract being deployed. + ConstructorArgs []interface{} `json:"constructorArgs,omitempty"` + GasConfig *GasTransactionConfig `json:"gasConfig,omitempty"` + // Ether balance to send on deployment. + Value *string `json:"value,omitempty"` +} + +// NewDeployContractV1Request instantiates a new DeployContractV1Request 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 +// will change when the set of required properties is changed +func NewDeployContractV1Request(web3SigningCredential Web3SigningCredential, contract DeployContractV1RequestContract) *DeployContractV1Request { + this := DeployContractV1Request{} + this.Web3SigningCredential = web3SigningCredential + this.Contract = contract + return &this +} + +// NewDeployContractV1RequestWithDefaults instantiates a new DeployContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractV1RequestWithDefaults() *DeployContractV1Request { + this := DeployContractV1Request{} + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployContractV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployContractV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetContract returns the Contract field value +func (o *DeployContractV1Request) GetContract() DeployContractV1RequestContract { + if o == nil { + var ret DeployContractV1RequestContract + return ret + } + + return o.Contract +} + +// GetContractOk returns a tuple with the Contract field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetContractOk() (*DeployContractV1RequestContract, bool) { + if o == nil { + return nil, false + } + return &o.Contract, true +} + +// SetContract sets field value +func (o *DeployContractV1Request) SetContract(v DeployContractV1RequestContract) { + o.Contract = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetConstructorArgs() []interface{} { + if o == nil || isNil(o.ConstructorArgs) { + var ret []interface{} + return ret + } + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil || isNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasConstructorArgs() bool { + if o != nil && !isNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given []interface{} and assigns it to the ConstructorArgs field. +func (o *DeployContractV1Request) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +// GetGasConfig returns the GasConfig field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetGasConfig() GasTransactionConfig { + if o == nil || isNil(o.GasConfig) { + var ret GasTransactionConfig + return ret + } + return *o.GasConfig +} + +// GetGasConfigOk returns a tuple with the GasConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetGasConfigOk() (*GasTransactionConfig, bool) { + if o == nil || isNil(o.GasConfig) { + return nil, false + } + return o.GasConfig, true +} + +// HasGasConfig returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasGasConfig() bool { + if o != nil && !isNil(o.GasConfig) { + return true + } + + return false +} + +// SetGasConfig gets a reference to the given GasTransactionConfig and assigns it to the GasConfig field. +func (o *DeployContractV1Request) SetGasConfig(v GasTransactionConfig) { + o.GasConfig = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetValue() string { + if o == nil || isNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetValueOk() (*string, bool) { + if o == nil || isNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasValue() bool { + if o != nil && !isNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *DeployContractV1Request) SetValue(v string) { + o.Value = &v +} + +func (o DeployContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["contract"] = o.Contract + if !isNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + if !isNil(o.GasConfig) { + toSerialize["gasConfig"] = o.GasConfig + } + if !isNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullableDeployContractV1Request struct { + value *DeployContractV1Request + isSet bool +} + +func (v NullableDeployContractV1Request) Get() *DeployContractV1Request { + return v.value +} + +func (v *NullableDeployContractV1Request) Set(val *DeployContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractV1Request(val *DeployContractV1Request) *NullableDeployContractV1Request { + return &NullableDeployContractV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request_contract.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request_contract.go new file mode 100644 index 00000000000..4ac1c4fa8b5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request_contract.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "fmt" +) + +// DeployContractV1RequestContract - struct for DeployContractV1RequestContract +type DeployContractV1RequestContract struct { + ContractJsonDefinition *ContractJsonDefinition + ContractKeychainDefinition *ContractKeychainDefinition +} + +// ContractJsonDefinitionAsDeployContractV1RequestContract is a convenience function that returns ContractJsonDefinition wrapped in DeployContractV1RequestContract +func ContractJsonDefinitionAsDeployContractV1RequestContract(v *ContractJsonDefinition) DeployContractV1RequestContract { + return DeployContractV1RequestContract{ + ContractJsonDefinition: v, + } +} + +// ContractKeychainDefinitionAsDeployContractV1RequestContract is a convenience function that returns ContractKeychainDefinition wrapped in DeployContractV1RequestContract +func ContractKeychainDefinitionAsDeployContractV1RequestContract(v *ContractKeychainDefinition) DeployContractV1RequestContract { + return DeployContractV1RequestContract{ + ContractKeychainDefinition: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *DeployContractV1RequestContract) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into ContractJsonDefinition + err = newStrictDecoder(data).Decode(&dst.ContractJsonDefinition) + if err == nil { + jsonContractJsonDefinition, _ := json.Marshal(dst.ContractJsonDefinition) + if string(jsonContractJsonDefinition) == "{}" { // empty struct + dst.ContractJsonDefinition = nil + } else { + match++ + } + } else { + dst.ContractJsonDefinition = nil + } + + // try to unmarshal data into ContractKeychainDefinition + err = newStrictDecoder(data).Decode(&dst.ContractKeychainDefinition) + if err == nil { + jsonContractKeychainDefinition, _ := json.Marshal(dst.ContractKeychainDefinition) + if string(jsonContractKeychainDefinition) == "{}" { // empty struct + dst.ContractKeychainDefinition = nil + } else { + match++ + } + } else { + dst.ContractKeychainDefinition = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.ContractJsonDefinition = nil + dst.ContractKeychainDefinition = nil + + return fmt.Errorf("data matches more than one schema in oneOf(DeployContractV1RequestContract)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(DeployContractV1RequestContract)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src DeployContractV1RequestContract) MarshalJSON() ([]byte, error) { + if src.ContractJsonDefinition != nil { + return json.Marshal(&src.ContractJsonDefinition) + } + + if src.ContractKeychainDefinition != nil { + return json.Marshal(&src.ContractKeychainDefinition) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *DeployContractV1RequestContract) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.ContractJsonDefinition != nil { + return obj.ContractJsonDefinition + } + + if obj.ContractKeychainDefinition != nil { + return obj.ContractKeychainDefinition + } + + // all schemas are nil + return nil +} + +type NullableDeployContractV1RequestContract struct { + value *DeployContractV1RequestContract + isSet bool +} + +func (v NullableDeployContractV1RequestContract) Get() *DeployContractV1RequestContract { + return v.value +} + +func (v *NullableDeployContractV1RequestContract) Set(val *DeployContractV1RequestContract) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractV1RequestContract) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractV1RequestContract) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractV1RequestContract(val *DeployContractV1RequestContract) *NullableDeployContractV1RequestContract { + return &NullableDeployContractV1RequestContract{value: val, isSet: true} +} + +func (v NullableDeployContractV1RequestContract) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractV1RequestContract) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deployed_contract_json_definition.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deployed_contract_json_definition.go new file mode 100644 index 00000000000..34f50ff5790 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_deployed_contract_json_definition.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the DeployedContractJsonDefinition type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployedContractJsonDefinition{} + +// DeployedContractJsonDefinition struct for DeployedContractJsonDefinition +type DeployedContractJsonDefinition struct { + ContractJSON ContractJSON `json:"contractJSON"` + ContractAddress string `json:"contractAddress"` +} + +// NewDeployedContractJsonDefinition instantiates a new DeployedContractJsonDefinition 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 +// will change when the set of required properties is changed +func NewDeployedContractJsonDefinition(contractJSON ContractJSON, contractAddress string) *DeployedContractJsonDefinition { + this := DeployedContractJsonDefinition{} + this.ContractJSON = contractJSON + this.ContractAddress = contractAddress + return &this +} + +// NewDeployedContractJsonDefinitionWithDefaults instantiates a new DeployedContractJsonDefinition object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployedContractJsonDefinitionWithDefaults() *DeployedContractJsonDefinition { + this := DeployedContractJsonDefinition{} + return &this +} + +// GetContractJSON returns the ContractJSON field value +func (o *DeployedContractJsonDefinition) GetContractJSON() ContractJSON { + if o == nil { + var ret ContractJSON + return ret + } + + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value +// and a boolean to check if the value has been set. +func (o *DeployedContractJsonDefinition) GetContractJSONOk() (*ContractJSON, bool) { + if o == nil { + return nil, false + } + return &o.ContractJSON, true +} + +// SetContractJSON sets field value +func (o *DeployedContractJsonDefinition) SetContractJSON(v ContractJSON) { + o.ContractJSON = v +} + +// GetContractAddress returns the ContractAddress field value +func (o *DeployedContractJsonDefinition) GetContractAddress() string { + if o == nil { + var ret string + return ret + } + + return o.ContractAddress +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value +// and a boolean to check if the value has been set. +func (o *DeployedContractJsonDefinition) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractAddress, true +} + +// SetContractAddress sets field value +func (o *DeployedContractJsonDefinition) SetContractAddress(v string) { + o.ContractAddress = v +} + +func (o DeployedContractJsonDefinition) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployedContractJsonDefinition) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractJSON"] = o.ContractJSON + toSerialize["contractAddress"] = o.ContractAddress + return toSerialize, nil +} + +type NullableDeployedContractJsonDefinition struct { + value *DeployedContractJsonDefinition + isSet bool +} + +func (v NullableDeployedContractJsonDefinition) Get() *DeployedContractJsonDefinition { + return v.value +} + +func (v *NullableDeployedContractJsonDefinition) Set(val *DeployedContractJsonDefinition) { + v.value = val + v.isSet = true +} + +func (v NullableDeployedContractJsonDefinition) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployedContractJsonDefinition) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployedContractJsonDefinition(val *DeployedContractJsonDefinition) *NullableDeployedContractJsonDefinition { + return &NullableDeployedContractJsonDefinition{value: val, isSet: true} +} + +func (v NullableDeployedContractJsonDefinition) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployedContractJsonDefinition) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go new file mode 100644 index 00000000000..83bcd2be846 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the ErrorExceptionResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorExceptionResponseV1{} + +// ErrorExceptionResponseV1 Error response from the connector. +type ErrorExceptionResponseV1 struct { + // Short error description message. + Message string `json:"message"` + // Detailed error information. + Error string `json:"error"` +} + +// NewErrorExceptionResponseV1 instantiates a new ErrorExceptionResponseV1 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 +// will change when the set of required properties is changed +func NewErrorExceptionResponseV1(message string, error_ string) *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + this.Message = message + this.Error = error_ + return &this +} + +// NewErrorExceptionResponseV1WithDefaults instantiates a new ErrorExceptionResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorExceptionResponseV1WithDefaults() *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + return &this +} + +// GetMessage returns the Message field value +func (o *ErrorExceptionResponseV1) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ErrorExceptionResponseV1) SetMessage(v string) { + o.Message = v +} + +// GetError returns the Error field value +func (o *ErrorExceptionResponseV1) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *ErrorExceptionResponseV1) SetError(v string) { + o.Error = v +} + +func (o ErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorExceptionResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + toSerialize["error"] = o.Error + return toSerialize, nil +} + +type NullableErrorExceptionResponseV1 struct { + value *ErrorExceptionResponseV1 + isSet bool +} + +func (v NullableErrorExceptionResponseV1) Get() *ErrorExceptionResponseV1 { + return v.value +} + +func (v *NullableErrorExceptionResponseV1) Set(val *ErrorExceptionResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableErrorExceptionResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorExceptionResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorExceptionResponseV1(val *ErrorExceptionResponseV1) *NullableErrorExceptionResponseV1 { + return &NullableErrorExceptionResponseV1{value: val, isSet: true} +} + +func (v NullableErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorExceptionResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go new file mode 100644 index 00000000000..6bb3f4a350f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "fmt" +) + +// EthContractInvocationType the model 'EthContractInvocationType' +type EthContractInvocationType string + +// List of EthContractInvocationType +const ( + SEND EthContractInvocationType = "SEND" + CALL EthContractInvocationType = "CALL" +) + +// All allowed values of EthContractInvocationType enum +var AllowedEthContractInvocationTypeEnumValues = []EthContractInvocationType{ + "SEND", + "CALL", +} + +func (v *EthContractInvocationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EthContractInvocationType(value) + for _, existing := range AllowedEthContractInvocationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EthContractInvocationType", value) +} + +// NewEthContractInvocationTypeFromValue returns a pointer to a valid EthContractInvocationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEthContractInvocationTypeFromValue(v string) (*EthContractInvocationType, error) { + ev := EthContractInvocationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EthContractInvocationType: valid values are %v", v, AllowedEthContractInvocationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EthContractInvocationType) IsValid() bool { + for _, existing := range AllowedEthContractInvocationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EthContractInvocationType value +func (v EthContractInvocationType) Ptr() *EthContractInvocationType { + return &v +} + +type NullableEthContractInvocationType struct { + value *EthContractInvocationType + isSet bool +} + +func (v NullableEthContractInvocationType) Get() *EthContractInvocationType { + return v.value +} + +func (v *NullableEthContractInvocationType) Set(val *EthContractInvocationType) { + v.value = val + v.isSet = true +} + +func (v NullableEthContractInvocationType) IsSet() bool { + return v.isSet +} + +func (v *NullableEthContractInvocationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEthContractInvocationType(val *EthContractInvocationType) *NullableEthContractInvocationType { + return &NullableEthContractInvocationType{value: val, isSet: true} +} + +func (v NullableEthContractInvocationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEthContractInvocationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_web3_method.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_web3_method.go new file mode 100644 index 00000000000..9a32862a944 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_web3_method.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "fmt" +) + +// EthContractInvocationWeb3Method the model 'EthContractInvocationWeb3Method' +type EthContractInvocationWeb3Method string + +// List of EthContractInvocationWeb3Method +const ( + SEND EthContractInvocationWeb3Method = "send" + CALL EthContractInvocationWeb3Method = "call" + ENCODE_ABI EthContractInvocationWeb3Method = "encodeABI" + ESTIMATE_GAS EthContractInvocationWeb3Method = "estimateGas" +) + +// All allowed values of EthContractInvocationWeb3Method enum +var AllowedEthContractInvocationWeb3MethodEnumValues = []EthContractInvocationWeb3Method{ + "send", + "call", + "encodeABI", + "estimateGas", +} + +func (v *EthContractInvocationWeb3Method) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EthContractInvocationWeb3Method(value) + for _, existing := range AllowedEthContractInvocationWeb3MethodEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EthContractInvocationWeb3Method", value) +} + +// NewEthContractInvocationWeb3MethodFromValue returns a pointer to a valid EthContractInvocationWeb3Method +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEthContractInvocationWeb3MethodFromValue(v string) (*EthContractInvocationWeb3Method, error) { + ev := EthContractInvocationWeb3Method(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EthContractInvocationWeb3Method: valid values are %v", v, AllowedEthContractInvocationWeb3MethodEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EthContractInvocationWeb3Method) IsValid() bool { + for _, existing := range AllowedEthContractInvocationWeb3MethodEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EthContractInvocationWeb3Method value +func (v EthContractInvocationWeb3Method) Ptr() *EthContractInvocationWeb3Method { + return &v +} + +type NullableEthContractInvocationWeb3Method struct { + value *EthContractInvocationWeb3Method + isSet bool +} + +func (v NullableEthContractInvocationWeb3Method) Get() *EthContractInvocationWeb3Method { + return v.value +} + +func (v *NullableEthContractInvocationWeb3Method) Set(val *EthContractInvocationWeb3Method) { + v.value = val + v.isSet = true +} + +func (v NullableEthContractInvocationWeb3Method) IsSet() bool { + return v.isSet +} + +func (v *NullableEthContractInvocationWeb3Method) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEthContractInvocationWeb3Method(val *EthContractInvocationWeb3Method) *NullableEthContractInvocationWeb3Method { + return &NullableEthContractInvocationWeb3Method{value: val, isSet: true} +} + +func (v NullableEthContractInvocationWeb3Method) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEthContractInvocationWeb3Method) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_ethereum_transaction_config.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_ethereum_transaction_config.go new file mode 100644 index 00000000000..3db99fdf046 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_ethereum_transaction_config.go @@ -0,0 +1,342 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the EthereumTransactionConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EthereumTransactionConfig{} + +// EthereumTransactionConfig struct for EthereumTransactionConfig +type EthereumTransactionConfig struct { + RawTransaction *string `json:"rawTransaction,omitempty"` + From *string `json:"from,omitempty"` + To *string `json:"to,omitempty"` + Value *string `json:"value,omitempty"` + Nonce *string `json:"nonce,omitempty"` + Data *string `json:"data,omitempty"` + GasConfig *GasTransactionConfig `json:"gasConfig,omitempty"` +} + +// NewEthereumTransactionConfig instantiates a new EthereumTransactionConfig 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 +// will change when the set of required properties is changed +func NewEthereumTransactionConfig() *EthereumTransactionConfig { + this := EthereumTransactionConfig{} + return &this +} + +// NewEthereumTransactionConfigWithDefaults instantiates a new EthereumTransactionConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEthereumTransactionConfigWithDefaults() *EthereumTransactionConfig { + this := EthereumTransactionConfig{} + return &this +} + +// GetRawTransaction returns the RawTransaction field value if set, zero value otherwise. +func (o *EthereumTransactionConfig) GetRawTransaction() string { + if o == nil || isNil(o.RawTransaction) { + var ret string + return ret + } + return *o.RawTransaction +} + +// GetRawTransactionOk returns a tuple with the RawTransaction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EthereumTransactionConfig) GetRawTransactionOk() (*string, bool) { + if o == nil || isNil(o.RawTransaction) { + return nil, false + } + return o.RawTransaction, true +} + +// HasRawTransaction returns a boolean if a field has been set. +func (o *EthereumTransactionConfig) HasRawTransaction() bool { + if o != nil && !isNil(o.RawTransaction) { + return true + } + + return false +} + +// SetRawTransaction gets a reference to the given string and assigns it to the RawTransaction field. +func (o *EthereumTransactionConfig) SetRawTransaction(v string) { + o.RawTransaction = &v +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *EthereumTransactionConfig) GetFrom() string { + if o == nil || isNil(o.From) { + var ret string + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EthereumTransactionConfig) GetFromOk() (*string, bool) { + if o == nil || isNil(o.From) { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *EthereumTransactionConfig) HasFrom() bool { + if o != nil && !isNil(o.From) { + return true + } + + return false +} + +// SetFrom gets a reference to the given string and assigns it to the From field. +func (o *EthereumTransactionConfig) SetFrom(v string) { + o.From = &v +} + +// GetTo returns the To field value if set, zero value otherwise. +func (o *EthereumTransactionConfig) GetTo() string { + if o == nil || isNil(o.To) { + var ret string + return ret + } + return *o.To +} + +// GetToOk returns a tuple with the To field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EthereumTransactionConfig) GetToOk() (*string, bool) { + if o == nil || isNil(o.To) { + return nil, false + } + return o.To, true +} + +// HasTo returns a boolean if a field has been set. +func (o *EthereumTransactionConfig) HasTo() bool { + if o != nil && !isNil(o.To) { + return true + } + + return false +} + +// SetTo gets a reference to the given string and assigns it to the To field. +func (o *EthereumTransactionConfig) SetTo(v string) { + o.To = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *EthereumTransactionConfig) GetValue() string { + if o == nil || isNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EthereumTransactionConfig) GetValueOk() (*string, bool) { + if o == nil || isNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *EthereumTransactionConfig) HasValue() bool { + if o != nil && !isNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *EthereumTransactionConfig) SetValue(v string) { + o.Value = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *EthereumTransactionConfig) GetNonce() string { + if o == nil || isNil(o.Nonce) { + var ret string + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EthereumTransactionConfig) GetNonceOk() (*string, bool) { + if o == nil || isNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *EthereumTransactionConfig) HasNonce() bool { + if o != nil && !isNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given string and assigns it to the Nonce field. +func (o *EthereumTransactionConfig) SetNonce(v string) { + o.Nonce = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *EthereumTransactionConfig) GetData() string { + if o == nil || isNil(o.Data) { + var ret string + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EthereumTransactionConfig) GetDataOk() (*string, bool) { + if o == nil || isNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *EthereumTransactionConfig) HasData() bool { + if o != nil && !isNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given string and assigns it to the Data field. +func (o *EthereumTransactionConfig) SetData(v string) { + o.Data = &v +} + +// GetGasConfig returns the GasConfig field value if set, zero value otherwise. +func (o *EthereumTransactionConfig) GetGasConfig() GasTransactionConfig { + if o == nil || isNil(o.GasConfig) { + var ret GasTransactionConfig + return ret + } + return *o.GasConfig +} + +// GetGasConfigOk returns a tuple with the GasConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EthereumTransactionConfig) GetGasConfigOk() (*GasTransactionConfig, bool) { + if o == nil || isNil(o.GasConfig) { + return nil, false + } + return o.GasConfig, true +} + +// HasGasConfig returns a boolean if a field has been set. +func (o *EthereumTransactionConfig) HasGasConfig() bool { + if o != nil && !isNil(o.GasConfig) { + return true + } + + return false +} + +// SetGasConfig gets a reference to the given GasTransactionConfig and assigns it to the GasConfig field. +func (o *EthereumTransactionConfig) SetGasConfig(v GasTransactionConfig) { + o.GasConfig = &v +} + +func (o EthereumTransactionConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EthereumTransactionConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.RawTransaction) { + toSerialize["rawTransaction"] = o.RawTransaction + } + if !isNil(o.From) { + toSerialize["from"] = o.From + } + if !isNil(o.To) { + toSerialize["to"] = o.To + } + if !isNil(o.Value) { + toSerialize["value"] = o.Value + } + if !isNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !isNil(o.Data) { + toSerialize["data"] = o.Data + } + if !isNil(o.GasConfig) { + toSerialize["gasConfig"] = o.GasConfig + } + return toSerialize, nil +} + +type NullableEthereumTransactionConfig struct { + value *EthereumTransactionConfig + isSet bool +} + +func (v NullableEthereumTransactionConfig) Get() *EthereumTransactionConfig { + return v.value +} + +func (v *NullableEthereumTransactionConfig) Set(val *EthereumTransactionConfig) { + v.value = val + v.isSet = true +} + +func (v NullableEthereumTransactionConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableEthereumTransactionConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEthereumTransactionConfig(val *EthereumTransactionConfig) *NullableEthereumTransactionConfig { + return &NullableEthereumTransactionConfig{value: val, isSet: true} +} + +func (v NullableEthereumTransactionConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEthereumTransactionConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config.go new file mode 100644 index 00000000000..9b6bf5d5e1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "fmt" +) + +// GasTransactionConfig - Transaction gas settings. +type GasTransactionConfig struct { + GasTransactionConfigEIP1559 *GasTransactionConfigEIP1559 + GasTransactionConfigLegacy *GasTransactionConfigLegacy +} + +// GasTransactionConfigEIP1559AsGasTransactionConfig is a convenience function that returns GasTransactionConfigEIP1559 wrapped in GasTransactionConfig +func GasTransactionConfigEIP1559AsGasTransactionConfig(v *GasTransactionConfigEIP1559) GasTransactionConfig { + return GasTransactionConfig{ + GasTransactionConfigEIP1559: v, + } +} + +// GasTransactionConfigLegacyAsGasTransactionConfig is a convenience function that returns GasTransactionConfigLegacy wrapped in GasTransactionConfig +func GasTransactionConfigLegacyAsGasTransactionConfig(v *GasTransactionConfigLegacy) GasTransactionConfig { + return GasTransactionConfig{ + GasTransactionConfigLegacy: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *GasTransactionConfig) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into GasTransactionConfigEIP1559 + err = newStrictDecoder(data).Decode(&dst.GasTransactionConfigEIP1559) + if err == nil { + jsonGasTransactionConfigEIP1559, _ := json.Marshal(dst.GasTransactionConfigEIP1559) + if string(jsonGasTransactionConfigEIP1559) == "{}" { // empty struct + dst.GasTransactionConfigEIP1559 = nil + } else { + match++ + } + } else { + dst.GasTransactionConfigEIP1559 = nil + } + + // try to unmarshal data into GasTransactionConfigLegacy + err = newStrictDecoder(data).Decode(&dst.GasTransactionConfigLegacy) + if err == nil { + jsonGasTransactionConfigLegacy, _ := json.Marshal(dst.GasTransactionConfigLegacy) + if string(jsonGasTransactionConfigLegacy) == "{}" { // empty struct + dst.GasTransactionConfigLegacy = nil + } else { + match++ + } + } else { + dst.GasTransactionConfigLegacy = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.GasTransactionConfigEIP1559 = nil + dst.GasTransactionConfigLegacy = nil + + return fmt.Errorf("data matches more than one schema in oneOf(GasTransactionConfig)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(GasTransactionConfig)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src GasTransactionConfig) MarshalJSON() ([]byte, error) { + if src.GasTransactionConfigEIP1559 != nil { + return json.Marshal(&src.GasTransactionConfigEIP1559) + } + + if src.GasTransactionConfigLegacy != nil { + return json.Marshal(&src.GasTransactionConfigLegacy) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *GasTransactionConfig) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.GasTransactionConfigEIP1559 != nil { + return obj.GasTransactionConfigEIP1559 + } + + if obj.GasTransactionConfigLegacy != nil { + return obj.GasTransactionConfigLegacy + } + + // all schemas are nil + return nil +} + +type NullableGasTransactionConfig struct { + value *GasTransactionConfig + isSet bool +} + +func (v NullableGasTransactionConfig) Get() *GasTransactionConfig { + return v.value +} + +func (v *NullableGasTransactionConfig) Set(val *GasTransactionConfig) { + v.value = val + v.isSet = true +} + +func (v NullableGasTransactionConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableGasTransactionConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGasTransactionConfig(val *GasTransactionConfig) *NullableGasTransactionConfig { + return &NullableGasTransactionConfig{value: val, isSet: true} +} + +func (v NullableGasTransactionConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGasTransactionConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config_eip1559.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config_eip1559.go new file mode 100644 index 00000000000..9677269dd93 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config_eip1559.go @@ -0,0 +1,201 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the GasTransactionConfigEIP1559 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GasTransactionConfigEIP1559{} + +// GasTransactionConfigEIP1559 Transaction gas settings in networks after EIP-1559 (London fork). +type GasTransactionConfigEIP1559 struct { + // A maximum amount of gas a user is willing to provide for the execution of the transaction. + GasLimit *string `json:"gasLimit,omitempty"` + // A maximum fee (including the base fee and the tip) a user is willing to pay per unit of gas. + MaxFeePerGas *string `json:"maxFeePerGas,omitempty"` + // A maximum tip amount a user is willing to pay per unit of gas. + MaxPriorityFeePerGas *string `json:"maxPriorityFeePerGas,omitempty"` +} + +// NewGasTransactionConfigEIP1559 instantiates a new GasTransactionConfigEIP1559 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 +// will change when the set of required properties is changed +func NewGasTransactionConfigEIP1559() *GasTransactionConfigEIP1559 { + this := GasTransactionConfigEIP1559{} + return &this +} + +// NewGasTransactionConfigEIP1559WithDefaults instantiates a new GasTransactionConfigEIP1559 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGasTransactionConfigEIP1559WithDefaults() *GasTransactionConfigEIP1559 { + this := GasTransactionConfigEIP1559{} + return &this +} + +// GetGasLimit returns the GasLimit field value if set, zero value otherwise. +func (o *GasTransactionConfigEIP1559) GetGasLimit() string { + if o == nil || isNil(o.GasLimit) { + var ret string + return ret + } + return *o.GasLimit +} + +// GetGasLimitOk returns a tuple with the GasLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GasTransactionConfigEIP1559) GetGasLimitOk() (*string, bool) { + if o == nil || isNil(o.GasLimit) { + return nil, false + } + return o.GasLimit, true +} + +// HasGasLimit returns a boolean if a field has been set. +func (o *GasTransactionConfigEIP1559) HasGasLimit() bool { + if o != nil && !isNil(o.GasLimit) { + return true + } + + return false +} + +// SetGasLimit gets a reference to the given string and assigns it to the GasLimit field. +func (o *GasTransactionConfigEIP1559) SetGasLimit(v string) { + o.GasLimit = &v +} + +// GetMaxFeePerGas returns the MaxFeePerGas field value if set, zero value otherwise. +func (o *GasTransactionConfigEIP1559) GetMaxFeePerGas() string { + if o == nil || isNil(o.MaxFeePerGas) { + var ret string + return ret + } + return *o.MaxFeePerGas +} + +// GetMaxFeePerGasOk returns a tuple with the MaxFeePerGas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GasTransactionConfigEIP1559) GetMaxFeePerGasOk() (*string, bool) { + if o == nil || isNil(o.MaxFeePerGas) { + return nil, false + } + return o.MaxFeePerGas, true +} + +// HasMaxFeePerGas returns a boolean if a field has been set. +func (o *GasTransactionConfigEIP1559) HasMaxFeePerGas() bool { + if o != nil && !isNil(o.MaxFeePerGas) { + return true + } + + return false +} + +// SetMaxFeePerGas gets a reference to the given string and assigns it to the MaxFeePerGas field. +func (o *GasTransactionConfigEIP1559) SetMaxFeePerGas(v string) { + o.MaxFeePerGas = &v +} + +// GetMaxPriorityFeePerGas returns the MaxPriorityFeePerGas field value if set, zero value otherwise. +func (o *GasTransactionConfigEIP1559) GetMaxPriorityFeePerGas() string { + if o == nil || isNil(o.MaxPriorityFeePerGas) { + var ret string + return ret + } + return *o.MaxPriorityFeePerGas +} + +// GetMaxPriorityFeePerGasOk returns a tuple with the MaxPriorityFeePerGas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GasTransactionConfigEIP1559) GetMaxPriorityFeePerGasOk() (*string, bool) { + if o == nil || isNil(o.MaxPriorityFeePerGas) { + return nil, false + } + return o.MaxPriorityFeePerGas, true +} + +// HasMaxPriorityFeePerGas returns a boolean if a field has been set. +func (o *GasTransactionConfigEIP1559) HasMaxPriorityFeePerGas() bool { + if o != nil && !isNil(o.MaxPriorityFeePerGas) { + return true + } + + return false +} + +// SetMaxPriorityFeePerGas gets a reference to the given string and assigns it to the MaxPriorityFeePerGas field. +func (o *GasTransactionConfigEIP1559) SetMaxPriorityFeePerGas(v string) { + o.MaxPriorityFeePerGas = &v +} + +func (o GasTransactionConfigEIP1559) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GasTransactionConfigEIP1559) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.GasLimit) { + toSerialize["gasLimit"] = o.GasLimit + } + if !isNil(o.MaxFeePerGas) { + toSerialize["maxFeePerGas"] = o.MaxFeePerGas + } + if !isNil(o.MaxPriorityFeePerGas) { + toSerialize["maxPriorityFeePerGas"] = o.MaxPriorityFeePerGas + } + return toSerialize, nil +} + +type NullableGasTransactionConfigEIP1559 struct { + value *GasTransactionConfigEIP1559 + isSet bool +} + +func (v NullableGasTransactionConfigEIP1559) Get() *GasTransactionConfigEIP1559 { + return v.value +} + +func (v *NullableGasTransactionConfigEIP1559) Set(val *GasTransactionConfigEIP1559) { + v.value = val + v.isSet = true +} + +func (v NullableGasTransactionConfigEIP1559) IsSet() bool { + return v.isSet +} + +func (v *NullableGasTransactionConfigEIP1559) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGasTransactionConfigEIP1559(val *GasTransactionConfigEIP1559) *NullableGasTransactionConfigEIP1559 { + return &NullableGasTransactionConfigEIP1559{value: val, isSet: true} +} + +func (v NullableGasTransactionConfigEIP1559) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGasTransactionConfigEIP1559) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config_legacy.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config_legacy.go new file mode 100644 index 00000000000..0b06ff262c8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_gas_transaction_config_legacy.go @@ -0,0 +1,164 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the GasTransactionConfigLegacy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GasTransactionConfigLegacy{} + +// GasTransactionConfigLegacy Transaction gas settings in networks before EIP-1559 (London fork). +type GasTransactionConfigLegacy struct { + // A maximum amount of gas a user is willing to provide for the execution of the transaction. (gasLimit) + Gas *string `json:"gas,omitempty"` + // A price (in Wei) a user is willing to pay for each unit of gas used during the execution of the transaction. In EIP-1559 (London fork) networks, it will be set as both maxFeePerGas and maxPriorityFeePerGas. + GasPrice *string `json:"gasPrice,omitempty"` +} + +// NewGasTransactionConfigLegacy instantiates a new GasTransactionConfigLegacy 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 +// will change when the set of required properties is changed +func NewGasTransactionConfigLegacy() *GasTransactionConfigLegacy { + this := GasTransactionConfigLegacy{} + return &this +} + +// NewGasTransactionConfigLegacyWithDefaults instantiates a new GasTransactionConfigLegacy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGasTransactionConfigLegacyWithDefaults() *GasTransactionConfigLegacy { + this := GasTransactionConfigLegacy{} + return &this +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *GasTransactionConfigLegacy) GetGas() string { + if o == nil || isNil(o.Gas) { + var ret string + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GasTransactionConfigLegacy) GetGasOk() (*string, bool) { + if o == nil || isNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *GasTransactionConfigLegacy) HasGas() bool { + if o != nil && !isNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given string and assigns it to the Gas field. +func (o *GasTransactionConfigLegacy) SetGas(v string) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *GasTransactionConfigLegacy) GetGasPrice() string { + if o == nil || isNil(o.GasPrice) { + var ret string + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GasTransactionConfigLegacy) GetGasPriceOk() (*string, bool) { + if o == nil || isNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *GasTransactionConfigLegacy) HasGasPrice() bool { + if o != nil && !isNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given string and assigns it to the GasPrice field. +func (o *GasTransactionConfigLegacy) SetGasPrice(v string) { + o.GasPrice = &v +} + +func (o GasTransactionConfigLegacy) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GasTransactionConfigLegacy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !isNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + return toSerialize, nil +} + +type NullableGasTransactionConfigLegacy struct { + value *GasTransactionConfigLegacy + isSet bool +} + +func (v NullableGasTransactionConfigLegacy) Get() *GasTransactionConfigLegacy { + return v.value +} + +func (v *NullableGasTransactionConfigLegacy) Set(val *GasTransactionConfigLegacy) { + v.value = val + v.isSet = true +} + +func (v NullableGasTransactionConfigLegacy) IsSet() bool { + return v.isSet +} + +func (v *NullableGasTransactionConfigLegacy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGasTransactionConfigLegacy(val *GasTransactionConfigLegacy) *NullableGasTransactionConfigLegacy { + return &NullableGasTransactionConfigLegacy{value: val, isSet: true} +} + +func (v NullableGasTransactionConfigLegacy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGasTransactionConfigLegacy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go new file mode 100644 index 00000000000..d00c1195b8b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go @@ -0,0 +1,349 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Request{} + +// InvokeContractV1Request struct for InvokeContractV1Request +type InvokeContractV1Request struct { + Contract InvokeContractV1RequestContract `json:"contract"` + // The name of the contract method to invoke. + MethodName string `json:"methodName"` + // The list of arguments to pass in to the contract method being invoked. + Params []interface{} `json:"params"` + InvocationType EthContractInvocationType `json:"invocationType"` + Web3SigningCredential *Web3SigningCredential `json:"web3SigningCredential,omitempty"` + GasConfig *GasTransactionConfig `json:"gasConfig,omitempty"` + Value *string `json:"value,omitempty"` + // The amount of milliseconds to wait for a transaction receipt before returning an error. Only has any effect if the invocation type is SEND + TimeoutMs *float32 `json:"timeoutMs,omitempty"` +} + +// NewInvokeContractV1Request instantiates a new InvokeContractV1Request 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 +// will change when the set of required properties is changed +func NewInvokeContractV1Request(contract InvokeContractV1RequestContract, methodName string, params []interface{}, invocationType EthContractInvocationType) *InvokeContractV1Request { + this := InvokeContractV1Request{} + this.Contract = contract + this.MethodName = methodName + this.Params = params + this.InvocationType = invocationType + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewInvokeContractV1RequestWithDefaults instantiates a new InvokeContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1RequestWithDefaults() *InvokeContractV1Request { + this := InvokeContractV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContract returns the Contract field value +func (o *InvokeContractV1Request) GetContract() InvokeContractV1RequestContract { + if o == nil { + var ret InvokeContractV1RequestContract + return ret + } + + return o.Contract +} + +// GetContractOk returns a tuple with the Contract field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetContractOk() (*InvokeContractV1RequestContract, bool) { + if o == nil { + return nil, false + } + return &o.Contract, true +} + +// SetContract sets field value +func (o *InvokeContractV1Request) SetContract(v InvokeContractV1RequestContract) { + o.Contract = v +} + +// GetMethodName returns the MethodName field value +func (o *InvokeContractV1Request) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeContractV1Request) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value +func (o *InvokeContractV1Request) GetParams() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetParamsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *InvokeContractV1Request) SetParams(v []interface{}) { + o.Params = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeContractV1Request) GetInvocationType() EthContractInvocationType { + if o == nil { + var ret EthContractInvocationType + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetInvocationTypeOk() (*EthContractInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeContractV1Request) SetInvocationType(v EthContractInvocationType) { + o.InvocationType = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil || isNil(o.Web3SigningCredential) { + var ret Web3SigningCredential + return ret + } + return *o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil || isNil(o.Web3SigningCredential) { + return nil, false + } + return o.Web3SigningCredential, true +} + +// HasWeb3SigningCredential returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasWeb3SigningCredential() bool { + if o != nil && !isNil(o.Web3SigningCredential) { + return true + } + + return false +} + +// SetWeb3SigningCredential gets a reference to the given Web3SigningCredential and assigns it to the Web3SigningCredential field. +func (o *InvokeContractV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = &v +} + +// GetGasConfig returns the GasConfig field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetGasConfig() GasTransactionConfig { + if o == nil || isNil(o.GasConfig) { + var ret GasTransactionConfig + return ret + } + return *o.GasConfig +} + +// GetGasConfigOk returns a tuple with the GasConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetGasConfigOk() (*GasTransactionConfig, bool) { + if o == nil || isNil(o.GasConfig) { + return nil, false + } + return o.GasConfig, true +} + +// HasGasConfig returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasGasConfig() bool { + if o != nil && !isNil(o.GasConfig) { + return true + } + + return false +} + +// SetGasConfig gets a reference to the given GasTransactionConfig and assigns it to the GasConfig field. +func (o *InvokeContractV1Request) SetGasConfig(v GasTransactionConfig) { + o.GasConfig = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetValue() string { + if o == nil || isNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetValueOk() (*string, bool) { + if o == nil || isNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasValue() bool { + if o != nil && !isNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *InvokeContractV1Request) SetValue(v string) { + o.Value = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetTimeoutMs() float32 { + if o == nil || isNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || isNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasTimeoutMs() bool { + if o != nil && !isNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *InvokeContractV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +func (o InvokeContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contract"] = o.Contract + toSerialize["methodName"] = o.MethodName + toSerialize["params"] = o.Params + toSerialize["invocationType"] = o.InvocationType + if !isNil(o.Web3SigningCredential) { + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + } + if !isNil(o.GasConfig) { + toSerialize["gasConfig"] = o.GasConfig + } + if !isNil(o.Value) { + toSerialize["value"] = o.Value + } + if !isNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + return toSerialize, nil +} + +type NullableInvokeContractV1Request struct { + value *InvokeContractV1Request + isSet bool +} + +func (v NullableInvokeContractV1Request) Get() *InvokeContractV1Request { + return v.value +} + +func (v *NullableInvokeContractV1Request) Set(val *InvokeContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Request(val *InvokeContractV1Request) *NullableInvokeContractV1Request { + return &NullableInvokeContractV1Request{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request_contract.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request_contract.go new file mode 100644 index 00000000000..2df16af9196 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request_contract.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "fmt" +) + +// InvokeContractV1RequestContract - struct for InvokeContractV1RequestContract +type InvokeContractV1RequestContract struct { + ContractKeychainDefinition *ContractKeychainDefinition + DeployedContractJsonDefinition *DeployedContractJsonDefinition +} + +// ContractKeychainDefinitionAsInvokeContractV1RequestContract is a convenience function that returns ContractKeychainDefinition wrapped in InvokeContractV1RequestContract +func ContractKeychainDefinitionAsInvokeContractV1RequestContract(v *ContractKeychainDefinition) InvokeContractV1RequestContract { + return InvokeContractV1RequestContract{ + ContractKeychainDefinition: v, + } +} + +// DeployedContractJsonDefinitionAsInvokeContractV1RequestContract is a convenience function that returns DeployedContractJsonDefinition wrapped in InvokeContractV1RequestContract +func DeployedContractJsonDefinitionAsInvokeContractV1RequestContract(v *DeployedContractJsonDefinition) InvokeContractV1RequestContract { + return InvokeContractV1RequestContract{ + DeployedContractJsonDefinition: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *InvokeContractV1RequestContract) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into ContractKeychainDefinition + err = newStrictDecoder(data).Decode(&dst.ContractKeychainDefinition) + if err == nil { + jsonContractKeychainDefinition, _ := json.Marshal(dst.ContractKeychainDefinition) + if string(jsonContractKeychainDefinition) == "{}" { // empty struct + dst.ContractKeychainDefinition = nil + } else { + match++ + } + } else { + dst.ContractKeychainDefinition = nil + } + + // try to unmarshal data into DeployedContractJsonDefinition + err = newStrictDecoder(data).Decode(&dst.DeployedContractJsonDefinition) + if err == nil { + jsonDeployedContractJsonDefinition, _ := json.Marshal(dst.DeployedContractJsonDefinition) + if string(jsonDeployedContractJsonDefinition) == "{}" { // empty struct + dst.DeployedContractJsonDefinition = nil + } else { + match++ + } + } else { + dst.DeployedContractJsonDefinition = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.ContractKeychainDefinition = nil + dst.DeployedContractJsonDefinition = nil + + return fmt.Errorf("data matches more than one schema in oneOf(InvokeContractV1RequestContract)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(InvokeContractV1RequestContract)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src InvokeContractV1RequestContract) MarshalJSON() ([]byte, error) { + if src.ContractKeychainDefinition != nil { + return json.Marshal(&src.ContractKeychainDefinition) + } + + if src.DeployedContractJsonDefinition != nil { + return json.Marshal(&src.DeployedContractJsonDefinition) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *InvokeContractV1RequestContract) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.ContractKeychainDefinition != nil { + return obj.ContractKeychainDefinition + } + + if obj.DeployedContractJsonDefinition != nil { + return obj.DeployedContractJsonDefinition + } + + // all schemas are nil + return nil +} + +type NullableInvokeContractV1RequestContract struct { + value *InvokeContractV1RequestContract + isSet bool +} + +func (v NullableInvokeContractV1RequestContract) Get() *InvokeContractV1RequestContract { + return v.value +} + +func (v *NullableInvokeContractV1RequestContract) Set(val *InvokeContractV1RequestContract) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1RequestContract) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1RequestContract) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1RequestContract(val *InvokeContractV1RequestContract) *NullableInvokeContractV1RequestContract { + return &NullableInvokeContractV1RequestContract{value: val, isSet: true} +} + +func (v NullableInvokeContractV1RequestContract) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1RequestContract) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go new file mode 100644 index 00000000000..035bec17110 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go @@ -0,0 +1,190 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Response{} + +// InvokeContractV1Response struct for InvokeContractV1Response +type InvokeContractV1Response struct { + TransactionReceipt *Web3TransactionReceipt `json:"transactionReceipt,omitempty"` + CallOutput interface{} `json:"callOutput,omitempty"` + Success bool `json:"success"` +} + +// NewInvokeContractV1Response instantiates a new InvokeContractV1Response 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 +// will change when the set of required properties is changed +func NewInvokeContractV1Response(success bool) *InvokeContractV1Response { + this := InvokeContractV1Response{} + this.Success = success + return &this +} + +// NewInvokeContractV1ResponseWithDefaults instantiates a new InvokeContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1ResponseWithDefaults() *InvokeContractV1Response { + this := InvokeContractV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value if set, zero value otherwise. +func (o *InvokeContractV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil || isNil(o.TransactionReceipt) { + var ret Web3TransactionReceipt + return ret + } + return *o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil || isNil(o.TransactionReceipt) { + return nil, false + } + return o.TransactionReceipt, true +} + +// HasTransactionReceipt returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasTransactionReceipt() bool { + if o != nil && !isNil(o.TransactionReceipt) { + return true + } + + return false +} + +// SetTransactionReceipt gets a reference to the given Web3TransactionReceipt and assigns it to the TransactionReceipt field. +func (o *InvokeContractV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = &v +} + +// GetCallOutput returns the CallOutput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeContractV1Response) GetCallOutput() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.CallOutput +} + +// GetCallOutputOk returns a tuple with the CallOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeContractV1Response) GetCallOutputOk() (*interface{}, bool) { + if o == nil || isNil(o.CallOutput) { + return nil, false + } + return &o.CallOutput, true +} + +// HasCallOutput returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasCallOutput() bool { + if o != nil && isNil(o.CallOutput) { + return true + } + + return false +} + +// SetCallOutput gets a reference to the given interface{} and assigns it to the CallOutput field. +func (o *InvokeContractV1Response) SetCallOutput(v interface{}) { + o.CallOutput = v +} + +// GetSuccess returns the Success field value +func (o *InvokeContractV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *InvokeContractV1Response) SetSuccess(v bool) { + o.Success = v +} + +func (o InvokeContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.TransactionReceipt) { + toSerialize["transactionReceipt"] = o.TransactionReceipt + } + if o.CallOutput != nil { + toSerialize["callOutput"] = o.CallOutput + } + toSerialize["success"] = o.Success + return toSerialize, nil +} + +type NullableInvokeContractV1Response struct { + value *InvokeContractV1Response + isSet bool +} + +func (v NullableInvokeContractV1Response) Get() *InvokeContractV1Response { + return v.value +} + +func (v *NullableInvokeContractV1Response) Set(val *InvokeContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Response(val *InvokeContractV1Response) *NullableInvokeContractV1Response { + return &NullableInvokeContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_request.go new file mode 100644 index 00000000000..22746292a36 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_request.go @@ -0,0 +1,279 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the InvokeRawWeb3EthContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRawWeb3EthContractV1Request{} + +// InvokeRawWeb3EthContractV1Request struct for InvokeRawWeb3EthContractV1Request +type InvokeRawWeb3EthContractV1Request struct { + // The application binary interface of the solidity contract + Abi interface{} `json:"abi"` + // Deployed solidity contract address + Address string `json:"address"` + InvocationType EthContractInvocationWeb3Method `json:"invocationType"` + // The list of arguments for contract invocation method (send, call, etc...) + InvocationParams map[string]interface{} `json:"invocationParams,omitempty"` + // Method of deployed solidity contract to execute + ContractMethod string `json:"contractMethod"` + // The list of arguments for deployed solidity contract method + ContractMethodArgs []interface{} `json:"contractMethodArgs,omitempty"` +} + +// NewInvokeRawWeb3EthContractV1Request instantiates a new InvokeRawWeb3EthContractV1Request 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 +// will change when the set of required properties is changed +func NewInvokeRawWeb3EthContractV1Request(abi interface{}, address string, invocationType EthContractInvocationWeb3Method, contractMethod string) *InvokeRawWeb3EthContractV1Request { + this := InvokeRawWeb3EthContractV1Request{} + this.Abi = abi + this.Address = address + this.InvocationType = invocationType + this.ContractMethod = contractMethod + return &this +} + +// NewInvokeRawWeb3EthContractV1RequestWithDefaults instantiates a new InvokeRawWeb3EthContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRawWeb3EthContractV1RequestWithDefaults() *InvokeRawWeb3EthContractV1Request { + this := InvokeRawWeb3EthContractV1Request{} + return &this +} + +// GetAbi returns the Abi field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *InvokeRawWeb3EthContractV1Request) GetAbi() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Abi +} + +// GetAbiOk returns a tuple with the Abi field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeRawWeb3EthContractV1Request) GetAbiOk() (*interface{}, bool) { + if o == nil || isNil(o.Abi) { + return nil, false + } + return &o.Abi, true +} + +// SetAbi sets field value +func (o *InvokeRawWeb3EthContractV1Request) SetAbi(v interface{}) { + o.Abi = v +} + +// GetAddress returns the Address field value +func (o *InvokeRawWeb3EthContractV1Request) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *InvokeRawWeb3EthContractV1Request) SetAddress(v string) { + o.Address = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeRawWeb3EthContractV1Request) GetInvocationType() EthContractInvocationWeb3Method { + if o == nil { + var ret EthContractInvocationWeb3Method + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetInvocationTypeOk() (*EthContractInvocationWeb3Method, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeRawWeb3EthContractV1Request) SetInvocationType(v EthContractInvocationWeb3Method) { + o.InvocationType = v +} + +// GetInvocationParams returns the InvocationParams field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthContractV1Request) GetInvocationParams() map[string]interface{} { + if o == nil || isNil(o.InvocationParams) { + var ret map[string]interface{} + return ret + } + return o.InvocationParams +} + +// GetInvocationParamsOk returns a tuple with the InvocationParams field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetInvocationParamsOk() (map[string]interface{}, bool) { + if o == nil || isNil(o.InvocationParams) { + return map[string]interface{}{}, false + } + return o.InvocationParams, true +} + +// HasInvocationParams returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthContractV1Request) HasInvocationParams() bool { + if o != nil && !isNil(o.InvocationParams) { + return true + } + + return false +} + +// SetInvocationParams gets a reference to the given map[string]interface{} and assigns it to the InvocationParams field. +func (o *InvokeRawWeb3EthContractV1Request) SetInvocationParams(v map[string]interface{}) { + o.InvocationParams = v +} + +// GetContractMethod returns the ContractMethod field value +func (o *InvokeRawWeb3EthContractV1Request) GetContractMethod() string { + if o == nil { + var ret string + return ret + } + + return o.ContractMethod +} + +// GetContractMethodOk returns a tuple with the ContractMethod field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetContractMethodOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractMethod, true +} + +// SetContractMethod sets field value +func (o *InvokeRawWeb3EthContractV1Request) SetContractMethod(v string) { + o.ContractMethod = v +} + +// GetContractMethodArgs returns the ContractMethodArgs field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthContractV1Request) GetContractMethodArgs() []interface{} { + if o == nil || isNil(o.ContractMethodArgs) { + var ret []interface{} + return ret + } + return o.ContractMethodArgs +} + +// GetContractMethodArgsOk returns a tuple with the ContractMethodArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetContractMethodArgsOk() ([]interface{}, bool) { + if o == nil || isNil(o.ContractMethodArgs) { + return nil, false + } + return o.ContractMethodArgs, true +} + +// HasContractMethodArgs returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthContractV1Request) HasContractMethodArgs() bool { + if o != nil && !isNil(o.ContractMethodArgs) { + return true + } + + return false +} + +// SetContractMethodArgs gets a reference to the given []interface{} and assigns it to the ContractMethodArgs field. +func (o *InvokeRawWeb3EthContractV1Request) SetContractMethodArgs(v []interface{}) { + o.ContractMethodArgs = v +} + +func (o InvokeRawWeb3EthContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRawWeb3EthContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Abi != nil { + toSerialize["abi"] = o.Abi + } + toSerialize["address"] = o.Address + toSerialize["invocationType"] = o.InvocationType + if !isNil(o.InvocationParams) { + toSerialize["invocationParams"] = o.InvocationParams + } + toSerialize["contractMethod"] = o.ContractMethod + if !isNil(o.ContractMethodArgs) { + toSerialize["contractMethodArgs"] = o.ContractMethodArgs + } + return toSerialize, nil +} + +type NullableInvokeRawWeb3EthContractV1Request struct { + value *InvokeRawWeb3EthContractV1Request + isSet bool +} + +func (v NullableInvokeRawWeb3EthContractV1Request) Get() *InvokeRawWeb3EthContractV1Request { + return v.value +} + +func (v *NullableInvokeRawWeb3EthContractV1Request) Set(val *InvokeRawWeb3EthContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRawWeb3EthContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRawWeb3EthContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRawWeb3EthContractV1Request(val *InvokeRawWeb3EthContractV1Request) *NullableInvokeRawWeb3EthContractV1Request { + return &NullableInvokeRawWeb3EthContractV1Request{value: val, isSet: true} +} + +func (v NullableInvokeRawWeb3EthContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRawWeb3EthContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_response.go new file mode 100644 index 00000000000..6cd4523de1d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_response.go @@ -0,0 +1,193 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the InvokeRawWeb3EthContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRawWeb3EthContractV1Response{} + +// InvokeRawWeb3EthContractV1Response struct for InvokeRawWeb3EthContractV1Response +type InvokeRawWeb3EthContractV1Response struct { + // Status code of the operation + Status float32 `json:"status"` + // Output of contract invocation method + Data interface{} `json:"data,omitempty"` + // Error details + ErrorDetail *string `json:"errorDetail,omitempty"` +} + +// NewInvokeRawWeb3EthContractV1Response instantiates a new InvokeRawWeb3EthContractV1Response 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 +// will change when the set of required properties is changed +func NewInvokeRawWeb3EthContractV1Response(status float32) *InvokeRawWeb3EthContractV1Response { + this := InvokeRawWeb3EthContractV1Response{} + this.Status = status + return &this +} + +// NewInvokeRawWeb3EthContractV1ResponseWithDefaults instantiates a new InvokeRawWeb3EthContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRawWeb3EthContractV1ResponseWithDefaults() *InvokeRawWeb3EthContractV1Response { + this := InvokeRawWeb3EthContractV1Response{} + return &this +} + +// GetStatus returns the Status field value +func (o *InvokeRawWeb3EthContractV1Response) GetStatus() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Response) GetStatusOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *InvokeRawWeb3EthContractV1Response) SetStatus(v float32) { + o.Status = v +} + +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeRawWeb3EthContractV1Response) GetData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeRawWeb3EthContractV1Response) GetDataOk() (*interface{}, bool) { + if o == nil || isNil(o.Data) { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthContractV1Response) HasData() bool { + if o != nil && isNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *InvokeRawWeb3EthContractV1Response) SetData(v interface{}) { + o.Data = v +} + +// GetErrorDetail returns the ErrorDetail field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthContractV1Response) GetErrorDetail() string { + if o == nil || isNil(o.ErrorDetail) { + var ret string + return ret + } + return *o.ErrorDetail +} + +// GetErrorDetailOk returns a tuple with the ErrorDetail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Response) GetErrorDetailOk() (*string, bool) { + if o == nil || isNil(o.ErrorDetail) { + return nil, false + } + return o.ErrorDetail, true +} + +// HasErrorDetail returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthContractV1Response) HasErrorDetail() bool { + if o != nil && !isNil(o.ErrorDetail) { + return true + } + + return false +} + +// SetErrorDetail gets a reference to the given string and assigns it to the ErrorDetail field. +func (o *InvokeRawWeb3EthContractV1Response) SetErrorDetail(v string) { + o.ErrorDetail = &v +} + +func (o InvokeRawWeb3EthContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRawWeb3EthContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + if o.Data != nil { + toSerialize["data"] = o.Data + } + if !isNil(o.ErrorDetail) { + toSerialize["errorDetail"] = o.ErrorDetail + } + return toSerialize, nil +} + +type NullableInvokeRawWeb3EthContractV1Response struct { + value *InvokeRawWeb3EthContractV1Response + isSet bool +} + +func (v NullableInvokeRawWeb3EthContractV1Response) Get() *InvokeRawWeb3EthContractV1Response { + return v.value +} + +func (v *NullableInvokeRawWeb3EthContractV1Response) Set(val *InvokeRawWeb3EthContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRawWeb3EthContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRawWeb3EthContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRawWeb3EthContractV1Response(val *InvokeRawWeb3EthContractV1Response) *NullableInvokeRawWeb3EthContractV1Response { + return &NullableInvokeRawWeb3EthContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeRawWeb3EthContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRawWeb3EthContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_request.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_request.go new file mode 100644 index 00000000000..81a92a2550c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_request.go @@ -0,0 +1,155 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the InvokeRawWeb3EthMethodV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRawWeb3EthMethodV1Request{} + +// InvokeRawWeb3EthMethodV1Request struct for InvokeRawWeb3EthMethodV1Request +type InvokeRawWeb3EthMethodV1Request struct { + // The name of the web3.eth method to invoke + MethodName string `json:"methodName"` + // The list of arguments to pass to web3.eth method specified in methodName + Params []interface{} `json:"params,omitempty"` +} + +// NewInvokeRawWeb3EthMethodV1Request instantiates a new InvokeRawWeb3EthMethodV1Request 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 +// will change when the set of required properties is changed +func NewInvokeRawWeb3EthMethodV1Request(methodName string) *InvokeRawWeb3EthMethodV1Request { + this := InvokeRawWeb3EthMethodV1Request{} + this.MethodName = methodName + return &this +} + +// NewInvokeRawWeb3EthMethodV1RequestWithDefaults instantiates a new InvokeRawWeb3EthMethodV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRawWeb3EthMethodV1RequestWithDefaults() *InvokeRawWeb3EthMethodV1Request { + this := InvokeRawWeb3EthMethodV1Request{} + return &this +} + +// GetMethodName returns the MethodName field value +func (o *InvokeRawWeb3EthMethodV1Request) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthMethodV1Request) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeRawWeb3EthMethodV1Request) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthMethodV1Request) GetParams() []interface{} { + if o == nil || isNil(o.Params) { + var ret []interface{} + return ret + } + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthMethodV1Request) GetParamsOk() ([]interface{}, bool) { + if o == nil || isNil(o.Params) { + return nil, false + } + return o.Params, true +} + +// HasParams returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthMethodV1Request) HasParams() bool { + if o != nil && !isNil(o.Params) { + return true + } + + return false +} + +// SetParams gets a reference to the given []interface{} and assigns it to the Params field. +func (o *InvokeRawWeb3EthMethodV1Request) SetParams(v []interface{}) { + o.Params = v +} + +func (o InvokeRawWeb3EthMethodV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRawWeb3EthMethodV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["methodName"] = o.MethodName + if !isNil(o.Params) { + toSerialize["params"] = o.Params + } + return toSerialize, nil +} + +type NullableInvokeRawWeb3EthMethodV1Request struct { + value *InvokeRawWeb3EthMethodV1Request + isSet bool +} + +func (v NullableInvokeRawWeb3EthMethodV1Request) Get() *InvokeRawWeb3EthMethodV1Request { + return v.value +} + +func (v *NullableInvokeRawWeb3EthMethodV1Request) Set(val *InvokeRawWeb3EthMethodV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRawWeb3EthMethodV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRawWeb3EthMethodV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRawWeb3EthMethodV1Request(val *InvokeRawWeb3EthMethodV1Request) *NullableInvokeRawWeb3EthMethodV1Request { + return &NullableInvokeRawWeb3EthMethodV1Request{value: val, isSet: true} +} + +func (v NullableInvokeRawWeb3EthMethodV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRawWeb3EthMethodV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_response.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_response.go new file mode 100644 index 00000000000..169f5a95ff9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_response.go @@ -0,0 +1,193 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the InvokeRawWeb3EthMethodV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRawWeb3EthMethodV1Response{} + +// InvokeRawWeb3EthMethodV1Response struct for InvokeRawWeb3EthMethodV1Response +type InvokeRawWeb3EthMethodV1Response struct { + // Status code of the operation + Status float32 `json:"status"` + // Output of requested web3.eth method + Data interface{} `json:"data,omitempty"` + // Error details + ErrorDetail *string `json:"errorDetail,omitempty"` +} + +// NewInvokeRawWeb3EthMethodV1Response instantiates a new InvokeRawWeb3EthMethodV1Response 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 +// will change when the set of required properties is changed +func NewInvokeRawWeb3EthMethodV1Response(status float32) *InvokeRawWeb3EthMethodV1Response { + this := InvokeRawWeb3EthMethodV1Response{} + this.Status = status + return &this +} + +// NewInvokeRawWeb3EthMethodV1ResponseWithDefaults instantiates a new InvokeRawWeb3EthMethodV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRawWeb3EthMethodV1ResponseWithDefaults() *InvokeRawWeb3EthMethodV1Response { + this := InvokeRawWeb3EthMethodV1Response{} + return &this +} + +// GetStatus returns the Status field value +func (o *InvokeRawWeb3EthMethodV1Response) GetStatus() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthMethodV1Response) GetStatusOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *InvokeRawWeb3EthMethodV1Response) SetStatus(v float32) { + o.Status = v +} + +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeRawWeb3EthMethodV1Response) GetData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeRawWeb3EthMethodV1Response) GetDataOk() (*interface{}, bool) { + if o == nil || isNil(o.Data) { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthMethodV1Response) HasData() bool { + if o != nil && isNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *InvokeRawWeb3EthMethodV1Response) SetData(v interface{}) { + o.Data = v +} + +// GetErrorDetail returns the ErrorDetail field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthMethodV1Response) GetErrorDetail() string { + if o == nil || isNil(o.ErrorDetail) { + var ret string + return ret + } + return *o.ErrorDetail +} + +// GetErrorDetailOk returns a tuple with the ErrorDetail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthMethodV1Response) GetErrorDetailOk() (*string, bool) { + if o == nil || isNil(o.ErrorDetail) { + return nil, false + } + return o.ErrorDetail, true +} + +// HasErrorDetail returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthMethodV1Response) HasErrorDetail() bool { + if o != nil && !isNil(o.ErrorDetail) { + return true + } + + return false +} + +// SetErrorDetail gets a reference to the given string and assigns it to the ErrorDetail field. +func (o *InvokeRawWeb3EthMethodV1Response) SetErrorDetail(v string) { + o.ErrorDetail = &v +} + +func (o InvokeRawWeb3EthMethodV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRawWeb3EthMethodV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + if o.Data != nil { + toSerialize["data"] = o.Data + } + if !isNil(o.ErrorDetail) { + toSerialize["errorDetail"] = o.ErrorDetail + } + return toSerialize, nil +} + +type NullableInvokeRawWeb3EthMethodV1Response struct { + value *InvokeRawWeb3EthMethodV1Response + isSet bool +} + +func (v NullableInvokeRawWeb3EthMethodV1Response) Get() *InvokeRawWeb3EthMethodV1Response { + return v.value +} + +func (v *NullableInvokeRawWeb3EthMethodV1Response) Set(val *InvokeRawWeb3EthMethodV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRawWeb3EthMethodV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRawWeb3EthMethodV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRawWeb3EthMethodV1Response(val *InvokeRawWeb3EthMethodV1Response) *NullableInvokeRawWeb3EthMethodV1Response { + return &NullableInvokeRawWeb3EthMethodV1Response{value: val, isSet: true} +} + +func (v NullableInvokeRawWeb3EthMethodV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRawWeb3EthMethodV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_run_transaction_request.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_run_transaction_request.go new file mode 100644 index 00000000000..8dd8ca80ff6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_run_transaction_request.go @@ -0,0 +1,185 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the RunTransactionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionRequest{} + +// RunTransactionRequest struct for RunTransactionRequest +type RunTransactionRequest struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + TransactionConfig EthereumTransactionConfig `json:"transactionConfig"` + // The amount of milliseconds to wait for a transaction receipt with thehash of the transaction(which indicates successful execution) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` +} + +// NewRunTransactionRequest instantiates a new RunTransactionRequest 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 +// will change when the set of required properties is changed +func NewRunTransactionRequest(web3SigningCredential Web3SigningCredential, transactionConfig EthereumTransactionConfig) *RunTransactionRequest { + this := RunTransactionRequest{} + this.Web3SigningCredential = web3SigningCredential + this.TransactionConfig = transactionConfig + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewRunTransactionRequestWithDefaults instantiates a new RunTransactionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionRequestWithDefaults() *RunTransactionRequest { + this := RunTransactionRequest{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *RunTransactionRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *RunTransactionRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetTransactionConfig returns the TransactionConfig field value +func (o *RunTransactionRequest) GetTransactionConfig() EthereumTransactionConfig { + if o == nil { + var ret EthereumTransactionConfig + return ret + } + + return o.TransactionConfig +} + +// GetTransactionConfigOk returns a tuple with the TransactionConfig field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetTransactionConfigOk() (*EthereumTransactionConfig, bool) { + if o == nil { + return nil, false + } + return &o.TransactionConfig, true +} + +// SetTransactionConfig sets field value +func (o *RunTransactionRequest) SetTransactionConfig(v EthereumTransactionConfig) { + o.TransactionConfig = v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *RunTransactionRequest) GetTimeoutMs() float32 { + if o == nil || isNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetTimeoutMsOk() (*float32, bool) { + if o == nil || isNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *RunTransactionRequest) HasTimeoutMs() bool { + if o != nil && !isNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *RunTransactionRequest) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +func (o RunTransactionRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["transactionConfig"] = o.TransactionConfig + if !isNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + return toSerialize, nil +} + +type NullableRunTransactionRequest struct { + value *RunTransactionRequest + isSet bool +} + +func (v NullableRunTransactionRequest) Get() *RunTransactionRequest { + return v.value +} + +func (v *NullableRunTransactionRequest) Set(val *RunTransactionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionRequest(val *RunTransactionRequest) *NullableRunTransactionRequest { + return &NullableRunTransactionRequest{value: val, isSet: true} +} + +func (v NullableRunTransactionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_run_transaction_response.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_run_transaction_response.go new file mode 100644 index 00000000000..06821651082 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_run_transaction_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the RunTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionResponse{} + +// RunTransactionResponse struct for RunTransactionResponse +type RunTransactionResponse struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewRunTransactionResponse instantiates a new RunTransactionResponse 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 +// will change when the set of required properties is changed +func NewRunTransactionResponse(transactionReceipt Web3TransactionReceipt) *RunTransactionResponse { + this := RunTransactionResponse{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewRunTransactionResponseWithDefaults instantiates a new RunTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionResponseWithDefaults() *RunTransactionResponse { + this := RunTransactionResponse{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *RunTransactionResponse) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *RunTransactionResponse) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *RunTransactionResponse) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o RunTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableRunTransactionResponse struct { + value *RunTransactionResponse + isSet bool +} + +func (v NullableRunTransactionResponse) Get() *RunTransactionResponse { + return v.value +} + +func (v *NullableRunTransactionResponse) Set(val *RunTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionResponse(val *RunTransactionResponse) *NullableRunTransactionResponse { + return &NullableRunTransactionResponse{value: val, isSet: true} +} + +func (v NullableRunTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go new file mode 100644 index 00000000000..745e34db603 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksV1 the model 'WatchBlocksV1' +type WatchBlocksV1 string + +// List of WatchBlocksV1 +const ( + Subscribe WatchBlocksV1 = "org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Subscribe" + Next WatchBlocksV1 = "org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Next" + Unsubscribe WatchBlocksV1 = "org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Unsubscribe" + Error WatchBlocksV1 = "org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Error" + Complete WatchBlocksV1 = "org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Complete" +) + +// All allowed values of WatchBlocksV1 enum +var AllowedWatchBlocksV1EnumValues = []WatchBlocksV1{ + "org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Subscribe", + "org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Next", + "org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Unsubscribe", + "org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Error", + "org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Complete", +} + +func (v *WatchBlocksV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchBlocksV1(value) + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchBlocksV1", value) +} + +// NewWatchBlocksV1FromValue returns a pointer to a valid WatchBlocksV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchBlocksV1FromValue(v string) (*WatchBlocksV1, error) { + ev := WatchBlocksV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchBlocksV1: valid values are %v", v, AllowedWatchBlocksV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchBlocksV1) IsValid() bool { + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchBlocksV1 value +func (v WatchBlocksV1) Ptr() *WatchBlocksV1 { + return &v +} + +type NullableWatchBlocksV1 struct { + value *WatchBlocksV1 + isSet bool +} + +func (v NullableWatchBlocksV1) Get() *WatchBlocksV1 { + return v.value +} + +func (v *NullableWatchBlocksV1) Set(val *WatchBlocksV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1(val *WatchBlocksV1) *NullableWatchBlocksV1 { + return &NullableWatchBlocksV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data.go new file mode 100644 index 00000000000..99ab10f9f28 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data.go @@ -0,0 +1,720 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1BlockData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1BlockData{} + +// WatchBlocksV1BlockData struct for WatchBlocksV1BlockData +type WatchBlocksV1BlockData struct { + Number string `json:"number"` + Hash *string `json:"hash,omitempty"` + ParentHash string `json:"parentHash"` + Nonce string `json:"nonce"` + Sha3Uncles string `json:"sha3Uncles"` + LogsBloom *string `json:"logsBloom,omitempty"` + TransactionsRoot *string `json:"transactionsRoot,omitempty"` + StateRoot string `json:"stateRoot"` + ReceiptsRoot *string `json:"receiptsRoot,omitempty"` + Difficulty *string `json:"difficulty,omitempty"` + MixHash *string `json:"mixHash,omitempty"` + Miner string `json:"miner"` + ExtraData string `json:"extraData"` + GasLimit string `json:"gasLimit"` + GasUsed string `json:"gasUsed"` + Timestamp WatchBlocksV1BlockDataTimestamp `json:"timestamp"` + Size string `json:"size"` + TotalDifficulty string `json:"totalDifficulty"` + Uncles []string `json:"uncles"` + BaseFeePerGas *string `json:"baseFeePerGas,omitempty"` + Transactions []Web3Transaction `json:"transactions"` +} + +// NewWatchBlocksV1BlockData instantiates a new WatchBlocksV1BlockData 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 +// will change when the set of required properties is changed +func NewWatchBlocksV1BlockData(number string, parentHash string, nonce string, sha3Uncles string, stateRoot string, miner string, extraData string, gasLimit string, gasUsed string, timestamp WatchBlocksV1BlockDataTimestamp, size string, totalDifficulty string, uncles []string, transactions []Web3Transaction) *WatchBlocksV1BlockData { + this := WatchBlocksV1BlockData{} + this.Number = number + this.ParentHash = parentHash + this.Nonce = nonce + this.Sha3Uncles = sha3Uncles + this.StateRoot = stateRoot + this.Miner = miner + this.ExtraData = extraData + this.GasLimit = gasLimit + this.GasUsed = gasUsed + this.Timestamp = timestamp + this.Size = size + this.TotalDifficulty = totalDifficulty + this.Uncles = uncles + this.Transactions = transactions + return &this +} + +// NewWatchBlocksV1BlockDataWithDefaults instantiates a new WatchBlocksV1BlockData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1BlockDataWithDefaults() *WatchBlocksV1BlockData { + this := WatchBlocksV1BlockData{} + return &this +} + +// GetNumber returns the Number field value +func (o *WatchBlocksV1BlockData) GetNumber() string { + if o == nil { + var ret string + return ret + } + + return o.Number +} + +// GetNumberOk returns a tuple with the Number field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Number, true +} + +// SetNumber sets field value +func (o *WatchBlocksV1BlockData) SetNumber(v string) { + o.Number = v +} + +// GetHash returns the Hash field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetHash() string { + if o == nil || isNil(o.Hash) { + var ret string + return ret + } + return *o.Hash +} + +// GetHashOk returns a tuple with the Hash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetHashOk() (*string, bool) { + if o == nil || isNil(o.Hash) { + return nil, false + } + return o.Hash, true +} + +// HasHash returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasHash() bool { + if o != nil && !isNil(o.Hash) { + return true + } + + return false +} + +// SetHash gets a reference to the given string and assigns it to the Hash field. +func (o *WatchBlocksV1BlockData) SetHash(v string) { + o.Hash = &v +} + +// GetParentHash returns the ParentHash field value +func (o *WatchBlocksV1BlockData) GetParentHash() string { + if o == nil { + var ret string + return ret + } + + return o.ParentHash +} + +// GetParentHashOk returns a tuple with the ParentHash field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetParentHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ParentHash, true +} + +// SetParentHash sets field value +func (o *WatchBlocksV1BlockData) SetParentHash(v string) { + o.ParentHash = v +} + +// GetNonce returns the Nonce field value +func (o *WatchBlocksV1BlockData) GetNonce() string { + if o == nil { + var ret string + return ret + } + + return o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetNonceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Nonce, true +} + +// SetNonce sets field value +func (o *WatchBlocksV1BlockData) SetNonce(v string) { + o.Nonce = v +} + +// GetSha3Uncles returns the Sha3Uncles field value +func (o *WatchBlocksV1BlockData) GetSha3Uncles() string { + if o == nil { + var ret string + return ret + } + + return o.Sha3Uncles +} + +// GetSha3UnclesOk returns a tuple with the Sha3Uncles field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetSha3UnclesOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Sha3Uncles, true +} + +// SetSha3Uncles sets field value +func (o *WatchBlocksV1BlockData) SetSha3Uncles(v string) { + o.Sha3Uncles = v +} + +// GetLogsBloom returns the LogsBloom field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetLogsBloom() string { + if o == nil || isNil(o.LogsBloom) { + var ret string + return ret + } + return *o.LogsBloom +} + +// GetLogsBloomOk returns a tuple with the LogsBloom field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetLogsBloomOk() (*string, bool) { + if o == nil || isNil(o.LogsBloom) { + return nil, false + } + return o.LogsBloom, true +} + +// HasLogsBloom returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasLogsBloom() bool { + if o != nil && !isNil(o.LogsBloom) { + return true + } + + return false +} + +// SetLogsBloom gets a reference to the given string and assigns it to the LogsBloom field. +func (o *WatchBlocksV1BlockData) SetLogsBloom(v string) { + o.LogsBloom = &v +} + +// GetTransactionsRoot returns the TransactionsRoot field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetTransactionsRoot() string { + if o == nil || isNil(o.TransactionsRoot) { + var ret string + return ret + } + return *o.TransactionsRoot +} + +// GetTransactionsRootOk returns a tuple with the TransactionsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetTransactionsRootOk() (*string, bool) { + if o == nil || isNil(o.TransactionsRoot) { + return nil, false + } + return o.TransactionsRoot, true +} + +// HasTransactionsRoot returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasTransactionsRoot() bool { + if o != nil && !isNil(o.TransactionsRoot) { + return true + } + + return false +} + +// SetTransactionsRoot gets a reference to the given string and assigns it to the TransactionsRoot field. +func (o *WatchBlocksV1BlockData) SetTransactionsRoot(v string) { + o.TransactionsRoot = &v +} + +// GetStateRoot returns the StateRoot field value +func (o *WatchBlocksV1BlockData) GetStateRoot() string { + if o == nil { + var ret string + return ret + } + + return o.StateRoot +} + +// GetStateRootOk returns a tuple with the StateRoot field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetStateRootOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateRoot, true +} + +// SetStateRoot sets field value +func (o *WatchBlocksV1BlockData) SetStateRoot(v string) { + o.StateRoot = v +} + +// GetReceiptsRoot returns the ReceiptsRoot field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetReceiptsRoot() string { + if o == nil || isNil(o.ReceiptsRoot) { + var ret string + return ret + } + return *o.ReceiptsRoot +} + +// GetReceiptsRootOk returns a tuple with the ReceiptsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetReceiptsRootOk() (*string, bool) { + if o == nil || isNil(o.ReceiptsRoot) { + return nil, false + } + return o.ReceiptsRoot, true +} + +// HasReceiptsRoot returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasReceiptsRoot() bool { + if o != nil && !isNil(o.ReceiptsRoot) { + return true + } + + return false +} + +// SetReceiptsRoot gets a reference to the given string and assigns it to the ReceiptsRoot field. +func (o *WatchBlocksV1BlockData) SetReceiptsRoot(v string) { + o.ReceiptsRoot = &v +} + +// GetDifficulty returns the Difficulty field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetDifficulty() string { + if o == nil || isNil(o.Difficulty) { + var ret string + return ret + } + return *o.Difficulty +} + +// GetDifficultyOk returns a tuple with the Difficulty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetDifficultyOk() (*string, bool) { + if o == nil || isNil(o.Difficulty) { + return nil, false + } + return o.Difficulty, true +} + +// HasDifficulty returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasDifficulty() bool { + if o != nil && !isNil(o.Difficulty) { + return true + } + + return false +} + +// SetDifficulty gets a reference to the given string and assigns it to the Difficulty field. +func (o *WatchBlocksV1BlockData) SetDifficulty(v string) { + o.Difficulty = &v +} + +// GetMixHash returns the MixHash field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetMixHash() string { + if o == nil || isNil(o.MixHash) { + var ret string + return ret + } + return *o.MixHash +} + +// GetMixHashOk returns a tuple with the MixHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetMixHashOk() (*string, bool) { + if o == nil || isNil(o.MixHash) { + return nil, false + } + return o.MixHash, true +} + +// HasMixHash returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasMixHash() bool { + if o != nil && !isNil(o.MixHash) { + return true + } + + return false +} + +// SetMixHash gets a reference to the given string and assigns it to the MixHash field. +func (o *WatchBlocksV1BlockData) SetMixHash(v string) { + o.MixHash = &v +} + +// GetMiner returns the Miner field value +func (o *WatchBlocksV1BlockData) GetMiner() string { + if o == nil { + var ret string + return ret + } + + return o.Miner +} + +// GetMinerOk returns a tuple with the Miner field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetMinerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Miner, true +} + +// SetMiner sets field value +func (o *WatchBlocksV1BlockData) SetMiner(v string) { + o.Miner = v +} + +// GetExtraData returns the ExtraData field value +func (o *WatchBlocksV1BlockData) GetExtraData() string { + if o == nil { + var ret string + return ret + } + + return o.ExtraData +} + +// GetExtraDataOk returns a tuple with the ExtraData field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetExtraDataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExtraData, true +} + +// SetExtraData sets field value +func (o *WatchBlocksV1BlockData) SetExtraData(v string) { + o.ExtraData = v +} + +// GetGasLimit returns the GasLimit field value +func (o *WatchBlocksV1BlockData) GetGasLimit() string { + if o == nil { + var ret string + return ret + } + + return o.GasLimit +} + +// GetGasLimitOk returns a tuple with the GasLimit field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetGasLimitOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GasLimit, true +} + +// SetGasLimit sets field value +func (o *WatchBlocksV1BlockData) SetGasLimit(v string) { + o.GasLimit = v +} + +// GetGasUsed returns the GasUsed field value +func (o *WatchBlocksV1BlockData) GetGasUsed() string { + if o == nil { + var ret string + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetGasUsedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *WatchBlocksV1BlockData) SetGasUsed(v string) { + o.GasUsed = v +} + +// GetTimestamp returns the Timestamp field value +func (o *WatchBlocksV1BlockData) GetTimestamp() WatchBlocksV1BlockDataTimestamp { + if o == nil { + var ret WatchBlocksV1BlockDataTimestamp + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetTimestampOk() (*WatchBlocksV1BlockDataTimestamp, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *WatchBlocksV1BlockData) SetTimestamp(v WatchBlocksV1BlockDataTimestamp) { + o.Timestamp = v +} + +// GetSize returns the Size field value +func (o *WatchBlocksV1BlockData) GetSize() string { + if o == nil { + var ret string + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetSizeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *WatchBlocksV1BlockData) SetSize(v string) { + o.Size = v +} + +// GetTotalDifficulty returns the TotalDifficulty field value +func (o *WatchBlocksV1BlockData) GetTotalDifficulty() string { + if o == nil { + var ret string + return ret + } + + return o.TotalDifficulty +} + +// GetTotalDifficultyOk returns a tuple with the TotalDifficulty field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetTotalDifficultyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TotalDifficulty, true +} + +// SetTotalDifficulty sets field value +func (o *WatchBlocksV1BlockData) SetTotalDifficulty(v string) { + o.TotalDifficulty = v +} + +// GetUncles returns the Uncles field value +func (o *WatchBlocksV1BlockData) GetUncles() []string { + if o == nil { + var ret []string + return ret + } + + return o.Uncles +} + +// GetUnclesOk returns a tuple with the Uncles field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetUnclesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Uncles, true +} + +// SetUncles sets field value +func (o *WatchBlocksV1BlockData) SetUncles(v []string) { + o.Uncles = v +} + +// GetBaseFeePerGas returns the BaseFeePerGas field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetBaseFeePerGas() string { + if o == nil || isNil(o.BaseFeePerGas) { + var ret string + return ret + } + return *o.BaseFeePerGas +} + +// GetBaseFeePerGasOk returns a tuple with the BaseFeePerGas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetBaseFeePerGasOk() (*string, bool) { + if o == nil || isNil(o.BaseFeePerGas) { + return nil, false + } + return o.BaseFeePerGas, true +} + +// HasBaseFeePerGas returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasBaseFeePerGas() bool { + if o != nil && !isNil(o.BaseFeePerGas) { + return true + } + + return false +} + +// SetBaseFeePerGas gets a reference to the given string and assigns it to the BaseFeePerGas field. +func (o *WatchBlocksV1BlockData) SetBaseFeePerGas(v string) { + o.BaseFeePerGas = &v +} + +// GetTransactions returns the Transactions field value +func (o *WatchBlocksV1BlockData) GetTransactions() []Web3Transaction { + if o == nil { + var ret []Web3Transaction + return ret + } + + return o.Transactions +} + +// GetTransactionsOk returns a tuple with the Transactions field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetTransactionsOk() ([]Web3Transaction, bool) { + if o == nil { + return nil, false + } + return o.Transactions, true +} + +// SetTransactions sets field value +func (o *WatchBlocksV1BlockData) SetTransactions(v []Web3Transaction) { + o.Transactions = v +} + +func (o WatchBlocksV1BlockData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1BlockData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["number"] = o.Number + if !isNil(o.Hash) { + toSerialize["hash"] = o.Hash + } + toSerialize["parentHash"] = o.ParentHash + toSerialize["nonce"] = o.Nonce + toSerialize["sha3Uncles"] = o.Sha3Uncles + if !isNil(o.LogsBloom) { + toSerialize["logsBloom"] = o.LogsBloom + } + if !isNil(o.TransactionsRoot) { + toSerialize["transactionsRoot"] = o.TransactionsRoot + } + toSerialize["stateRoot"] = o.StateRoot + if !isNil(o.ReceiptsRoot) { + toSerialize["receiptsRoot"] = o.ReceiptsRoot + } + if !isNil(o.Difficulty) { + toSerialize["difficulty"] = o.Difficulty + } + if !isNil(o.MixHash) { + toSerialize["mixHash"] = o.MixHash + } + toSerialize["miner"] = o.Miner + toSerialize["extraData"] = o.ExtraData + toSerialize["gasLimit"] = o.GasLimit + toSerialize["gasUsed"] = o.GasUsed + toSerialize["timestamp"] = o.Timestamp + toSerialize["size"] = o.Size + toSerialize["totalDifficulty"] = o.TotalDifficulty + toSerialize["uncles"] = o.Uncles + if !isNil(o.BaseFeePerGas) { + toSerialize["baseFeePerGas"] = o.BaseFeePerGas + } + toSerialize["transactions"] = o.Transactions + return toSerialize, nil +} + +type NullableWatchBlocksV1BlockData struct { + value *WatchBlocksV1BlockData + isSet bool +} + +func (v NullableWatchBlocksV1BlockData) Get() *WatchBlocksV1BlockData { + return v.value +} + +func (v *NullableWatchBlocksV1BlockData) Set(val *WatchBlocksV1BlockData) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1BlockData) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1BlockData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1BlockData(val *WatchBlocksV1BlockData) *NullableWatchBlocksV1BlockData { + return &NullableWatchBlocksV1BlockData{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1BlockData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1BlockData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data_timestamp.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data_timestamp.go new file mode 100644 index 00000000000..3765b836a8b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data_timestamp.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksV1BlockDataTimestamp - struct for WatchBlocksV1BlockDataTimestamp +type WatchBlocksV1BlockDataTimestamp struct { + Float32 *float32 + String *string +} + +// float32AsWatchBlocksV1BlockDataTimestamp is a convenience function that returns float32 wrapped in WatchBlocksV1BlockDataTimestamp +func Float32AsWatchBlocksV1BlockDataTimestamp(v *float32) WatchBlocksV1BlockDataTimestamp { + return WatchBlocksV1BlockDataTimestamp{ + Float32: v, + } +} + +// stringAsWatchBlocksV1BlockDataTimestamp is a convenience function that returns string wrapped in WatchBlocksV1BlockDataTimestamp +func StringAsWatchBlocksV1BlockDataTimestamp(v *string) WatchBlocksV1BlockDataTimestamp { + return WatchBlocksV1BlockDataTimestamp{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *WatchBlocksV1BlockDataTimestamp) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Float32 + err = newStrictDecoder(data).Decode(&dst.Float32) + if err == nil { + jsonFloat32, _ := json.Marshal(dst.Float32) + if string(jsonFloat32) == "{}" { // empty struct + dst.Float32 = nil + } else { + match++ + } + } else { + dst.Float32 = nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Float32 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(WatchBlocksV1BlockDataTimestamp)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(WatchBlocksV1BlockDataTimestamp)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src WatchBlocksV1BlockDataTimestamp) MarshalJSON() ([]byte, error) { + if src.Float32 != nil { + return json.Marshal(&src.Float32) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *WatchBlocksV1BlockDataTimestamp) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Float32 != nil { + return obj.Float32 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableWatchBlocksV1BlockDataTimestamp struct { + value *WatchBlocksV1BlockDataTimestamp + isSet bool +} + +func (v NullableWatchBlocksV1BlockDataTimestamp) Get() *WatchBlocksV1BlockDataTimestamp { + return v.value +} + +func (v *NullableWatchBlocksV1BlockDataTimestamp) Set(val *WatchBlocksV1BlockDataTimestamp) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1BlockDataTimestamp) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1BlockDataTimestamp) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1BlockDataTimestamp(val *WatchBlocksV1BlockDataTimestamp) *NullableWatchBlocksV1BlockDataTimestamp { + return &NullableWatchBlocksV1BlockDataTimestamp{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1BlockDataTimestamp) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1BlockDataTimestamp) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go new file mode 100644 index 00000000000..db6d8e23d68 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go @@ -0,0 +1,126 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1Options type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1Options{} + +// WatchBlocksV1Options struct for WatchBlocksV1Options +type WatchBlocksV1Options struct { + GetBlockData *bool `json:"getBlockData,omitempty"` +} + +// NewWatchBlocksV1Options instantiates a new WatchBlocksV1Options 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 +// will change when the set of required properties is changed +func NewWatchBlocksV1Options() *WatchBlocksV1Options { + this := WatchBlocksV1Options{} + return &this +} + +// NewWatchBlocksV1OptionsWithDefaults instantiates a new WatchBlocksV1Options object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1OptionsWithDefaults() *WatchBlocksV1Options { + this := WatchBlocksV1Options{} + return &this +} + +// GetGetBlockData returns the GetBlockData field value if set, zero value otherwise. +func (o *WatchBlocksV1Options) GetGetBlockData() bool { + if o == nil || isNil(o.GetBlockData) { + var ret bool + return ret + } + return *o.GetBlockData +} + +// GetGetBlockDataOk returns a tuple with the GetBlockData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Options) GetGetBlockDataOk() (*bool, bool) { + if o == nil || isNil(o.GetBlockData) { + return nil, false + } + return o.GetBlockData, true +} + +// HasGetBlockData returns a boolean if a field has been set. +func (o *WatchBlocksV1Options) HasGetBlockData() bool { + if o != nil && !isNil(o.GetBlockData) { + return true + } + + return false +} + +// SetGetBlockData gets a reference to the given bool and assigns it to the GetBlockData field. +func (o *WatchBlocksV1Options) SetGetBlockData(v bool) { + o.GetBlockData = &v +} + +func (o WatchBlocksV1Options) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1Options) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.GetBlockData) { + toSerialize["getBlockData"] = o.GetBlockData + } + return toSerialize, nil +} + +type NullableWatchBlocksV1Options struct { + value *WatchBlocksV1Options + isSet bool +} + +func (v NullableWatchBlocksV1Options) Get() *WatchBlocksV1Options { + return v.value +} + +func (v *NullableWatchBlocksV1Options) Set(val *WatchBlocksV1Options) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1Options) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1Options) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1Options(val *WatchBlocksV1Options) *NullableWatchBlocksV1Options { + return &NullableWatchBlocksV1Options{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1Options) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1Options) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go new file mode 100644 index 00000000000..27cc31c73e7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1Progress type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1Progress{} + +// WatchBlocksV1Progress struct for WatchBlocksV1Progress +type WatchBlocksV1Progress struct { + BlockHeader *Web3BlockHeader `json:"blockHeader,omitempty"` + BlockData *WatchBlocksV1BlockData `json:"blockData,omitempty"` +} + +// NewWatchBlocksV1Progress instantiates a new WatchBlocksV1Progress 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 +// will change when the set of required properties is changed +func NewWatchBlocksV1Progress() *WatchBlocksV1Progress { + this := WatchBlocksV1Progress{} + return &this +} + +// NewWatchBlocksV1ProgressWithDefaults instantiates a new WatchBlocksV1Progress object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1ProgressWithDefaults() *WatchBlocksV1Progress { + this := WatchBlocksV1Progress{} + return &this +} + +// GetBlockHeader returns the BlockHeader field value if set, zero value otherwise. +func (o *WatchBlocksV1Progress) GetBlockHeader() Web3BlockHeader { + if o == nil || isNil(o.BlockHeader) { + var ret Web3BlockHeader + return ret + } + return *o.BlockHeader +} + +// GetBlockHeaderOk returns a tuple with the BlockHeader field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Progress) GetBlockHeaderOk() (*Web3BlockHeader, bool) { + if o == nil || isNil(o.BlockHeader) { + return nil, false + } + return o.BlockHeader, true +} + +// HasBlockHeader returns a boolean if a field has been set. +func (o *WatchBlocksV1Progress) HasBlockHeader() bool { + if o != nil && !isNil(o.BlockHeader) { + return true + } + + return false +} + +// SetBlockHeader gets a reference to the given Web3BlockHeader and assigns it to the BlockHeader field. +func (o *WatchBlocksV1Progress) SetBlockHeader(v Web3BlockHeader) { + o.BlockHeader = &v +} + +// GetBlockData returns the BlockData field value if set, zero value otherwise. +func (o *WatchBlocksV1Progress) GetBlockData() WatchBlocksV1BlockData { + if o == nil || isNil(o.BlockData) { + var ret WatchBlocksV1BlockData + return ret + } + return *o.BlockData +} + +// GetBlockDataOk returns a tuple with the BlockData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Progress) GetBlockDataOk() (*WatchBlocksV1BlockData, bool) { + if o == nil || isNil(o.BlockData) { + return nil, false + } + return o.BlockData, true +} + +// HasBlockData returns a boolean if a field has been set. +func (o *WatchBlocksV1Progress) HasBlockData() bool { + if o != nil && !isNil(o.BlockData) { + return true + } + + return false +} + +// SetBlockData gets a reference to the given WatchBlocksV1BlockData and assigns it to the BlockData field. +func (o *WatchBlocksV1Progress) SetBlockData(v WatchBlocksV1BlockData) { + o.BlockData = &v +} + +func (o WatchBlocksV1Progress) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1Progress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.BlockHeader) { + toSerialize["blockHeader"] = o.BlockHeader + } + if !isNil(o.BlockData) { + toSerialize["blockData"] = o.BlockData + } + return toSerialize, nil +} + +type NullableWatchBlocksV1Progress struct { + value *WatchBlocksV1Progress + isSet bool +} + +func (v NullableWatchBlocksV1Progress) Get() *WatchBlocksV1Progress { + return v.value +} + +func (v *NullableWatchBlocksV1Progress) Set(val *WatchBlocksV1Progress) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1Progress) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1Progress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1Progress(val *WatchBlocksV1Progress) *NullableWatchBlocksV1Progress { + return &NullableWatchBlocksV1Progress{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1Progress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1Progress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_block_header.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_block_header.go new file mode 100644 index 00000000000..6d43870f2d4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_block_header.go @@ -0,0 +1,603 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the Web3BlockHeader type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3BlockHeader{} + +// Web3BlockHeader struct for Web3BlockHeader +type Web3BlockHeader struct { + Number *string `json:"number,omitempty"` + ParentHash *string `json:"parentHash,omitempty"` + Sha3Uncles string `json:"sha3Uncles"` + TransactionsRoot *string `json:"transactionsRoot,omitempty"` + ReceiptsRoot *string `json:"receiptsRoot,omitempty"` + Difficulty *string `json:"difficulty,omitempty"` + MixHash *string `json:"mixHash,omitempty"` + Miner *string `json:"miner,omitempty"` + GasLimit string `json:"gasLimit"` + GasUsed string `json:"gasUsed"` + StateRoot *string `json:"stateRoot,omitempty"` + LogsBloom *string `json:"logsBloom,omitempty"` + ExtraData *string `json:"extraData,omitempty"` + Nonce *string `json:"nonce,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +// NewWeb3BlockHeader instantiates a new Web3BlockHeader 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 +// will change when the set of required properties is changed +func NewWeb3BlockHeader(sha3Uncles string, gasLimit string, gasUsed string) *Web3BlockHeader { + this := Web3BlockHeader{} + this.Sha3Uncles = sha3Uncles + this.GasLimit = gasLimit + this.GasUsed = gasUsed + return &this +} + +// NewWeb3BlockHeaderWithDefaults instantiates a new Web3BlockHeader object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3BlockHeaderWithDefaults() *Web3BlockHeader { + this := Web3BlockHeader{} + return &this +} + +// GetNumber returns the Number field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetNumber() string { + if o == nil || isNil(o.Number) { + var ret string + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetNumberOk() (*string, bool) { + if o == nil || isNil(o.Number) { + return nil, false + } + return o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasNumber() bool { + if o != nil && !isNil(o.Number) { + return true + } + + return false +} + +// SetNumber gets a reference to the given string and assigns it to the Number field. +func (o *Web3BlockHeader) SetNumber(v string) { + o.Number = &v +} + +// GetParentHash returns the ParentHash field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetParentHash() string { + if o == nil || isNil(o.ParentHash) { + var ret string + return ret + } + return *o.ParentHash +} + +// GetParentHashOk returns a tuple with the ParentHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetParentHashOk() (*string, bool) { + if o == nil || isNil(o.ParentHash) { + return nil, false + } + return o.ParentHash, true +} + +// HasParentHash returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasParentHash() bool { + if o != nil && !isNil(o.ParentHash) { + return true + } + + return false +} + +// SetParentHash gets a reference to the given string and assigns it to the ParentHash field. +func (o *Web3BlockHeader) SetParentHash(v string) { + o.ParentHash = &v +} + +// GetSha3Uncles returns the Sha3Uncles field value +func (o *Web3BlockHeader) GetSha3Uncles() string { + if o == nil { + var ret string + return ret + } + + return o.Sha3Uncles +} + +// GetSha3UnclesOk returns a tuple with the Sha3Uncles field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetSha3UnclesOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Sha3Uncles, true +} + +// SetSha3Uncles sets field value +func (o *Web3BlockHeader) SetSha3Uncles(v string) { + o.Sha3Uncles = v +} + +// GetTransactionsRoot returns the TransactionsRoot field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetTransactionsRoot() string { + if o == nil || isNil(o.TransactionsRoot) { + var ret string + return ret + } + return *o.TransactionsRoot +} + +// GetTransactionsRootOk returns a tuple with the TransactionsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetTransactionsRootOk() (*string, bool) { + if o == nil || isNil(o.TransactionsRoot) { + return nil, false + } + return o.TransactionsRoot, true +} + +// HasTransactionsRoot returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasTransactionsRoot() bool { + if o != nil && !isNil(o.TransactionsRoot) { + return true + } + + return false +} + +// SetTransactionsRoot gets a reference to the given string and assigns it to the TransactionsRoot field. +func (o *Web3BlockHeader) SetTransactionsRoot(v string) { + o.TransactionsRoot = &v +} + +// GetReceiptsRoot returns the ReceiptsRoot field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetReceiptsRoot() string { + if o == nil || isNil(o.ReceiptsRoot) { + var ret string + return ret + } + return *o.ReceiptsRoot +} + +// GetReceiptsRootOk returns a tuple with the ReceiptsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetReceiptsRootOk() (*string, bool) { + if o == nil || isNil(o.ReceiptsRoot) { + return nil, false + } + return o.ReceiptsRoot, true +} + +// HasReceiptsRoot returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasReceiptsRoot() bool { + if o != nil && !isNil(o.ReceiptsRoot) { + return true + } + + return false +} + +// SetReceiptsRoot gets a reference to the given string and assigns it to the ReceiptsRoot field. +func (o *Web3BlockHeader) SetReceiptsRoot(v string) { + o.ReceiptsRoot = &v +} + +// GetDifficulty returns the Difficulty field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetDifficulty() string { + if o == nil || isNil(o.Difficulty) { + var ret string + return ret + } + return *o.Difficulty +} + +// GetDifficultyOk returns a tuple with the Difficulty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetDifficultyOk() (*string, bool) { + if o == nil || isNil(o.Difficulty) { + return nil, false + } + return o.Difficulty, true +} + +// HasDifficulty returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasDifficulty() bool { + if o != nil && !isNil(o.Difficulty) { + return true + } + + return false +} + +// SetDifficulty gets a reference to the given string and assigns it to the Difficulty field. +func (o *Web3BlockHeader) SetDifficulty(v string) { + o.Difficulty = &v +} + +// GetMixHash returns the MixHash field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetMixHash() string { + if o == nil || isNil(o.MixHash) { + var ret string + return ret + } + return *o.MixHash +} + +// GetMixHashOk returns a tuple with the MixHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetMixHashOk() (*string, bool) { + if o == nil || isNil(o.MixHash) { + return nil, false + } + return o.MixHash, true +} + +// HasMixHash returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasMixHash() bool { + if o != nil && !isNil(o.MixHash) { + return true + } + + return false +} + +// SetMixHash gets a reference to the given string and assigns it to the MixHash field. +func (o *Web3BlockHeader) SetMixHash(v string) { + o.MixHash = &v +} + +// GetMiner returns the Miner field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetMiner() string { + if o == nil || isNil(o.Miner) { + var ret string + return ret + } + return *o.Miner +} + +// GetMinerOk returns a tuple with the Miner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetMinerOk() (*string, bool) { + if o == nil || isNil(o.Miner) { + return nil, false + } + return o.Miner, true +} + +// HasMiner returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasMiner() bool { + if o != nil && !isNil(o.Miner) { + return true + } + + return false +} + +// SetMiner gets a reference to the given string and assigns it to the Miner field. +func (o *Web3BlockHeader) SetMiner(v string) { + o.Miner = &v +} + +// GetGasLimit returns the GasLimit field value +func (o *Web3BlockHeader) GetGasLimit() string { + if o == nil { + var ret string + return ret + } + + return o.GasLimit +} + +// GetGasLimitOk returns a tuple with the GasLimit field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetGasLimitOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GasLimit, true +} + +// SetGasLimit sets field value +func (o *Web3BlockHeader) SetGasLimit(v string) { + o.GasLimit = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3BlockHeader) GetGasUsed() string { + if o == nil { + var ret string + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetGasUsedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3BlockHeader) SetGasUsed(v string) { + o.GasUsed = v +} + +// GetStateRoot returns the StateRoot field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetStateRoot() string { + if o == nil || isNil(o.StateRoot) { + var ret string + return ret + } + return *o.StateRoot +} + +// GetStateRootOk returns a tuple with the StateRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetStateRootOk() (*string, bool) { + if o == nil || isNil(o.StateRoot) { + return nil, false + } + return o.StateRoot, true +} + +// HasStateRoot returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasStateRoot() bool { + if o != nil && !isNil(o.StateRoot) { + return true + } + + return false +} + +// SetStateRoot gets a reference to the given string and assigns it to the StateRoot field. +func (o *Web3BlockHeader) SetStateRoot(v string) { + o.StateRoot = &v +} + +// GetLogsBloom returns the LogsBloom field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetLogsBloom() string { + if o == nil || isNil(o.LogsBloom) { + var ret string + return ret + } + return *o.LogsBloom +} + +// GetLogsBloomOk returns a tuple with the LogsBloom field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetLogsBloomOk() (*string, bool) { + if o == nil || isNil(o.LogsBloom) { + return nil, false + } + return o.LogsBloom, true +} + +// HasLogsBloom returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasLogsBloom() bool { + if o != nil && !isNil(o.LogsBloom) { + return true + } + + return false +} + +// SetLogsBloom gets a reference to the given string and assigns it to the LogsBloom field. +func (o *Web3BlockHeader) SetLogsBloom(v string) { + o.LogsBloom = &v +} + +// GetExtraData returns the ExtraData field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetExtraData() string { + if o == nil || isNil(o.ExtraData) { + var ret string + return ret + } + return *o.ExtraData +} + +// GetExtraDataOk returns a tuple with the ExtraData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetExtraDataOk() (*string, bool) { + if o == nil || isNil(o.ExtraData) { + return nil, false + } + return o.ExtraData, true +} + +// HasExtraData returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasExtraData() bool { + if o != nil && !isNil(o.ExtraData) { + return true + } + + return false +} + +// SetExtraData gets a reference to the given string and assigns it to the ExtraData field. +func (o *Web3BlockHeader) SetExtraData(v string) { + o.ExtraData = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetNonce() string { + if o == nil || isNil(o.Nonce) { + var ret string + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetNonceOk() (*string, bool) { + if o == nil || isNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasNonce() bool { + if o != nil && !isNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given string and assigns it to the Nonce field. +func (o *Web3BlockHeader) SetNonce(v string) { + o.Nonce = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetTimestamp() string { + if o == nil || isNil(o.Timestamp) { + var ret string + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetTimestampOk() (*string, bool) { + if o == nil || isNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasTimestamp() bool { + if o != nil && !isNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. +func (o *Web3BlockHeader) SetTimestamp(v string) { + o.Timestamp = &v +} + +func (o Web3BlockHeader) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3BlockHeader) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Number) { + toSerialize["number"] = o.Number + } + if !isNil(o.ParentHash) { + toSerialize["parentHash"] = o.ParentHash + } + toSerialize["sha3Uncles"] = o.Sha3Uncles + if !isNil(o.TransactionsRoot) { + toSerialize["transactionsRoot"] = o.TransactionsRoot + } + if !isNil(o.ReceiptsRoot) { + toSerialize["receiptsRoot"] = o.ReceiptsRoot + } + if !isNil(o.Difficulty) { + toSerialize["difficulty"] = o.Difficulty + } + if !isNil(o.MixHash) { + toSerialize["mixHash"] = o.MixHash + } + if !isNil(o.Miner) { + toSerialize["miner"] = o.Miner + } + toSerialize["gasLimit"] = o.GasLimit + toSerialize["gasUsed"] = o.GasUsed + if !isNil(o.StateRoot) { + toSerialize["stateRoot"] = o.StateRoot + } + if !isNil(o.LogsBloom) { + toSerialize["logsBloom"] = o.LogsBloom + } + if !isNil(o.ExtraData) { + toSerialize["extraData"] = o.ExtraData + } + if !isNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !isNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return toSerialize, nil +} + +type NullableWeb3BlockHeader struct { + value *Web3BlockHeader + isSet bool +} + +func (v NullableWeb3BlockHeader) Get() *Web3BlockHeader { + return v.value +} + +func (v *NullableWeb3BlockHeader) Set(val *Web3BlockHeader) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3BlockHeader) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3BlockHeader) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3BlockHeader(val *Web3BlockHeader) *NullableWeb3BlockHeader { + return &NullableWeb3BlockHeader{value: val, isSet: true} +} + +func (v NullableWeb3BlockHeader) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3BlockHeader) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go new file mode 100644 index 00000000000..e48c3f29af8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go @@ -0,0 +1,208 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredential - struct for Web3SigningCredential +type Web3SigningCredential struct { + Web3SigningCredentialCactiKeychainRef *Web3SigningCredentialCactiKeychainRef + Web3SigningCredentialGethKeychainPassword *Web3SigningCredentialGethKeychainPassword + Web3SigningCredentialNone *Web3SigningCredentialNone + Web3SigningCredentialPrivateKeyHex *Web3SigningCredentialPrivateKeyHex +} + +// Web3SigningCredentialCactiKeychainRefAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialCactiKeychainRef wrapped in Web3SigningCredential +func Web3SigningCredentialCactiKeychainRefAsWeb3SigningCredential(v *Web3SigningCredentialCactiKeychainRef) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialCactiKeychainRef: v, + } +} + +// Web3SigningCredentialGethKeychainPasswordAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialGethKeychainPassword wrapped in Web3SigningCredential +func Web3SigningCredentialGethKeychainPasswordAsWeb3SigningCredential(v *Web3SigningCredentialGethKeychainPassword) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialGethKeychainPassword: v, + } +} + +// Web3SigningCredentialNoneAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialNone wrapped in Web3SigningCredential +func Web3SigningCredentialNoneAsWeb3SigningCredential(v *Web3SigningCredentialNone) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialNone: v, + } +} + +// Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialPrivateKeyHex wrapped in Web3SigningCredential +func Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential(v *Web3SigningCredentialPrivateKeyHex) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialPrivateKeyHex: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Web3SigningCredential) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Web3SigningCredentialCactiKeychainRef + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialCactiKeychainRef) + if err == nil { + jsonWeb3SigningCredentialCactiKeychainRef, _ := json.Marshal(dst.Web3SigningCredentialCactiKeychainRef) + if string(jsonWeb3SigningCredentialCactiKeychainRef) == "{}" { // empty struct + dst.Web3SigningCredentialCactiKeychainRef = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialCactiKeychainRef = nil + } + + // try to unmarshal data into Web3SigningCredentialGethKeychainPassword + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialGethKeychainPassword) + if err == nil { + jsonWeb3SigningCredentialGethKeychainPassword, _ := json.Marshal(dst.Web3SigningCredentialGethKeychainPassword) + if string(jsonWeb3SigningCredentialGethKeychainPassword) == "{}" { // empty struct + dst.Web3SigningCredentialGethKeychainPassword = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialGethKeychainPassword = nil + } + + // try to unmarshal data into Web3SigningCredentialNone + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialNone) + if err == nil { + jsonWeb3SigningCredentialNone, _ := json.Marshal(dst.Web3SigningCredentialNone) + if string(jsonWeb3SigningCredentialNone) == "{}" { // empty struct + dst.Web3SigningCredentialNone = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialNone = nil + } + + // try to unmarshal data into Web3SigningCredentialPrivateKeyHex + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialPrivateKeyHex) + if err == nil { + jsonWeb3SigningCredentialPrivateKeyHex, _ := json.Marshal(dst.Web3SigningCredentialPrivateKeyHex) + if string(jsonWeb3SigningCredentialPrivateKeyHex) == "{}" { // empty struct + dst.Web3SigningCredentialPrivateKeyHex = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialPrivateKeyHex = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Web3SigningCredentialCactiKeychainRef = nil + dst.Web3SigningCredentialGethKeychainPassword = nil + dst.Web3SigningCredentialNone = nil + dst.Web3SigningCredentialPrivateKeyHex = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Web3SigningCredential)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Web3SigningCredential)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Web3SigningCredential) MarshalJSON() ([]byte, error) { + if src.Web3SigningCredentialCactiKeychainRef != nil { + return json.Marshal(&src.Web3SigningCredentialCactiKeychainRef) + } + + if src.Web3SigningCredentialGethKeychainPassword != nil { + return json.Marshal(&src.Web3SigningCredentialGethKeychainPassword) + } + + if src.Web3SigningCredentialNone != nil { + return json.Marshal(&src.Web3SigningCredentialNone) + } + + if src.Web3SigningCredentialPrivateKeyHex != nil { + return json.Marshal(&src.Web3SigningCredentialPrivateKeyHex) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Web3SigningCredential) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Web3SigningCredentialCactiKeychainRef != nil { + return obj.Web3SigningCredentialCactiKeychainRef + } + + if obj.Web3SigningCredentialGethKeychainPassword != nil { + return obj.Web3SigningCredentialGethKeychainPassword + } + + if obj.Web3SigningCredentialNone != nil { + return obj.Web3SigningCredentialNone + } + + if obj.Web3SigningCredentialPrivateKeyHex != nil { + return obj.Web3SigningCredentialPrivateKeyHex + } + + // all schemas are nil + return nil +} + +type NullableWeb3SigningCredential struct { + value *Web3SigningCredential + isSet bool +} + +func (v NullableWeb3SigningCredential) Get() *Web3SigningCredential { + return v.value +} + +func (v *NullableWeb3SigningCredential) Set(val *Web3SigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredential(val *Web3SigningCredential) *NullableWeb3SigningCredential { + return &NullableWeb3SigningCredential{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cacti_keychain_ref.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cacti_keychain_ref.go new file mode 100644 index 00000000000..f7db2fbb214 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cacti_keychain_ref.go @@ -0,0 +1,210 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialCactiKeychainRef type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialCactiKeychainRef{} + +// Web3SigningCredentialCactiKeychainRef struct for Web3SigningCredentialCactiKeychainRef +type Web3SigningCredentialCactiKeychainRef struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + KeychainEntryKey string `json:"keychainEntryKey"` + // The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + KeychainId *string `json:"keychainId,omitempty"` +} + +// NewWeb3SigningCredentialCactiKeychainRef instantiates a new Web3SigningCredentialCactiKeychainRef 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialCactiKeychainRef(type_ Web3SigningCredentialType, ethAccount string, keychainEntryKey string) *Web3SigningCredentialCactiKeychainRef { + this := Web3SigningCredentialCactiKeychainRef{} + this.Type = type_ + this.EthAccount = ethAccount + this.KeychainEntryKey = keychainEntryKey + return &this +} + +// NewWeb3SigningCredentialCactiKeychainRefWithDefaults instantiates a new Web3SigningCredentialCactiKeychainRef object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialCactiKeychainRefWithDefaults() *Web3SigningCredentialCactiKeychainRef { + this := Web3SigningCredentialCactiKeychainRef{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialCactiKeychainRef) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactiKeychainRef) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialCactiKeychainRef) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialCactiKeychainRef) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactiKeychainRef) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialCactiKeychainRef) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetKeychainEntryKey returns the KeychainEntryKey field value +func (o *Web3SigningCredentialCactiKeychainRef) GetKeychainEntryKey() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainEntryKey +} + +// GetKeychainEntryKeyOk returns a tuple with the KeychainEntryKey field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactiKeychainRef) GetKeychainEntryKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainEntryKey, true +} + +// SetKeychainEntryKey sets field value +func (o *Web3SigningCredentialCactiKeychainRef) SetKeychainEntryKey(v string) { + o.KeychainEntryKey = v +} + +// GetKeychainId returns the KeychainId field value if set, zero value otherwise. +func (o *Web3SigningCredentialCactiKeychainRef) GetKeychainId() string { + if o == nil || isNil(o.KeychainId) { + var ret string + return ret + } + return *o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactiKeychainRef) GetKeychainIdOk() (*string, bool) { + if o == nil || isNil(o.KeychainId) { + return nil, false + } + return o.KeychainId, true +} + +// HasKeychainId returns a boolean if a field has been set. +func (o *Web3SigningCredentialCactiKeychainRef) HasKeychainId() bool { + if o != nil && !isNil(o.KeychainId) { + return true + } + + return false +} + +// SetKeychainId gets a reference to the given string and assigns it to the KeychainId field. +func (o *Web3SigningCredentialCactiKeychainRef) SetKeychainId(v string) { + o.KeychainId = &v +} + +func (o Web3SigningCredentialCactiKeychainRef) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialCactiKeychainRef) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["keychainEntryKey"] = o.KeychainEntryKey + if !isNil(o.KeychainId) { + toSerialize["keychainId"] = o.KeychainId + } + return toSerialize, nil +} + +type NullableWeb3SigningCredentialCactiKeychainRef struct { + value *Web3SigningCredentialCactiKeychainRef + isSet bool +} + +func (v NullableWeb3SigningCredentialCactiKeychainRef) Get() *Web3SigningCredentialCactiKeychainRef { + return v.value +} + +func (v *NullableWeb3SigningCredentialCactiKeychainRef) Set(val *Web3SigningCredentialCactiKeychainRef) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialCactiKeychainRef) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialCactiKeychainRef) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialCactiKeychainRef(val *Web3SigningCredentialCactiKeychainRef) *NullableWeb3SigningCredentialCactiKeychainRef { + return &NullableWeb3SigningCredentialCactiKeychainRef{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialCactiKeychainRef) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialCactiKeychainRef) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_geth_keychain_password.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_geth_keychain_password.go new file mode 100644 index 00000000000..c19560dab15 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_geth_keychain_password.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialGethKeychainPassword type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialGethKeychainPassword{} + +// Web3SigningCredentialGethKeychainPassword struct for Web3SigningCredentialGethKeychainPassword +type Web3SigningCredentialGethKeychainPassword struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // A geth keychain unlock password. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialGethKeychainPassword instantiates a new Web3SigningCredentialGethKeychainPassword 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialGethKeychainPassword(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialGethKeychainPassword { + this := Web3SigningCredentialGethKeychainPassword{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialGethKeychainPasswordWithDefaults instantiates a new Web3SigningCredentialGethKeychainPassword object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialGethKeychainPasswordWithDefaults() *Web3SigningCredentialGethKeychainPassword { + this := Web3SigningCredentialGethKeychainPassword{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialGethKeychainPassword) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialGethKeychainPassword) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialGethKeychainPassword) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialGethKeychainPassword) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialGethKeychainPassword) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialGethKeychainPassword) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialGethKeychainPassword) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialGethKeychainPassword) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialGethKeychainPassword) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialGethKeychainPassword) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialGethKeychainPassword) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialGethKeychainPassword struct { + value *Web3SigningCredentialGethKeychainPassword + isSet bool +} + +func (v NullableWeb3SigningCredentialGethKeychainPassword) Get() *Web3SigningCredentialGethKeychainPassword { + return v.value +} + +func (v *NullableWeb3SigningCredentialGethKeychainPassword) Set(val *Web3SigningCredentialGethKeychainPassword) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialGethKeychainPassword) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialGethKeychainPassword) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialGethKeychainPassword(val *Web3SigningCredentialGethKeychainPassword) *NullableWeb3SigningCredentialGethKeychainPassword { + return &NullableWeb3SigningCredentialGethKeychainPassword{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialGethKeychainPassword) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialGethKeychainPassword) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go new file mode 100644 index 00000000000..3925cf1b5c0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialNone type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialNone{} + +// Web3SigningCredentialNone Using this denotes that there is no signing required because the transaction is pre-signed. +type Web3SigningCredentialNone struct { + Type Web3SigningCredentialType `json:"type"` +} + +// NewWeb3SigningCredentialNone instantiates a new Web3SigningCredentialNone 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialNone(type_ Web3SigningCredentialType) *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + this.Type = type_ + return &this +} + +// NewWeb3SigningCredentialNoneWithDefaults instantiates a new Web3SigningCredentialNone object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialNoneWithDefaults() *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialNone) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialNone) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialNone) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +func (o Web3SigningCredentialNone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialNone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableWeb3SigningCredentialNone struct { + value *Web3SigningCredentialNone + isSet bool +} + +func (v NullableWeb3SigningCredentialNone) Get() *Web3SigningCredentialNone { + return v.value +} + +func (v *NullableWeb3SigningCredentialNone) Set(val *Web3SigningCredentialNone) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialNone) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialNone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialNone(val *Web3SigningCredentialNone) *NullableWeb3SigningCredentialNone { + return &NullableWeb3SigningCredentialNone{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialNone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialNone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go new file mode 100644 index 00000000000..5cddf32e4d7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialPrivateKeyHex type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialPrivateKeyHex{} + +// Web3SigningCredentialPrivateKeyHex struct for Web3SigningCredentialPrivateKeyHex +type Web3SigningCredentialPrivateKeyHex struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The HEX encoded private key of an eth account. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialPrivateKeyHex instantiates a new Web3SigningCredentialPrivateKeyHex 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialPrivateKeyHex(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialPrivateKeyHexWithDefaults instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialPrivateKeyHexWithDefaults() *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialPrivateKeyHex) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialPrivateKeyHex) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialPrivateKeyHex) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialPrivateKeyHex struct { + value *Web3SigningCredentialPrivateKeyHex + isSet bool +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) Get() *Web3SigningCredentialPrivateKeyHex { + return v.value +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Set(val *Web3SigningCredentialPrivateKeyHex) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialPrivateKeyHex(val *Web3SigningCredentialPrivateKeyHex) *NullableWeb3SigningCredentialPrivateKeyHex { + return &NullableWeb3SigningCredentialPrivateKeyHex{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go new file mode 100644 index 00000000000..6b1fa1ef7cb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredentialType the model 'Web3SigningCredentialType' +type Web3SigningCredentialType string + +// List of Web3SigningCredentialType +const ( + CACTI_KEYCHAIN_REF Web3SigningCredentialType = "CACTI_KEYCHAIN_REF" + GETH_KEYCHAIN_PASSWORD Web3SigningCredentialType = "GETH_KEYCHAIN_PASSWORD" + PRIVATE_KEY_HEX Web3SigningCredentialType = "PRIVATE_KEY_HEX" + NONE Web3SigningCredentialType = "NONE" +) + +// All allowed values of Web3SigningCredentialType enum +var AllowedWeb3SigningCredentialTypeEnumValues = []Web3SigningCredentialType{ + "CACTI_KEYCHAIN_REF", + "GETH_KEYCHAIN_PASSWORD", + "PRIVATE_KEY_HEX", + "NONE", +} + +func (v *Web3SigningCredentialType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Web3SigningCredentialType(value) + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Web3SigningCredentialType", value) +} + +// NewWeb3SigningCredentialTypeFromValue returns a pointer to a valid Web3SigningCredentialType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWeb3SigningCredentialTypeFromValue(v string) (*Web3SigningCredentialType, error) { + ev := Web3SigningCredentialType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Web3SigningCredentialType: valid values are %v", v, AllowedWeb3SigningCredentialTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Web3SigningCredentialType) IsValid() bool { + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Web3SigningCredentialType value +func (v Web3SigningCredentialType) Ptr() *Web3SigningCredentialType { + return &v +} + +type NullableWeb3SigningCredentialType struct { + value *Web3SigningCredentialType + isSet bool +} + +func (v NullableWeb3SigningCredentialType) Get() *Web3SigningCredentialType { + return v.value +} + +func (v *NullableWeb3SigningCredentialType) Set(val *Web3SigningCredentialType) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialType) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialType(val *Web3SigningCredentialType) *NullableWeb3SigningCredentialType { + return &NullableWeb3SigningCredentialType{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_transaction.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_transaction.go new file mode 100644 index 00000000000..02d052700b0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_transaction.go @@ -0,0 +1,549 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the Web3Transaction type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3Transaction{} + +// Web3Transaction struct for Web3Transaction +type Web3Transaction struct { + Hash string `json:"hash"` + Nonce string `json:"nonce"` + BlockHash string `json:"blockHash"` + BlockNumber string `json:"blockNumber"` + TransactionIndex string `json:"transactionIndex"` + From string `json:"from"` + To string `json:"to"` + Value string `json:"value"` + GasPrice string `json:"gasPrice"` + Gas string `json:"gas"` + Input string `json:"input"` + Type string `json:"type"` + ChainId string `json:"chainId"` + V *string `json:"v,omitempty"` + R *string `json:"r,omitempty"` + S *string `json:"s,omitempty"` +} + +// NewWeb3Transaction instantiates a new Web3Transaction 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 +// will change when the set of required properties is changed +func NewWeb3Transaction(hash string, nonce string, blockHash string, blockNumber string, transactionIndex string, from string, to string, value string, gasPrice string, gas string, input string, type_ string, chainId string) *Web3Transaction { + this := Web3Transaction{} + this.Hash = hash + this.Nonce = nonce + this.BlockHash = blockHash + this.BlockNumber = blockNumber + this.TransactionIndex = transactionIndex + this.From = from + this.To = to + this.Value = value + this.GasPrice = gasPrice + this.Gas = gas + this.Input = input + this.Type = type_ + this.ChainId = chainId + return &this +} + +// NewWeb3TransactionWithDefaults instantiates a new Web3Transaction object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3TransactionWithDefaults() *Web3Transaction { + this := Web3Transaction{} + return &this +} + +// GetHash returns the Hash field value +func (o *Web3Transaction) GetHash() string { + if o == nil { + var ret string + return ret + } + + return o.Hash +} + +// GetHashOk returns a tuple with the Hash field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *Web3Transaction) SetHash(v string) { + o.Hash = v +} + +// GetNonce returns the Nonce field value +func (o *Web3Transaction) GetNonce() string { + if o == nil { + var ret string + return ret + } + + return o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetNonceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Nonce, true +} + +// SetNonce sets field value +func (o *Web3Transaction) SetNonce(v string) { + o.Nonce = v +} + +// GetBlockHash returns the BlockHash field value +func (o *Web3Transaction) GetBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *Web3Transaction) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetBlockNumber returns the BlockNumber field value +func (o *Web3Transaction) GetBlockNumber() string { + if o == nil { + var ret string + return ret + } + + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetBlockNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *Web3Transaction) SetBlockNumber(v string) { + o.BlockNumber = v +} + +// GetTransactionIndex returns the TransactionIndex field value +func (o *Web3Transaction) GetTransactionIndex() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetTransactionIndexOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionIndex, true +} + +// SetTransactionIndex sets field value +func (o *Web3Transaction) SetTransactionIndex(v string) { + o.TransactionIndex = v +} + +// GetFrom returns the From field value +func (o *Web3Transaction) GetFrom() string { + if o == nil { + var ret string + return ret + } + + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value +func (o *Web3Transaction) SetFrom(v string) { + o.From = v +} + +// GetTo returns the To field value +func (o *Web3Transaction) GetTo() string { + if o == nil { + var ret string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *Web3Transaction) SetTo(v string) { + o.To = v +} + +// GetValue returns the Value field value +func (o *Web3Transaction) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *Web3Transaction) SetValue(v string) { + o.Value = v +} + +// GetGasPrice returns the GasPrice field value +func (o *Web3Transaction) GetGasPrice() string { + if o == nil { + var ret string + return ret + } + + return o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetGasPriceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GasPrice, true +} + +// SetGasPrice sets field value +func (o *Web3Transaction) SetGasPrice(v string) { + o.GasPrice = v +} + +// GetGas returns the Gas field value +func (o *Web3Transaction) GetGas() string { + if o == nil { + var ret string + return ret + } + + return o.Gas +} + +// GetGasOk returns a tuple with the Gas field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetGasOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Gas, true +} + +// SetGas sets field value +func (o *Web3Transaction) SetGas(v string) { + o.Gas = v +} + +// GetInput returns the Input field value +func (o *Web3Transaction) GetInput() string { + if o == nil { + var ret string + return ret + } + + return o.Input +} + +// GetInputOk returns a tuple with the Input field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetInputOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Input, true +} + +// SetInput sets field value +func (o *Web3Transaction) SetInput(v string) { + o.Input = v +} + +// GetType returns the Type field value +func (o *Web3Transaction) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3Transaction) SetType(v string) { + o.Type = v +} + +// GetChainId returns the ChainId field value +func (o *Web3Transaction) GetChainId() string { + if o == nil { + var ret string + return ret + } + + return o.ChainId +} + +// GetChainIdOk returns a tuple with the ChainId field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetChainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChainId, true +} + +// SetChainId sets field value +func (o *Web3Transaction) SetChainId(v string) { + o.ChainId = v +} + +// GetV returns the V field value if set, zero value otherwise. +func (o *Web3Transaction) GetV() string { + if o == nil || isNil(o.V) { + var ret string + return ret + } + return *o.V +} + +// GetVOk returns a tuple with the V field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetVOk() (*string, bool) { + if o == nil || isNil(o.V) { + return nil, false + } + return o.V, true +} + +// HasV returns a boolean if a field has been set. +func (o *Web3Transaction) HasV() bool { + if o != nil && !isNil(o.V) { + return true + } + + return false +} + +// SetV gets a reference to the given string and assigns it to the V field. +func (o *Web3Transaction) SetV(v string) { + o.V = &v +} + +// GetR returns the R field value if set, zero value otherwise. +func (o *Web3Transaction) GetR() string { + if o == nil || isNil(o.R) { + var ret string + return ret + } + return *o.R +} + +// GetROk returns a tuple with the R field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetROk() (*string, bool) { + if o == nil || isNil(o.R) { + return nil, false + } + return o.R, true +} + +// HasR returns a boolean if a field has been set. +func (o *Web3Transaction) HasR() bool { + if o != nil && !isNil(o.R) { + return true + } + + return false +} + +// SetR gets a reference to the given string and assigns it to the R field. +func (o *Web3Transaction) SetR(v string) { + o.R = &v +} + +// GetS returns the S field value if set, zero value otherwise. +func (o *Web3Transaction) GetS() string { + if o == nil || isNil(o.S) { + var ret string + return ret + } + return *o.S +} + +// GetSOk returns a tuple with the S field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetSOk() (*string, bool) { + if o == nil || isNil(o.S) { + return nil, false + } + return o.S, true +} + +// HasS returns a boolean if a field has been set. +func (o *Web3Transaction) HasS() bool { + if o != nil && !isNil(o.S) { + return true + } + + return false +} + +// SetS gets a reference to the given string and assigns it to the S field. +func (o *Web3Transaction) SetS(v string) { + o.S = &v +} + +func (o Web3Transaction) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3Transaction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["hash"] = o.Hash + toSerialize["nonce"] = o.Nonce + toSerialize["blockHash"] = o.BlockHash + toSerialize["blockNumber"] = o.BlockNumber + toSerialize["transactionIndex"] = o.TransactionIndex + toSerialize["from"] = o.From + toSerialize["to"] = o.To + toSerialize["value"] = o.Value + toSerialize["gasPrice"] = o.GasPrice + toSerialize["gas"] = o.Gas + toSerialize["input"] = o.Input + toSerialize["type"] = o.Type + toSerialize["chainId"] = o.ChainId + if !isNil(o.V) { + toSerialize["v"] = o.V + } + if !isNil(o.R) { + toSerialize["r"] = o.R + } + if !isNil(o.S) { + toSerialize["s"] = o.S + } + return toSerialize, nil +} + +type NullableWeb3Transaction struct { + value *Web3Transaction + isSet bool +} + +func (v NullableWeb3Transaction) Get() *Web3Transaction { + return v.value +} + +func (v *NullableWeb3Transaction) Set(val *Web3Transaction) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3Transaction) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3Transaction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3Transaction(val *Web3Transaction) *NullableWeb3Transaction { + return &NullableWeb3Transaction{value: val, isSet: true} +} + +func (v NullableWeb3Transaction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3Transaction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go new file mode 100644 index 00000000000..31dea1ce492 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go @@ -0,0 +1,681 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" +) + +// checks if the Web3TransactionReceipt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3TransactionReceipt{} + +// Web3TransactionReceipt struct for Web3TransactionReceipt +type Web3TransactionReceipt struct { + Status bool `json:"status"` + TransactionHash string `json:"transactionHash"` + TransactionIndex string `json:"transactionIndex"` + BlockHash string `json:"blockHash"` + BlockNumber string `json:"blockNumber"` + GasUsed string `json:"gasUsed"` + EffectiveGasPrice *string `json:"effectiveGasPrice,omitempty"` + ContractAddress NullableString `json:"contractAddress,omitempty"` + From string `json:"from"` + To string `json:"to"` + Logs []interface{} `json:"logs,omitempty"` + LogsBloom *string `json:"logsBloom,omitempty"` + RevertReason *string `json:"revertReason,omitempty"` + Output *string `json:"output,omitempty"` + CommitmentHash *string `json:"commitmentHash,omitempty"` + CumulativeGasUsed *string `json:"cumulativeGasUsed,omitempty"` + Type *string `json:"type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Web3TransactionReceipt Web3TransactionReceipt + +// NewWeb3TransactionReceipt instantiates a new Web3TransactionReceipt 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 +// will change when the set of required properties is changed +func NewWeb3TransactionReceipt(status bool, transactionHash string, transactionIndex string, blockHash string, blockNumber string, gasUsed string, from string, to string) *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + this.Status = status + this.TransactionHash = transactionHash + this.TransactionIndex = transactionIndex + this.BlockHash = blockHash + this.BlockNumber = blockNumber + this.GasUsed = gasUsed + this.From = from + this.To = to + return &this +} + +// NewWeb3TransactionReceiptWithDefaults instantiates a new Web3TransactionReceipt object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3TransactionReceiptWithDefaults() *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + return &this +} + +// GetStatus returns the Status field value +func (o *Web3TransactionReceipt) GetStatus() bool { + if o == nil { + var ret bool + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetStatusOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Web3TransactionReceipt) SetStatus(v bool) { + o.Status = v +} + +// GetTransactionHash returns the TransactionHash field value +func (o *Web3TransactionReceipt) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *Web3TransactionReceipt) SetTransactionHash(v string) { + o.TransactionHash = v +} + +// GetTransactionIndex returns the TransactionIndex field value +func (o *Web3TransactionReceipt) GetTransactionIndex() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionIndexOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionIndex, true +} + +// SetTransactionIndex sets field value +func (o *Web3TransactionReceipt) SetTransactionIndex(v string) { + o.TransactionIndex = v +} + +// GetBlockHash returns the BlockHash field value +func (o *Web3TransactionReceipt) GetBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *Web3TransactionReceipt) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetBlockNumber returns the BlockNumber field value +func (o *Web3TransactionReceipt) GetBlockNumber() string { + if o == nil { + var ret string + return ret + } + + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *Web3TransactionReceipt) SetBlockNumber(v string) { + o.BlockNumber = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3TransactionReceipt) GetGasUsed() string { + if o == nil { + var ret string + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetGasUsedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3TransactionReceipt) SetGasUsed(v string) { + o.GasUsed = v +} + +// GetEffectiveGasPrice returns the EffectiveGasPrice field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetEffectiveGasPrice() string { + if o == nil || isNil(o.EffectiveGasPrice) { + var ret string + return ret + } + return *o.EffectiveGasPrice +} + +// GetEffectiveGasPriceOk returns a tuple with the EffectiveGasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetEffectiveGasPriceOk() (*string, bool) { + if o == nil || isNil(o.EffectiveGasPrice) { + return nil, false + } + return o.EffectiveGasPrice, true +} + +// HasEffectiveGasPrice returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasEffectiveGasPrice() bool { + if o != nil && !isNil(o.EffectiveGasPrice) { + return true + } + + return false +} + +// SetEffectiveGasPrice gets a reference to the given string and assigns it to the EffectiveGasPrice field. +func (o *Web3TransactionReceipt) SetEffectiveGasPrice(v string) { + o.EffectiveGasPrice = &v +} + +// GetContractAddress returns the ContractAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Web3TransactionReceipt) GetContractAddress() string { + if o == nil || isNil(o.ContractAddress.Get()) { + var ret string + return ret + } + return *o.ContractAddress.Get() +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3TransactionReceipt) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ContractAddress.Get(), o.ContractAddress.IsSet() +} + +// HasContractAddress returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasContractAddress() bool { + if o != nil && o.ContractAddress.IsSet() { + return true + } + + return false +} + +// SetContractAddress gets a reference to the given NullableString and assigns it to the ContractAddress field. +func (o *Web3TransactionReceipt) SetContractAddress(v string) { + o.ContractAddress.Set(&v) +} +// SetContractAddressNil sets the value for ContractAddress to be an explicit nil +func (o *Web3TransactionReceipt) SetContractAddressNil() { + o.ContractAddress.Set(nil) +} + +// UnsetContractAddress ensures that no value is present for ContractAddress, not even an explicit nil +func (o *Web3TransactionReceipt) UnsetContractAddress() { + o.ContractAddress.Unset() +} + +// GetFrom returns the From field value +func (o *Web3TransactionReceipt) GetFrom() string { + if o == nil { + var ret string + return ret + } + + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value +func (o *Web3TransactionReceipt) SetFrom(v string) { + o.From = v +} + +// GetTo returns the To field value +func (o *Web3TransactionReceipt) GetTo() string { + if o == nil { + var ret string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *Web3TransactionReceipt) SetTo(v string) { + o.To = v +} + +// GetLogs returns the Logs field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetLogs() []interface{} { + if o == nil || isNil(o.Logs) { + var ret []interface{} + return ret + } + return o.Logs +} + +// GetLogsOk returns a tuple with the Logs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetLogsOk() ([]interface{}, bool) { + if o == nil || isNil(o.Logs) { + return nil, false + } + return o.Logs, true +} + +// HasLogs returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasLogs() bool { + if o != nil && !isNil(o.Logs) { + return true + } + + return false +} + +// SetLogs gets a reference to the given []interface{} and assigns it to the Logs field. +func (o *Web3TransactionReceipt) SetLogs(v []interface{}) { + o.Logs = v +} + +// GetLogsBloom returns the LogsBloom field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetLogsBloom() string { + if o == nil || isNil(o.LogsBloom) { + var ret string + return ret + } + return *o.LogsBloom +} + +// GetLogsBloomOk returns a tuple with the LogsBloom field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetLogsBloomOk() (*string, bool) { + if o == nil || isNil(o.LogsBloom) { + return nil, false + } + return o.LogsBloom, true +} + +// HasLogsBloom returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasLogsBloom() bool { + if o != nil && !isNil(o.LogsBloom) { + return true + } + + return false +} + +// SetLogsBloom gets a reference to the given string and assigns it to the LogsBloom field. +func (o *Web3TransactionReceipt) SetLogsBloom(v string) { + o.LogsBloom = &v +} + +// GetRevertReason returns the RevertReason field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetRevertReason() string { + if o == nil || isNil(o.RevertReason) { + var ret string + return ret + } + return *o.RevertReason +} + +// GetRevertReasonOk returns a tuple with the RevertReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetRevertReasonOk() (*string, bool) { + if o == nil || isNil(o.RevertReason) { + return nil, false + } + return o.RevertReason, true +} + +// HasRevertReason returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasRevertReason() bool { + if o != nil && !isNil(o.RevertReason) { + return true + } + + return false +} + +// SetRevertReason gets a reference to the given string and assigns it to the RevertReason field. +func (o *Web3TransactionReceipt) SetRevertReason(v string) { + o.RevertReason = &v +} + +// GetOutput returns the Output field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetOutput() string { + if o == nil || isNil(o.Output) { + var ret string + return ret + } + return *o.Output +} + +// GetOutputOk returns a tuple with the Output field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetOutputOk() (*string, bool) { + if o == nil || isNil(o.Output) { + return nil, false + } + return o.Output, true +} + +// HasOutput returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasOutput() bool { + if o != nil && !isNil(o.Output) { + return true + } + + return false +} + +// SetOutput gets a reference to the given string and assigns it to the Output field. +func (o *Web3TransactionReceipt) SetOutput(v string) { + o.Output = &v +} + +// GetCommitmentHash returns the CommitmentHash field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetCommitmentHash() string { + if o == nil || isNil(o.CommitmentHash) { + var ret string + return ret + } + return *o.CommitmentHash +} + +// GetCommitmentHashOk returns a tuple with the CommitmentHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetCommitmentHashOk() (*string, bool) { + if o == nil || isNil(o.CommitmentHash) { + return nil, false + } + return o.CommitmentHash, true +} + +// HasCommitmentHash returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasCommitmentHash() bool { + if o != nil && !isNil(o.CommitmentHash) { + return true + } + + return false +} + +// SetCommitmentHash gets a reference to the given string and assigns it to the CommitmentHash field. +func (o *Web3TransactionReceipt) SetCommitmentHash(v string) { + o.CommitmentHash = &v +} + +// GetCumulativeGasUsed returns the CumulativeGasUsed field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetCumulativeGasUsed() string { + if o == nil || isNil(o.CumulativeGasUsed) { + var ret string + return ret + } + return *o.CumulativeGasUsed +} + +// GetCumulativeGasUsedOk returns a tuple with the CumulativeGasUsed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetCumulativeGasUsedOk() (*string, bool) { + if o == nil || isNil(o.CumulativeGasUsed) { + return nil, false + } + return o.CumulativeGasUsed, true +} + +// HasCumulativeGasUsed returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasCumulativeGasUsed() bool { + if o != nil && !isNil(o.CumulativeGasUsed) { + return true + } + + return false +} + +// SetCumulativeGasUsed gets a reference to the given string and assigns it to the CumulativeGasUsed field. +func (o *Web3TransactionReceipt) SetCumulativeGasUsed(v string) { + o.CumulativeGasUsed = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetType() string { + if o == nil || isNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTypeOk() (*string, bool) { + if o == nil || isNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasType() bool { + if o != nil && !isNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *Web3TransactionReceipt) SetType(v string) { + o.Type = &v +} + +func (o Web3TransactionReceipt) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3TransactionReceipt) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + toSerialize["transactionHash"] = o.TransactionHash + toSerialize["transactionIndex"] = o.TransactionIndex + toSerialize["blockHash"] = o.BlockHash + toSerialize["blockNumber"] = o.BlockNumber + toSerialize["gasUsed"] = o.GasUsed + if !isNil(o.EffectiveGasPrice) { + toSerialize["effectiveGasPrice"] = o.EffectiveGasPrice + } + if o.ContractAddress.IsSet() { + toSerialize["contractAddress"] = o.ContractAddress.Get() + } + toSerialize["from"] = o.From + toSerialize["to"] = o.To + if !isNil(o.Logs) { + toSerialize["logs"] = o.Logs + } + if !isNil(o.LogsBloom) { + toSerialize["logsBloom"] = o.LogsBloom + } + if !isNil(o.RevertReason) { + toSerialize["revertReason"] = o.RevertReason + } + if !isNil(o.Output) { + toSerialize["output"] = o.Output + } + if !isNil(o.CommitmentHash) { + toSerialize["commitmentHash"] = o.CommitmentHash + } + if !isNil(o.CumulativeGasUsed) { + toSerialize["cumulativeGasUsed"] = o.CumulativeGasUsed + } + if !isNil(o.Type) { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Web3TransactionReceipt) UnmarshalJSON(bytes []byte) (err error) { + varWeb3TransactionReceipt := _Web3TransactionReceipt{} + + if err = json.Unmarshal(bytes, &varWeb3TransactionReceipt); err == nil { + *o = Web3TransactionReceipt(varWeb3TransactionReceipt) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "status") + delete(additionalProperties, "transactionHash") + delete(additionalProperties, "transactionIndex") + delete(additionalProperties, "blockHash") + delete(additionalProperties, "blockNumber") + delete(additionalProperties, "gasUsed") + delete(additionalProperties, "effectiveGasPrice") + delete(additionalProperties, "contractAddress") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + delete(additionalProperties, "logs") + delete(additionalProperties, "logsBloom") + delete(additionalProperties, "revertReason") + delete(additionalProperties, "output") + delete(additionalProperties, "commitmentHash") + delete(additionalProperties, "cumulativeGasUsed") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWeb3TransactionReceipt struct { + value *Web3TransactionReceipt + isSet bool +} + +func (v NullableWeb3TransactionReceipt) Get() *Web3TransactionReceipt { + return v.value +} + +func (v *NullableWeb3TransactionReceipt) Set(val *Web3TransactionReceipt) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3TransactionReceipt) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3TransactionReceipt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3TransactionReceipt(val *Web3TransactionReceipt) *NullableWeb3TransactionReceipt { + return &NullableWeb3TransactionReceipt{value: val, isSet: true} +} + +func (v NullableWeb3TransactionReceipt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3TransactionReceipt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..361b4e29f45 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..0529f5ad070 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,97 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-ledger-connector-ethereum + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-ledger-connector-ethereum_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService DeployContract", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeployContract(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPrometheusMetricsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPrometheusMetricsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeContractV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeContractV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeRawWeb3EthContractV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeRawWeb3EthContractV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeWeb3EthMethodV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeWeb3EthMethodV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RunTransactionV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.RunTransactionV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..af3d465e188 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// isNil checks if an input is nil +func isNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..c14e2794f63 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.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 Hyperledger Cacti Plugin - Connector Ethereum + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..1b92b3f598d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,104 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/ContractJSON.java +src/main/java/org/openapitools/client/model/ContractJsonDefinition.java +src/main/java/org/openapitools/client/model/ContractKeychainDefinition.java +src/main/java/org/openapitools/client/model/DeployContractV1Request.java +src/main/java/org/openapitools/client/model/DeployContractV1RequestContract.java +src/main/java/org/openapitools/client/model/DeployedContractJsonDefinition.java +src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java +src/main/java/org/openapitools/client/model/EthContractInvocationType.java +src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java +src/main/java/org/openapitools/client/model/EthereumTransactionConfig.java +src/main/java/org/openapitools/client/model/GasTransactionConfig.java +src/main/java/org/openapitools/client/model/GasTransactionConfigEIP1559.java +src/main/java/org/openapitools/client/model/GasTransactionConfigLegacy.java +src/main/java/org/openapitools/client/model/InvokeContractV1Request.java +src/main/java/org/openapitools/client/model/InvokeContractV1RequestContract.java +src/main/java/org/openapitools/client/model/InvokeContractV1Response.java +src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java +src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java +src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java +src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java +src/main/java/org/openapitools/client/model/RunTransactionRequest.java +src/main/java/org/openapitools/client/model/RunTransactionResponse.java +src/main/java/org/openapitools/client/model/WatchBlocksV1.java +src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java +src/main/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestamp.java +src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java +src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java +src/main/java/org/openapitools/client/model/Web3BlockHeader.java +src/main/java/org/openapitools/client/model/Web3SigningCredential.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialCactiKeychainRef.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java +src/main/java/org/openapitools/client/model/Web3Transaction.java +src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/ContractJSONTest.java +src/test/java/org/openapitools/client/model/ContractJsonDefinitionTest.java +src/test/java/org/openapitools/client/model/ContractKeychainDefinitionTest.java +src/test/java/org/openapitools/client/model/DeployContractV1RequestContractTest.java +src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java +src/test/java/org/openapitools/client/model/DeployedContractJsonDefinitionTest.java +src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java +src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java +src/test/java/org/openapitools/client/model/EthContractInvocationWeb3MethodTest.java +src/test/java/org/openapitools/client/model/EthereumTransactionConfigTest.java +src/test/java/org/openapitools/client/model/GasTransactionConfigEIP1559Test.java +src/test/java/org/openapitools/client/model/GasTransactionConfigLegacyTest.java +src/test/java/org/openapitools/client/model/GasTransactionConfigTest.java +src/test/java/org/openapitools/client/model/InvokeContractV1RequestContractTest.java +src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java +src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java +src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1RequestTest.java +src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1ResponseTest.java +src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1RequestTest.java +src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1ResponseTest.java +src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java +src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestampTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java +src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialCactiKeychainRefTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPasswordTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java +src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java +src/test/java/org/openapitools/client/model/Web3TransactionTest.java diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..e7e42a4b585 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..bed64441f3c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,176 @@ +# openapi-java-client + +Hyperledger Cacti Plugin - Connector Ethereum +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a Ethereum ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeployContractV1Request deployContractV1Request = new DeployContractV1Request(); // DeployContractV1Request | + try { + RunTransactionResponse result = apiInstance.deployContract(deployContractV1Request); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deployContract"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deployContract**](docs/DefaultApi.md#deployContract) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract | Deploys the contract to ethereum ledger. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**invokeContractV1**](docs/DefaultApi.md#invokeContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract | Invokes a contract on an ethereum ledger +*DefaultApi* | [**invokeRawWeb3EthContractV1**](docs/DefaultApi.md#invokeRawWeb3EthContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-contract | Low-level endpoint to invoke a method on deployed contract. +*DefaultApi* | [**invokeWeb3EthMethodV1**](docs/DefaultApi.md#invokeWeb3EthMethodV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-method | Invoke any method from web3.eth (low-level) +*DefaultApi* | [**runTransactionV1**](docs/DefaultApi.md#runTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/run-transaction | Executes a transaction on a ethereum ledger + + +## Documentation for Models + + - [ContractJSON](docs/ContractJSON.md) + - [ContractJsonDefinition](docs/ContractJsonDefinition.md) + - [ContractKeychainDefinition](docs/ContractKeychainDefinition.md) + - [DeployContractV1Request](docs/DeployContractV1Request.md) + - [DeployContractV1RequestContract](docs/DeployContractV1RequestContract.md) + - [DeployedContractJsonDefinition](docs/DeployedContractJsonDefinition.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [EthContractInvocationType](docs/EthContractInvocationType.md) + - [EthContractInvocationWeb3Method](docs/EthContractInvocationWeb3Method.md) + - [EthereumTransactionConfig](docs/EthereumTransactionConfig.md) + - [GasTransactionConfig](docs/GasTransactionConfig.md) + - [GasTransactionConfigEIP1559](docs/GasTransactionConfigEIP1559.md) + - [GasTransactionConfigLegacy](docs/GasTransactionConfigLegacy.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1RequestContract](docs/InvokeContractV1RequestContract.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [InvokeRawWeb3EthContractV1Request](docs/InvokeRawWeb3EthContractV1Request.md) + - [InvokeRawWeb3EthContractV1Response](docs/InvokeRawWeb3EthContractV1Response.md) + - [InvokeRawWeb3EthMethodV1Request](docs/InvokeRawWeb3EthMethodV1Request.md) + - [InvokeRawWeb3EthMethodV1Response](docs/InvokeRawWeb3EthMethodV1Response.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WatchBlocksV1BlockData](docs/WatchBlocksV1BlockData.md) + - [WatchBlocksV1BlockDataTimestamp](docs/WatchBlocksV1BlockDataTimestamp.md) + - [WatchBlocksV1Options](docs/WatchBlocksV1Options.md) + - [WatchBlocksV1Progress](docs/WatchBlocksV1Progress.md) + - [Web3BlockHeader](docs/Web3BlockHeader.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactiKeychainRef](docs/Web3SigningCredentialCactiKeychainRef.md) + - [Web3SigningCredentialGethKeychainPassword](docs/Web3SigningCredentialGethKeychainPassword.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3Transaction](docs/Web3Transaction.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + + +## Documentation for Authorization + +All endpoints do not require authorization. +Authentication schemes defined for the API: + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..d6a475a8b6c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,1015 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Ethereum ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cacti Plugin - Connector Ethereum + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract: + post: + operationId: deployContract + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Deploys the contract to ethereum ledger. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Executes a transaction on a ethereum ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/run-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Invokes a contract on an ethereum ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/get-prometheus-exporter-metrics + x-accepts: text/plain + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-method: + post: + operationId: invokeWeb3EthMethodV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthMethodV1Request' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthMethodV1Response' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Invoke any method from web3.eth (low-level) + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-method + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-contract: + post: + operationId: invokeRawWeb3EthContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthContractV1Request' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthContractV1Response' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Low-level endpoint to invoke a method on deployed contract. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-contract + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/json-rpc: + summary: Proxy endpoint to pass JSON-RPC requests to remote ethereum node. +components: + schemas: + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialGethKeychainPassword' + - $ref: '#/components/schemas/Web3SigningCredentialCactiKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialGethKeychainPassword: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + secret: + description: A geth keychain unlock password. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialCactiKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - type + type: object + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialType: + enum: + - CACTI_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + EthContractInvocationType: + enum: + - SEND + - CALL + type: string + EthContractInvocationWeb3Method: + enum: + - send + - call + - encodeABI + - estimateGas + type: string + GasTransactionConfigLegacy: + description: Transaction gas settings in networks before EIP-1559 (London fork). + properties: + gas: + description: A maximum amount of gas a user is willing to provide for the + execution of the transaction. (gasLimit) + type: string + gasPrice: + description: "A price (in Wei) a user is willing to pay for each unit of\ + \ gas used during the execution of the transaction. In EIP-1559 (London\ + \ fork) networks, it will be set as both maxFeePerGas and maxPriorityFeePerGas." + type: string + type: object + GasTransactionConfigEIP1559: + description: Transaction gas settings in networks after EIP-1559 (London fork). + properties: + gasLimit: + description: A maximum amount of gas a user is willing to provide for the + execution of the transaction. + nullable: false + type: string + maxFeePerGas: + description: A maximum fee (including the base fee and the tip) a user is + willing to pay per unit of gas. + nullable: false + type: string + maxPriorityFeePerGas: + description: A maximum tip amount a user is willing to pay per unit of gas. + nullable: false + type: string + type: object + GasTransactionConfig: + description: Transaction gas settings. + oneOf: + - $ref: '#/components/schemas/GasTransactionConfigLegacy' + - $ref: '#/components/schemas/GasTransactionConfigEIP1559' + type: object + EthereumTransactionConfig: + example: + gasConfig: null + rawTransaction: rawTransaction + data: data + from: from + to: to + value: value + nonce: nonce + properties: + rawTransaction: + nullable: false + type: string + from: + type: string + to: + type: string + value: + type: string + nonce: + type: string + data: + type: string + gasConfig: + $ref: '#/components/schemas/GasTransactionConfig' + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: transactionIndex + commitmentHash: commitmentHash + type: type + transactionHash: transactionHash + output: output + gasUsed: gasUsed + blockNumber: blockNumber + cumulativeGasUsed: cumulativeGasUsed + from: from + to: to + revertReason: revertReason + effectiveGasPrice: effectiveGasPrice + logs: + - "" + - "" + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: string + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: string + gasUsed: + nullable: false + type: string + effectiveGasPrice: + nullable: false + type: string + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + logs: + default: [] + items: {} + nullable: false + type: array + logsBloom: + nullable: false + type: string + revertReason: + nullable: false + type: string + output: + nullable: false + type: string + commitmentHash: + nullable: false + type: string + cumulativeGasUsed: + nullable: false + type: string + type: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + ContractJSON: + additionalProperties: true + properties: + contractName: + nullable: false + type: string + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + abi: + description: "The application binary interface of the solidity contract,\ + \ optional parameter" + items: {} + nullable: false + type: array + metadata: + type: string + deployedBytecode: + type: string + sourceMap: + type: string + deployedSourceMap: + type: string + sourcePath: + type: string + compiler: + type: object + networks: + type: object + ast: + type: object + functionHashes: + type: object + gasEstimates: + type: object + required: + - abi + - bytecode + - contractName + type: object + ContractJsonDefinition: + additionalProperties: false + properties: + contractJSON: + $ref: '#/components/schemas/ContractJSON' + required: + - contractJSON + type: object + DeployedContractJsonDefinition: + additionalProperties: false + properties: + contractJSON: + $ref: '#/components/schemas/ContractJSON' + contractAddress: + nullable: false + type: string + required: + - contractAddress + - contractJSON + type: object + ContractKeychainDefinition: + additionalProperties: false + properties: + contractName: + description: The contract name for retrieve the contracts json on the keychain. + maxLength: 100 + minLength: 1 + nullable: false + type: string + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + nullable: false + type: string + required: + - contractName + - keychainId + type: object + RunTransactionRequest: + additionalProperties: false + example: + timeoutMs: 0.08008281904610115 + transactionConfig: + gasConfig: null + rawTransaction: rawTransaction + data: data + from: from + to: to + value: value + nonce: nonce + web3SigningCredential: + type: null + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + transactionConfig: + $ref: '#/components/schemas/EthereumTransactionConfig' + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with thehash of the transaction(which indicates successful execution) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + required: + - transactionConfig + - web3SigningCredential + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: transactionIndex + commitmentHash: commitmentHash + type: type + transactionHash: transactionHash + output: output + gasUsed: gasUsed + blockNumber: blockNumber + cumulativeGasUsed: cumulativeGasUsed + from: from + to: to + revertReason: revertReason + effectiveGasPrice: effectiveGasPrice + logs: + - "" + - "" + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractV1Request: + additionalProperties: false + example: + gasConfig: null + constructorArgs: + - "" + - "" + contract: null + web3SigningCredential: + type: null + value: value + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + contract: + $ref: '#/components/schemas/DeployContractV1Request_contract' + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + gasConfig: + $ref: '#/components/schemas/GasTransactionConfig' + value: + description: Ether balance to send on deployment. + nullable: false + type: string + required: + - contract + - web3SigningCredential + type: object + InvokeContractV1Request: + additionalProperties: false + example: + gasConfig: null + invocationType: null + timeoutMs: 0.08008281904610115 + contract: null + methodName: methodName + web3SigningCredential: + type: null + params: + - "" + - "" + value: value + properties: + contract: + $ref: '#/components/schemas/InvokeContractV1Request_contract' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gasConfig: + $ref: '#/components/schemas/GasTransactionConfig' + value: + type: string + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + before returning an error. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + required: + - contract + - invocationType + - methodName + - params + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: transactionIndex + commitmentHash: commitmentHash + type: type + transactionHash: transactionHash + output: output + gasUsed: gasUsed + blockNumber: blockNumber + cumulativeGasUsed: cumulativeGasUsed + from: from + to: to + revertReason: revertReason + effectiveGasPrice: effectiveGasPrice + logs: + - "" + - "" + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + InvokeRawWeb3EthMethodV1Request: + additionalProperties: false + example: + methodName: methodName + params: + - "" + - "" + properties: + methodName: + description: The name of the web3.eth method to invoke + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass to web3.eth method specified + in methodName + items: {} + type: array + required: + - methodName + type: object + InvokeRawWeb3EthMethodV1Response: + additionalProperties: false + example: + data: "" + errorDetail: errorDetail + status: 0.8008281904610115 + properties: + status: + description: Status code of the operation + nullable: false + type: number + data: + description: Output of requested web3.eth method + errorDetail: + description: Error details + nullable: false + type: string + required: + - status + type: object + InvokeRawWeb3EthContractV1Request: + additionalProperties: false + example: + invocationType: null + address: address + abi: "" + contractMethodArgs: + - "" + - "" + contractMethod: contractMethod + invocationParams: "{}" + properties: + abi: + description: The application binary interface of the solidity contract + address: + description: Deployed solidity contract address + type: string + invocationType: + $ref: '#/components/schemas/EthContractInvocationWeb3Method' + invocationParams: + default: {} + description: "The list of arguments for contract invocation method (send,\ + \ call, etc...)" + type: object + contractMethod: + description: Method of deployed solidity contract to execute + type: string + contractMethodArgs: + default: [] + description: The list of arguments for deployed solidity contract method + items: {} + type: array + required: + - abi + - address + - contractMethod + - invocationType + type: object + InvokeRawWeb3EthContractV1Response: + additionalProperties: false + example: + data: "" + errorDetail: errorDetail + status: 0.8008281904610115 + properties: + status: + description: Status code of the operation + type: number + data: + description: Output of contract invocation method + errorDetail: + description: Error details + type: string + required: + - status + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + WatchBlocksV1: + enum: + - org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Subscribe + - org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Next + - org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Unsubscribe + - org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Error + - org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + WatchBlocksV1Options: + properties: + getBlockData: + type: boolean + type: object + Web3BlockHeader: + properties: + number: + type: string + parentHash: + type: string + sha3Uncles: + type: string + transactionsRoot: + type: string + receiptsRoot: + type: string + difficulty: + type: string + mixHash: + type: string + miner: + type: string + gasLimit: + type: string + gasUsed: + type: string + stateRoot: + type: string + logsBloom: + type: string + extraData: + type: string + nonce: + type: string + timestamp: + type: string + required: + - gasLimit + - gasUsed + - sha3Uncles + - transactionRoot + type: object + Web3Transaction: + properties: + hash: + type: string + nonce: + type: string + blockHash: + type: string + blockNumber: + type: string + transactionIndex: + type: string + from: + type: string + to: + type: string + value: + type: string + gasPrice: + type: string + gas: + type: string + input: + type: string + type: + type: string + chainId: + type: string + v: + type: string + r: + type: string + s: + type: string + required: + - blockHash + - blockNumber + - chainId + - from + - gas + - gasPrice + - hash + - input + - nonce + - to + - transactionIndex + - type + - value + type: object + WatchBlocksV1BlockData: + properties: + number: + type: string + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionsRoot: + type: string + stateRoot: + type: string + receiptsRoot: + type: string + difficulty: + type: string + mixHash: + type: string + miner: + type: string + extraData: + type: string + gasLimit: + type: string + gasUsed: + type: string + timestamp: + $ref: '#/components/schemas/WatchBlocksV1BlockData_timestamp' + size: + type: string + totalDifficulty: + type: string + uncles: + items: + type: string + type: array + baseFeePerGas: + type: string + transactions: + items: + $ref: '#/components/schemas/Web3Transaction' + type: array + required: + - extraData + - gasLimit + - gasUsed + - miner + - nonce + - number + - parentHash + - receiptRoot + - sha3Uncles + - size + - stateRoot + - timestamp + - totalDifficulty + - transactionRoot + - transactions + - uncles + type: object + WatchBlocksV1Progress: + properties: + blockHeader: + $ref: '#/components/schemas/Web3BlockHeader' + blockData: + $ref: '#/components/schemas/WatchBlocksV1BlockData' + type: object + ErrorExceptionResponseV1: + description: Error response from the connector. + properties: + message: + description: Short error description message. + nullable: false + type: string + error: + description: Detailed error information. + nullable: false + type: string + required: + - error + - message + type: object + DeployContractV1Request_contract: + nullable: false + oneOf: + - $ref: '#/components/schemas/ContractJsonDefinition' + - $ref: '#/components/schemas/ContractKeychainDefinition' + InvokeContractV1Request_contract: + nullable: false + oneOf: + - $ref: '#/components/schemas/DeployedContractJsonDefinition' + - $ref: '#/components/schemas/ContractKeychainDefinition' + WatchBlocksV1BlockData_timestamp: + oneOf: + - type: string + - type: number + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..8135510869c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.4' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..4e5f1034c30 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..be00ac975c7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.4 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..889f808e5b5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..8f7f04673fe --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1546 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..55dc77c648f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..a4c3635fc03 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..11fd6b6d211 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,39 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..af26403f302 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..928b84febfd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,445 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(org.openapitools.client.model.Web3SigningCredential.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Web3SigningCredentialCactiKeychainRef", org.openapitools.client.model.Web3SigningCredentialCactiKeychainRef.class); + classByDiscriminatorValue.put("Web3SigningCredentialGethKeychainPassword", org.openapitools.client.model.Web3SigningCredentialGethKeychainPassword.class); + classByDiscriminatorValue.put("Web3SigningCredentialNone", org.openapitools.client.model.Web3SigningCredentialNone.class); + classByDiscriminatorValue.put("Web3SigningCredentialPrivateKeyHex", org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.class); + classByDiscriminatorValue.put("Web3SigningCredential", org.openapitools.client.model.Web3SigningCredential.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) + ; + 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; + } + + { + 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.ContractJSON.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ContractJsonDefinition.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ContractKeychainDefinition.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractV1RequestContract.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployedContractJsonDefinition.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ErrorExceptionResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.EthereumTransactionConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GasTransactionConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GasTransactionConfigEIP1559.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GasTransactionConfigLegacy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1RequestContract.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRawWeb3EthContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRawWeb3EthContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRawWeb3EthMethodV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRawWeb3EthMethodV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1BlockData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1BlockDataTimestamp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1Options.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1Progress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3BlockHeader.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialCactiKeychainRef.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialGethKeychainPassword.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialNone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3Transaction.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3TransactionReceipt.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); + } + } + } + + /** + * 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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..f0542e54c51 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..29f2821eda4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..13d1a2e7586 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..577bdc5c2bf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..67e037c5bd2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,810 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeployContractV1Request; +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.InvokeRawWeb3EthContractV1Request; +import org.openapitools.client.model.InvokeRawWeb3EthContractV1Response; +import org.openapitools.client.model.InvokeRawWeb3EthMethodV1Request; +import org.openapitools.client.model.InvokeRawWeb3EthMethodV1Response; +import org.openapitools.client.model.RunTransactionRequest; +import org.openapitools.client.model.RunTransactionResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 deployContract + * @param deployContractV1Request (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call deployContractCall(DeployContractV1Request deployContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/deploy-contract"; + + 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 deployContractValidateBeforeCall(DeployContractV1Request deployContractV1Request, final ApiCallback _callback) throws ApiException { + return deployContractCall(deployContractV1Request, _callback); + + } + + /** + * Deploys the contract to ethereum ledger. + * + * @param deployContractV1Request (optional) + * @return RunTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public RunTransactionResponse deployContract(DeployContractV1Request deployContractV1Request) throws ApiException { + ApiResponse localVarResp = deployContractWithHttpInfo(deployContractV1Request); + return localVarResp.getData(); + } + + /** + * Deploys the contract to ethereum ledger. + * + * @param deployContractV1Request (optional) + * @return ApiResponse<RunTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public ApiResponse deployContractWithHttpInfo(DeployContractV1Request deployContractV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractValidateBeforeCall(deployContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys the contract to ethereum ledger. (asynchronously) + * + * @param deployContractV1Request (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call deployContractAsync(DeployContractV1Request deployContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractValidateBeforeCall(deployContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + 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 getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeContractV1 + * @param invokeContractV1Request (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call invokeContractV1Call(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-contract"; + + 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 invokeContractV1ValidateBeforeCall(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + return invokeContractV1Call(invokeContractV1Request, _callback); + + } + + /** + * Invokes a contract on an ethereum ledger + * + * @param invokeContractV1Request (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public InvokeContractV1Response invokeContractV1(InvokeContractV1Request invokeContractV1Request) throws ApiException { + ApiResponse localVarResp = invokeContractV1WithHttpInfo(invokeContractV1Request); + return localVarResp.getData(); + } + + /** + * Invokes a contract on an ethereum ledger + * + * @param invokeContractV1Request (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public ApiResponse invokeContractV1WithHttpInfo(InvokeContractV1Request invokeContractV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invokes a contract on an ethereum ledger (asynchronously) + * + * @param invokeContractV1Request (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call invokeContractV1Async(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeRawWeb3EthContractV1 + * @param invokeRawWeb3EthContractV1Request (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call invokeRawWeb3EthContractV1Call(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeRawWeb3EthContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-contract"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain", + "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 invokeRawWeb3EthContractV1ValidateBeforeCall(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request, final ApiCallback _callback) throws ApiException { + return invokeRawWeb3EthContractV1Call(invokeRawWeb3EthContractV1Request, _callback); + + } + + /** + * Low-level endpoint to invoke a method on deployed contract. + * + * @param invokeRawWeb3EthContractV1Request (optional) + * @return InvokeRawWeb3EthContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public InvokeRawWeb3EthContractV1Response invokeRawWeb3EthContractV1(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request) throws ApiException { + ApiResponse localVarResp = invokeRawWeb3EthContractV1WithHttpInfo(invokeRawWeb3EthContractV1Request); + return localVarResp.getData(); + } + + /** + * Low-level endpoint to invoke a method on deployed contract. + * + * @param invokeRawWeb3EthContractV1Request (optional) + * @return ApiResponse<InvokeRawWeb3EthContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public ApiResponse invokeRawWeb3EthContractV1WithHttpInfo(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeRawWeb3EthContractV1ValidateBeforeCall(invokeRawWeb3EthContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Low-level endpoint to invoke a method on deployed contract. (asynchronously) + * + * @param invokeRawWeb3EthContractV1Request (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call invokeRawWeb3EthContractV1Async(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeRawWeb3EthContractV1ValidateBeforeCall(invokeRawWeb3EthContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeWeb3EthMethodV1 + * @param invokeRawWeb3EthMethodV1Request (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call invokeWeb3EthMethodV1Call(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeRawWeb3EthMethodV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/invoke-raw-web3eth-method"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain", + "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 invokeWeb3EthMethodV1ValidateBeforeCall(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request, final ApiCallback _callback) throws ApiException { + return invokeWeb3EthMethodV1Call(invokeRawWeb3EthMethodV1Request, _callback); + + } + + /** + * Invoke any method from web3.eth (low-level) + * + * @param invokeRawWeb3EthMethodV1Request (optional) + * @return InvokeRawWeb3EthMethodV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public InvokeRawWeb3EthMethodV1Response invokeWeb3EthMethodV1(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request) throws ApiException { + ApiResponse localVarResp = invokeWeb3EthMethodV1WithHttpInfo(invokeRawWeb3EthMethodV1Request); + return localVarResp.getData(); + } + + /** + * Invoke any method from web3.eth (low-level) + * + * @param invokeRawWeb3EthMethodV1Request (optional) + * @return ApiResponse<InvokeRawWeb3EthMethodV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public ApiResponse invokeWeb3EthMethodV1WithHttpInfo(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeWeb3EthMethodV1ValidateBeforeCall(invokeRawWeb3EthMethodV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invoke any method from web3.eth (low-level) (asynchronously) + * + * @param invokeRawWeb3EthMethodV1Request (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call invokeWeb3EthMethodV1Async(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeWeb3EthMethodV1ValidateBeforeCall(invokeRawWeb3EthMethodV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for runTransactionV1 + * @param runTransactionRequest (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call runTransactionV1Call(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = runTransactionRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/run-transaction"; + + 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 runTransactionV1ValidateBeforeCall(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + return runTransactionV1Call(runTransactionRequest, _callback); + + } + + /** + * Executes a transaction on a ethereum ledger + * + * @param runTransactionRequest (optional) + * @return RunTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public RunTransactionResponse runTransactionV1(RunTransactionRequest runTransactionRequest) throws ApiException { + ApiResponse localVarResp = runTransactionV1WithHttpInfo(runTransactionRequest); + return localVarResp.getData(); + } + + /** + * Executes a transaction on a ethereum ledger + * + * @param runTransactionRequest (optional) + * @return ApiResponse<RunTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public ApiResponse runTransactionV1WithHttpInfo(RunTransactionRequest runTransactionRequest) throws ApiException { + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Executes a transaction on a ethereum ledger (asynchronously) + * + * @param runTransactionRequest (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call runTransactionV1Async(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..7ab10776ab4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..7f1af90ed75 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..1094952e7ea --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..0e6586dbb94 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..90cb70bd3f1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java new file mode 100644 index 00000000000..3dadba1bc27 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java @@ -0,0 +1,669 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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 java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ContractJSON + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ContractJSON { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_ABI = "abi"; + @SerializedName(SERIALIZED_NAME_ABI) + private List abi = new ArrayList<>(); + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private String metadata; + + public static final String SERIALIZED_NAME_DEPLOYED_BYTECODE = "deployedBytecode"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_BYTECODE) + private String deployedBytecode; + + public static final String SERIALIZED_NAME_SOURCE_MAP = "sourceMap"; + @SerializedName(SERIALIZED_NAME_SOURCE_MAP) + private String sourceMap; + + public static final String SERIALIZED_NAME_DEPLOYED_SOURCE_MAP = "deployedSourceMap"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_SOURCE_MAP) + private String deployedSourceMap; + + public static final String SERIALIZED_NAME_SOURCE_PATH = "sourcePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_PATH) + private String sourcePath; + + public static final String SERIALIZED_NAME_COMPILER = "compiler"; + @SerializedName(SERIALIZED_NAME_COMPILER) + private Object compiler; + + public static final String SERIALIZED_NAME_NETWORKS = "networks"; + @SerializedName(SERIALIZED_NAME_NETWORKS) + private Object networks; + + public static final String SERIALIZED_NAME_AST = "ast"; + @SerializedName(SERIALIZED_NAME_AST) + private Object ast; + + public static final String SERIALIZED_NAME_FUNCTION_HASHES = "functionHashes"; + @SerializedName(SERIALIZED_NAME_FUNCTION_HASHES) + private Object functionHashes; + + public static final String SERIALIZED_NAME_GAS_ESTIMATES = "gasEstimates"; + @SerializedName(SERIALIZED_NAME_GAS_ESTIMATES) + private Object gasEstimates; + + public ContractJSON() { + } + + public ContractJSON contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public ContractJSON bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + * @return bytecode + **/ + @javax.annotation.Nonnull + + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public ContractJSON abi(List abi) { + + this.abi = abi; + return this; + } + + public ContractJSON addAbiItem(Object abiItem) { + this.abi.add(abiItem); + return this; + } + + /** + * The application binary interface of the solidity contract, optional parameter + * @return abi + **/ + @javax.annotation.Nonnull + + public List getAbi() { + return abi; + } + + + public void setAbi(List abi) { + this.abi = abi; + } + + + public ContractJSON metadata(String metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + + public String getMetadata() { + return metadata; + } + + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + + public ContractJSON deployedBytecode(String deployedBytecode) { + + this.deployedBytecode = deployedBytecode; + return this; + } + + /** + * Get deployedBytecode + * @return deployedBytecode + **/ + @javax.annotation.Nullable + + public String getDeployedBytecode() { + return deployedBytecode; + } + + + public void setDeployedBytecode(String deployedBytecode) { + this.deployedBytecode = deployedBytecode; + } + + + public ContractJSON sourceMap(String sourceMap) { + + this.sourceMap = sourceMap; + return this; + } + + /** + * Get sourceMap + * @return sourceMap + **/ + @javax.annotation.Nullable + + public String getSourceMap() { + return sourceMap; + } + + + public void setSourceMap(String sourceMap) { + this.sourceMap = sourceMap; + } + + + public ContractJSON deployedSourceMap(String deployedSourceMap) { + + this.deployedSourceMap = deployedSourceMap; + return this; + } + + /** + * Get deployedSourceMap + * @return deployedSourceMap + **/ + @javax.annotation.Nullable + + public String getDeployedSourceMap() { + return deployedSourceMap; + } + + + public void setDeployedSourceMap(String deployedSourceMap) { + this.deployedSourceMap = deployedSourceMap; + } + + + public ContractJSON sourcePath(String sourcePath) { + + this.sourcePath = sourcePath; + return this; + } + + /** + * Get sourcePath + * @return sourcePath + **/ + @javax.annotation.Nullable + + public String getSourcePath() { + return sourcePath; + } + + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + } + + + public ContractJSON compiler(Object compiler) { + + this.compiler = compiler; + return this; + } + + /** + * Get compiler + * @return compiler + **/ + @javax.annotation.Nullable + + public Object getCompiler() { + return compiler; + } + + + public void setCompiler(Object compiler) { + this.compiler = compiler; + } + + + public ContractJSON networks(Object networks) { + + this.networks = networks; + return this; + } + + /** + * Get networks + * @return networks + **/ + @javax.annotation.Nullable + + public Object getNetworks() { + return networks; + } + + + public void setNetworks(Object networks) { + this.networks = networks; + } + + + public ContractJSON ast(Object ast) { + + this.ast = ast; + return this; + } + + /** + * Get ast + * @return ast + **/ + @javax.annotation.Nullable + + public Object getAst() { + return ast; + } + + + public void setAst(Object ast) { + this.ast = ast; + } + + + public ContractJSON functionHashes(Object functionHashes) { + + this.functionHashes = functionHashes; + return this; + } + + /** + * Get functionHashes + * @return functionHashes + **/ + @javax.annotation.Nullable + + public Object getFunctionHashes() { + return functionHashes; + } + + + public void setFunctionHashes(Object functionHashes) { + this.functionHashes = functionHashes; + } + + + public ContractJSON gasEstimates(Object gasEstimates) { + + this.gasEstimates = gasEstimates; + return this; + } + + /** + * Get gasEstimates + * @return gasEstimates + **/ + @javax.annotation.Nullable + + public Object getGasEstimates() { + return gasEstimates; + } + + + public void setGasEstimates(Object gasEstimates) { + this.gasEstimates = gasEstimates; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ContractJSON instance itself + */ + public ContractJSON putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContractJSON contractJSON = (ContractJSON) o; + return Objects.equals(this.contractName, contractJSON.contractName) && + Objects.equals(this.bytecode, contractJSON.bytecode) && + Objects.equals(this.abi, contractJSON.abi) && + Objects.equals(this.metadata, contractJSON.metadata) && + Objects.equals(this.deployedBytecode, contractJSON.deployedBytecode) && + Objects.equals(this.sourceMap, contractJSON.sourceMap) && + Objects.equals(this.deployedSourceMap, contractJSON.deployedSourceMap) && + Objects.equals(this.sourcePath, contractJSON.sourcePath) && + Objects.equals(this.compiler, contractJSON.compiler) && + Objects.equals(this.networks, contractJSON.networks) && + Objects.equals(this.ast, contractJSON.ast) && + Objects.equals(this.functionHashes, contractJSON.functionHashes) && + Objects.equals(this.gasEstimates, contractJSON.gasEstimates)&& + Objects.equals(this.additionalProperties, contractJSON.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, bytecode, abi, metadata, deployedBytecode, sourceMap, deployedSourceMap, sourcePath, compiler, networks, ast, functionHashes, gasEstimates, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContractJSON {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" abi: ").append(toIndentedString(abi)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" deployedBytecode: ").append(toIndentedString(deployedBytecode)).append("\n"); + sb.append(" sourceMap: ").append(toIndentedString(sourceMap)).append("\n"); + sb.append(" deployedSourceMap: ").append(toIndentedString(deployedSourceMap)).append("\n"); + sb.append(" sourcePath: ").append(toIndentedString(sourcePath)).append("\n"); + sb.append(" compiler: ").append(toIndentedString(compiler)).append("\n"); + sb.append(" networks: ").append(toIndentedString(networks)).append("\n"); + sb.append(" ast: ").append(toIndentedString(ast)).append("\n"); + sb.append(" functionHashes: ").append(toIndentedString(functionHashes)).append("\n"); + sb.append(" gasEstimates: ").append(toIndentedString(gasEstimates)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("bytecode"); + openapiFields.add("abi"); + openapiFields.add("metadata"); + openapiFields.add("deployedBytecode"); + openapiFields.add("sourceMap"); + openapiFields.add("deployedSourceMap"); + openapiFields.add("sourcePath"); + openapiFields.add("compiler"); + openapiFields.add("networks"); + openapiFields.add("ast"); + openapiFields.add("functionHashes"); + openapiFields.add("gasEstimates"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("bytecode"); + openapiRequiredFields.add("abi"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ContractJSON + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ContractJSON.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ContractJSON is not found in the empty JSON string", ContractJSON.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ContractJSON.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if (!jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + // ensure the required json array is present + if (jsonObj.get("abi") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("abi").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `abi` to be an array in the JSON string but got `%s`", jsonObj.get("abi").toString())); + } + if ((jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) && !jsonObj.get("metadata").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `metadata` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadata").toString())); + } + if ((jsonObj.get("deployedBytecode") != null && !jsonObj.get("deployedBytecode").isJsonNull()) && !jsonObj.get("deployedBytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedBytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedBytecode").toString())); + } + if ((jsonObj.get("sourceMap") != null && !jsonObj.get("sourceMap").isJsonNull()) && !jsonObj.get("sourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceMap").toString())); + } + if ((jsonObj.get("deployedSourceMap") != null && !jsonObj.get("deployedSourceMap").isJsonNull()) && !jsonObj.get("deployedSourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedSourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedSourceMap").toString())); + } + if ((jsonObj.get("sourcePath") != null && !jsonObj.get("sourcePath").isJsonNull()) && !jsonObj.get("sourcePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourcePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourcePath").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ContractJSON.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ContractJSON' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ContractJSON.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ContractJSON value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ContractJSON read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ContractJSON instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ContractJSON given an JSON string + * + * @param jsonString JSON string + * @return An instance of ContractJSON + * @throws IOException if the JSON string is invalid with respect to ContractJSON + */ + public static ContractJSON fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ContractJSON.class); + } + + /** + * Convert an instance of ContractJSON to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJsonDefinition.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJsonDefinition.java new file mode 100644 index 00000000000..d5c34e609f9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJsonDefinition.java @@ -0,0 +1,211 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ContractJSON; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ContractJsonDefinition + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ContractJsonDefinition { + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private ContractJSON contractJSON; + + public ContractJsonDefinition() { + } + + public ContractJsonDefinition contractJSON(ContractJSON contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * Get contractJSON + * @return contractJSON + **/ + @javax.annotation.Nonnull + + public ContractJSON getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(ContractJSON contractJSON) { + this.contractJSON = contractJSON; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContractJsonDefinition contractJsonDefinition = (ContractJsonDefinition) o; + return Objects.equals(this.contractJSON, contractJsonDefinition.contractJSON); + } + + @Override + public int hashCode() { + return Objects.hash(contractJSON); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContractJsonDefinition {\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractJSON"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractJSON"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ContractJsonDefinition + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ContractJsonDefinition.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ContractJsonDefinition is not found in the empty JSON string", ContractJsonDefinition.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ContractJsonDefinition.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ContractJsonDefinition` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ContractJsonDefinition.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ContractJsonDefinition.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ContractJsonDefinition' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ContractJsonDefinition.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ContractJsonDefinition value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ContractJsonDefinition read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ContractJsonDefinition given an JSON string + * + * @param jsonString JSON string + * @return An instance of ContractJsonDefinition + * @throws IOException if the JSON string is invalid with respect to ContractJsonDefinition + */ + public static ContractJsonDefinition fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ContractJsonDefinition.class); + } + + /** + * Convert an instance of ContractJsonDefinition to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractKeychainDefinition.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractKeychainDefinition.java new file mode 100644 index 00000000000..de941a72770 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractKeychainDefinition.java @@ -0,0 +1,246 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ContractKeychainDefinition + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ContractKeychainDefinition { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public ContractKeychainDefinition() { + } + + public ContractKeychainDefinition contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * The contract name for retrieve the contracts json on the keychain. + * @return contractName + **/ + @javax.annotation.Nonnull + + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public ContractKeychainDefinition keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychainId for retrieve the contracts json. + * @return keychainId + **/ + @javax.annotation.Nonnull + + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContractKeychainDefinition contractKeychainDefinition = (ContractKeychainDefinition) o; + return Objects.equals(this.contractName, contractKeychainDefinition.contractName) && + Objects.equals(this.keychainId, contractKeychainDefinition.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContractKeychainDefinition {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ContractKeychainDefinition + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ContractKeychainDefinition.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ContractKeychainDefinition is not found in the empty JSON string", ContractKeychainDefinition.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ContractKeychainDefinition.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ContractKeychainDefinition` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ContractKeychainDefinition.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ContractKeychainDefinition.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ContractKeychainDefinition' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ContractKeychainDefinition.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ContractKeychainDefinition value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ContractKeychainDefinition read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ContractKeychainDefinition given an JSON string + * + * @param jsonString JSON string + * @return An instance of ContractKeychainDefinition + * @throws IOException if the JSON string is invalid with respect to ContractKeychainDefinition + */ + public static ContractKeychainDefinition fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ContractKeychainDefinition.class); + } + + /** + * Convert an instance of ContractKeychainDefinition to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java new file mode 100644 index 00000000000..7ce96c770a6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java @@ -0,0 +1,355 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.DeployContractV1RequestContract; +import org.openapitools.client.model.GasTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractV1Request { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private DeployContractV1RequestContract contract; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public static final String SERIALIZED_NAME_GAS_CONFIG = "gasConfig"; + @SerializedName(SERIALIZED_NAME_GAS_CONFIG) + private GasTransactionConfig gasConfig; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public DeployContractV1Request() { + } + + public DeployContractV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public DeployContractV1Request contract(DeployContractV1RequestContract contract) { + + this.contract = contract; + return this; + } + + /** + * Get contract + * @return contract + **/ + @javax.annotation.Nonnull + + public DeployContractV1RequestContract getContract() { + return contract; + } + + + public void setContract(DeployContractV1RequestContract contract) { + this.contract = contract; + } + + + public DeployContractV1Request constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public DeployContractV1Request addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * The list of arguments to pass in to the constructor of the contract being deployed. + * @return constructorArgs + **/ + @javax.annotation.Nullable + + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public DeployContractV1Request gasConfig(GasTransactionConfig gasConfig) { + + this.gasConfig = gasConfig; + return this; + } + + /** + * Get gasConfig + * @return gasConfig + **/ + @javax.annotation.Nullable + + public GasTransactionConfig getGasConfig() { + return gasConfig; + } + + + public void setGasConfig(GasTransactionConfig gasConfig) { + this.gasConfig = gasConfig; + } + + + public DeployContractV1Request value(String value) { + + this.value = value; + return this; + } + + /** + * Ether balance to send on deployment. + * @return value + **/ + @javax.annotation.Nullable + + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractV1Request deployContractV1Request = (DeployContractV1Request) o; + return Objects.equals(this.web3SigningCredential, deployContractV1Request.web3SigningCredential) && + Objects.equals(this.contract, deployContractV1Request.contract) && + Objects.equals(this.constructorArgs, deployContractV1Request.constructorArgs) && + Objects.equals(this.gasConfig, deployContractV1Request.gasConfig) && + Objects.equals(this.value, deployContractV1Request.value); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, contract, constructorArgs, gasConfig, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractV1Request {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" gasConfig: ").append(toIndentedString(gasConfig)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("contract"); + openapiFields.add("constructorArgs"); + openapiFields.add("gasConfig"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("contract"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractV1Request is not found in the empty JSON string", DeployContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + // validate the required field `contract` + DeployContractV1RequestContract.validateJsonObject(jsonObj.getAsJsonObject("contract")); + // ensure the optional json data is an array if present + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + // validate the optional field `gasConfig` + if (jsonObj.get("gasConfig") != null && !jsonObj.get("gasConfig").isJsonNull()) { + GasTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("gasConfig")); + } + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractV1Request + */ + public static DeployContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractV1Request.class); + } + + /** + * Convert an instance of DeployContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1RequestContract.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1RequestContract.java new file mode 100644 index 00000000000..6849110b25d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1RequestContract.java @@ -0,0 +1,285 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.ContractJsonDefinition; +import org.openapitools.client.model.ContractKeychainDefinition; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractV1RequestContract extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(DeployContractV1RequestContract.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractV1RequestContract.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractV1RequestContract' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterContractJsonDefinition = gson.getDelegateAdapter(this, TypeToken.get(ContractJsonDefinition.class)); + final TypeAdapter adapterContractKeychainDefinition = gson.getDelegateAdapter(this, TypeToken.get(ContractKeychainDefinition.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractV1RequestContract value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `ContractJsonDefinition` + if (value.getActualInstance() instanceof ContractJsonDefinition) { + JsonObject obj = adapterContractJsonDefinition.toJsonTree((ContractJsonDefinition)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `ContractKeychainDefinition` + if (value.getActualInstance() instanceof ContractKeychainDefinition) { + JsonObject obj = adapterContractKeychainDefinition.toJsonTree((ContractKeychainDefinition)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ContractJsonDefinition, ContractKeychainDefinition"); + } + + @Override + public DeployContractV1RequestContract read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ContractJsonDefinition + try { + // validate the JSON object to see if any exception is thrown + ContractJsonDefinition.validateJsonObject(jsonObject); + actualAdapter = adapterContractJsonDefinition; + match++; + log.log(Level.FINER, "Input data matches schema 'ContractJsonDefinition'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ContractJsonDefinition failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ContractJsonDefinition'", e); + } + + // deserialize ContractKeychainDefinition + try { + // validate the JSON object to see if any exception is thrown + ContractKeychainDefinition.validateJsonObject(jsonObject); + actualAdapter = adapterContractKeychainDefinition; + match++; + log.log(Level.FINER, "Input data matches schema 'ContractKeychainDefinition'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ContractKeychainDefinition failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ContractKeychainDefinition'", e); + } + + if (match == 1) { + DeployContractV1RequestContract ret = new DeployContractV1RequestContract(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for DeployContractV1RequestContract: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public DeployContractV1RequestContract() { + super("oneOf", Boolean.FALSE); + } + + public DeployContractV1RequestContract(ContractJsonDefinition o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public DeployContractV1RequestContract(ContractKeychainDefinition o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ContractJsonDefinition", new GenericType() { + }); + schemas.put("ContractKeychainDefinition", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return DeployContractV1RequestContract.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * ContractJsonDefinition, ContractKeychainDefinition + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ContractJsonDefinition) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ContractKeychainDefinition) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be ContractJsonDefinition, ContractKeychainDefinition"); + } + + /** + * Get the actual instance, which can be the following: + * ContractJsonDefinition, ContractKeychainDefinition + * + * @return The actual instance (ContractJsonDefinition, ContractKeychainDefinition) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ContractJsonDefinition`. If the actual instance is not `ContractJsonDefinition`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ContractJsonDefinition` + * @throws ClassCastException if the instance is not `ContractJsonDefinition` + */ + public ContractJsonDefinition getContractJsonDefinition() throws ClassCastException { + return (ContractJsonDefinition)super.getActualInstance(); + } + + /** + * Get the actual instance of `ContractKeychainDefinition`. If the actual instance is not `ContractKeychainDefinition`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ContractKeychainDefinition` + * @throws ClassCastException if the instance is not `ContractKeychainDefinition` + */ + public ContractKeychainDefinition getContractKeychainDefinition() throws ClassCastException { + return (ContractKeychainDefinition)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractV1RequestContract + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ContractJsonDefinition + try { + ContractJsonDefinition.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ContractJsonDefinition failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ContractKeychainDefinition + try { + ContractKeychainDefinition.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ContractKeychainDefinition failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for DeployContractV1RequestContract with oneOf schemas: ContractJsonDefinition, ContractKeychainDefinition. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of DeployContractV1RequestContract given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractV1RequestContract + * @throws IOException if the JSON string is invalid with respect to DeployContractV1RequestContract + */ + public static DeployContractV1RequestContract fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractV1RequestContract.class); + } + + /** + * Convert an instance of DeployContractV1RequestContract to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployedContractJsonDefinition.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployedContractJsonDefinition.java new file mode 100644 index 00000000000..f1c8de0d855 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployedContractJsonDefinition.java @@ -0,0 +1,244 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ContractJSON; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployedContractJsonDefinition + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployedContractJsonDefinition { + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private ContractJSON contractJSON; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public DeployedContractJsonDefinition() { + } + + public DeployedContractJsonDefinition contractJSON(ContractJSON contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * Get contractJSON + * @return contractJSON + **/ + @javax.annotation.Nonnull + + public ContractJSON getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(ContractJSON contractJSON) { + this.contractJSON = contractJSON; + } + + + public DeployedContractJsonDefinition contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Get contractAddress + * @return contractAddress + **/ + @javax.annotation.Nonnull + + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployedContractJsonDefinition deployedContractJsonDefinition = (DeployedContractJsonDefinition) o; + return Objects.equals(this.contractJSON, deployedContractJsonDefinition.contractJSON) && + Objects.equals(this.contractAddress, deployedContractJsonDefinition.contractAddress); + } + + @Override + public int hashCode() { + return Objects.hash(contractJSON, contractAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployedContractJsonDefinition {\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractJSON"); + openapiFields.add("contractAddress"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractJSON"); + openapiRequiredFields.add("contractAddress"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployedContractJsonDefinition + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployedContractJsonDefinition.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployedContractJsonDefinition is not found in the empty JSON string", DeployedContractJsonDefinition.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployedContractJsonDefinition.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployedContractJsonDefinition` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployedContractJsonDefinition.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployedContractJsonDefinition.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployedContractJsonDefinition' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployedContractJsonDefinition.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployedContractJsonDefinition value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployedContractJsonDefinition read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployedContractJsonDefinition given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployedContractJsonDefinition + * @throws IOException if the JSON string is invalid with respect to DeployedContractJsonDefinition + */ + public static DeployedContractJsonDefinition fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployedContractJsonDefinition.class); + } + + /** + * Convert an instance of DeployedContractJsonDefinition to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java new file mode 100644 index 00000000000..9f7f38d7232 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java @@ -0,0 +1,246 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Error response from the connector. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ErrorExceptionResponseV1 { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private String error; + + public ErrorExceptionResponseV1() { + } + + public ErrorExceptionResponseV1 message(String message) { + + this.message = message; + return this; + } + + /** + * Short error description message. + * @return message + **/ + @javax.annotation.Nonnull + + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ErrorExceptionResponseV1 error(String error) { + + this.error = error; + return this; + } + + /** + * Detailed error information. + * @return error + **/ + @javax.annotation.Nonnull + + public String getError() { + return error; + } + + + public void setError(String error) { + this.error = error; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorExceptionResponseV1 errorExceptionResponseV1 = (ErrorExceptionResponseV1) o; + return Objects.equals(this.message, errorExceptionResponseV1.message) && + Objects.equals(this.error, errorExceptionResponseV1.error); + } + + @Override + public int hashCode() { + return Objects.hash(message, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorExceptionResponseV1 {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + openapiFields.add("error"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("error"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ErrorExceptionResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ErrorExceptionResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorExceptionResponseV1 is not found in the empty JSON string", ErrorExceptionResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ErrorExceptionResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorExceptionResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorExceptionResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if (!jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorExceptionResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorExceptionResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorExceptionResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorExceptionResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorExceptionResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorExceptionResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorExceptionResponseV1 + * @throws IOException if the JSON string is invalid with respect to ErrorExceptionResponseV1 + */ + public static ErrorExceptionResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorExceptionResponseV1.class); + } + + /** + * Convert an instance of ErrorExceptionResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java new file mode 100644 index 00000000000..d5fbd058d6b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets EthContractInvocationType + */ +@JsonAdapter(EthContractInvocationType.Adapter.class) +public enum EthContractInvocationType { + + SEND("SEND"), + + CALL("CALL"); + + private String value; + + EthContractInvocationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EthContractInvocationType fromValue(String value) { + for (EthContractInvocationType b : EthContractInvocationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EthContractInvocationType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EthContractInvocationType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EthContractInvocationType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java new file mode 100644 index 00000000000..f1dc16408c7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets EthContractInvocationWeb3Method + */ +@JsonAdapter(EthContractInvocationWeb3Method.Adapter.class) +public enum EthContractInvocationWeb3Method { + + SEND("send"), + + CALL("call"), + + ENCODEABI("encodeABI"), + + ESTIMATEGAS("estimateGas"); + + private String value; + + EthContractInvocationWeb3Method(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EthContractInvocationWeb3Method fromValue(String value) { + for (EthContractInvocationWeb3Method b : EthContractInvocationWeb3Method.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EthContractInvocationWeb3Method enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EthContractInvocationWeb3Method read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EthContractInvocationWeb3Method.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthereumTransactionConfig.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthereumTransactionConfig.java new file mode 100644 index 00000000000..6bd4d729720 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthereumTransactionConfig.java @@ -0,0 +1,399 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GasTransactionConfig; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * EthereumTransactionConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EthereumTransactionConfig { + public static final String SERIALIZED_NAME_RAW_TRANSACTION = "rawTransaction"; + @SerializedName(SERIALIZED_NAME_RAW_TRANSACTION) + private String rawTransaction; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private String data; + + public static final String SERIALIZED_NAME_GAS_CONFIG = "gasConfig"; + @SerializedName(SERIALIZED_NAME_GAS_CONFIG) + private GasTransactionConfig gasConfig; + + public EthereumTransactionConfig() { + } + + public EthereumTransactionConfig rawTransaction(String rawTransaction) { + + this.rawTransaction = rawTransaction; + return this; + } + + /** + * Get rawTransaction + * @return rawTransaction + **/ + @javax.annotation.Nullable + + public String getRawTransaction() { + return rawTransaction; + } + + + public void setRawTransaction(String rawTransaction) { + this.rawTransaction = rawTransaction; + } + + + public EthereumTransactionConfig from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nullable + + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public EthereumTransactionConfig to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nullable + + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + + public EthereumTransactionConfig value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + public EthereumTransactionConfig nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public EthereumTransactionConfig data(String data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + + public String getData() { + return data; + } + + + public void setData(String data) { + this.data = data; + } + + + public EthereumTransactionConfig gasConfig(GasTransactionConfig gasConfig) { + + this.gasConfig = gasConfig; + return this; + } + + /** + * Get gasConfig + * @return gasConfig + **/ + @javax.annotation.Nullable + + public GasTransactionConfig getGasConfig() { + return gasConfig; + } + + + public void setGasConfig(GasTransactionConfig gasConfig) { + this.gasConfig = gasConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EthereumTransactionConfig ethereumTransactionConfig = (EthereumTransactionConfig) o; + return Objects.equals(this.rawTransaction, ethereumTransactionConfig.rawTransaction) && + Objects.equals(this.from, ethereumTransactionConfig.from) && + Objects.equals(this.to, ethereumTransactionConfig.to) && + Objects.equals(this.value, ethereumTransactionConfig.value) && + Objects.equals(this.nonce, ethereumTransactionConfig.nonce) && + Objects.equals(this.data, ethereumTransactionConfig.data) && + Objects.equals(this.gasConfig, ethereumTransactionConfig.gasConfig); + } + + @Override + public int hashCode() { + return Objects.hash(rawTransaction, from, to, value, nonce, data, gasConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EthereumTransactionConfig {\n"); + sb.append(" rawTransaction: ").append(toIndentedString(rawTransaction)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" gasConfig: ").append(toIndentedString(gasConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rawTransaction"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("value"); + openapiFields.add("nonce"); + openapiFields.add("data"); + openapiFields.add("gasConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EthereumTransactionConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EthereumTransactionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EthereumTransactionConfig is not found in the empty JSON string", EthereumTransactionConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EthereumTransactionConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EthereumTransactionConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("rawTransaction") != null && !jsonObj.get("rawTransaction").isJsonNull()) && !jsonObj.get("rawTransaction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rawTransaction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawTransaction").toString())); + } + if ((jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) && !jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if ((jsonObj.get("to") != null && !jsonObj.get("to").isJsonNull()) && !jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + if ((jsonObj.get("nonce") != null && !jsonObj.get("nonce").isJsonNull()) && !jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if ((jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) && !jsonObj.get("data").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + // validate the optional field `gasConfig` + if (jsonObj.get("gasConfig") != null && !jsonObj.get("gasConfig").isJsonNull()) { + GasTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("gasConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EthereumTransactionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EthereumTransactionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EthereumTransactionConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EthereumTransactionConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EthereumTransactionConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EthereumTransactionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of EthereumTransactionConfig + * @throws IOException if the JSON string is invalid with respect to EthereumTransactionConfig + */ + public static EthereumTransactionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EthereumTransactionConfig.class); + } + + /** + * Convert an instance of EthereumTransactionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfig.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfig.java new file mode 100644 index 00000000000..5fc19700a63 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfig.java @@ -0,0 +1,284 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GasTransactionConfigEIP1559; +import org.openapitools.client.model.GasTransactionConfigLegacy; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GasTransactionConfig extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(GasTransactionConfig.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GasTransactionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GasTransactionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterGasTransactionConfigEIP1559 = gson.getDelegateAdapter(this, TypeToken.get(GasTransactionConfigEIP1559.class)); + final TypeAdapter adapterGasTransactionConfigLegacy = gson.getDelegateAdapter(this, TypeToken.get(GasTransactionConfigLegacy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GasTransactionConfig value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `GasTransactionConfigEIP1559` + if (value.getActualInstance() instanceof GasTransactionConfigEIP1559) { + JsonObject obj = adapterGasTransactionConfigEIP1559.toJsonTree((GasTransactionConfigEIP1559)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GasTransactionConfigLegacy` + if (value.getActualInstance() instanceof GasTransactionConfigLegacy) { + JsonObject obj = adapterGasTransactionConfigLegacy.toJsonTree((GasTransactionConfigLegacy)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: GasTransactionConfigEIP1559, GasTransactionConfigLegacy"); + } + + @Override + public GasTransactionConfig read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize GasTransactionConfigEIP1559 + try { + // validate the JSON object to see if any exception is thrown + GasTransactionConfigEIP1559.validateJsonObject(jsonObject); + actualAdapter = adapterGasTransactionConfigEIP1559; + match++; + log.log(Level.FINER, "Input data matches schema 'GasTransactionConfigEIP1559'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GasTransactionConfigEIP1559 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GasTransactionConfigEIP1559'", e); + } + + // deserialize GasTransactionConfigLegacy + try { + // validate the JSON object to see if any exception is thrown + GasTransactionConfigLegacy.validateJsonObject(jsonObject); + actualAdapter = adapterGasTransactionConfigLegacy; + match++; + log.log(Level.FINER, "Input data matches schema 'GasTransactionConfigLegacy'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GasTransactionConfigLegacy failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GasTransactionConfigLegacy'", e); + } + + if (match == 1) { + GasTransactionConfig ret = new GasTransactionConfig(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for GasTransactionConfig: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public GasTransactionConfig() { + super("oneOf", Boolean.FALSE); + } + + public GasTransactionConfig(GasTransactionConfigEIP1559 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public GasTransactionConfig(GasTransactionConfigLegacy o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("GasTransactionConfigEIP1559", new GenericType() { + }); + schemas.put("GasTransactionConfigLegacy", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return GasTransactionConfig.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * GasTransactionConfigEIP1559, GasTransactionConfigLegacy + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof GasTransactionConfigEIP1559) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GasTransactionConfigLegacy) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be GasTransactionConfigEIP1559, GasTransactionConfigLegacy"); + } + + /** + * Get the actual instance, which can be the following: + * GasTransactionConfigEIP1559, GasTransactionConfigLegacy + * + * @return The actual instance (GasTransactionConfigEIP1559, GasTransactionConfigLegacy) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `GasTransactionConfigEIP1559`. If the actual instance is not `GasTransactionConfigEIP1559`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GasTransactionConfigEIP1559` + * @throws ClassCastException if the instance is not `GasTransactionConfigEIP1559` + */ + public GasTransactionConfigEIP1559 getGasTransactionConfigEIP1559() throws ClassCastException { + return (GasTransactionConfigEIP1559)super.getActualInstance(); + } + + /** + * Get the actual instance of `GasTransactionConfigLegacy`. If the actual instance is not `GasTransactionConfigLegacy`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GasTransactionConfigLegacy` + * @throws ClassCastException if the instance is not `GasTransactionConfigLegacy` + */ + public GasTransactionConfigLegacy getGasTransactionConfigLegacy() throws ClassCastException { + return (GasTransactionConfigLegacy)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GasTransactionConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with GasTransactionConfigEIP1559 + try { + GasTransactionConfigEIP1559.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GasTransactionConfigEIP1559 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GasTransactionConfigLegacy + try { + GasTransactionConfigLegacy.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GasTransactionConfigLegacy failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for GasTransactionConfig with oneOf schemas: GasTransactionConfigEIP1559, GasTransactionConfigLegacy. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of GasTransactionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of GasTransactionConfig + * @throws IOException if the JSON string is invalid with respect to GasTransactionConfig + */ + public static GasTransactionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GasTransactionConfig.class); + } + + /** + * Convert an instance of GasTransactionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfigEIP1559.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfigEIP1559.java new file mode 100644 index 00000000000..59219fa9752 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfigEIP1559.java @@ -0,0 +1,269 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Transaction gas settings in networks after EIP-1559 (London fork). + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GasTransactionConfigEIP1559 { + public static final String SERIALIZED_NAME_GAS_LIMIT = "gasLimit"; + @SerializedName(SERIALIZED_NAME_GAS_LIMIT) + private String gasLimit; + + public static final String SERIALIZED_NAME_MAX_FEE_PER_GAS = "maxFeePerGas"; + @SerializedName(SERIALIZED_NAME_MAX_FEE_PER_GAS) + private String maxFeePerGas; + + public static final String SERIALIZED_NAME_MAX_PRIORITY_FEE_PER_GAS = "maxPriorityFeePerGas"; + @SerializedName(SERIALIZED_NAME_MAX_PRIORITY_FEE_PER_GAS) + private String maxPriorityFeePerGas; + + public GasTransactionConfigEIP1559() { + } + + public GasTransactionConfigEIP1559 gasLimit(String gasLimit) { + + this.gasLimit = gasLimit; + return this; + } + + /** + * A maximum amount of gas a user is willing to provide for the execution of the transaction. + * @return gasLimit + **/ + @javax.annotation.Nullable + + public String getGasLimit() { + return gasLimit; + } + + + public void setGasLimit(String gasLimit) { + this.gasLimit = gasLimit; + } + + + public GasTransactionConfigEIP1559 maxFeePerGas(String maxFeePerGas) { + + this.maxFeePerGas = maxFeePerGas; + return this; + } + + /** + * A maximum fee (including the base fee and the tip) a user is willing to pay per unit of gas. + * @return maxFeePerGas + **/ + @javax.annotation.Nullable + + public String getMaxFeePerGas() { + return maxFeePerGas; + } + + + public void setMaxFeePerGas(String maxFeePerGas) { + this.maxFeePerGas = maxFeePerGas; + } + + + public GasTransactionConfigEIP1559 maxPriorityFeePerGas(String maxPriorityFeePerGas) { + + this.maxPriorityFeePerGas = maxPriorityFeePerGas; + return this; + } + + /** + * A maximum tip amount a user is willing to pay per unit of gas. + * @return maxPriorityFeePerGas + **/ + @javax.annotation.Nullable + + public String getMaxPriorityFeePerGas() { + return maxPriorityFeePerGas; + } + + + public void setMaxPriorityFeePerGas(String maxPriorityFeePerGas) { + this.maxPriorityFeePerGas = maxPriorityFeePerGas; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GasTransactionConfigEIP1559 gasTransactionConfigEIP1559 = (GasTransactionConfigEIP1559) o; + return Objects.equals(this.gasLimit, gasTransactionConfigEIP1559.gasLimit) && + Objects.equals(this.maxFeePerGas, gasTransactionConfigEIP1559.maxFeePerGas) && + Objects.equals(this.maxPriorityFeePerGas, gasTransactionConfigEIP1559.maxPriorityFeePerGas); + } + + @Override + public int hashCode() { + return Objects.hash(gasLimit, maxFeePerGas, maxPriorityFeePerGas); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GasTransactionConfigEIP1559 {\n"); + sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" maxFeePerGas: ").append(toIndentedString(maxFeePerGas)).append("\n"); + sb.append(" maxPriorityFeePerGas: ").append(toIndentedString(maxPriorityFeePerGas)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("gasLimit"); + openapiFields.add("maxFeePerGas"); + openapiFields.add("maxPriorityFeePerGas"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GasTransactionConfigEIP1559 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GasTransactionConfigEIP1559.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GasTransactionConfigEIP1559 is not found in the empty JSON string", GasTransactionConfigEIP1559.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GasTransactionConfigEIP1559.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GasTransactionConfigEIP1559` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("gasLimit") != null && !jsonObj.get("gasLimit").isJsonNull()) && !jsonObj.get("gasLimit").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasLimit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasLimit").toString())); + } + if ((jsonObj.get("maxFeePerGas") != null && !jsonObj.get("maxFeePerGas").isJsonNull()) && !jsonObj.get("maxFeePerGas").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `maxFeePerGas` to be a primitive type in the JSON string but got `%s`", jsonObj.get("maxFeePerGas").toString())); + } + if ((jsonObj.get("maxPriorityFeePerGas") != null && !jsonObj.get("maxPriorityFeePerGas").isJsonNull()) && !jsonObj.get("maxPriorityFeePerGas").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `maxPriorityFeePerGas` to be a primitive type in the JSON string but got `%s`", jsonObj.get("maxPriorityFeePerGas").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GasTransactionConfigEIP1559.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GasTransactionConfigEIP1559' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GasTransactionConfigEIP1559.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GasTransactionConfigEIP1559 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GasTransactionConfigEIP1559 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GasTransactionConfigEIP1559 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GasTransactionConfigEIP1559 + * @throws IOException if the JSON string is invalid with respect to GasTransactionConfigEIP1559 + */ + public static GasTransactionConfigEIP1559 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GasTransactionConfigEIP1559.class); + } + + /** + * Convert an instance of GasTransactionConfigEIP1559 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfigLegacy.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfigLegacy.java new file mode 100644 index 00000000000..0ae049d3604 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GasTransactionConfigLegacy.java @@ -0,0 +1,237 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Transaction gas settings in networks before EIP-1559 (London fork). + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GasTransactionConfigLegacy { + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private String gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private String gasPrice; + + public GasTransactionConfigLegacy() { + } + + public GasTransactionConfigLegacy gas(String gas) { + + this.gas = gas; + return this; + } + + /** + * A maximum amount of gas a user is willing to provide for the execution of the transaction. (gasLimit) + * @return gas + **/ + @javax.annotation.Nullable + + public String getGas() { + return gas; + } + + + public void setGas(String gas) { + this.gas = gas; + } + + + public GasTransactionConfigLegacy gasPrice(String gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * A price (in Wei) a user is willing to pay for each unit of gas used during the execution of the transaction. In EIP-1559 (London fork) networks, it will be set as both maxFeePerGas and maxPriorityFeePerGas. + * @return gasPrice + **/ + @javax.annotation.Nullable + + public String getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(String gasPrice) { + this.gasPrice = gasPrice; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GasTransactionConfigLegacy gasTransactionConfigLegacy = (GasTransactionConfigLegacy) o; + return Objects.equals(this.gas, gasTransactionConfigLegacy.gas) && + Objects.equals(this.gasPrice, gasTransactionConfigLegacy.gasPrice); + } + + @Override + public int hashCode() { + return Objects.hash(gas, gasPrice); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GasTransactionConfigLegacy {\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GasTransactionConfigLegacy + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GasTransactionConfigLegacy.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GasTransactionConfigLegacy is not found in the empty JSON string", GasTransactionConfigLegacy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GasTransactionConfigLegacy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GasTransactionConfigLegacy` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) && !jsonObj.get("gas").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gas` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gas").toString())); + } + if ((jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) && !jsonObj.get("gasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasPrice").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GasTransactionConfigLegacy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GasTransactionConfigLegacy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GasTransactionConfigLegacy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GasTransactionConfigLegacy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GasTransactionConfigLegacy read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GasTransactionConfigLegacy given an JSON string + * + * @param jsonString JSON string + * @return An instance of GasTransactionConfigLegacy + * @throws IOException if the JSON string is invalid with respect to GasTransactionConfigLegacy + */ + public static GasTransactionConfigLegacy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GasTransactionConfigLegacy.class); + } + + /** + * Convert an instance of GasTransactionConfigLegacy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java new file mode 100644 index 00000000000..71b71bd20f7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java @@ -0,0 +1,451 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.GasTransactionConfig; +import org.openapitools.client.model.InvokeContractV1RequestContract; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Request { + public static final String SERIALIZED_NAME_CONTRACT = "contract"; + @SerializedName(SERIALIZED_NAME_CONTRACT) + private InvokeContractV1RequestContract contract; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_GAS_CONFIG = "gasConfig"; + @SerializedName(SERIALIZED_NAME_GAS_CONFIG) + private GasTransactionConfig gasConfig; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public InvokeContractV1Request() { + } + + public InvokeContractV1Request contract(InvokeContractV1RequestContract contract) { + + this.contract = contract; + return this; + } + + /** + * Get contract + * @return contract + **/ + @javax.annotation.Nonnull + + public InvokeContractV1RequestContract getContract() { + return contract; + } + + + public void setContract(InvokeContractV1RequestContract contract) { + this.contract = contract; + } + + + public InvokeContractV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the contract method to invoke. + * @return methodName + **/ + @javax.annotation.Nonnull + + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeContractV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeContractV1Request addParamsItem(Object paramsItem) { + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeContractV1Request invocationType(EthContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + + public EthContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public InvokeContractV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nullable + + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InvokeContractV1Request gasConfig(GasTransactionConfig gasConfig) { + + this.gasConfig = gasConfig; + return this; + } + + /** + * Get gasConfig + * @return gasConfig + **/ + @javax.annotation.Nullable + + public GasTransactionConfig getGasConfig() { + return gasConfig; + } + + + public void setGasConfig(GasTransactionConfig gasConfig) { + this.gasConfig = gasConfig; + } + + + public InvokeContractV1Request value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + public InvokeContractV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt before returning an error. Only has any effect if the invocation type is SEND + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Request invokeContractV1Request = (InvokeContractV1Request) o; + return Objects.equals(this.contract, invokeContractV1Request.contract) && + Objects.equals(this.methodName, invokeContractV1Request.methodName) && + Objects.equals(this.params, invokeContractV1Request.params) && + Objects.equals(this.invocationType, invokeContractV1Request.invocationType) && + Objects.equals(this.web3SigningCredential, invokeContractV1Request.web3SigningCredential) && + Objects.equals(this.gasConfig, invokeContractV1Request.gasConfig) && + Objects.equals(this.value, invokeContractV1Request.value) && + Objects.equals(this.timeoutMs, invokeContractV1Request.timeoutMs); + } + + @Override + public int hashCode() { + return Objects.hash(contract, methodName, params, invocationType, web3SigningCredential, gasConfig, value, timeoutMs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Request {\n"); + sb.append(" contract: ").append(toIndentedString(contract)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" gasConfig: ").append(toIndentedString(gasConfig)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contract"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("invocationType"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("gasConfig"); + openapiFields.add("value"); + openapiFields.add("timeoutMs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contract"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + openapiRequiredFields.add("invocationType"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Request is not found in the empty JSON string", InvokeContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `contract` + InvokeContractV1RequestContract.validateJsonObject(jsonObj.getAsJsonObject("contract")); + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + // validate the optional field `web3SigningCredential` + if (jsonObj.get("web3SigningCredential") != null && !jsonObj.get("web3SigningCredential").isJsonNull()) { + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + } + // validate the optional field `gasConfig` + if (jsonObj.get("gasConfig") != null && !jsonObj.get("gasConfig").isJsonNull()) { + GasTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("gasConfig")); + } + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Request + */ + public static InvokeContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Request.class); + } + + /** + * Convert an instance of InvokeContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1RequestContract.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1RequestContract.java new file mode 100644 index 00000000000..8b629eb6a80 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1RequestContract.java @@ -0,0 +1,285 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.ContractKeychainDefinition; +import org.openapitools.client.model.DeployedContractJsonDefinition; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1RequestContract extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(InvokeContractV1RequestContract.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1RequestContract.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1RequestContract' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterContractKeychainDefinition = gson.getDelegateAdapter(this, TypeToken.get(ContractKeychainDefinition.class)); + final TypeAdapter adapterDeployedContractJsonDefinition = gson.getDelegateAdapter(this, TypeToken.get(DeployedContractJsonDefinition.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1RequestContract value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `ContractKeychainDefinition` + if (value.getActualInstance() instanceof ContractKeychainDefinition) { + JsonObject obj = adapterContractKeychainDefinition.toJsonTree((ContractKeychainDefinition)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `DeployedContractJsonDefinition` + if (value.getActualInstance() instanceof DeployedContractJsonDefinition) { + JsonObject obj = adapterDeployedContractJsonDefinition.toJsonTree((DeployedContractJsonDefinition)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ContractKeychainDefinition, DeployedContractJsonDefinition"); + } + + @Override + public InvokeContractV1RequestContract read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ContractKeychainDefinition + try { + // validate the JSON object to see if any exception is thrown + ContractKeychainDefinition.validateJsonObject(jsonObject); + actualAdapter = adapterContractKeychainDefinition; + match++; + log.log(Level.FINER, "Input data matches schema 'ContractKeychainDefinition'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ContractKeychainDefinition failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ContractKeychainDefinition'", e); + } + + // deserialize DeployedContractJsonDefinition + try { + // validate the JSON object to see if any exception is thrown + DeployedContractJsonDefinition.validateJsonObject(jsonObject); + actualAdapter = adapterDeployedContractJsonDefinition; + match++; + log.log(Level.FINER, "Input data matches schema 'DeployedContractJsonDefinition'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for DeployedContractJsonDefinition failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'DeployedContractJsonDefinition'", e); + } + + if (match == 1) { + InvokeContractV1RequestContract ret = new InvokeContractV1RequestContract(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for InvokeContractV1RequestContract: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public InvokeContractV1RequestContract() { + super("oneOf", Boolean.FALSE); + } + + public InvokeContractV1RequestContract(ContractKeychainDefinition o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public InvokeContractV1RequestContract(DeployedContractJsonDefinition o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ContractKeychainDefinition", new GenericType() { + }); + schemas.put("DeployedContractJsonDefinition", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return InvokeContractV1RequestContract.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * ContractKeychainDefinition, DeployedContractJsonDefinition + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ContractKeychainDefinition) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DeployedContractJsonDefinition) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be ContractKeychainDefinition, DeployedContractJsonDefinition"); + } + + /** + * Get the actual instance, which can be the following: + * ContractKeychainDefinition, DeployedContractJsonDefinition + * + * @return The actual instance (ContractKeychainDefinition, DeployedContractJsonDefinition) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ContractKeychainDefinition`. If the actual instance is not `ContractKeychainDefinition`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ContractKeychainDefinition` + * @throws ClassCastException if the instance is not `ContractKeychainDefinition` + */ + public ContractKeychainDefinition getContractKeychainDefinition() throws ClassCastException { + return (ContractKeychainDefinition)super.getActualInstance(); + } + + /** + * Get the actual instance of `DeployedContractJsonDefinition`. If the actual instance is not `DeployedContractJsonDefinition`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DeployedContractJsonDefinition` + * @throws ClassCastException if the instance is not `DeployedContractJsonDefinition` + */ + public DeployedContractJsonDefinition getDeployedContractJsonDefinition() throws ClassCastException { + return (DeployedContractJsonDefinition)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1RequestContract + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ContractKeychainDefinition + try { + ContractKeychainDefinition.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ContractKeychainDefinition failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with DeployedContractJsonDefinition + try { + DeployedContractJsonDefinition.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for DeployedContractJsonDefinition failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for InvokeContractV1RequestContract with oneOf schemas: ContractKeychainDefinition, DeployedContractJsonDefinition. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of InvokeContractV1RequestContract given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1RequestContract + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1RequestContract + */ + public static InvokeContractV1RequestContract fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1RequestContract.class); + } + + /** + * Convert an instance of InvokeContractV1RequestContract to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java new file mode 100644 index 00000000000..067c5ff06f4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java @@ -0,0 +1,281 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public static final String SERIALIZED_NAME_CALL_OUTPUT = "callOutput"; + @SerializedName(SERIALIZED_NAME_CALL_OUTPUT) + private Object callOutput = null; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public InvokeContractV1Response() { + } + + public InvokeContractV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nullable + + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + public InvokeContractV1Response callOutput(Object callOutput) { + + this.callOutput = callOutput; + return this; + } + + /** + * Get callOutput + * @return callOutput + **/ + @javax.annotation.Nullable + + public Object getCallOutput() { + return callOutput; + } + + + public void setCallOutput(Object callOutput) { + this.callOutput = callOutput; + } + + + public InvokeContractV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Response invokeContractV1Response = (InvokeContractV1Response) o; + return Objects.equals(this.transactionReceipt, invokeContractV1Response.transactionReceipt) && + Objects.equals(this.callOutput, invokeContractV1Response.callOutput) && + Objects.equals(this.success, invokeContractV1Response.success); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt, callOutput, success); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append(" callOutput: ").append(toIndentedString(callOutput)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + openapiFields.add("callOutput"); + openapiFields.add("success"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Response is not found in the empty JSON string", InvokeContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Response + */ + public static InvokeContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Response.class); + } + + /** + * Convert an instance of InvokeContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java new file mode 100644 index 00000000000..b6eefd8d2e1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java @@ -0,0 +1,379 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.EthContractInvocationWeb3Method; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRawWeb3EthContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRawWeb3EthContractV1Request { + public static final String SERIALIZED_NAME_ABI = "abi"; + @SerializedName(SERIALIZED_NAME_ABI) + private Object abi = null; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationWeb3Method invocationType; + + public static final String SERIALIZED_NAME_INVOCATION_PARAMS = "invocationParams"; + @SerializedName(SERIALIZED_NAME_INVOCATION_PARAMS) + private Object invocationParams = {}; + + public static final String SERIALIZED_NAME_CONTRACT_METHOD = "contractMethod"; + @SerializedName(SERIALIZED_NAME_CONTRACT_METHOD) + private String contractMethod; + + public static final String SERIALIZED_NAME_CONTRACT_METHOD_ARGS = "contractMethodArgs"; + @SerializedName(SERIALIZED_NAME_CONTRACT_METHOD_ARGS) + private List contractMethodArgs = null; + + public InvokeRawWeb3EthContractV1Request() { + } + + public InvokeRawWeb3EthContractV1Request abi(Object abi) { + + this.abi = abi; + return this; + } + + /** + * The application binary interface of the solidity contract + * @return abi + **/ + @javax.annotation.Nullable + + public Object getAbi() { + return abi; + } + + + public void setAbi(Object abi) { + this.abi = abi; + } + + + public InvokeRawWeb3EthContractV1Request address(String address) { + + this.address = address; + return this; + } + + /** + * Deployed solidity contract address + * @return address + **/ + @javax.annotation.Nonnull + + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public InvokeRawWeb3EthContractV1Request invocationType(EthContractInvocationWeb3Method invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + + public EthContractInvocationWeb3Method getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationWeb3Method invocationType) { + this.invocationType = invocationType; + } + + + public InvokeRawWeb3EthContractV1Request invocationParams(Object invocationParams) { + + this.invocationParams = invocationParams; + return this; + } + + /** + * The list of arguments for contract invocation method (send, call, etc...) + * @return invocationParams + **/ + @javax.annotation.Nullable + + public Object getInvocationParams() { + return invocationParams; + } + + + public void setInvocationParams(Object invocationParams) { + this.invocationParams = invocationParams; + } + + + public InvokeRawWeb3EthContractV1Request contractMethod(String contractMethod) { + + this.contractMethod = contractMethod; + return this; + } + + /** + * Method of deployed solidity contract to execute + * @return contractMethod + **/ + @javax.annotation.Nonnull + + public String getContractMethod() { + return contractMethod; + } + + + public void setContractMethod(String contractMethod) { + this.contractMethod = contractMethod; + } + + + public InvokeRawWeb3EthContractV1Request contractMethodArgs(List contractMethodArgs) { + + this.contractMethodArgs = contractMethodArgs; + return this; + } + + public InvokeRawWeb3EthContractV1Request addContractMethodArgsItem(Object contractMethodArgsItem) { + if (this.contractMethodArgs == null) { + this.contractMethodArgs = null; + } + this.contractMethodArgs.add(contractMethodArgsItem); + return this; + } + + /** + * The list of arguments for deployed solidity contract method + * @return contractMethodArgs + **/ + @javax.annotation.Nullable + + public List getContractMethodArgs() { + return contractMethodArgs; + } + + + public void setContractMethodArgs(List contractMethodArgs) { + this.contractMethodArgs = contractMethodArgs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request = (InvokeRawWeb3EthContractV1Request) o; + return Objects.equals(this.abi, invokeRawWeb3EthContractV1Request.abi) && + Objects.equals(this.address, invokeRawWeb3EthContractV1Request.address) && + Objects.equals(this.invocationType, invokeRawWeb3EthContractV1Request.invocationType) && + Objects.equals(this.invocationParams, invokeRawWeb3EthContractV1Request.invocationParams) && + Objects.equals(this.contractMethod, invokeRawWeb3EthContractV1Request.contractMethod) && + Objects.equals(this.contractMethodArgs, invokeRawWeb3EthContractV1Request.contractMethodArgs); + } + + @Override + public int hashCode() { + return Objects.hash(abi, address, invocationType, invocationParams, contractMethod, contractMethodArgs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRawWeb3EthContractV1Request {\n"); + sb.append(" abi: ").append(toIndentedString(abi)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" invocationParams: ").append(toIndentedString(invocationParams)).append("\n"); + sb.append(" contractMethod: ").append(toIndentedString(contractMethod)).append("\n"); + sb.append(" contractMethodArgs: ").append(toIndentedString(contractMethodArgs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("abi"); + openapiFields.add("address"); + openapiFields.add("invocationType"); + openapiFields.add("invocationParams"); + openapiFields.add("contractMethod"); + openapiFields.add("contractMethodArgs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("abi"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("contractMethod"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRawWeb3EthContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRawWeb3EthContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRawWeb3EthContractV1Request is not found in the empty JSON string", InvokeRawWeb3EthContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRawWeb3EthContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRawWeb3EthContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRawWeb3EthContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if (!jsonObj.get("contractMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractMethod").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("contractMethodArgs") != null && !jsonObj.get("contractMethodArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `contractMethodArgs` to be an array in the JSON string but got `%s`", jsonObj.get("contractMethodArgs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRawWeb3EthContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRawWeb3EthContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRawWeb3EthContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRawWeb3EthContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRawWeb3EthContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRawWeb3EthContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRawWeb3EthContractV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeRawWeb3EthContractV1Request + */ + public static InvokeRawWeb3EthContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRawWeb3EthContractV1Request.class); + } + + /** + * Convert an instance of InvokeRawWeb3EthContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java new file mode 100644 index 00000000000..566c33fcdb2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java @@ -0,0 +1,284 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRawWeb3EthContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRawWeb3EthContractV1Response { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private BigDecimal status; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private Object data = null; + + public static final String SERIALIZED_NAME_ERROR_DETAIL = "errorDetail"; + @SerializedName(SERIALIZED_NAME_ERROR_DETAIL) + private String errorDetail; + + public InvokeRawWeb3EthContractV1Response() { + } + + public InvokeRawWeb3EthContractV1Response status(BigDecimal status) { + + this.status = status; + return this; + } + + /** + * Status code of the operation + * @return status + **/ + @javax.annotation.Nonnull + + public BigDecimal getStatus() { + return status; + } + + + public void setStatus(BigDecimal status) { + this.status = status; + } + + + public InvokeRawWeb3EthContractV1Response data(Object data) { + + this.data = data; + return this; + } + + /** + * Output of contract invocation method + * @return data + **/ + @javax.annotation.Nullable + + public Object getData() { + return data; + } + + + public void setData(Object data) { + this.data = data; + } + + + public InvokeRawWeb3EthContractV1Response errorDetail(String errorDetail) { + + this.errorDetail = errorDetail; + return this; + } + + /** + * Error details + * @return errorDetail + **/ + @javax.annotation.Nullable + + public String getErrorDetail() { + return errorDetail; + } + + + public void setErrorDetail(String errorDetail) { + this.errorDetail = errorDetail; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRawWeb3EthContractV1Response invokeRawWeb3EthContractV1Response = (InvokeRawWeb3EthContractV1Response) o; + return Objects.equals(this.status, invokeRawWeb3EthContractV1Response.status) && + Objects.equals(this.data, invokeRawWeb3EthContractV1Response.data) && + Objects.equals(this.errorDetail, invokeRawWeb3EthContractV1Response.errorDetail); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, data, errorDetail); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRawWeb3EthContractV1Response {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" errorDetail: ").append(toIndentedString(errorDetail)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("data"); + openapiFields.add("errorDetail"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRawWeb3EthContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRawWeb3EthContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRawWeb3EthContractV1Response is not found in the empty JSON string", InvokeRawWeb3EthContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRawWeb3EthContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRawWeb3EthContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRawWeb3EthContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("errorDetail") != null && !jsonObj.get("errorDetail").isJsonNull()) && !jsonObj.get("errorDetail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorDetail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorDetail").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRawWeb3EthContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRawWeb3EthContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRawWeb3EthContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRawWeb3EthContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRawWeb3EthContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRawWeb3EthContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRawWeb3EthContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeRawWeb3EthContractV1Response + */ + public static InvokeRawWeb3EthContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRawWeb3EthContractV1Response.class); + } + + /** + * Convert an instance of InvokeRawWeb3EthContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java new file mode 100644 index 00000000000..1ebb4f3857a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java @@ -0,0 +1,256 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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 java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRawWeb3EthMethodV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRawWeb3EthMethodV1Request { + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public InvokeRawWeb3EthMethodV1Request() { + } + + public InvokeRawWeb3EthMethodV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the web3.eth method to invoke + * @return methodName + **/ + @javax.annotation.Nonnull + + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeRawWeb3EthMethodV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeRawWeb3EthMethodV1Request addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass to web3.eth method specified in methodName + * @return params + **/ + @javax.annotation.Nullable + + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request = (InvokeRawWeb3EthMethodV1Request) o; + return Objects.equals(this.methodName, invokeRawWeb3EthMethodV1Request.methodName) && + Objects.equals(this.params, invokeRawWeb3EthMethodV1Request.params); + } + + @Override + public int hashCode() { + return Objects.hash(methodName, params); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRawWeb3EthMethodV1Request {\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("methodName"); + openapiFields.add("params"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("methodName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRawWeb3EthMethodV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRawWeb3EthMethodV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRawWeb3EthMethodV1Request is not found in the empty JSON string", InvokeRawWeb3EthMethodV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRawWeb3EthMethodV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRawWeb3EthMethodV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRawWeb3EthMethodV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("params") != null && !jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRawWeb3EthMethodV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRawWeb3EthMethodV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRawWeb3EthMethodV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRawWeb3EthMethodV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRawWeb3EthMethodV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRawWeb3EthMethodV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRawWeb3EthMethodV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeRawWeb3EthMethodV1Request + */ + public static InvokeRawWeb3EthMethodV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRawWeb3EthMethodV1Request.class); + } + + /** + * Convert an instance of InvokeRawWeb3EthMethodV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java new file mode 100644 index 00000000000..79c6e8d63c1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java @@ -0,0 +1,284 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRawWeb3EthMethodV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRawWeb3EthMethodV1Response { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private BigDecimal status; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private Object data = null; + + public static final String SERIALIZED_NAME_ERROR_DETAIL = "errorDetail"; + @SerializedName(SERIALIZED_NAME_ERROR_DETAIL) + private String errorDetail; + + public InvokeRawWeb3EthMethodV1Response() { + } + + public InvokeRawWeb3EthMethodV1Response status(BigDecimal status) { + + this.status = status; + return this; + } + + /** + * Status code of the operation + * @return status + **/ + @javax.annotation.Nonnull + + public BigDecimal getStatus() { + return status; + } + + + public void setStatus(BigDecimal status) { + this.status = status; + } + + + public InvokeRawWeb3EthMethodV1Response data(Object data) { + + this.data = data; + return this; + } + + /** + * Output of requested web3.eth method + * @return data + **/ + @javax.annotation.Nullable + + public Object getData() { + return data; + } + + + public void setData(Object data) { + this.data = data; + } + + + public InvokeRawWeb3EthMethodV1Response errorDetail(String errorDetail) { + + this.errorDetail = errorDetail; + return this; + } + + /** + * Error details + * @return errorDetail + **/ + @javax.annotation.Nullable + + public String getErrorDetail() { + return errorDetail; + } + + + public void setErrorDetail(String errorDetail) { + this.errorDetail = errorDetail; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRawWeb3EthMethodV1Response invokeRawWeb3EthMethodV1Response = (InvokeRawWeb3EthMethodV1Response) o; + return Objects.equals(this.status, invokeRawWeb3EthMethodV1Response.status) && + Objects.equals(this.data, invokeRawWeb3EthMethodV1Response.data) && + Objects.equals(this.errorDetail, invokeRawWeb3EthMethodV1Response.errorDetail); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, data, errorDetail); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRawWeb3EthMethodV1Response {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" errorDetail: ").append(toIndentedString(errorDetail)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("data"); + openapiFields.add("errorDetail"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRawWeb3EthMethodV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRawWeb3EthMethodV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRawWeb3EthMethodV1Response is not found in the empty JSON string", InvokeRawWeb3EthMethodV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRawWeb3EthMethodV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRawWeb3EthMethodV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRawWeb3EthMethodV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("errorDetail") != null && !jsonObj.get("errorDetail").isJsonNull()) && !jsonObj.get("errorDetail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorDetail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorDetail").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRawWeb3EthMethodV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRawWeb3EthMethodV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRawWeb3EthMethodV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRawWeb3EthMethodV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRawWeb3EthMethodV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRawWeb3EthMethodV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRawWeb3EthMethodV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeRawWeb3EthMethodV1Response + */ + public static InvokeRawWeb3EthMethodV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRawWeb3EthMethodV1Response.class); + } + + /** + * Convert an instance of InvokeRawWeb3EthMethodV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java new file mode 100644 index 00000000000..428f4018495 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.EthereumTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionRequest { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_TRANSACTION_CONFIG = "transactionConfig"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_CONFIG) + private EthereumTransactionConfig transactionConfig; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public RunTransactionRequest() { + } + + public RunTransactionRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public RunTransactionRequest transactionConfig(EthereumTransactionConfig transactionConfig) { + + this.transactionConfig = transactionConfig; + return this; + } + + /** + * Get transactionConfig + * @return transactionConfig + **/ + @javax.annotation.Nonnull + + public EthereumTransactionConfig getTransactionConfig() { + return transactionConfig; + } + + + public void setTransactionConfig(EthereumTransactionConfig transactionConfig) { + this.transactionConfig = transactionConfig; + } + + + public RunTransactionRequest timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with thehash of the transaction(which indicates successful execution) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionRequest runTransactionRequest = (RunTransactionRequest) o; + return Objects.equals(this.web3SigningCredential, runTransactionRequest.web3SigningCredential) && + Objects.equals(this.transactionConfig, runTransactionRequest.transactionConfig) && + Objects.equals(this.timeoutMs, runTransactionRequest.timeoutMs); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, transactionConfig, timeoutMs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionRequest {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" transactionConfig: ").append(toIndentedString(transactionConfig)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("transactionConfig"); + openapiFields.add("timeoutMs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("transactionConfig"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionRequest is not found in the empty JSON string", RunTransactionRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + // validate the required field `transactionConfig` + EthereumTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("transactionConfig")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionRequest + * @throws IOException if the JSON string is invalid with respect to RunTransactionRequest + */ + public static RunTransactionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionRequest.class); + } + + /** + * Convert an instance of RunTransactionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java new file mode 100644 index 00000000000..41988dae40d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java @@ -0,0 +1,211 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionResponse { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public RunTransactionResponse() { + } + + public RunTransactionResponse transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionResponse runTransactionResponse = (RunTransactionResponse) o; + return Objects.equals(this.transactionReceipt, runTransactionResponse.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionResponse {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionResponse is not found in the empty JSON string", RunTransactionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionResponse + * @throws IOException if the JSON string is invalid with respect to RunTransactionResponse + */ + public static RunTransactionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionResponse.class); + } + + /** + * Convert an instance of RunTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java new file mode 100644 index 00000000000..017ac880831 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets WatchBlocksV1 + */ +@JsonAdapter(WatchBlocksV1.Adapter.class) +public enum WatchBlocksV1 { + + Subscribe("org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Subscribe"), + + Next("org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Next"), + + Unsubscribe("org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Unsubscribe"), + + Error("org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Error"), + + Complete("org.hyperledger.cacti.api.async.ethereum.WatchBlocksV1.Complete"); + + private String value; + + WatchBlocksV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchBlocksV1 fromValue(String value) { + for (WatchBlocksV1 b : WatchBlocksV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchBlocksV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchBlocksV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchBlocksV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java new file mode 100644 index 00000000000..82652368ef0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java @@ -0,0 +1,889 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.WatchBlocksV1BlockDataTimestamp; +import org.openapitools.client.model.Web3Transaction; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WatchBlocksV1BlockData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1BlockData { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private String number; + + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_PARENT_HASH = "parentHash"; + @SerializedName(SERIALIZED_NAME_PARENT_HASH) + private String parentHash; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_SHA3_UNCLES = "sha3Uncles"; + @SerializedName(SERIALIZED_NAME_SHA3_UNCLES) + private String sha3Uncles; + + public static final String SERIALIZED_NAME_LOGS_BLOOM = "logsBloom"; + @SerializedName(SERIALIZED_NAME_LOGS_BLOOM) + private String logsBloom; + + public static final String SERIALIZED_NAME_TRANSACTIONS_ROOT = "transactionsRoot"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS_ROOT) + private String transactionsRoot; + + public static final String SERIALIZED_NAME_STATE_ROOT = "stateRoot"; + @SerializedName(SERIALIZED_NAME_STATE_ROOT) + private String stateRoot; + + public static final String SERIALIZED_NAME_RECEIPTS_ROOT = "receiptsRoot"; + @SerializedName(SERIALIZED_NAME_RECEIPTS_ROOT) + private String receiptsRoot; + + public static final String SERIALIZED_NAME_DIFFICULTY = "difficulty"; + @SerializedName(SERIALIZED_NAME_DIFFICULTY) + private String difficulty; + + public static final String SERIALIZED_NAME_MIX_HASH = "mixHash"; + @SerializedName(SERIALIZED_NAME_MIX_HASH) + private String mixHash; + + public static final String SERIALIZED_NAME_MINER = "miner"; + @SerializedName(SERIALIZED_NAME_MINER) + private String miner; + + public static final String SERIALIZED_NAME_EXTRA_DATA = "extraData"; + @SerializedName(SERIALIZED_NAME_EXTRA_DATA) + private String extraData; + + public static final String SERIALIZED_NAME_GAS_LIMIT = "gasLimit"; + @SerializedName(SERIALIZED_NAME_GAS_LIMIT) + private String gasLimit; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private String gasUsed; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private WatchBlocksV1BlockDataTimestamp timestamp; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private String size; + + public static final String SERIALIZED_NAME_TOTAL_DIFFICULTY = "totalDifficulty"; + @SerializedName(SERIALIZED_NAME_TOTAL_DIFFICULTY) + private String totalDifficulty; + + public static final String SERIALIZED_NAME_UNCLES = "uncles"; + @SerializedName(SERIALIZED_NAME_UNCLES) + private List uncles = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BASE_FEE_PER_GAS = "baseFeePerGas"; + @SerializedName(SERIALIZED_NAME_BASE_FEE_PER_GAS) + private String baseFeePerGas; + + public static final String SERIALIZED_NAME_TRANSACTIONS = "transactions"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS) + private List transactions = new ArrayList<>(); + + public WatchBlocksV1BlockData() { + } + + public WatchBlocksV1BlockData number(String number) { + + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @javax.annotation.Nonnull + + public String getNumber() { + return number; + } + + + public void setNumber(String number) { + this.number = number; + } + + + public WatchBlocksV1BlockData hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + **/ + @javax.annotation.Nullable + + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public WatchBlocksV1BlockData parentHash(String parentHash) { + + this.parentHash = parentHash; + return this; + } + + /** + * Get parentHash + * @return parentHash + **/ + @javax.annotation.Nonnull + + public String getParentHash() { + return parentHash; + } + + + public void setParentHash(String parentHash) { + this.parentHash = parentHash; + } + + + public WatchBlocksV1BlockData nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nonnull + + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public WatchBlocksV1BlockData sha3Uncles(String sha3Uncles) { + + this.sha3Uncles = sha3Uncles; + return this; + } + + /** + * Get sha3Uncles + * @return sha3Uncles + **/ + @javax.annotation.Nonnull + + public String getSha3Uncles() { + return sha3Uncles; + } + + + public void setSha3Uncles(String sha3Uncles) { + this.sha3Uncles = sha3Uncles; + } + + + public WatchBlocksV1BlockData logsBloom(String logsBloom) { + + this.logsBloom = logsBloom; + return this; + } + + /** + * Get logsBloom + * @return logsBloom + **/ + @javax.annotation.Nullable + + public String getLogsBloom() { + return logsBloom; + } + + + public void setLogsBloom(String logsBloom) { + this.logsBloom = logsBloom; + } + + + public WatchBlocksV1BlockData transactionsRoot(String transactionsRoot) { + + this.transactionsRoot = transactionsRoot; + return this; + } + + /** + * Get transactionsRoot + * @return transactionsRoot + **/ + @javax.annotation.Nullable + + public String getTransactionsRoot() { + return transactionsRoot; + } + + + public void setTransactionsRoot(String transactionsRoot) { + this.transactionsRoot = transactionsRoot; + } + + + public WatchBlocksV1BlockData stateRoot(String stateRoot) { + + this.stateRoot = stateRoot; + return this; + } + + /** + * Get stateRoot + * @return stateRoot + **/ + @javax.annotation.Nonnull + + public String getStateRoot() { + return stateRoot; + } + + + public void setStateRoot(String stateRoot) { + this.stateRoot = stateRoot; + } + + + public WatchBlocksV1BlockData receiptsRoot(String receiptsRoot) { + + this.receiptsRoot = receiptsRoot; + return this; + } + + /** + * Get receiptsRoot + * @return receiptsRoot + **/ + @javax.annotation.Nullable + + public String getReceiptsRoot() { + return receiptsRoot; + } + + + public void setReceiptsRoot(String receiptsRoot) { + this.receiptsRoot = receiptsRoot; + } + + + public WatchBlocksV1BlockData difficulty(String difficulty) { + + this.difficulty = difficulty; + return this; + } + + /** + * Get difficulty + * @return difficulty + **/ + @javax.annotation.Nullable + + public String getDifficulty() { + return difficulty; + } + + + public void setDifficulty(String difficulty) { + this.difficulty = difficulty; + } + + + public WatchBlocksV1BlockData mixHash(String mixHash) { + + this.mixHash = mixHash; + return this; + } + + /** + * Get mixHash + * @return mixHash + **/ + @javax.annotation.Nullable + + public String getMixHash() { + return mixHash; + } + + + public void setMixHash(String mixHash) { + this.mixHash = mixHash; + } + + + public WatchBlocksV1BlockData miner(String miner) { + + this.miner = miner; + return this; + } + + /** + * Get miner + * @return miner + **/ + @javax.annotation.Nonnull + + public String getMiner() { + return miner; + } + + + public void setMiner(String miner) { + this.miner = miner; + } + + + public WatchBlocksV1BlockData extraData(String extraData) { + + this.extraData = extraData; + return this; + } + + /** + * Get extraData + * @return extraData + **/ + @javax.annotation.Nonnull + + public String getExtraData() { + return extraData; + } + + + public void setExtraData(String extraData) { + this.extraData = extraData; + } + + + public WatchBlocksV1BlockData gasLimit(String gasLimit) { + + this.gasLimit = gasLimit; + return this; + } + + /** + * Get gasLimit + * @return gasLimit + **/ + @javax.annotation.Nonnull + + public String getGasLimit() { + return gasLimit; + } + + + public void setGasLimit(String gasLimit) { + this.gasLimit = gasLimit; + } + + + public WatchBlocksV1BlockData gasUsed(String gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + + public String getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(String gasUsed) { + this.gasUsed = gasUsed; + } + + + public WatchBlocksV1BlockData timestamp(WatchBlocksV1BlockDataTimestamp timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nonnull + + public WatchBlocksV1BlockDataTimestamp getTimestamp() { + return timestamp; + } + + + public void setTimestamp(WatchBlocksV1BlockDataTimestamp timestamp) { + this.timestamp = timestamp; + } + + + public WatchBlocksV1BlockData size(String size) { + + this.size = size; + return this; + } + + /** + * Get size + * @return size + **/ + @javax.annotation.Nonnull + + public String getSize() { + return size; + } + + + public void setSize(String size) { + this.size = size; + } + + + public WatchBlocksV1BlockData totalDifficulty(String totalDifficulty) { + + this.totalDifficulty = totalDifficulty; + return this; + } + + /** + * Get totalDifficulty + * @return totalDifficulty + **/ + @javax.annotation.Nonnull + + public String getTotalDifficulty() { + return totalDifficulty; + } + + + public void setTotalDifficulty(String totalDifficulty) { + this.totalDifficulty = totalDifficulty; + } + + + public WatchBlocksV1BlockData uncles(List uncles) { + + this.uncles = uncles; + return this; + } + + public WatchBlocksV1BlockData addUnclesItem(String unclesItem) { + this.uncles.add(unclesItem); + return this; + } + + /** + * Get uncles + * @return uncles + **/ + @javax.annotation.Nonnull + + public List getUncles() { + return uncles; + } + + + public void setUncles(List uncles) { + this.uncles = uncles; + } + + + public WatchBlocksV1BlockData baseFeePerGas(String baseFeePerGas) { + + this.baseFeePerGas = baseFeePerGas; + return this; + } + + /** + * Get baseFeePerGas + * @return baseFeePerGas + **/ + @javax.annotation.Nullable + + public String getBaseFeePerGas() { + return baseFeePerGas; + } + + + public void setBaseFeePerGas(String baseFeePerGas) { + this.baseFeePerGas = baseFeePerGas; + } + + + public WatchBlocksV1BlockData transactions(List transactions) { + + this.transactions = transactions; + return this; + } + + public WatchBlocksV1BlockData addTransactionsItem(Web3Transaction transactionsItem) { + this.transactions.add(transactionsItem); + return this; + } + + /** + * Get transactions + * @return transactions + **/ + @javax.annotation.Nonnull + + public List getTransactions() { + return transactions; + } + + + public void setTransactions(List transactions) { + this.transactions = transactions; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1BlockData watchBlocksV1BlockData = (WatchBlocksV1BlockData) o; + return Objects.equals(this.number, watchBlocksV1BlockData.number) && + Objects.equals(this.hash, watchBlocksV1BlockData.hash) && + Objects.equals(this.parentHash, watchBlocksV1BlockData.parentHash) && + Objects.equals(this.nonce, watchBlocksV1BlockData.nonce) && + Objects.equals(this.sha3Uncles, watchBlocksV1BlockData.sha3Uncles) && + Objects.equals(this.logsBloom, watchBlocksV1BlockData.logsBloom) && + Objects.equals(this.transactionsRoot, watchBlocksV1BlockData.transactionsRoot) && + Objects.equals(this.stateRoot, watchBlocksV1BlockData.stateRoot) && + Objects.equals(this.receiptsRoot, watchBlocksV1BlockData.receiptsRoot) && + Objects.equals(this.difficulty, watchBlocksV1BlockData.difficulty) && + Objects.equals(this.mixHash, watchBlocksV1BlockData.mixHash) && + Objects.equals(this.miner, watchBlocksV1BlockData.miner) && + Objects.equals(this.extraData, watchBlocksV1BlockData.extraData) && + Objects.equals(this.gasLimit, watchBlocksV1BlockData.gasLimit) && + Objects.equals(this.gasUsed, watchBlocksV1BlockData.gasUsed) && + Objects.equals(this.timestamp, watchBlocksV1BlockData.timestamp) && + Objects.equals(this.size, watchBlocksV1BlockData.size) && + Objects.equals(this.totalDifficulty, watchBlocksV1BlockData.totalDifficulty) && + Objects.equals(this.uncles, watchBlocksV1BlockData.uncles) && + Objects.equals(this.baseFeePerGas, watchBlocksV1BlockData.baseFeePerGas) && + Objects.equals(this.transactions, watchBlocksV1BlockData.transactions); + } + + @Override + public int hashCode() { + return Objects.hash(number, hash, parentHash, nonce, sha3Uncles, logsBloom, transactionsRoot, stateRoot, receiptsRoot, difficulty, mixHash, miner, extraData, gasLimit, gasUsed, timestamp, size, totalDifficulty, uncles, baseFeePerGas, transactions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1BlockData {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" parentHash: ").append(toIndentedString(parentHash)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" sha3Uncles: ").append(toIndentedString(sha3Uncles)).append("\n"); + sb.append(" logsBloom: ").append(toIndentedString(logsBloom)).append("\n"); + sb.append(" transactionsRoot: ").append(toIndentedString(transactionsRoot)).append("\n"); + sb.append(" stateRoot: ").append(toIndentedString(stateRoot)).append("\n"); + sb.append(" receiptsRoot: ").append(toIndentedString(receiptsRoot)).append("\n"); + sb.append(" difficulty: ").append(toIndentedString(difficulty)).append("\n"); + sb.append(" mixHash: ").append(toIndentedString(mixHash)).append("\n"); + sb.append(" miner: ").append(toIndentedString(miner)).append("\n"); + sb.append(" extraData: ").append(toIndentedString(extraData)).append("\n"); + sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" totalDifficulty: ").append(toIndentedString(totalDifficulty)).append("\n"); + sb.append(" uncles: ").append(toIndentedString(uncles)).append("\n"); + sb.append(" baseFeePerGas: ").append(toIndentedString(baseFeePerGas)).append("\n"); + sb.append(" transactions: ").append(toIndentedString(transactions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("number"); + openapiFields.add("hash"); + openapiFields.add("parentHash"); + openapiFields.add("nonce"); + openapiFields.add("sha3Uncles"); + openapiFields.add("logsBloom"); + openapiFields.add("transactionsRoot"); + openapiFields.add("stateRoot"); + openapiFields.add("receiptsRoot"); + openapiFields.add("difficulty"); + openapiFields.add("mixHash"); + openapiFields.add("miner"); + openapiFields.add("extraData"); + openapiFields.add("gasLimit"); + openapiFields.add("gasUsed"); + openapiFields.add("timestamp"); + openapiFields.add("size"); + openapiFields.add("totalDifficulty"); + openapiFields.add("uncles"); + openapiFields.add("baseFeePerGas"); + openapiFields.add("transactions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("number"); + openapiRequiredFields.add("parentHash"); + openapiRequiredFields.add("nonce"); + openapiRequiredFields.add("sha3Uncles"); + openapiRequiredFields.add("stateRoot"); + openapiRequiredFields.add("miner"); + openapiRequiredFields.add("extraData"); + openapiRequiredFields.add("gasLimit"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("timestamp"); + openapiRequiredFields.add("size"); + openapiRequiredFields.add("totalDifficulty"); + openapiRequiredFields.add("uncles"); + openapiRequiredFields.add("transactions"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1BlockData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1BlockData.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1BlockData is not found in the empty JSON string", WatchBlocksV1BlockData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1BlockData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1BlockData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksV1BlockData.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + } + if ((jsonObj.get("hash") != null && !jsonObj.get("hash").isJsonNull()) && !jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if (!jsonObj.get("parentHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parentHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parentHash").toString())); + } + if (!jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if (!jsonObj.get("sha3Uncles").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sha3Uncles` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3Uncles").toString())); + } + if ((jsonObj.get("logsBloom") != null && !jsonObj.get("logsBloom").isJsonNull()) && !jsonObj.get("logsBloom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logsBloom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logsBloom").toString())); + } + if ((jsonObj.get("transactionsRoot") != null && !jsonObj.get("transactionsRoot").isJsonNull()) && !jsonObj.get("transactionsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionsRoot").toString())); + } + if (!jsonObj.get("stateRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateRoot").toString())); + } + if ((jsonObj.get("receiptsRoot") != null && !jsonObj.get("receiptsRoot").isJsonNull()) && !jsonObj.get("receiptsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `receiptsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiptsRoot").toString())); + } + if ((jsonObj.get("difficulty") != null && !jsonObj.get("difficulty").isJsonNull()) && !jsonObj.get("difficulty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `difficulty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("difficulty").toString())); + } + if ((jsonObj.get("mixHash") != null && !jsonObj.get("mixHash").isJsonNull()) && !jsonObj.get("mixHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mixHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mixHash").toString())); + } + if (!jsonObj.get("miner").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `miner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("miner").toString())); + } + if (!jsonObj.get("extraData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `extraData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraData").toString())); + } + if (!jsonObj.get("gasLimit").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasLimit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasLimit").toString())); + } + if (!jsonObj.get("gasUsed").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasUsed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasUsed").toString())); + } + // validate the required field `timestamp` + WatchBlocksV1BlockDataTimestamp.validateJsonObject(jsonObj.getAsJsonObject("timestamp")); + if (!jsonObj.get("size").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `size` to be a primitive type in the JSON string but got `%s`", jsonObj.get("size").toString())); + } + if (!jsonObj.get("totalDifficulty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `totalDifficulty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalDifficulty").toString())); + } + // ensure the required json array is present + if (jsonObj.get("uncles") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("uncles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `uncles` to be an array in the JSON string but got `%s`", jsonObj.get("uncles").toString())); + } + if ((jsonObj.get("baseFeePerGas") != null && !jsonObj.get("baseFeePerGas").isJsonNull()) && !jsonObj.get("baseFeePerGas").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `baseFeePerGas` to be a primitive type in the JSON string but got `%s`", jsonObj.get("baseFeePerGas").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("transactions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transactions` to be an array in the JSON string but got `%s`", jsonObj.get("transactions").toString())); + } + + JsonArray jsonArraytransactions = jsonObj.getAsJsonArray("transactions"); + // validate the required field `transactions` (array) + for (int i = 0; i < jsonArraytransactions.size(); i++) { + Web3Transaction.validateJsonObject(jsonArraytransactions.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1BlockData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1BlockData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1BlockData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1BlockData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1BlockData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1BlockData given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1BlockData + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1BlockData + */ + public static WatchBlocksV1BlockData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1BlockData.class); + } + + /** + * Convert an instance of WatchBlocksV1BlockData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestamp.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestamp.java new file mode 100644 index 00000000000..d5e0b37474b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestamp.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import java.math.BigDecimal; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1BlockDataTimestamp extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(WatchBlocksV1BlockDataTimestamp.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1BlockDataTimestamp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1BlockDataTimestamp' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1BlockDataTimestamp value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonObject obj = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, String"); + } + + @Override + public WatchBlocksV1BlockDataTimestamp read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + BigDecimal.validateJsonObject(jsonObject); + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + WatchBlocksV1BlockDataTimestamp ret = new WatchBlocksV1BlockDataTimestamp(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for WatchBlocksV1BlockDataTimestamp: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public WatchBlocksV1BlockDataTimestamp() { + super("oneOf", Boolean.FALSE); + } + + public WatchBlocksV1BlockDataTimestamp(BigDecimal o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public WatchBlocksV1BlockDataTimestamp(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BigDecimal", new GenericType() { + }); + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return WatchBlocksV1BlockDataTimestamp.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, String"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, String + * + * @return The actual instance (BigDecimal, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1BlockDataTimestamp + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with BigDecimal + try { + BigDecimal.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for WatchBlocksV1BlockDataTimestamp with oneOf schemas: BigDecimal, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of WatchBlocksV1BlockDataTimestamp given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1BlockDataTimestamp + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1BlockDataTimestamp + */ + public static WatchBlocksV1BlockDataTimestamp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1BlockDataTimestamp.class); + } + + /** + * Convert an instance of WatchBlocksV1BlockDataTimestamp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java new file mode 100644 index 00000000000..c0f1c879752 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java @@ -0,0 +1,202 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WatchBlocksV1Options + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1Options { + public static final String SERIALIZED_NAME_GET_BLOCK_DATA = "getBlockData"; + @SerializedName(SERIALIZED_NAME_GET_BLOCK_DATA) + private Boolean getBlockData; + + public WatchBlocksV1Options() { + } + + public WatchBlocksV1Options getBlockData(Boolean getBlockData) { + + this.getBlockData = getBlockData; + return this; + } + + /** + * Get getBlockData + * @return getBlockData + **/ + @javax.annotation.Nullable + + public Boolean getGetBlockData() { + return getBlockData; + } + + + public void setGetBlockData(Boolean getBlockData) { + this.getBlockData = getBlockData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1Options watchBlocksV1Options = (WatchBlocksV1Options) o; + return Objects.equals(this.getBlockData, watchBlocksV1Options.getBlockData); + } + + @Override + public int hashCode() { + return Objects.hash(getBlockData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1Options {\n"); + sb.append(" getBlockData: ").append(toIndentedString(getBlockData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("getBlockData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1Options + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1Options.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1Options is not found in the empty JSON string", WatchBlocksV1Options.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1Options.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1Options` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1Options.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1Options' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1Options.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1Options value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1Options read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1Options given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1Options + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1Options + */ + public static WatchBlocksV1Options fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1Options.class); + } + + /** + * Convert an instance of WatchBlocksV1Options to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java new file mode 100644 index 00000000000..264546b0a71 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java @@ -0,0 +1,241 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.WatchBlocksV1BlockData; +import org.openapitools.client.model.Web3BlockHeader; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WatchBlocksV1Progress + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1Progress { + public static final String SERIALIZED_NAME_BLOCK_HEADER = "blockHeader"; + @SerializedName(SERIALIZED_NAME_BLOCK_HEADER) + private Web3BlockHeader blockHeader; + + public static final String SERIALIZED_NAME_BLOCK_DATA = "blockData"; + @SerializedName(SERIALIZED_NAME_BLOCK_DATA) + private WatchBlocksV1BlockData blockData; + + public WatchBlocksV1Progress() { + } + + public WatchBlocksV1Progress blockHeader(Web3BlockHeader blockHeader) { + + this.blockHeader = blockHeader; + return this; + } + + /** + * Get blockHeader + * @return blockHeader + **/ + @javax.annotation.Nullable + + public Web3BlockHeader getBlockHeader() { + return blockHeader; + } + + + public void setBlockHeader(Web3BlockHeader blockHeader) { + this.blockHeader = blockHeader; + } + + + public WatchBlocksV1Progress blockData(WatchBlocksV1BlockData blockData) { + + this.blockData = blockData; + return this; + } + + /** + * Get blockData + * @return blockData + **/ + @javax.annotation.Nullable + + public WatchBlocksV1BlockData getBlockData() { + return blockData; + } + + + public void setBlockData(WatchBlocksV1BlockData blockData) { + this.blockData = blockData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1Progress watchBlocksV1Progress = (WatchBlocksV1Progress) o; + return Objects.equals(this.blockHeader, watchBlocksV1Progress.blockHeader) && + Objects.equals(this.blockData, watchBlocksV1Progress.blockData); + } + + @Override + public int hashCode() { + return Objects.hash(blockHeader, blockData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1Progress {\n"); + sb.append(" blockHeader: ").append(toIndentedString(blockHeader)).append("\n"); + sb.append(" blockData: ").append(toIndentedString(blockData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("blockHeader"); + openapiFields.add("blockData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1Progress + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1Progress.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1Progress is not found in the empty JSON string", WatchBlocksV1Progress.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1Progress.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1Progress` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `blockHeader` + if (jsonObj.get("blockHeader") != null && !jsonObj.get("blockHeader").isJsonNull()) { + Web3BlockHeader.validateJsonObject(jsonObj.getAsJsonObject("blockHeader")); + } + // validate the optional field `blockData` + if (jsonObj.get("blockData") != null && !jsonObj.get("blockData").isJsonNull()) { + WatchBlocksV1BlockData.validateJsonObject(jsonObj.getAsJsonObject("blockData")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1Progress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1Progress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1Progress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1Progress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1Progress read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1Progress given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1Progress + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1Progress + */ + public static WatchBlocksV1Progress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1Progress.class); + } + + /** + * Convert an instance of WatchBlocksV1Progress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java new file mode 100644 index 00000000000..68e76d64747 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java @@ -0,0 +1,663 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3BlockHeader + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3BlockHeader { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private String number; + + public static final String SERIALIZED_NAME_PARENT_HASH = "parentHash"; + @SerializedName(SERIALIZED_NAME_PARENT_HASH) + private String parentHash; + + public static final String SERIALIZED_NAME_SHA3_UNCLES = "sha3Uncles"; + @SerializedName(SERIALIZED_NAME_SHA3_UNCLES) + private String sha3Uncles; + + public static final String SERIALIZED_NAME_TRANSACTIONS_ROOT = "transactionsRoot"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS_ROOT) + private String transactionsRoot; + + public static final String SERIALIZED_NAME_RECEIPTS_ROOT = "receiptsRoot"; + @SerializedName(SERIALIZED_NAME_RECEIPTS_ROOT) + private String receiptsRoot; + + public static final String SERIALIZED_NAME_DIFFICULTY = "difficulty"; + @SerializedName(SERIALIZED_NAME_DIFFICULTY) + private String difficulty; + + public static final String SERIALIZED_NAME_MIX_HASH = "mixHash"; + @SerializedName(SERIALIZED_NAME_MIX_HASH) + private String mixHash; + + public static final String SERIALIZED_NAME_MINER = "miner"; + @SerializedName(SERIALIZED_NAME_MINER) + private String miner; + + public static final String SERIALIZED_NAME_GAS_LIMIT = "gasLimit"; + @SerializedName(SERIALIZED_NAME_GAS_LIMIT) + private String gasLimit; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private String gasUsed; + + public static final String SERIALIZED_NAME_STATE_ROOT = "stateRoot"; + @SerializedName(SERIALIZED_NAME_STATE_ROOT) + private String stateRoot; + + public static final String SERIALIZED_NAME_LOGS_BLOOM = "logsBloom"; + @SerializedName(SERIALIZED_NAME_LOGS_BLOOM) + private String logsBloom; + + public static final String SERIALIZED_NAME_EXTRA_DATA = "extraData"; + @SerializedName(SERIALIZED_NAME_EXTRA_DATA) + private String extraData; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private String timestamp; + + public Web3BlockHeader() { + } + + public Web3BlockHeader number(String number) { + + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @javax.annotation.Nullable + + public String getNumber() { + return number; + } + + + public void setNumber(String number) { + this.number = number; + } + + + public Web3BlockHeader parentHash(String parentHash) { + + this.parentHash = parentHash; + return this; + } + + /** + * Get parentHash + * @return parentHash + **/ + @javax.annotation.Nullable + + public String getParentHash() { + return parentHash; + } + + + public void setParentHash(String parentHash) { + this.parentHash = parentHash; + } + + + public Web3BlockHeader sha3Uncles(String sha3Uncles) { + + this.sha3Uncles = sha3Uncles; + return this; + } + + /** + * Get sha3Uncles + * @return sha3Uncles + **/ + @javax.annotation.Nonnull + + public String getSha3Uncles() { + return sha3Uncles; + } + + + public void setSha3Uncles(String sha3Uncles) { + this.sha3Uncles = sha3Uncles; + } + + + public Web3BlockHeader transactionsRoot(String transactionsRoot) { + + this.transactionsRoot = transactionsRoot; + return this; + } + + /** + * Get transactionsRoot + * @return transactionsRoot + **/ + @javax.annotation.Nullable + + public String getTransactionsRoot() { + return transactionsRoot; + } + + + public void setTransactionsRoot(String transactionsRoot) { + this.transactionsRoot = transactionsRoot; + } + + + public Web3BlockHeader receiptsRoot(String receiptsRoot) { + + this.receiptsRoot = receiptsRoot; + return this; + } + + /** + * Get receiptsRoot + * @return receiptsRoot + **/ + @javax.annotation.Nullable + + public String getReceiptsRoot() { + return receiptsRoot; + } + + + public void setReceiptsRoot(String receiptsRoot) { + this.receiptsRoot = receiptsRoot; + } + + + public Web3BlockHeader difficulty(String difficulty) { + + this.difficulty = difficulty; + return this; + } + + /** + * Get difficulty + * @return difficulty + **/ + @javax.annotation.Nullable + + public String getDifficulty() { + return difficulty; + } + + + public void setDifficulty(String difficulty) { + this.difficulty = difficulty; + } + + + public Web3BlockHeader mixHash(String mixHash) { + + this.mixHash = mixHash; + return this; + } + + /** + * Get mixHash + * @return mixHash + **/ + @javax.annotation.Nullable + + public String getMixHash() { + return mixHash; + } + + + public void setMixHash(String mixHash) { + this.mixHash = mixHash; + } + + + public Web3BlockHeader miner(String miner) { + + this.miner = miner; + return this; + } + + /** + * Get miner + * @return miner + **/ + @javax.annotation.Nullable + + public String getMiner() { + return miner; + } + + + public void setMiner(String miner) { + this.miner = miner; + } + + + public Web3BlockHeader gasLimit(String gasLimit) { + + this.gasLimit = gasLimit; + return this; + } + + /** + * Get gasLimit + * @return gasLimit + **/ + @javax.annotation.Nonnull + + public String getGasLimit() { + return gasLimit; + } + + + public void setGasLimit(String gasLimit) { + this.gasLimit = gasLimit; + } + + + public Web3BlockHeader gasUsed(String gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + + public String getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(String gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3BlockHeader stateRoot(String stateRoot) { + + this.stateRoot = stateRoot; + return this; + } + + /** + * Get stateRoot + * @return stateRoot + **/ + @javax.annotation.Nullable + + public String getStateRoot() { + return stateRoot; + } + + + public void setStateRoot(String stateRoot) { + this.stateRoot = stateRoot; + } + + + public Web3BlockHeader logsBloom(String logsBloom) { + + this.logsBloom = logsBloom; + return this; + } + + /** + * Get logsBloom + * @return logsBloom + **/ + @javax.annotation.Nullable + + public String getLogsBloom() { + return logsBloom; + } + + + public void setLogsBloom(String logsBloom) { + this.logsBloom = logsBloom; + } + + + public Web3BlockHeader extraData(String extraData) { + + this.extraData = extraData; + return this; + } + + /** + * Get extraData + * @return extraData + **/ + @javax.annotation.Nullable + + public String getExtraData() { + return extraData; + } + + + public void setExtraData(String extraData) { + this.extraData = extraData; + } + + + public Web3BlockHeader nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public Web3BlockHeader timestamp(String timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nullable + + public String getTimestamp() { + return timestamp; + } + + + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3BlockHeader web3BlockHeader = (Web3BlockHeader) o; + return Objects.equals(this.number, web3BlockHeader.number) && + Objects.equals(this.parentHash, web3BlockHeader.parentHash) && + Objects.equals(this.sha3Uncles, web3BlockHeader.sha3Uncles) && + Objects.equals(this.transactionsRoot, web3BlockHeader.transactionsRoot) && + Objects.equals(this.receiptsRoot, web3BlockHeader.receiptsRoot) && + Objects.equals(this.difficulty, web3BlockHeader.difficulty) && + Objects.equals(this.mixHash, web3BlockHeader.mixHash) && + Objects.equals(this.miner, web3BlockHeader.miner) && + Objects.equals(this.gasLimit, web3BlockHeader.gasLimit) && + Objects.equals(this.gasUsed, web3BlockHeader.gasUsed) && + Objects.equals(this.stateRoot, web3BlockHeader.stateRoot) && + Objects.equals(this.logsBloom, web3BlockHeader.logsBloom) && + Objects.equals(this.extraData, web3BlockHeader.extraData) && + Objects.equals(this.nonce, web3BlockHeader.nonce) && + Objects.equals(this.timestamp, web3BlockHeader.timestamp); + } + + @Override + public int hashCode() { + return Objects.hash(number, parentHash, sha3Uncles, transactionsRoot, receiptsRoot, difficulty, mixHash, miner, gasLimit, gasUsed, stateRoot, logsBloom, extraData, nonce, timestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3BlockHeader {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" parentHash: ").append(toIndentedString(parentHash)).append("\n"); + sb.append(" sha3Uncles: ").append(toIndentedString(sha3Uncles)).append("\n"); + sb.append(" transactionsRoot: ").append(toIndentedString(transactionsRoot)).append("\n"); + sb.append(" receiptsRoot: ").append(toIndentedString(receiptsRoot)).append("\n"); + sb.append(" difficulty: ").append(toIndentedString(difficulty)).append("\n"); + sb.append(" mixHash: ").append(toIndentedString(mixHash)).append("\n"); + sb.append(" miner: ").append(toIndentedString(miner)).append("\n"); + sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" stateRoot: ").append(toIndentedString(stateRoot)).append("\n"); + sb.append(" logsBloom: ").append(toIndentedString(logsBloom)).append("\n"); + sb.append(" extraData: ").append(toIndentedString(extraData)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).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(); + openapiFields.add("number"); + openapiFields.add("parentHash"); + openapiFields.add("sha3Uncles"); + openapiFields.add("transactionsRoot"); + openapiFields.add("receiptsRoot"); + openapiFields.add("difficulty"); + openapiFields.add("mixHash"); + openapiFields.add("miner"); + openapiFields.add("gasLimit"); + openapiFields.add("gasUsed"); + openapiFields.add("stateRoot"); + openapiFields.add("logsBloom"); + openapiFields.add("extraData"); + openapiFields.add("nonce"); + openapiFields.add("timestamp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sha3Uncles"); + openapiRequiredFields.add("gasLimit"); + openapiRequiredFields.add("gasUsed"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3BlockHeader + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3BlockHeader.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3BlockHeader is not found in the empty JSON string", Web3BlockHeader.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3BlockHeader.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3BlockHeader` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3BlockHeader.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("number") != null && !jsonObj.get("number").isJsonNull()) && !jsonObj.get("number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + } + if ((jsonObj.get("parentHash") != null && !jsonObj.get("parentHash").isJsonNull()) && !jsonObj.get("parentHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parentHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parentHash").toString())); + } + if (!jsonObj.get("sha3Uncles").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sha3Uncles` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3Uncles").toString())); + } + if ((jsonObj.get("transactionsRoot") != null && !jsonObj.get("transactionsRoot").isJsonNull()) && !jsonObj.get("transactionsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionsRoot").toString())); + } + if ((jsonObj.get("receiptsRoot") != null && !jsonObj.get("receiptsRoot").isJsonNull()) && !jsonObj.get("receiptsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `receiptsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiptsRoot").toString())); + } + if ((jsonObj.get("difficulty") != null && !jsonObj.get("difficulty").isJsonNull()) && !jsonObj.get("difficulty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `difficulty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("difficulty").toString())); + } + if ((jsonObj.get("mixHash") != null && !jsonObj.get("mixHash").isJsonNull()) && !jsonObj.get("mixHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mixHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mixHash").toString())); + } + if ((jsonObj.get("miner") != null && !jsonObj.get("miner").isJsonNull()) && !jsonObj.get("miner").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `miner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("miner").toString())); + } + if (!jsonObj.get("gasLimit").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasLimit` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasLimit").toString())); + } + if (!jsonObj.get("gasUsed").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasUsed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasUsed").toString())); + } + if ((jsonObj.get("stateRoot") != null && !jsonObj.get("stateRoot").isJsonNull()) && !jsonObj.get("stateRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateRoot").toString())); + } + if ((jsonObj.get("logsBloom") != null && !jsonObj.get("logsBloom").isJsonNull()) && !jsonObj.get("logsBloom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logsBloom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logsBloom").toString())); + } + if ((jsonObj.get("extraData") != null && !jsonObj.get("extraData").isJsonNull()) && !jsonObj.get("extraData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `extraData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraData").toString())); + } + if ((jsonObj.get("nonce") != null && !jsonObj.get("nonce").isJsonNull()) && !jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if ((jsonObj.get("timestamp") != null && !jsonObj.get("timestamp").isJsonNull()) && !jsonObj.get("timestamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timestamp").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3BlockHeader.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3BlockHeader' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3BlockHeader.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3BlockHeader value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3BlockHeader read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3BlockHeader given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3BlockHeader + * @throws IOException if the JSON string is invalid with respect to Web3BlockHeader + */ + public static Web3BlockHeader fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3BlockHeader.class); + } + + /** + * Convert an instance of Web3BlockHeader to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java new file mode 100644 index 00000000000..60e9c878ac9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java @@ -0,0 +1,391 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactiKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialGethKeychainPassword; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredential extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Web3SigningCredential.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWeb3SigningCredentialCactiKeychainRef = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactiKeychainRef.class)); + final TypeAdapter adapterWeb3SigningCredentialGethKeychainPassword = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialGethKeychainPassword.class)); + final TypeAdapter adapterWeb3SigningCredentialNone = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + final TypeAdapter adapterWeb3SigningCredentialPrivateKeyHex = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredential value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialCactiKeychainRef` + if (value.getActualInstance() instanceof Web3SigningCredentialCactiKeychainRef) { + JsonObject obj = adapterWeb3SigningCredentialCactiKeychainRef.toJsonTree((Web3SigningCredentialCactiKeychainRef)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialGethKeychainPassword` + if (value.getActualInstance() instanceof Web3SigningCredentialGethKeychainPassword) { + JsonObject obj = adapterWeb3SigningCredentialGethKeychainPassword.toJsonTree((Web3SigningCredentialGethKeychainPassword)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialNone` + if (value.getActualInstance() instanceof Web3SigningCredentialNone) { + JsonObject obj = adapterWeb3SigningCredentialNone.toJsonTree((Web3SigningCredentialNone)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialPrivateKeyHex` + if (value.getActualInstance() instanceof Web3SigningCredentialPrivateKeyHex) { + JsonObject obj = adapterWeb3SigningCredentialPrivateKeyHex.toJsonTree((Web3SigningCredentialPrivateKeyHex)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Web3SigningCredentialCactiKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + @Override + public Web3SigningCredential read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Web3SigningCredentialCactiKeychainRef + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialCactiKeychainRef.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialCactiKeychainRef; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialCactiKeychainRef'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactiKeychainRef failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialCactiKeychainRef'", e); + } + + // deserialize Web3SigningCredentialGethKeychainPassword + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialGethKeychainPassword.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialGethKeychainPassword; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialGethKeychainPassword'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialGethKeychainPassword failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialGethKeychainPassword'", e); + } + + // deserialize Web3SigningCredentialNone + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialNone.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialNone; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialNone'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialNone'", e); + } + + // deserialize Web3SigningCredentialPrivateKeyHex + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialPrivateKeyHex; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialPrivateKeyHex'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialPrivateKeyHex'", e); + } + + if (match == 1) { + Web3SigningCredential ret = new Web3SigningCredential(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Web3SigningCredential: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Web3SigningCredential() { + super("oneOf", Boolean.FALSE); + } + + public Web3SigningCredential(Web3SigningCredentialCactiKeychainRef o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialGethKeychainPassword o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialNone o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialPrivateKeyHex o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Web3SigningCredentialCactiKeychainRef", new GenericType() { + }); + schemas.put("Web3SigningCredentialGethKeychainPassword", new GenericType() { + }); + schemas.put("Web3SigningCredentialNone", new GenericType() { + }); + schemas.put("Web3SigningCredentialPrivateKeyHex", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Web3SigningCredential.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Web3SigningCredentialCactiKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Web3SigningCredentialCactiKeychainRef) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialGethKeychainPassword) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialNone) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialPrivateKeyHex) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Web3SigningCredentialCactiKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + /** + * Get the actual instance, which can be the following: + * Web3SigningCredentialCactiKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * @return The actual instance (Web3SigningCredentialCactiKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialCactiKeychainRef`. If the actual instance is not `Web3SigningCredentialCactiKeychainRef`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialCactiKeychainRef` + * @throws ClassCastException if the instance is not `Web3SigningCredentialCactiKeychainRef` + */ + public Web3SigningCredentialCactiKeychainRef getWeb3SigningCredentialCactiKeychainRef() throws ClassCastException { + return (Web3SigningCredentialCactiKeychainRef)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialGethKeychainPassword`. If the actual instance is not `Web3SigningCredentialGethKeychainPassword`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialGethKeychainPassword` + * @throws ClassCastException if the instance is not `Web3SigningCredentialGethKeychainPassword` + */ + public Web3SigningCredentialGethKeychainPassword getWeb3SigningCredentialGethKeychainPassword() throws ClassCastException { + return (Web3SigningCredentialGethKeychainPassword)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialNone`. If the actual instance is not `Web3SigningCredentialNone`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialNone` + * @throws ClassCastException if the instance is not `Web3SigningCredentialNone` + */ + public Web3SigningCredentialNone getWeb3SigningCredentialNone() throws ClassCastException { + return (Web3SigningCredentialNone)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialPrivateKeyHex`. If the actual instance is not `Web3SigningCredentialPrivateKeyHex`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialPrivateKeyHex` + * @throws ClassCastException if the instance is not `Web3SigningCredentialPrivateKeyHex` + */ + public Web3SigningCredentialPrivateKeyHex getWeb3SigningCredentialPrivateKeyHex() throws ClassCastException { + return (Web3SigningCredentialPrivateKeyHex)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Web3SigningCredentialCactiKeychainRef + try { + Web3SigningCredentialCactiKeychainRef.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactiKeychainRef failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialGethKeychainPassword + try { + Web3SigningCredentialGethKeychainPassword.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialGethKeychainPassword failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialNone + try { + Web3SigningCredentialNone.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialPrivateKeyHex + try { + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Web3SigningCredential with oneOf schemas: Web3SigningCredentialCactiKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Web3SigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredential + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredential + */ + public static Web3SigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredential.class); + } + + /** + * Convert an instance of Web3SigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactiKeychainRef.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactiKeychainRef.java new file mode 100644 index 00000000000..b863738f46e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactiKeychainRef.java @@ -0,0 +1,309 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialCactiKeychainRef + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialCactiKeychainRef { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY = "keychainEntryKey"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY) + private String keychainEntryKey; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public Web3SigningCredentialCactiKeychainRef() { + } + + public Web3SigningCredentialCactiKeychainRef type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialCactiKeychainRef ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialCactiKeychainRef keychainEntryKey(String keychainEntryKey) { + + this.keychainEntryKey = keychainEntryKey; + return this; + } + + /** + * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + * @return keychainEntryKey + **/ + @javax.annotation.Nonnull + + public String getKeychainEntryKey() { + return keychainEntryKey; + } + + + public void setKeychainEntryKey(String keychainEntryKey) { + this.keychainEntryKey = keychainEntryKey; + } + + + public Web3SigningCredentialCactiKeychainRef keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + * @return keychainId + **/ + @javax.annotation.Nullable + + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialCactiKeychainRef web3SigningCredentialCactiKeychainRef = (Web3SigningCredentialCactiKeychainRef) o; + return Objects.equals(this.type, web3SigningCredentialCactiKeychainRef.type) && + Objects.equals(this.ethAccount, web3SigningCredentialCactiKeychainRef.ethAccount) && + Objects.equals(this.keychainEntryKey, web3SigningCredentialCactiKeychainRef.keychainEntryKey) && + Objects.equals(this.keychainId, web3SigningCredentialCactiKeychainRef.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, keychainEntryKey, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialCactiKeychainRef {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" keychainEntryKey: ").append(toIndentedString(keychainEntryKey)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("keychainEntryKey"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("keychainEntryKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialCactiKeychainRef + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialCactiKeychainRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialCactiKeychainRef is not found in the empty JSON string", Web3SigningCredentialCactiKeychainRef.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialCactiKeychainRef.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialCactiKeychainRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialCactiKeychainRef.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("keychainEntryKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainEntryKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainEntryKey").toString())); + } + if ((jsonObj.get("keychainId") != null && !jsonObj.get("keychainId").isJsonNull()) && !jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialCactiKeychainRef.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialCactiKeychainRef' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactiKeychainRef.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialCactiKeychainRef value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialCactiKeychainRef read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialCactiKeychainRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialCactiKeychainRef + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialCactiKeychainRef + */ + public static Web3SigningCredentialCactiKeychainRef fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialCactiKeychainRef.class); + } + + /** + * Convert an instance of Web3SigningCredentialCactiKeychainRef to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java new file mode 100644 index 00000000000..87f34da91bd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialGethKeychainPassword + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialGethKeychainPassword { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialGethKeychainPassword() { + } + + public Web3SigningCredentialGethKeychainPassword type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialGethKeychainPassword ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialGethKeychainPassword secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * A geth keychain unlock password. + * @return secret + **/ + @javax.annotation.Nonnull + + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialGethKeychainPassword web3SigningCredentialGethKeychainPassword = (Web3SigningCredentialGethKeychainPassword) o; + return Objects.equals(this.type, web3SigningCredentialGethKeychainPassword.type) && + Objects.equals(this.ethAccount, web3SigningCredentialGethKeychainPassword.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialGethKeychainPassword.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialGethKeychainPassword {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialGethKeychainPassword + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialGethKeychainPassword.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialGethKeychainPassword is not found in the empty JSON string", Web3SigningCredentialGethKeychainPassword.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialGethKeychainPassword.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialGethKeychainPassword` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialGethKeychainPassword.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialGethKeychainPassword.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialGethKeychainPassword' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialGethKeychainPassword.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialGethKeychainPassword value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialGethKeychainPassword read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialGethKeychainPassword given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialGethKeychainPassword + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialGethKeychainPassword + */ + public static Web3SigningCredentialGethKeychainPassword fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialGethKeychainPassword.class); + } + + /** + * Convert an instance of Web3SigningCredentialGethKeychainPassword to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java new file mode 100644 index 00000000000..c3903c8910a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java @@ -0,0 +1,211 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Using this denotes that there is no signing required because the transaction is pre-signed. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialNone { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public Web3SigningCredentialNone() { + } + + public Web3SigningCredentialNone type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialNone web3SigningCredentialNone = (Web3SigningCredentialNone) o; + return Objects.equals(this.type, web3SigningCredentialNone.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialNone {\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(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialNone + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialNone.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialNone is not found in the empty JSON string", Web3SigningCredentialNone.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialNone.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialNone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialNone.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialNone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialNone' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialNone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialNone read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialNone given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialNone + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialNone + */ + public static Web3SigningCredentialNone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialNone.class); + } + + /** + * Convert an instance of Web3SigningCredentialNone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java new file mode 100644 index 00000000000..3fad08e37b2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialPrivateKeyHex + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialPrivateKeyHex { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialPrivateKeyHex() { + } + + public Web3SigningCredentialPrivateKeyHex type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialPrivateKeyHex ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialPrivateKeyHex secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * The HEX encoded private key of an eth account. + * @return secret + **/ + @javax.annotation.Nonnull + + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialPrivateKeyHex web3SigningCredentialPrivateKeyHex = (Web3SigningCredentialPrivateKeyHex) o; + return Objects.equals(this.type, web3SigningCredentialPrivateKeyHex.type) && + Objects.equals(this.ethAccount, web3SigningCredentialPrivateKeyHex.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialPrivateKeyHex.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialPrivateKeyHex {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialPrivateKeyHex is not found in the empty JSON string", Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialPrivateKeyHex.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialPrivateKeyHex` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialPrivateKeyHex.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialPrivateKeyHex.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialPrivateKeyHex' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialPrivateKeyHex value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialPrivateKeyHex read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialPrivateKeyHex given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialPrivateKeyHex + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static Web3SigningCredentialPrivateKeyHex fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialPrivateKeyHex.class); + } + + /** + * Convert an instance of Web3SigningCredentialPrivateKeyHex to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java new file mode 100644 index 00000000000..5a0a3b39c0c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Web3SigningCredentialType + */ +@JsonAdapter(Web3SigningCredentialType.Adapter.class) +public enum Web3SigningCredentialType { + + CACTI_KEYCHAIN_REF("CACTI_KEYCHAIN_REF"), + + GETH_KEYCHAIN_PASSWORD("GETH_KEYCHAIN_PASSWORD"), + + PRIVATE_KEY_HEX("PRIVATE_KEY_HEX"), + + NONE("NONE"); + + private String value; + + Web3SigningCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Web3SigningCredentialType fromValue(String value) { + for (Web3SigningCredentialType b : Web3SigningCredentialType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Web3SigningCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Web3SigningCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Web3SigningCredentialType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3Transaction.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3Transaction.java new file mode 100644 index 00000000000..b8d2afe976b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3Transaction.java @@ -0,0 +1,705 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3Transaction + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3Transaction { + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private String blockNumber; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private String transactionIndex; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private String gasPrice; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private String gas; + + public static final String SERIALIZED_NAME_INPUT = "input"; + @SerializedName(SERIALIZED_NAME_INPUT) + private String input; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_CHAIN_ID = "chainId"; + @SerializedName(SERIALIZED_NAME_CHAIN_ID) + private String chainId; + + public static final String SERIALIZED_NAME_V = "v"; + @SerializedName(SERIALIZED_NAME_V) + private String v; + + public static final String SERIALIZED_NAME_R = "r"; + @SerializedName(SERIALIZED_NAME_R) + private String r; + + public static final String SERIALIZED_NAME_S = "s"; + @SerializedName(SERIALIZED_NAME_S) + private String s; + + public Web3Transaction() { + } + + public Web3Transaction hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + **/ + @javax.annotation.Nonnull + + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public Web3Transaction nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nonnull + + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public Web3Transaction blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nonnull + + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public Web3Transaction blockNumber(String blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nonnull + + public String getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(String blockNumber) { + this.blockNumber = blockNumber; + } + + + public Web3Transaction transactionIndex(String transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nonnull + + public String getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(String transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public Web3Transaction from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nonnull + + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public Web3Transaction to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nonnull + + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + + public Web3Transaction value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nonnull + + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + public Web3Transaction gasPrice(String gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nonnull + + public String getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(String gasPrice) { + this.gasPrice = gasPrice; + } + + + public Web3Transaction gas(String gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nonnull + + public String getGas() { + return gas; + } + + + public void setGas(String gas) { + this.gas = gas; + } + + + public Web3Transaction input(String input) { + + this.input = input; + return this; + } + + /** + * Get input + * @return input + **/ + @javax.annotation.Nonnull + + public String getInput() { + return input; + } + + + public void setInput(String input) { + this.input = input; + } + + + public Web3Transaction type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public Web3Transaction chainId(String chainId) { + + this.chainId = chainId; + return this; + } + + /** + * Get chainId + * @return chainId + **/ + @javax.annotation.Nonnull + + public String getChainId() { + return chainId; + } + + + public void setChainId(String chainId) { + this.chainId = chainId; + } + + + public Web3Transaction v(String v) { + + this.v = v; + return this; + } + + /** + * Get v + * @return v + **/ + @javax.annotation.Nullable + + public String getV() { + return v; + } + + + public void setV(String v) { + this.v = v; + } + + + public Web3Transaction r(String r) { + + this.r = r; + return this; + } + + /** + * Get r + * @return r + **/ + @javax.annotation.Nullable + + public String getR() { + return r; + } + + + public void setR(String r) { + this.r = r; + } + + + public Web3Transaction s(String s) { + + this.s = s; + return this; + } + + /** + * Get s + * @return s + **/ + @javax.annotation.Nullable + + public String getS() { + return s; + } + + + public void setS(String s) { + this.s = s; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3Transaction web3Transaction = (Web3Transaction) o; + return Objects.equals(this.hash, web3Transaction.hash) && + Objects.equals(this.nonce, web3Transaction.nonce) && + Objects.equals(this.blockHash, web3Transaction.blockHash) && + Objects.equals(this.blockNumber, web3Transaction.blockNumber) && + Objects.equals(this.transactionIndex, web3Transaction.transactionIndex) && + Objects.equals(this.from, web3Transaction.from) && + Objects.equals(this.to, web3Transaction.to) && + Objects.equals(this.value, web3Transaction.value) && + Objects.equals(this.gasPrice, web3Transaction.gasPrice) && + Objects.equals(this.gas, web3Transaction.gas) && + Objects.equals(this.input, web3Transaction.input) && + Objects.equals(this.type, web3Transaction.type) && + Objects.equals(this.chainId, web3Transaction.chainId) && + Objects.equals(this.v, web3Transaction.v) && + Objects.equals(this.r, web3Transaction.r) && + Objects.equals(this.s, web3Transaction.s); + } + + @Override + public int hashCode() { + return Objects.hash(hash, nonce, blockHash, blockNumber, transactionIndex, from, to, value, gasPrice, gas, input, type, chainId, v, r, s); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3Transaction {\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" input: ").append(toIndentedString(input)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" chainId: ").append(toIndentedString(chainId)).append("\n"); + sb.append(" v: ").append(toIndentedString(v)).append("\n"); + sb.append(" r: ").append(toIndentedString(r)).append("\n"); + sb.append(" s: ").append(toIndentedString(s)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hash"); + openapiFields.add("nonce"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("transactionIndex"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("value"); + openapiFields.add("gasPrice"); + openapiFields.add("gas"); + openapiFields.add("input"); + openapiFields.add("type"); + openapiFields.add("chainId"); + openapiFields.add("v"); + openapiFields.add("r"); + openapiFields.add("s"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("hash"); + openapiRequiredFields.add("nonce"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("blockNumber"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("to"); + openapiRequiredFields.add("value"); + openapiRequiredFields.add("gasPrice"); + openapiRequiredFields.add("gas"); + openapiRequiredFields.add("input"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("chainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3Transaction + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3Transaction.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3Transaction is not found in the empty JSON string", Web3Transaction.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3Transaction.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3Transaction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3Transaction.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if (!jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if (!jsonObj.get("blockNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockNumber").toString())); + } + if (!jsonObj.get("transactionIndex").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionIndex` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionIndex").toString())); + } + if (!jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if (!jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + if (!jsonObj.get("gasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasPrice").toString())); + } + if (!jsonObj.get("gas").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gas` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gas").toString())); + } + if (!jsonObj.get("input").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `input` to be a primitive type in the JSON string but got `%s`", jsonObj.get("input").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if (!jsonObj.get("chainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `chainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chainId").toString())); + } + if ((jsonObj.get("v") != null && !jsonObj.get("v").isJsonNull()) && !jsonObj.get("v").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `v` to be a primitive type in the JSON string but got `%s`", jsonObj.get("v").toString())); + } + if ((jsonObj.get("r") != null && !jsonObj.get("r").isJsonNull()) && !jsonObj.get("r").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `r` to be a primitive type in the JSON string but got `%s`", jsonObj.get("r").toString())); + } + if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) && !jsonObj.get("s").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `s` to be a primitive type in the JSON string but got `%s`", jsonObj.get("s").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3Transaction.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3Transaction' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3Transaction.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3Transaction value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3Transaction read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3Transaction given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3Transaction + * @throws IOException if the JSON string is invalid with respect to Web3Transaction + */ + public static Web3Transaction fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3Transaction.class); + } + + /** + * Convert an instance of Web3Transaction to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java new file mode 100644 index 00000000000..c4388576085 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java @@ -0,0 +1,827 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3TransactionReceipt + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3TransactionReceipt { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Boolean status; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private String transactionIndex; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private String blockNumber; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private String gasUsed; + + public static final String SERIALIZED_NAME_EFFECTIVE_GAS_PRICE = "effectiveGasPrice"; + @SerializedName(SERIALIZED_NAME_EFFECTIVE_GAS_PRICE) + private String effectiveGasPrice; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public static final String SERIALIZED_NAME_LOGS = "logs"; + @SerializedName(SERIALIZED_NAME_LOGS) + private List logs = null; + + public static final String SERIALIZED_NAME_LOGS_BLOOM = "logsBloom"; + @SerializedName(SERIALIZED_NAME_LOGS_BLOOM) + private String logsBloom; + + public static final String SERIALIZED_NAME_REVERT_REASON = "revertReason"; + @SerializedName(SERIALIZED_NAME_REVERT_REASON) + private String revertReason; + + public static final String SERIALIZED_NAME_OUTPUT = "output"; + @SerializedName(SERIALIZED_NAME_OUTPUT) + private String output; + + public static final String SERIALIZED_NAME_COMMITMENT_HASH = "commitmentHash"; + @SerializedName(SERIALIZED_NAME_COMMITMENT_HASH) + private String commitmentHash; + + public static final String SERIALIZED_NAME_CUMULATIVE_GAS_USED = "cumulativeGasUsed"; + @SerializedName(SERIALIZED_NAME_CUMULATIVE_GAS_USED) + private String cumulativeGasUsed; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public Web3TransactionReceipt() { + } + + public Web3TransactionReceipt status(Boolean status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + + public Boolean getStatus() { + return status; + } + + + public void setStatus(Boolean status) { + this.status = status; + } + + + public Web3TransactionReceipt transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nonnull + + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + public Web3TransactionReceipt transactionIndex(String transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nonnull + + public String getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(String transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public Web3TransactionReceipt blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nonnull + + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public Web3TransactionReceipt blockNumber(String blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nonnull + + public String getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(String blockNumber) { + this.blockNumber = blockNumber; + } + + + public Web3TransactionReceipt gasUsed(String gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + + public String getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(String gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3TransactionReceipt effectiveGasPrice(String effectiveGasPrice) { + + this.effectiveGasPrice = effectiveGasPrice; + return this; + } + + /** + * Get effectiveGasPrice + * @return effectiveGasPrice + **/ + @javax.annotation.Nullable + + public String getEffectiveGasPrice() { + return effectiveGasPrice; + } + + + public void setEffectiveGasPrice(String effectiveGasPrice) { + this.effectiveGasPrice = effectiveGasPrice; + } + + + public Web3TransactionReceipt contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Get contractAddress + * @return contractAddress + **/ + @javax.annotation.Nullable + + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public Web3TransactionReceipt from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nonnull + + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public Web3TransactionReceipt to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nonnull + + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + + public Web3TransactionReceipt logs(List logs) { + + this.logs = logs; + return this; + } + + public Web3TransactionReceipt addLogsItem(Object logsItem) { + if (this.logs == null) { + this.logs = null; + } + this.logs.add(logsItem); + return this; + } + + /** + * Get logs + * @return logs + **/ + @javax.annotation.Nullable + + public List getLogs() { + return logs; + } + + + public void setLogs(List logs) { + this.logs = logs; + } + + + public Web3TransactionReceipt logsBloom(String logsBloom) { + + this.logsBloom = logsBloom; + return this; + } + + /** + * Get logsBloom + * @return logsBloom + **/ + @javax.annotation.Nullable + + public String getLogsBloom() { + return logsBloom; + } + + + public void setLogsBloom(String logsBloom) { + this.logsBloom = logsBloom; + } + + + public Web3TransactionReceipt revertReason(String revertReason) { + + this.revertReason = revertReason; + return this; + } + + /** + * Get revertReason + * @return revertReason + **/ + @javax.annotation.Nullable + + public String getRevertReason() { + return revertReason; + } + + + public void setRevertReason(String revertReason) { + this.revertReason = revertReason; + } + + + public Web3TransactionReceipt output(String output) { + + this.output = output; + return this; + } + + /** + * Get output + * @return output + **/ + @javax.annotation.Nullable + + public String getOutput() { + return output; + } + + + public void setOutput(String output) { + this.output = output; + } + + + public Web3TransactionReceipt commitmentHash(String commitmentHash) { + + this.commitmentHash = commitmentHash; + return this; + } + + /** + * Get commitmentHash + * @return commitmentHash + **/ + @javax.annotation.Nullable + + public String getCommitmentHash() { + return commitmentHash; + } + + + public void setCommitmentHash(String commitmentHash) { + this.commitmentHash = commitmentHash; + } + + + public Web3TransactionReceipt cumulativeGasUsed(String cumulativeGasUsed) { + + this.cumulativeGasUsed = cumulativeGasUsed; + return this; + } + + /** + * Get cumulativeGasUsed + * @return cumulativeGasUsed + **/ + @javax.annotation.Nullable + + public String getCumulativeGasUsed() { + return cumulativeGasUsed; + } + + + public void setCumulativeGasUsed(String cumulativeGasUsed) { + this.cumulativeGasUsed = cumulativeGasUsed; + } + + + public Web3TransactionReceipt type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Web3TransactionReceipt instance itself + */ + public Web3TransactionReceipt putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3TransactionReceipt web3TransactionReceipt = (Web3TransactionReceipt) o; + return Objects.equals(this.status, web3TransactionReceipt.status) && + Objects.equals(this.transactionHash, web3TransactionReceipt.transactionHash) && + Objects.equals(this.transactionIndex, web3TransactionReceipt.transactionIndex) && + Objects.equals(this.blockHash, web3TransactionReceipt.blockHash) && + Objects.equals(this.blockNumber, web3TransactionReceipt.blockNumber) && + Objects.equals(this.gasUsed, web3TransactionReceipt.gasUsed) && + Objects.equals(this.effectiveGasPrice, web3TransactionReceipt.effectiveGasPrice) && + Objects.equals(this.contractAddress, web3TransactionReceipt.contractAddress) && + Objects.equals(this.from, web3TransactionReceipt.from) && + Objects.equals(this.to, web3TransactionReceipt.to) && + Objects.equals(this.logs, web3TransactionReceipt.logs) && + Objects.equals(this.logsBloom, web3TransactionReceipt.logsBloom) && + Objects.equals(this.revertReason, web3TransactionReceipt.revertReason) && + Objects.equals(this.output, web3TransactionReceipt.output) && + Objects.equals(this.commitmentHash, web3TransactionReceipt.commitmentHash) && + Objects.equals(this.cumulativeGasUsed, web3TransactionReceipt.cumulativeGasUsed) && + Objects.equals(this.type, web3TransactionReceipt.type)&& + Objects.equals(this.additionalProperties, web3TransactionReceipt.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, transactionHash, transactionIndex, blockHash, blockNumber, gasUsed, effectiveGasPrice, contractAddress, from, to, logs, logsBloom, revertReason, output, commitmentHash, cumulativeGasUsed, type, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3TransactionReceipt {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" effectiveGasPrice: ").append(toIndentedString(effectiveGasPrice)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" logs: ").append(toIndentedString(logs)).append("\n"); + sb.append(" logsBloom: ").append(toIndentedString(logsBloom)).append("\n"); + sb.append(" revertReason: ").append(toIndentedString(revertReason)).append("\n"); + sb.append(" output: ").append(toIndentedString(output)).append("\n"); + sb.append(" commitmentHash: ").append(toIndentedString(commitmentHash)).append("\n"); + sb.append(" cumulativeGasUsed: ").append(toIndentedString(cumulativeGasUsed)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("transactionHash"); + openapiFields.add("transactionIndex"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("gasUsed"); + openapiFields.add("effectiveGasPrice"); + openapiFields.add("contractAddress"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("logs"); + openapiFields.add("logsBloom"); + openapiFields.add("revertReason"); + openapiFields.add("output"); + openapiFields.add("commitmentHash"); + openapiFields.add("cumulativeGasUsed"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("transactionHash"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("blockNumber"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("to"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3TransactionReceipt + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3TransactionReceipt.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3TransactionReceipt is not found in the empty JSON string", Web3TransactionReceipt.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3TransactionReceipt.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + if (!jsonObj.get("transactionIndex").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionIndex` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionIndex").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if (!jsonObj.get("blockNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockNumber").toString())); + } + if (!jsonObj.get("gasUsed").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasUsed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasUsed").toString())); + } + if ((jsonObj.get("effectiveGasPrice") != null && !jsonObj.get("effectiveGasPrice").isJsonNull()) && !jsonObj.get("effectiveGasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `effectiveGasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effectiveGasPrice").toString())); + } + if ((jsonObj.get("contractAddress") != null && !jsonObj.get("contractAddress").isJsonNull()) && !jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if (!jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if (!jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("logs") != null && !jsonObj.get("logs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `logs` to be an array in the JSON string but got `%s`", jsonObj.get("logs").toString())); + } + if ((jsonObj.get("logsBloom") != null && !jsonObj.get("logsBloom").isJsonNull()) && !jsonObj.get("logsBloom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logsBloom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logsBloom").toString())); + } + if ((jsonObj.get("revertReason") != null && !jsonObj.get("revertReason").isJsonNull()) && !jsonObj.get("revertReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `revertReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("revertReason").toString())); + } + if ((jsonObj.get("output") != null && !jsonObj.get("output").isJsonNull()) && !jsonObj.get("output").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `output` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output").toString())); + } + if ((jsonObj.get("commitmentHash") != null && !jsonObj.get("commitmentHash").isJsonNull()) && !jsonObj.get("commitmentHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitmentHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitmentHash").toString())); + } + if ((jsonObj.get("cumulativeGasUsed") != null && !jsonObj.get("cumulativeGasUsed").isJsonNull()) && !jsonObj.get("cumulativeGasUsed").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cumulativeGasUsed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cumulativeGasUsed").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3TransactionReceipt.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3TransactionReceipt' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3TransactionReceipt.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3TransactionReceipt value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Web3TransactionReceipt read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Web3TransactionReceipt instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3TransactionReceipt given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3TransactionReceipt + * @throws IOException if the JSON string is invalid with respect to Web3TransactionReceipt + */ + public static Web3TransactionReceipt fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3TransactionReceipt.class); + } + + /** + * Convert an instance of Web3TransactionReceipt to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..9a252a03c09 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,114 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeployContractV1Request; +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.InvokeRawWeb3EthContractV1Request; +import org.openapitools.client.model.InvokeRawWeb3EthContractV1Response; +import org.openapitools.client.model.InvokeRawWeb3EthMethodV1Request; +import org.openapitools.client.model.InvokeRawWeb3EthMethodV1Response; +import org.openapitools.client.model.RunTransactionRequest; +import org.openapitools.client.model.RunTransactionResponse; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deploys the contract to ethereum ledger. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractTest() throws ApiException { + DeployContractV1Request deployContractV1Request = null; + RunTransactionResponse response = api.deployContract(deployContractV1Request); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Invokes a contract on an ethereum ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeContractV1Test() throws ApiException { + InvokeContractV1Request invokeContractV1Request = null; + InvokeContractV1Response response = api.invokeContractV1(invokeContractV1Request); + // TODO: test validations + } + + /** + * Low-level endpoint to invoke a method on deployed contract. + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeRawWeb3EthContractV1Test() throws ApiException { + InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request = null; + InvokeRawWeb3EthContractV1Response response = api.invokeRawWeb3EthContractV1(invokeRawWeb3EthContractV1Request); + // TODO: test validations + } + + /** + * Invoke any method from web3.eth (low-level) + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeWeb3EthMethodV1Test() throws ApiException { + InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request = null; + InvokeRawWeb3EthMethodV1Response response = api.invokeWeb3EthMethodV1(invokeRawWeb3EthMethodV1Request); + // TODO: test validations + } + + /** + * Executes a transaction on a ethereum ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void runTransactionV1Test() throws ApiException { + RunTransactionRequest runTransactionRequest = null; + RunTransactionResponse response = api.runTransactionV1(runTransactionRequest); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java new file mode 100644 index 00000000000..b081882ef6f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java @@ -0,0 +1,146 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ContractJSON + */ +public class ContractJSONTest { + private final ContractJSON model = new ContractJSON(); + + /** + * Model tests for ContractJSON + */ + @Test + public void testContractJSON() { + // TODO: test ContractJSON + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'abi' + */ + @Test + public void abiTest() { + // TODO: test abi + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'deployedBytecode' + */ + @Test + public void deployedBytecodeTest() { + // TODO: test deployedBytecode + } + + /** + * Test the property 'sourceMap' + */ + @Test + public void sourceMapTest() { + // TODO: test sourceMap + } + + /** + * Test the property 'deployedSourceMap' + */ + @Test + public void deployedSourceMapTest() { + // TODO: test deployedSourceMap + } + + /** + * Test the property 'sourcePath' + */ + @Test + public void sourcePathTest() { + // TODO: test sourcePath + } + + /** + * Test the property 'compiler' + */ + @Test + public void compilerTest() { + // TODO: test compiler + } + + /** + * Test the property 'networks' + */ + @Test + public void networksTest() { + // TODO: test networks + } + + /** + * Test the property 'ast' + */ + @Test + public void astTest() { + // TODO: test ast + } + + /** + * Test the property 'functionHashes' + */ + @Test + public void functionHashesTest() { + // TODO: test functionHashes + } + + /** + * Test the property 'gasEstimates' + */ + @Test + public void gasEstimatesTest() { + // TODO: test gasEstimates + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJsonDefinitionTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJsonDefinitionTest.java new file mode 100644 index 00000000000..d65c4ae2ee9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJsonDefinitionTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.ContractJSON; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ContractJsonDefinition + */ +public class ContractJsonDefinitionTest { + private final ContractJsonDefinition model = new ContractJsonDefinition(); + + /** + * Model tests for ContractJsonDefinition + */ + @Test + public void testContractJsonDefinition() { + // TODO: test ContractJsonDefinition + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractKeychainDefinitionTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractKeychainDefinitionTest.java new file mode 100644 index 00000000000..eefb7feaec4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractKeychainDefinitionTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ContractKeychainDefinition + */ +public class ContractKeychainDefinitionTest { + private final ContractKeychainDefinition model = new ContractKeychainDefinition(); + + /** + * Model tests for ContractKeychainDefinition + */ + @Test + public void testContractKeychainDefinition() { + // TODO: test ContractKeychainDefinition + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestContractTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestContractTest.java new file mode 100644 index 00000000000..88d1c125409 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestContractTest.java @@ -0,0 +1,67 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.ContractJsonDefinition; +import org.openapitools.client.model.ContractKeychainDefinition; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractV1RequestContract + */ +public class DeployContractV1RequestContractTest { + private final DeployContractV1RequestContract model = new DeployContractV1RequestContract(); + + /** + * Model tests for DeployContractV1RequestContract + */ + @Test + public void testDeployContractV1RequestContract() { + // TODO: test DeployContractV1RequestContract + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java new file mode 100644 index 00000000000..ccfb3e1806b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.DeployContractV1RequestContract; +import org.openapitools.client.model.GasTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractV1Request + */ +public class DeployContractV1RequestTest { + private final DeployContractV1Request model = new DeployContractV1Request(); + + /** + * Model tests for DeployContractV1Request + */ + @Test + public void testDeployContractV1Request() { + // TODO: test DeployContractV1Request + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'contract' + */ + @Test + public void contractTest() { + // TODO: test contract + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'gasConfig' + */ + @Test + public void gasConfigTest() { + // TODO: test gasConfig + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployedContractJsonDefinitionTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployedContractJsonDefinitionTest.java new file mode 100644 index 00000000000..7defc69b22b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployedContractJsonDefinitionTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.ContractJSON; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployedContractJsonDefinition + */ +public class DeployedContractJsonDefinitionTest { + private final DeployedContractJsonDefinition model = new DeployedContractJsonDefinition(); + + /** + * Model tests for DeployedContractJsonDefinition + */ + @Test + public void testDeployedContractJsonDefinition() { + // TODO: test DeployedContractJsonDefinition + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java new file mode 100644 index 00000000000..1aa854d9a37 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ErrorExceptionResponseV1 + */ +public class ErrorExceptionResponseV1Test { + private final ErrorExceptionResponseV1 model = new ErrorExceptionResponseV1(); + + /** + * Model tests for ErrorExceptionResponseV1 + */ + @Test + public void testErrorExceptionResponseV1() { + // TODO: test ErrorExceptionResponseV1 + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java new file mode 100644 index 00000000000..9114a344681 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EthContractInvocationType + */ +public class EthContractInvocationTypeTest { + /** + * Model tests for EthContractInvocationType + */ + @Test + public void testEthContractInvocationType() { + // TODO: test EthContractInvocationType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationWeb3MethodTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationWeb3MethodTest.java new file mode 100644 index 00000000000..dfb57092e8a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationWeb3MethodTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EthContractInvocationWeb3Method + */ +public class EthContractInvocationWeb3MethodTest { + /** + * Model tests for EthContractInvocationWeb3Method + */ + @Test + public void testEthContractInvocationWeb3Method() { + // TODO: test EthContractInvocationWeb3Method + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthereumTransactionConfigTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthereumTransactionConfigTest.java new file mode 100644 index 00000000000..afff39b5760 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthereumTransactionConfigTest.java @@ -0,0 +1,97 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.GasTransactionConfig; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EthereumTransactionConfig + */ +public class EthereumTransactionConfigTest { + private final EthereumTransactionConfig model = new EthereumTransactionConfig(); + + /** + * Model tests for EthereumTransactionConfig + */ + @Test + public void testEthereumTransactionConfig() { + // TODO: test EthereumTransactionConfig + } + + /** + * Test the property 'rawTransaction' + */ + @Test + public void rawTransactionTest() { + // TODO: test rawTransaction + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'gasConfig' + */ + @Test + public void gasConfigTest() { + // TODO: test gasConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigEIP1559Test.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigEIP1559Test.java new file mode 100644 index 00000000000..cd25f872fe6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigEIP1559Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GasTransactionConfigEIP1559 + */ +public class GasTransactionConfigEIP1559Test { + private final GasTransactionConfigEIP1559 model = new GasTransactionConfigEIP1559(); + + /** + * Model tests for GasTransactionConfigEIP1559 + */ + @Test + public void testGasTransactionConfigEIP1559() { + // TODO: test GasTransactionConfigEIP1559 + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'maxFeePerGas' + */ + @Test + public void maxFeePerGasTest() { + // TODO: test maxFeePerGas + } + + /** + * Test the property 'maxPriorityFeePerGas' + */ + @Test + public void maxPriorityFeePerGasTest() { + // TODO: test maxPriorityFeePerGas + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigLegacyTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigLegacyTest.java new file mode 100644 index 00000000000..0ee47bd903b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigLegacyTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GasTransactionConfigLegacy + */ +public class GasTransactionConfigLegacyTest { + private final GasTransactionConfigLegacy model = new GasTransactionConfigLegacy(); + + /** + * Model tests for GasTransactionConfigLegacy + */ + @Test + public void testGasTransactionConfigLegacy() { + // TODO: test GasTransactionConfigLegacy + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigTest.java new file mode 100644 index 00000000000..70704061b63 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GasTransactionConfigTest.java @@ -0,0 +1,82 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.GasTransactionConfigEIP1559; +import org.openapitools.client.model.GasTransactionConfigLegacy; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GasTransactionConfig + */ +public class GasTransactionConfigTest { + private final GasTransactionConfig model = new GasTransactionConfig(); + + /** + * Model tests for GasTransactionConfig + */ + @Test + public void testGasTransactionConfig() { + // TODO: test GasTransactionConfig + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'maxFeePerGas' + */ + @Test + public void maxFeePerGasTest() { + // TODO: test maxFeePerGas + } + + /** + * Test the property 'maxPriorityFeePerGas' + */ + @Test + public void maxPriorityFeePerGasTest() { + // TODO: test maxPriorityFeePerGas + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestContractTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestContractTest.java new file mode 100644 index 00000000000..c0c214a4306 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestContractTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.ContractKeychainDefinition; +import org.openapitools.client.model.DeployedContractJsonDefinition; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1RequestContract + */ +public class InvokeContractV1RequestContractTest { + private final InvokeContractV1RequestContract model = new InvokeContractV1RequestContract(); + + /** + * Model tests for InvokeContractV1RequestContract + */ + @Test + public void testInvokeContractV1RequestContract() { + // TODO: test InvokeContractV1RequestContract + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java new file mode 100644 index 00000000000..52d40f910d5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java @@ -0,0 +1,111 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.GasTransactionConfig; +import org.openapitools.client.model.InvokeContractV1RequestContract; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Request + */ +public class InvokeContractV1RequestTest { + private final InvokeContractV1Request model = new InvokeContractV1Request(); + + /** + * Model tests for InvokeContractV1Request + */ + @Test + public void testInvokeContractV1Request() { + // TODO: test InvokeContractV1Request + } + + /** + * Test the property 'contract' + */ + @Test + public void contractTest() { + // TODO: test contract + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'gasConfig' + */ + @Test + public void gasConfigTest() { + // TODO: test gasConfig + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java new file mode 100644 index 00000000000..2575f6bc05d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Response + */ +public class InvokeContractV1ResponseTest { + private final InvokeContractV1Response model = new InvokeContractV1Response(); + + /** + * Model tests for InvokeContractV1Response + */ + @Test + public void testInvokeContractV1Response() { + // TODO: test InvokeContractV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + + /** + * Test the property 'callOutput' + */ + @Test + public void callOutputTest() { + // TODO: test callOutput + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1RequestTest.java new file mode 100644 index 00000000000..4cccadecb1f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1RequestTest.java @@ -0,0 +1,91 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.EthContractInvocationWeb3Method; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRawWeb3EthContractV1Request + */ +public class InvokeRawWeb3EthContractV1RequestTest { + private final InvokeRawWeb3EthContractV1Request model = new InvokeRawWeb3EthContractV1Request(); + + /** + * Model tests for InvokeRawWeb3EthContractV1Request + */ + @Test + public void testInvokeRawWeb3EthContractV1Request() { + // TODO: test InvokeRawWeb3EthContractV1Request + } + + /** + * Test the property 'abi' + */ + @Test + public void abiTest() { + // TODO: test abi + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'invocationParams' + */ + @Test + public void invocationParamsTest() { + // TODO: test invocationParams + } + + /** + * Test the property 'contractMethod' + */ + @Test + public void contractMethodTest() { + // TODO: test contractMethod + } + + /** + * Test the property 'contractMethodArgs' + */ + @Test + public void contractMethodArgsTest() { + // TODO: test contractMethodArgs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1ResponseTest.java new file mode 100644 index 00000000000..3dec386123e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRawWeb3EthContractV1Response + */ +public class InvokeRawWeb3EthContractV1ResponseTest { + private final InvokeRawWeb3EthContractV1Response model = new InvokeRawWeb3EthContractV1Response(); + + /** + * Model tests for InvokeRawWeb3EthContractV1Response + */ + @Test + public void testInvokeRawWeb3EthContractV1Response() { + // TODO: test InvokeRawWeb3EthContractV1Response + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'errorDetail' + */ + @Test + public void errorDetailTest() { + // TODO: test errorDetail + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1RequestTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1RequestTest.java new file mode 100644 index 00000000000..09740d26106 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1RequestTest.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRawWeb3EthMethodV1Request + */ +public class InvokeRawWeb3EthMethodV1RequestTest { + private final InvokeRawWeb3EthMethodV1Request model = new InvokeRawWeb3EthMethodV1Request(); + + /** + * Model tests for InvokeRawWeb3EthMethodV1Request + */ + @Test + public void testInvokeRawWeb3EthMethodV1Request() { + // TODO: test InvokeRawWeb3EthMethodV1Request + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1ResponseTest.java new file mode 100644 index 00000000000..0c216dce753 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRawWeb3EthMethodV1Response + */ +public class InvokeRawWeb3EthMethodV1ResponseTest { + private final InvokeRawWeb3EthMethodV1Response model = new InvokeRawWeb3EthMethodV1Response(); + + /** + * Model tests for InvokeRawWeb3EthMethodV1Response + */ + @Test + public void testInvokeRawWeb3EthMethodV1Response() { + // TODO: test InvokeRawWeb3EthMethodV1Response + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'errorDetail' + */ + @Test + public void errorDetailTest() { + // TODO: test errorDetail + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java new file mode 100644 index 00000000000..16dacda1f7a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java @@ -0,0 +1,67 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.client.model.EthereumTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionRequest + */ +public class RunTransactionRequestTest { + private final RunTransactionRequest model = new RunTransactionRequest(); + + /** + * Model tests for RunTransactionRequest + */ + @Test + public void testRunTransactionRequest() { + // TODO: test RunTransactionRequest + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'transactionConfig' + */ + @Test + public void transactionConfigTest() { + // TODO: test transactionConfig + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java new file mode 100644 index 00000000000..64865bb616b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionResponse + */ +public class RunTransactionResponseTest { + private final RunTransactionResponse model = new RunTransactionResponse(); + + /** + * Model tests for RunTransactionResponse + */ + @Test + public void testRunTransactionResponse() { + // TODO: test RunTransactionResponse + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTest.java new file mode 100644 index 00000000000..fa13aa90ca9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTest.java @@ -0,0 +1,212 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.WatchBlocksV1BlockDataTimestamp; +import org.openapitools.client.model.Web3Transaction; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1BlockData + */ +public class WatchBlocksV1BlockDataTest { + private final WatchBlocksV1BlockData model = new WatchBlocksV1BlockData(); + + /** + * Model tests for WatchBlocksV1BlockData + */ + @Test + public void testWatchBlocksV1BlockData() { + // TODO: test WatchBlocksV1BlockData + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'parentHash' + */ + @Test + public void parentHashTest() { + // TODO: test parentHash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'sha3Uncles' + */ + @Test + public void sha3UnclesTest() { + // TODO: test sha3Uncles + } + + /** + * Test the property 'logsBloom' + */ + @Test + public void logsBloomTest() { + // TODO: test logsBloom + } + + /** + * Test the property 'transactionsRoot' + */ + @Test + public void transactionsRootTest() { + // TODO: test transactionsRoot + } + + /** + * Test the property 'stateRoot' + */ + @Test + public void stateRootTest() { + // TODO: test stateRoot + } + + /** + * Test the property 'receiptsRoot' + */ + @Test + public void receiptsRootTest() { + // TODO: test receiptsRoot + } + + /** + * Test the property 'difficulty' + */ + @Test + public void difficultyTest() { + // TODO: test difficulty + } + + /** + * Test the property 'mixHash' + */ + @Test + public void mixHashTest() { + // TODO: test mixHash + } + + /** + * Test the property 'miner' + */ + @Test + public void minerTest() { + // TODO: test miner + } + + /** + * Test the property 'extraData' + */ + @Test + public void extraDataTest() { + // TODO: test extraData + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + + /** + * Test the property 'size' + */ + @Test + public void sizeTest() { + // TODO: test size + } + + /** + * Test the property 'totalDifficulty' + */ + @Test + public void totalDifficultyTest() { + // TODO: test totalDifficulty + } + + /** + * Test the property 'uncles' + */ + @Test + public void unclesTest() { + // TODO: test uncles + } + + /** + * Test the property 'baseFeePerGas' + */ + @Test + public void baseFeePerGasTest() { + // TODO: test baseFeePerGas + } + + /** + * Test the property 'transactions' + */ + @Test + public void transactionsTest() { + // TODO: test transactions + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestampTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestampTest.java new file mode 100644 index 00000000000..38a82b76427 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTimestampTest.java @@ -0,0 +1,35 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1BlockDataTimestamp + */ +public class WatchBlocksV1BlockDataTimestampTest { + private final WatchBlocksV1BlockDataTimestamp model = new WatchBlocksV1BlockDataTimestamp(); + + /** + * Model tests for WatchBlocksV1BlockDataTimestamp + */ + @Test + public void testWatchBlocksV1BlockDataTimestamp() { + // TODO: test WatchBlocksV1BlockDataTimestamp + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java new file mode 100644 index 00000000000..ee91040558a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1Options + */ +public class WatchBlocksV1OptionsTest { + private final WatchBlocksV1Options model = new WatchBlocksV1Options(); + + /** + * Model tests for WatchBlocksV1Options + */ + @Test + public void testWatchBlocksV1Options() { + // TODO: test WatchBlocksV1Options + } + + /** + * Test the property 'getBlockData' + */ + @Test + public void getBlockDataTest() { + // TODO: test getBlockData + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java new file mode 100644 index 00000000000..57665d0212d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.WatchBlocksV1BlockData; +import org.openapitools.client.model.Web3BlockHeader; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1Progress + */ +public class WatchBlocksV1ProgressTest { + private final WatchBlocksV1Progress model = new WatchBlocksV1Progress(); + + /** + * Model tests for WatchBlocksV1Progress + */ + @Test + public void testWatchBlocksV1Progress() { + // TODO: test WatchBlocksV1Progress + } + + /** + * Test the property 'blockHeader' + */ + @Test + public void blockHeaderTest() { + // TODO: test blockHeader + } + + /** + * Test the property 'blockData' + */ + @Test + public void blockDataTest() { + // TODO: test blockData + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java new file mode 100644 index 00000000000..592bf65feb0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1 + */ +public class WatchBlocksV1Test { + /** + * Model tests for WatchBlocksV1 + */ + @Test + public void testWatchBlocksV1() { + // TODO: test WatchBlocksV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java new file mode 100644 index 00000000000..a123982172b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java @@ -0,0 +1,160 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3BlockHeader + */ +public class Web3BlockHeaderTest { + private final Web3BlockHeader model = new Web3BlockHeader(); + + /** + * Model tests for Web3BlockHeader + */ + @Test + public void testWeb3BlockHeader() { + // TODO: test Web3BlockHeader + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property 'parentHash' + */ + @Test + public void parentHashTest() { + // TODO: test parentHash + } + + /** + * Test the property 'sha3Uncles' + */ + @Test + public void sha3UnclesTest() { + // TODO: test sha3Uncles + } + + /** + * Test the property 'transactionsRoot' + */ + @Test + public void transactionsRootTest() { + // TODO: test transactionsRoot + } + + /** + * Test the property 'receiptsRoot' + */ + @Test + public void receiptsRootTest() { + // TODO: test receiptsRoot + } + + /** + * Test the property 'difficulty' + */ + @Test + public void difficultyTest() { + // TODO: test difficulty + } + + /** + * Test the property 'mixHash' + */ + @Test + public void mixHashTest() { + // TODO: test mixHash + } + + /** + * Test the property 'miner' + */ + @Test + public void minerTest() { + // TODO: test miner + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'stateRoot' + */ + @Test + public void stateRootTest() { + // TODO: test stateRoot + } + + /** + * Test the property 'logsBloom' + */ + @Test + public void logsBloomTest() { + // TODO: test logsBloom + } + + /** + * Test the property 'extraData' + */ + @Test + public void extraDataTest() { + // TODO: test extraData + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactiKeychainRefTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactiKeychainRefTest.java new file mode 100644 index 00000000000..b46fc1b3f82 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactiKeychainRefTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialCactiKeychainRef + */ +public class Web3SigningCredentialCactiKeychainRefTest { + private final Web3SigningCredentialCactiKeychainRef model = new Web3SigningCredentialCactiKeychainRef(); + + /** + * Model tests for Web3SigningCredentialCactiKeychainRef + */ + @Test + public void testWeb3SigningCredentialCactiKeychainRef() { + // TODO: test Web3SigningCredentialCactiKeychainRef + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPasswordTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPasswordTest.java new file mode 100644 index 00000000000..dd79523cd3b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPasswordTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialGethKeychainPassword + */ +public class Web3SigningCredentialGethKeychainPasswordTest { + private final Web3SigningCredentialGethKeychainPassword model = new Web3SigningCredentialGethKeychainPassword(); + + /** + * Model tests for Web3SigningCredentialGethKeychainPassword + */ + @Test + public void testWeb3SigningCredentialGethKeychainPassword() { + // TODO: test Web3SigningCredentialGethKeychainPassword + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java new file mode 100644 index 00000000000..96a5e67f0ae --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialNone + */ +public class Web3SigningCredentialNoneTest { + private final Web3SigningCredentialNone model = new Web3SigningCredentialNone(); + + /** + * Model tests for Web3SigningCredentialNone + */ + @Test + public void testWeb3SigningCredentialNone() { + // TODO: test Web3SigningCredentialNone + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java new file mode 100644 index 00000000000..146abb510bc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ +public class Web3SigningCredentialPrivateKeyHexTest { + private final Web3SigningCredentialPrivateKeyHex model = new Web3SigningCredentialPrivateKeyHex(); + + /** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ + @Test + public void testWeb3SigningCredentialPrivateKeyHex() { + // TODO: test Web3SigningCredentialPrivateKeyHex + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java new file mode 100644 index 00000000000..250f201a666 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialCactiKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialGethKeychainPassword; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredential + */ +public class Web3SigningCredentialTest { + private final Web3SigningCredential model = new Web3SigningCredential(); + + /** + * Model tests for Web3SigningCredential + */ + @Test + public void testWeb3SigningCredential() { + // TODO: test Web3SigningCredential + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java new file mode 100644 index 00000000000..f1e61e0a572 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialType + */ +public class Web3SigningCredentialTypeTest { + /** + * Model tests for Web3SigningCredentialType + */ + @Test + public void testWeb3SigningCredentialType() { + // TODO: test Web3SigningCredentialType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java new file mode 100644 index 00000000000..62d198846ca --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java @@ -0,0 +1,179 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3TransactionReceipt + */ +public class Web3TransactionReceiptTest { + private final Web3TransactionReceipt model = new Web3TransactionReceipt(); + + /** + * Model tests for Web3TransactionReceipt + */ + @Test + public void testWeb3TransactionReceipt() { + // TODO: test Web3TransactionReceipt + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'effectiveGasPrice' + */ + @Test + public void effectiveGasPriceTest() { + // TODO: test effectiveGasPrice + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'logs' + */ + @Test + public void logsTest() { + // TODO: test logs + } + + /** + * Test the property 'logsBloom' + */ + @Test + public void logsBloomTest() { + // TODO: test logsBloom + } + + /** + * Test the property 'revertReason' + */ + @Test + public void revertReasonTest() { + // TODO: test revertReason + } + + /** + * Test the property 'output' + */ + @Test + public void outputTest() { + // TODO: test output + } + + /** + * Test the property 'commitmentHash' + */ + @Test + public void commitmentHashTest() { + // TODO: test commitmentHash + } + + /** + * Test the property 'cumulativeGasUsed' + */ + @Test + public void cumulativeGasUsedTest() { + // TODO: test cumulativeGasUsed + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionTest.java b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionTest.java new file mode 100644 index 00000000000..963273ff127 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionTest.java @@ -0,0 +1,168 @@ +/* + * Hyperledger Cacti Plugin - Connector Ethereum + * Can perform basic tasks on a Ethereum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3Transaction + */ +public class Web3TransactionTest { + private final Web3Transaction model = new Web3Transaction(); + + /** + * Model tests for Web3Transaction + */ + @Test + public void testWeb3Transaction() { + // TODO: test Web3Transaction + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'input' + */ + @Test + public void inputTest() { + // TODO: test input + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'chainId' + */ + @Test + public void chainIdTest() { + // TODO: test chainId + } + + /** + * Test the property 'v' + */ + @Test + public void vTest() { + // TODO: test v + } + + /** + * Test the property 'r' + */ + @Test + public void rTest() { + // TODO: test r + } + + /** + * Test the property 's' + */ + @Test + public void sTest() { + // TODO: test s + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/package.json b/packages/cactus-plugin-ledger-connector-fabric/package.json index 054882e8aa9..46f267e67a6 100644 --- a/packages/cactus-plugin-ledger-connector-fabric/package.json +++ b/packages/cactus-plugin-ledger-connector-fabric/package.json @@ -48,6 +48,8 @@ "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..c549af03c0b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,62 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_chain_code_language_runtime.go +model_chain_code_life_cycle_command_responses.go +model_chain_code_programming_language.go +model_connection_profile.go +model_connection_profile_client.go +model_default_event_handler_strategy.go +model_deploy_contract_go_source_v1_501_response.go +model_deploy_contract_go_source_v1_request.go +model_deploy_contract_go_source_v1_request_constructor_args.go +model_deploy_contract_go_source_v1_response.go +model_deploy_contract_v1_request.go +model_deploy_contract_v1_response.go +model_deployment_target_org_fabric2x.go +model_deployment_target_organization.go +model_error_exception_response_v1.go +model_fabric_contract_invocation_type.go +model_fabric_signing_credential.go +model_fabric_signing_credential_type.go +model_file_base64.go +model_gateway_discovery_options.go +model_gateway_event_handler_options.go +model_gateway_options.go +model_gateway_options_wallet.go +model_get_block_request_v1.go +model_get_block_request_v1_query.go +model_get_block_request_v1_query_block_hash.go +model_get_block_response_decoded_v1.go +model_get_block_response_encoded_v1.go +model_get_block_response_v1.go +model_get_transaction_receipt_response.go +model_run_delegated_sign_transaction_request.go +model_run_transaction_request.go +model_run_transaction_response.go +model_run_transaction_response_type.go +model_ssh_exec_command_response.go +model_transact_receipt_block_meta_data.go +model_transact_receipt_transaction_creator.go +model_transact_receipt_transaction_endorsement.go +model_vault_transit_key.go +model_watch_blocks_cactus_error_response_v1.go +model_watch_blocks_cactus_transactions_event_v1.go +model_watch_blocks_cactus_transactions_response_v1.go +model_watch_blocks_delegated_sign_options_v1.go +model_watch_blocks_filtered_response_v1.go +model_watch_blocks_full_response_v1.go +model_watch_blocks_listener_type_v1.go +model_watch_blocks_options_v1.go +model_watch_blocks_private_response_v1.go +model_watch_blocks_response_v1.go +model_watch_blocks_v1.go +model_web_socket_key.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..5bd81f5f2e2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,168 @@ +# Go API client for cactus-plugin-ledger-connector-fabric + +Can perform basic tasks on a fabric ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-fabric "github.com/hyperledger/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-fabric.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-fabric.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-fabric.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-fabric.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeployContractGoSourceV1**](docs/DefaultApi.md#deploycontractgosourcev1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract-go-source | Deploys a chaincode contract in the form of a go sources. +*DefaultApi* | [**DeployContractV1**](docs/DefaultApi.md#deploycontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract | Deploys a chaincode contract from a set of source files. Note: This endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers to the Cactus API version, not the supported Fabric ledger version. +*DefaultApi* | [**GetBlockV1**](docs/DefaultApi.md#getblockv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-block | Get block from the channel using one of selectors from the input. Works only on Fabric 2.x. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**GetTransactionReceiptByTxIDV1**](docs/DefaultApi.md#gettransactionreceiptbytxidv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-transaction-receipt-by-txid | get a transaction receipt by tx id on a Fabric ledger. +*DefaultApi* | [**RunDelegatedSignTransactionV1**](docs/DefaultApi.md#rundelegatedsigntransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-delegated-sign-transaction | Runs a transaction on a Fabric ledger using user-provided signing callback. +*DefaultApi* | [**RunTransactionV1**](docs/DefaultApi.md#runtransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction | Runs a transaction on a Fabric ledger. + + +## Documentation For Models + + - [ChainCodeLanguageRuntime](docs/ChainCodeLanguageRuntime.md) + - [ChainCodeLifeCycleCommandResponses](docs/ChainCodeLifeCycleCommandResponses.md) + - [ChainCodeProgrammingLanguage](docs/ChainCodeProgrammingLanguage.md) + - [ConnectionProfile](docs/ConnectionProfile.md) + - [ConnectionProfileClient](docs/ConnectionProfileClient.md) + - [DefaultEventHandlerStrategy](docs/DefaultEventHandlerStrategy.md) + - [DeployContractGoSourceV1501Response](docs/DeployContractGoSourceV1501Response.md) + - [DeployContractGoSourceV1Request](docs/DeployContractGoSourceV1Request.md) + - [DeployContractGoSourceV1RequestConstructorArgs](docs/DeployContractGoSourceV1RequestConstructorArgs.md) + - [DeployContractGoSourceV1Response](docs/DeployContractGoSourceV1Response.md) + - [DeployContractV1Request](docs/DeployContractV1Request.md) + - [DeployContractV1Response](docs/DeployContractV1Response.md) + - [DeploymentTargetOrgFabric2x](docs/DeploymentTargetOrgFabric2x.md) + - [DeploymentTargetOrganization](docs/DeploymentTargetOrganization.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [FabricContractInvocationType](docs/FabricContractInvocationType.md) + - [FabricSigningCredential](docs/FabricSigningCredential.md) + - [FabricSigningCredentialType](docs/FabricSigningCredentialType.md) + - [FileBase64](docs/FileBase64.md) + - [GatewayDiscoveryOptions](docs/GatewayDiscoveryOptions.md) + - [GatewayEventHandlerOptions](docs/GatewayEventHandlerOptions.md) + - [GatewayOptions](docs/GatewayOptions.md) + - [GatewayOptionsWallet](docs/GatewayOptionsWallet.md) + - [GetBlockRequestV1](docs/GetBlockRequestV1.md) + - [GetBlockRequestV1Query](docs/GetBlockRequestV1Query.md) + - [GetBlockRequestV1QueryBlockHash](docs/GetBlockRequestV1QueryBlockHash.md) + - [GetBlockResponseDecodedV1](docs/GetBlockResponseDecodedV1.md) + - [GetBlockResponseEncodedV1](docs/GetBlockResponseEncodedV1.md) + - [GetBlockResponseV1](docs/GetBlockResponseV1.md) + - [GetTransactionReceiptResponse](docs/GetTransactionReceiptResponse.md) + - [RunDelegatedSignTransactionRequest](docs/RunDelegatedSignTransactionRequest.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [RunTransactionResponseType](docs/RunTransactionResponseType.md) + - [SSHExecCommandResponse](docs/SSHExecCommandResponse.md) + - [TransactReceiptBlockMetaData](docs/TransactReceiptBlockMetaData.md) + - [TransactReceiptTransactionCreator](docs/TransactReceiptTransactionCreator.md) + - [TransactReceiptTransactionEndorsement](docs/TransactReceiptTransactionEndorsement.md) + - [VaultTransitKey](docs/VaultTransitKey.md) + - [WatchBlocksCactusErrorResponseV1](docs/WatchBlocksCactusErrorResponseV1.md) + - [WatchBlocksCactusTransactionsEventV1](docs/WatchBlocksCactusTransactionsEventV1.md) + - [WatchBlocksCactusTransactionsResponseV1](docs/WatchBlocksCactusTransactionsResponseV1.md) + - [WatchBlocksDelegatedSignOptionsV1](docs/WatchBlocksDelegatedSignOptionsV1.md) + - [WatchBlocksFilteredResponseV1](docs/WatchBlocksFilteredResponseV1.md) + - [WatchBlocksFullResponseV1](docs/WatchBlocksFullResponseV1.md) + - [WatchBlocksListenerTypeV1](docs/WatchBlocksListenerTypeV1.md) + - [WatchBlocksOptionsV1](docs/WatchBlocksOptionsV1.md) + - [WatchBlocksPrivateResponseV1](docs/WatchBlocksPrivateResponseV1.md) + - [WatchBlocksResponseV1](docs/WatchBlocksResponseV1.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WebSocketKey](docs/WebSocketKey.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..ec7285ca01c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,1808 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a fabric ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Fabric + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction: + post: + description: "" + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Runs a transaction on a Fabric ledger. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-delegated-sign-transaction: + post: + description: "" + operationId: runDelegatedSignTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunDelegatedSignTransactionRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Runs a transaction on a Fabric ledger using user-provided signing callback. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-delegated-sign-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-transaction-receipt-by-txid: + post: + description: "" + operationId: getTransactionReceiptByTxIDV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetTransactionReceiptResponse' + description: OK + "404": + description: "" + summary: get a transaction receipt by tx id on a Fabric ledger. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-transaction-receipt-by-txid + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract-go-source: + post: + operationId: deployContractGoSourceV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractGoSourceV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractGoSourceV1Response' + description: OK + "501": + content: + text/plain: + schema: + $ref: '#/components/schemas/deployContractGoSourceV1_501_response' + description: Not implemented + summary: Deploys a chaincode contract in the form of a go sources. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract-go-source + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract: + post: + operationId: deployContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Response' + description: OK + "501": + content: + text/plain: + schema: + $ref: '#/components/schemas/deployContractGoSourceV1_501_response' + description: Not implemented + summary: "Deploys a chaincode contract from a set of source files. Note: This\ + \ endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers\ + \ to the Cactus API version, not the supported Fabric ledger version." + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-block: + post: + operationId: getBlockV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetBlockRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetBlockResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Get block from the channel using one of selectors from the input. Works + only on Fabric 2.x. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-block + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-prometheus-exporter-metrics +components: + schemas: + TransactReceiptTransactionEndorsement: + example: + mspid: mspid + signature: signature + endorserID: endorserID + properties: + mspid: + type: string + endorserID: + type: string + signature: + type: string + type: object + TransactReceiptTransactionCreator: + example: + mspid: mspid + creatorID: creatorID + properties: + mspid: + type: string + creatorID: + type: string + type: object + TransactReceiptBlockMetaData: + example: + mspid: mspid + blockCreatorID: blockCreatorID + signature: signature + properties: + mspid: + type: string + blockCreatorID: + type: string + signature: + type: string + type: object + VaultTransitKey: + description: vault key details for signing fabric message with private key stored + with transit engine. + example: + keyName: keyName + token: token + nullable: false + properties: + keyName: + description: label of private key + maxLength: 100 + minLength: 1 + nullable: false + type: string + token: + description: token for accessing private key + maxLength: 100 + minLength: 1 + nullable: false + type: string + required: + - keyName + - token + type: object + WebSocketKey: + description: web-socket key details for signing fabric message with private + key stored with external client + example: + signature: signature + sessionId: sessionId + nullable: false + properties: + sessionId: + description: session Id to access client + maxLength: 100 + minLength: 1 + nullable: false + type: string + signature: + description: signature of the session ID + maxLength: 100 + minLength: 1 + nullable: false + type: string + required: + - sessionId + - signature + type: object + FabricSigningCredentialType: + description: different type of identity provider for singing fabric messages + supported by this package + enum: + - X.509 + - Vault-X.509 + - WS-X.509 + nullable: false + type: string + FabricSigningCredential: + example: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + properties: + keychainId: + maxLength: 100 + minLength: 1 + nullable: false + type: string + keychainRef: + maxLength: 100 + minLength: 1 + nullable: false + type: string + type: + $ref: '#/components/schemas/FabricSigningCredentialType' + vaultTransitKey: + $ref: '#/components/schemas/VaultTransitKey' + webSocketKey: + $ref: '#/components/schemas/WebSocketKey' + required: + - keychainId + - keychainRef + type: object + ChainCodeLifeCycleCommandResponses: + example: + init: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + commit: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + installList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + queryCommitted: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + packaging: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + approveForMyOrgList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + queryInstalledList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + properties: + packaging: + $ref: '#/components/schemas/SSHExecCommandResponse' + installList: + items: + $ref: '#/components/schemas/SSHExecCommandResponse' + minItems: 1 + type: array + queryInstalledList: + items: + $ref: '#/components/schemas/SSHExecCommandResponse' + minItems: 1 + type: array + approveForMyOrgList: + items: + $ref: '#/components/schemas/SSHExecCommandResponse' + minItems: 1 + type: array + commit: + $ref: '#/components/schemas/SSHExecCommandResponse' + queryCommitted: + $ref: '#/components/schemas/SSHExecCommandResponse' + init: + $ref: '#/components/schemas/SSHExecCommandResponse' + required: + - approveForMyOrgList + - installList + - queryInstalledList + type: object + ChainCodeProgrammingLanguage: + description: Enumerates the supported source code programming languages of Hyperledger + Fabric + enum: + - golang + - javascript + - typescript + - java + type: string + ChainCodeLanguageRuntime: + description: Enumerates the supported programming language runtimes of Hyperledger + Fabric + enum: + - golang + - node + - java + type: string + ConnectionProfile: + additionalProperties: true + example: + channels: + key: "" + certificateAuthorities: + key: "" + name: basic-network + organizations: + key: "" + peers: + key: "" + x-type: hlfv1 + description: The basic network + client: + organization: Org1 + orderers: + key: "" + version: "1.0" + properties: + name: + example: basic-network + maxLength: 1024 + minLength: 1 + type: string + x-type: + example: hlfv1 + minLength: 1 + type: string + description: + example: The basic network + type: string + version: + example: "1.0" + type: string + client: + $ref: '#/components/schemas/ConnectionProfile_client' + channels: + additionalProperties: true + type: object + organizations: + additionalProperties: true + type: object + orderers: + additionalProperties: true + type: object + peers: + additionalProperties: true + type: object + certificateAuthorities: + additionalProperties: true + type: object + required: + - name + - organizations + - peers + - version + type: object + GatewayDiscoveryOptions: + additionalProperties: false + example: + asLocalhost: true + enabled: true + properties: + asLocalhost: + nullable: false + type: boolean + enabled: + nullable: false + type: boolean + type: object + GatewayOptions: + example: + wallet: + keychain: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + json: json + connectionProfile: + channels: + key: "" + certificateAuthorities: + key: "" + name: basic-network + organizations: + key: "" + peers: + key: "" + x-type: hlfv1 + description: The basic network + client: + organization: Org1 + orderers: + key: "" + version: "1.0" + discovery: + asLocalhost: true + enabled: true + identity: identity + eventHandlerOptions: + commitTimeout: 0.8008281904610115 + strategy: null + endorseTimeout: 6.027456183070403 + properties: + connectionProfile: + $ref: '#/components/schemas/ConnectionProfile' + discovery: + $ref: '#/components/schemas/GatewayDiscoveryOptions' + eventHandlerOptions: + $ref: '#/components/schemas/GatewayEventHandlerOptions' + identity: + type: string + wallet: + $ref: '#/components/schemas/GatewayOptions_wallet' + required: + - identity + - wallet + type: object + DefaultEventHandlerStrategy: + enum: + - MSPID_SCOPE_ALLFORTX + - MSPID_SCOPE_ANYFORTX + - NETWORK_SCOPE_ALLFORTX + - NETWORK_SCOPE_ANYFORTX + type: string + GatewayEventHandlerOptions: + additionalProperties: false + example: + commitTimeout: 0.8008281904610115 + strategy: null + endorseTimeout: 6.027456183070403 + properties: + commitTimeout: + nullable: false + type: number + endorseTimeout: + nullable: false + type: number + strategy: + $ref: '#/components/schemas/DefaultEventHandlerStrategy' + required: + - strategy + type: object + FileBase64: + description: Represents a file-system file that has a name and a body which + holds the file contents as a Base64 encoded string + example: + filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + properties: + body: + description: The file's contents encoded as a Base64 string. + maxLength: 104857600 + minLength: 1 + nullable: false + type: string + filename: + description: The name as referred to on a file system + example: my-cool-file-full-of-wonders-and-fun-stuff.go + maxLength: 255 + minLength: 1 + nullable: false + type: string + filepath: + description: "The relative path of the file, if it should be placed in a\ + \ sub-directory" + example: ./my/sub-folder/structure/ + maxLength: 512 + minLength: 1 + nullable: false + type: string + required: + - body + - filename + type: object + FabricContractInvocationType: + enum: + - FabricContractInvocationType.SEND + - FabricContractInvocationType.CALL + - FabricContractInvocationType.SENDPRIVATE + type: string + SSHExecCommandResponse: + example: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + properties: + stdout: + nullable: false + type: string + stderr: + nullable: false + type: string + code: + nullable: true + type: integer + signal: + nullable: true + type: string + required: + - code + - signal + - stderr + - stdout + type: object + RunTransactionResponseType: + description: Response format from transaction / query execution + enum: + - org.hyperledger.cacti.api.hlfabric.RunTransactionResponseType.JSON + - org.hyperledger.cacti.api.hlfabric.RunTransactionResponseType.UTF8 + type: string + x-enum-varnames: + - JSON + - UTF8 + RunTransactionRequest: + additionalProperties: false + example: + gatewayOptions: + wallet: + keychain: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + json: json + connectionProfile: + channels: + key: "" + certificateAuthorities: + key: "" + name: basic-network + organizations: + key: "" + peers: + key: "" + x-type: hlfv1 + description: The basic network + client: + organization: Org1 + orderers: + key: "" + version: "1.0" + discovery: + asLocalhost: true + enabled: true + identity: identity + eventHandlerOptions: + commitTimeout: 0.8008281904610115 + strategy: null + endorseTimeout: 6.027456183070403 + invocationType: null + responseType: null + transientData: "{}" + endorsingPeers: + - endorsingPeers + - endorsingPeers + endorsingOrgs: + - endorsingOrgs + - endorsingOrgs + methodName: methodName + channelName: channelName + contractName: contractName + params: + - params + - params + signingCredential: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + properties: + endorsingPeers: + description: An array of endorsing peers (name or url) for the transaction. + items: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + type: array + endorsingOrgs: + description: An array of endorsing organizations (by mspID or issuer org + name on certificate) for the transaction. + items: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + type: array + transientData: + nullable: true + type: object + gatewayOptions: + $ref: '#/components/schemas/GatewayOptions' + signingCredential: + $ref: '#/components/schemas/FabricSigningCredential' + channelName: + maxLength: 100 + minLength: 1 + nullable: false + type: string + contractName: + maxLength: 100 + minLength: 1 + nullable: false + type: string + invocationType: + $ref: '#/components/schemas/FabricContractInvocationType' + methodName: + maxLength: 100 + minLength: 1 + nullable: false + type: string + params: + default: [] + items: + nullable: true + type: string + nullable: false + type: array + responseType: + $ref: '#/components/schemas/RunTransactionResponseType' + required: + - channelName + - contractName + - invocationType + - methodName + - params + - signingCredential + type: object + RunTransactionResponse: + example: + functionOutput: functionOutput + transactionId: transactionId + properties: + functionOutput: + nullable: false + type: string + transactionId: + nullable: false + type: string + required: + - functionOutput + - transactionId + type: object + RunDelegatedSignTransactionRequest: + additionalProperties: false + example: + signerCertificate: signerCertificate + invocationType: null + responseType: null + transientData: "{}" + endorsingPeers: + - endorsingPeers + - endorsingPeers + endorsingOrgs: + - endorsingOrgs + - endorsingOrgs + methodName: methodName + channelName: channelName + contractName: contractName + uniqueTransactionData: "" + params: + - params + - params + signerMspID: signerMspID + properties: + endorsingPeers: + description: An array of endorsing peers (name or url) for the transaction. + items: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + type: array + endorsingOrgs: + description: An array of endorsing organizations (by mspID or issuer org + name on certificate) for the transaction. + items: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + type: array + transientData: + nullable: true + type: object + signerCertificate: + nullable: false + type: string + signerMspID: + nullable: false + type: string + uniqueTransactionData: + description: Can be used to uniquely identify and authorize signing request + nullable: false + channelName: + maxLength: 100 + minLength: 1 + nullable: false + type: string + contractName: + maxLength: 100 + minLength: 1 + nullable: false + type: string + invocationType: + $ref: '#/components/schemas/FabricContractInvocationType' + methodName: + maxLength: 100 + minLength: 1 + nullable: false + type: string + params: + default: [] + items: + nullable: true + type: string + nullable: false + type: array + responseType: + $ref: '#/components/schemas/RunTransactionResponseType' + required: + - channelName + - contractName + - invocationType + - methodName + - params + - signerCertificate + - signerMspID + type: object + GetTransactionReceiptResponse: + example: + chainCodeVersion: chainCodeVersion + blockMetaData: + mspid: mspid + blockCreatorID: blockCreatorID + signature: signature + transactionCreator: + mspid: mspid + creatorID: creatorID + blockNumber: blockNumber + chainCodeName: chainCodeName + transactionEndorsement: + - mspid: mspid + signature: signature + endorserID: endorserID + - mspid: mspid + signature: signature + endorserID: endorserID + responseStatus: responseStatus + channelID: channelID + rwsetWriteData: rwsetWriteData + rwsetKey: rwsetKey + properties: + blockNumber: + type: string + channelID: + type: string + transactionCreator: + $ref: '#/components/schemas/TransactReceiptTransactionCreator' + transactionEndorsement: + items: + $ref: '#/components/schemas/TransactReceiptTransactionEndorsement' + type: array + blockMetaData: + $ref: '#/components/schemas/TransactReceiptBlockMetaData' + chainCodeName: + type: string + chainCodeVersion: + type: string + responseStatus: + type: string + rwsetKey: + type: string + rwsetWriteData: + type: string + type: object + DeploymentTargetOrganization: + example: + CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + properties: + CORE_PEER_LOCALMSPID: + description: Mapped to environment variables of the Fabric CLI container. + example: Org1MSP + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_ADDRESS: + description: Mapped to environment variables of the Fabric CLI container. + example: peer0.org1.example.com:7051 + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_MSPCONFIGPATH: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_TLS_ROOTCERT_FILE: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + maxLength: 1024 + minLength: 1 + nullable: false + type: string + ORDERER_TLS_ROOTCERT_FILE: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - CORE_PEER_ADDRESS + - CORE_PEER_LOCALMSPID + - CORE_PEER_MSPCONFIGPATH + - CORE_PEER_TLS_ROOTCERT_FILE + - ORDERER_TLS_ROOTCERT_FILE + type: object + DeploymentTargetOrgFabric2x: + properties: + transient: + description: Transient map of arguments in JSON encoding + example: orderer.example.com:7050 + maxLength: 1073741824 + minLength: 1 + type: string + CORE_PEER_LOCALMSPID: + description: Mapped to environment variables of the Fabric CLI container. + example: Org1MSP + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_ADDRESS: + description: Mapped to environment variables of the Fabric CLI container. + example: peer0.org1.example.com:7051 + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_MSPCONFIGPATH: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_TLS_ROOTCERT_FILE: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + maxLength: 1024 + minLength: 1 + nullable: false + type: string + ORDERER_TLS_ROOTCERT_FILE: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - CORE_PEER_ADDRESS + - CORE_PEER_LOCALMSPID + - CORE_PEER_MSPCONFIGPATH + - CORE_PEER_TLS_ROOTCERT_FILE + - ORDERER_TLS_ROOTCERT_FILE + type: object + DeployContractGoSourceV1Request: + additionalProperties: false + example: + chainCodeVersion: 1.0.0 + pinnedDeps: + - github.com/hyperledger/fabric@v1.4.8 + - github.com/hyperledger/fabric@v1.4.8 + - github.com/hyperledger/fabric@v1.4.8 + - github.com/hyperledger/fabric@v1.4.8 + - github.com/hyperledger/fabric@v1.4.8 + goSource: + filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + targetPeerAddresses: + - peer0.org1.example.com:7051 + goMod: + filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + constructorArgs: "{} - An empty object literal can be sufficient if your contract\ + \ does not have parameters." + targetOrganizations: + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + tlsRootCertFiles: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + moduleName: hello-world-contract + policyDslSource: "AND('Org1MSP.member','Org2MSP.member')" + channelId: mychannel + modTidyOnly: true + properties: + policyDslSource: + example: "AND('Org1MSP.member','Org2MSP.member')" + maxLength: 65535 + minLength: 1 + nullable: false + type: string + tlsRootCertFiles: + description: The TLS root cert files that will be passed to the chaincode + instantiation command. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + maxLength: 65535 + minLength: 1 + nullable: false + type: string + channelId: + description: The name of the Fabric channel where the contract will get + instantiated. + example: mychannel + maxLength: 2048 + minLength: 1 + nullable: false + type: string + targetOrganizations: + items: + $ref: '#/components/schemas/DeploymentTargetOrganization' + maxItems: 1024 + minItems: 1 + nullable: false + type: array + targetPeerAddresses: + description: An array of peer addresses where the contract will be instantiated. + Note that at present only the first item from this array will be used + which is the behavior taken from the official Fabric samples repository + and therefore it is assumed to be correct usage. + example: + - peer0.org1.example.com:7051 + items: + maxLength: 4096 + minLength: 1 + type: string + maxItems: 2048 + minItems: 1 + type: array + constructorArgs: + $ref: '#/components/schemas/DeployContractGoSourceV1Request_constructorArgs' + chainCodeVersion: + example: 1.0.0 + maxLength: 128 + minLength: 1 + nullable: false + type: string + goSource: + $ref: '#/components/schemas/FileBase64' + goMod: + $ref: '#/components/schemas/FileBase64' + moduleName: + description: The go module name that will be used for the go compilation + process. + example: hello-world-contract + maxLength: 255 + minLength: 1 + nullable: false + type: string + pinnedDeps: + items: + example: github.com/hyperledger/fabric@v1.4.8 + nullable: false + type: string + maxItems: 1024 + minItems: 0 + type: array + modTidyOnly: + description: Indicates to the go chaincode compiler of Cactus if it should + do an actual go compilation with the contact source or if it should just + execute the go mod tidy command. + nullable: true + type: boolean + required: + - chainCodeVersion + - channelId + - goSource + - policyDslSource + - targetOrganizations + - targetPeerAddresses + - tlsRootCertFiles + type: object + DeployContractGoSourceV1Response: + example: + success: true + instantiationCommandResponse: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + installationCommandResponses: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + properties: + success: + type: boolean + installationCommandResponses: + items: + $ref: '#/components/schemas/SSHExecCommandResponse' + type: array + instantiationCommandResponse: + $ref: '#/components/schemas/SSHExecCommandResponse' + required: + - installationCommandResponses + - instantiationCommandResponse + - success + type: object + DeployContractV1Request: + additionalProperties: false + example: + ccVersion: 1.0.0 + ccLabel: hello-world-contract + constructorArgs: "{} - An empty object literal can be sufficient if your contract\ + \ does not have parameters." + ccLang: null + ccSequence: 1 + ccName: my-hello-world-contract + connTimeout: 0 + caFile: "${orgCfgDir}ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" + signaturePolicy: "AND('Org1MSP.member','Org2MSP.member')" + sourceFiles: + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + ordererTLSHostnameOverride: orderer.example.com:7050 + orderer: orderer.example.com:7050 + targetOrganizations: + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + collectionsConfigFile: collectionsConfigFile + channelId: mychannel + properties: + ccLang: + $ref: '#/components/schemas/ChainCodeProgrammingLanguage' + caFile: + description: File-system path pointing at the CA file. + example: "${orgCfgDir}ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" + maxLength: 4096 + minLength: 1 + type: string + orderer: + description: Ordering service endpoint specified as : + example: orderer.example.com:7050 + maxLength: 65535 + minLength: 1 + type: string + ordererTLSHostnameOverride: + description: The hostname override to use when validating the TLS connection + to the orderer + example: orderer.example.com:7050 + maxLength: 65535 + minLength: 1 + type: string + connTimeout: + description: Timeout for client to connect (default 3s) + nullable: false + type: integer + signaturePolicy: + description: "Passed in to the peer via the --signature-policy argument\ + \ on the command line. See also: https://hyperledger-fabric.readthedocs.io/en/release-2.2/endorsement-policies.html#setting-chaincode-level-endorsement-policies" + example: "AND('Org1MSP.member','Org2MSP.member')" + maxLength: 65535 + minLength: 1 + nullable: false + type: string + collectionsConfigFile: + description: Name of the collections config file as present in the sourceFiles + array of the request. + maxLength: 255 + minLength: 1 + nullable: false + type: string + channelId: + description: The name of the Fabric channel where the contract will get + instantiated. + example: mychannel + maxLength: 2048 + minLength: 1 + nullable: false + type: string + targetOrganizations: + items: + $ref: '#/components/schemas/DeploymentTargetOrganization' + maxItems: 1024 + minItems: 1 + nullable: false + type: array + constructorArgs: + $ref: '#/components/schemas/DeployContractGoSourceV1Request_constructorArgs' + ccSequence: + example: 1 + nullable: false + type: number + ccVersion: + example: 1.0.0 + maxLength: 128 + minLength: 1 + nullable: false + type: string + ccName: + example: my-hello-world-contract + maxLength: 128 + minLength: 1 + nullable: false + type: string + ccLabel: + description: Human readable label to uniquely identify the contract. Recommended + to include in this at least the contract name and the exact version in + order to make it easily distinguishable from other deployments of the + same contract. + example: hello-world-contract + maxLength: 255 + minLength: 1 + nullable: false + type: string + sourceFiles: + description: The your-smart-contract.go file where the functionality of + your contract is implemented. + items: + $ref: '#/components/schemas/FileBase64' + maxItems: 65535 + minItems: 1 + nullable: false + type: array + required: + - caFile + - ccLabel + - ccLang + - ccName + - ccSequence + - ccVersion + - channelId + - orderer + - ordererTLSHostnameOverride + - sourceFiles + - targetOrganizations + type: object + DeployContractV1Response: + example: + lifecycle: + init: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + commit: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + installList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + queryCommitted: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + packaging: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + approveForMyOrgList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + queryInstalledList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + success: true + packageIds: + - f8c8e06bfc27771028c4bbc3564341887881e29b92a844c66c30bac0ff83966e + - f8c8e06bfc27771028c4bbc3564341887881e29b92a844c66c30bac0ff83966e + properties: + success: + type: boolean + packageIds: + items: + example: f8c8e06bfc27771028c4bbc3564341887881e29b92a844c66c30bac0ff83966e + maxLength: 4096 + minLength: 1 + nullable: false + type: string + type: array + lifecycle: + $ref: '#/components/schemas/ChainCodeLifeCycleCommandResponses' + required: + - lifecycle + - packageIds + - success + type: object + GetBlockRequestV1: + description: Request for GetBlock endpoint. + example: + gatewayOptions: + wallet: + keychain: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + json: json + connectionProfile: + channels: + key: "" + certificateAuthorities: + key: "" + name: basic-network + organizations: + key: "" + peers: + key: "" + x-type: hlfv1 + description: The basic network + client: + organization: Org1 + orderers: + key: "" + version: "1.0" + discovery: + asLocalhost: true + enabled: true + identity: identity + eventHandlerOptions: + commitTimeout: 0.8008281904610115 + strategy: null + endorseTimeout: 6.027456183070403 + query: + blockHash: + buffer: buffer + encoding: encoding + blockNumber: blockNumber + transactionId: transactionId + skipDecode: false + channelName: channelName + connectionChannelName: connectionChannelName + properties: + channelName: + description: Fabric channel which we want to query. + maxLength: 100 + minLength: 1 + nullable: false + type: string + connectionChannelName: + description: "Fabric channel we want to connect to. If not provided, then\ + \ one from channelName parameter will be used" + maxLength: 100 + minLength: 1 + nullable: false + type: string + gatewayOptions: + $ref: '#/components/schemas/GatewayOptions' + query: + $ref: '#/components/schemas/GetBlockRequestV1_query' + skipDecode: + default: false + description: "If true, encoded buffer will be returned. Otherwise, entire\ + \ block object is returned." + nullable: false + type: boolean + required: + - channelName + - gatewayOptions + - query + type: object + FabricFullBlockDataV1: + description: Full hyperledger fabric block data. + GetBlockResponseDecodedV1: + description: When skipDecode is false (default) then decoded block object is + returned. + properties: + decodedBlock: + description: Full hyperledger fabric block data. + required: + - decodedBlock + type: object + GetBlockResponseEncodedV1: + description: When skipDecode is true then encoded block Buffer is returned. + properties: + encodedBlock: + type: string + required: + - encodedBlock + type: object + GetBlockResponseV1: + description: Response from GetBlock endpoint. + oneOf: + - $ref: '#/components/schemas/GetBlockResponseDecodedV1' + - $ref: '#/components/schemas/GetBlockResponseEncodedV1' + ErrorExceptionResponseV1: + properties: + message: + nullable: false + type: string + error: + nullable: false + type: string + required: + - error + - message + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + WatchBlocksV1: + description: Websocket requests for monitoring new blocks. + enum: + - org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.SubscribeDelegatedSign + - org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - SubscribeDelegatedSign + - Next + - Unsubscribe + - Error + - Complete + WatchBlocksListenerTypeV1: + description: "Response type from WatchBlocks. 'Cactus*' are custom views, others\ + \ correspond to fabric SDK call." + enum: + - filtered + - full + - private + - cactus:transactions + type: string + x-enum-varnames: + - Filtered + - Full + - Private + - CactusTransactions + WatchBlocksOptionsV1: + description: Options passed when subscribing to block monitoring. + properties: + channelName: + description: Hyperledger Fabric channel to connect to. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gatewayOptions: + $ref: '#/components/schemas/GatewayOptions' + type: + $ref: '#/components/schemas/WatchBlocksListenerTypeV1' + startBlock: + description: From which block start monitoring. Defaults to latest. + maxLength: 100 + minLength: 1 + nullable: false + type: string + required: + - channelName + - gatewayOptions + - type + type: object + WatchBlocksDelegatedSignOptionsV1: + description: Options passed when subscribing to block monitoring with delegated + signing. + properties: + type: + $ref: '#/components/schemas/WatchBlocksListenerTypeV1' + startBlock: + description: From which block start monitoring. Defaults to latest. + maxLength: 100 + minLength: 1 + nullable: false + type: string + channelName: + maxLength: 100 + minLength: 1 + nullable: false + type: string + signerCertificate: + nullable: false + type: string + signerMspID: + nullable: false + type: string + uniqueTransactionData: + description: Can be used to uniquely identify and authorize signing request + nullable: false + required: + - channelName + - signerCertificate + - signerMspID + - type + type: object + WatchBlocksCactusTransactionsEventV1: + description: Transaction summary from commited block. + properties: + chaincodeId: + description: ChainCode containing function that was executed. + nullable: false + type: string + transactionId: + description: Transaction identifier. + nullable: false + type: string + functionName: + description: Function name that was executed. + nullable: false + type: string + functionArgs: + description: List of function arguments. + items: + minLength: 0 + nullable: false + type: string + type: array + required: + - chaincodeId + - functionArgs + - functionName + - transactionId + type: object + WatchBlocksCactusTransactionsResponseV1: + description: Custom response containing block transactions summary. Compatible + with legacy fabric-socketio connector monitoring. + properties: + cactusTransactionsEvents: + description: List of transactions summary + items: + $ref: '#/components/schemas/WatchBlocksCactusTransactionsEventV1' + type: array + required: + - cactusTransactionsEvents + type: object + WatchBlocksFullResponseV1: + description: Response that corresponds to Fabric SDK 'full' EventType. + properties: + fullBlock: + description: Full commited block. + nullable: false + required: + - fullBlock + type: object + WatchBlocksFilteredResponseV1: + description: Response that corresponds to Fabric SDK 'filtered' EventType. + properties: + filteredBlock: + description: Filtered commited block. + nullable: false + required: + - filteredBlock + type: object + WatchBlocksPrivateResponseV1: + description: Response that corresponds to Fabric SDK 'private' EventType. + properties: + privateBlock: + description: Private commited block. + nullable: false + required: + - privateBlock + type: object + WatchBlocksCactusErrorResponseV1: + description: Error response from WatchBlocks operation. + properties: + code: + description: Error code. + type: number + errorMessage: + description: Description of the error. + type: string + required: + - code + - errorMessage + type: object + WatchBlocksResponseV1: + description: Response block from WatchBlocks endpoint. Depends on 'type' passed + in subscription options. + oneOf: + - $ref: '#/components/schemas/WatchBlocksCactusTransactionsResponseV1' + - $ref: '#/components/schemas/WatchBlocksFullResponseV1' + - $ref: '#/components/schemas/WatchBlocksFilteredResponseV1' + - $ref: '#/components/schemas/WatchBlocksPrivateResponseV1' + - $ref: '#/components/schemas/WatchBlocksCactusErrorResponseV1' + deployContractGoSourceV1_501_response: + properties: + message: + maxLength: 2048 + minLength: 1 + nullable: false + type: string + type: object + ConnectionProfile_client: + example: + organization: Org1 + properties: + organization: + example: Org1 + type: string + type: object + GatewayOptions_wallet: + example: + keychain: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + json: json + maxProperties: 1 + minProperties: 1 + properties: + keychain: + $ref: '#/components/schemas/FabricSigningCredential' + json: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + type: object + DeployContractGoSourceV1Request_constructorArgs: + example: "{} - An empty object literal can be sufficient if your contract does\ + \ not have parameters." + nullable: false + properties: + Args: + items: {} + maxLength: 2048 + minLength: 0 + type: array + type: object + GetBlockRequestV1_query_blockHash: + description: Select block by it's hash. + example: + buffer: buffer + encoding: encoding + nullable: false + properties: + encoding: + description: "NodeJS Buffer encoding (utf-8, hex, binary, base64, etc...).\ + \ Passed directly to `Buffer.from()` call on hashBuffer. If not provided\ + \ then JSON buffer format is assumed." + nullable: false + type: string + buffer: + description: Buffer of blockHash. It's encoding should be described in `encoding` + parameter. + nullable: false + type: string + required: + - buffer + type: object + GetBlockRequestV1_query: + description: "Query selector, caller must provide at least one of them. First\ + \ found will be used, rest will be ignored, so it's recommended to pass single\ + \ selector." + example: + blockHash: + buffer: buffer + encoding: encoding + blockNumber: blockNumber + transactionId: transactionId + properties: + blockNumber: + description: Select block by it's number. + nullable: false + type: string + blockHash: + $ref: '#/components/schemas/GetBlockRequestV1_query_blockHash' + transactionId: + description: Select block by id of transaction that it contains. + nullable: false + type: string + type: object diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..e25d76fa5bc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,815 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeployContractGoSourceV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractGoSourceV1Request *DeployContractGoSourceV1Request +} + +func (r ApiDeployContractGoSourceV1Request) DeployContractGoSourceV1Request(deployContractGoSourceV1Request DeployContractGoSourceV1Request) ApiDeployContractGoSourceV1Request { + r.deployContractGoSourceV1Request = &deployContractGoSourceV1Request + return r +} + +func (r ApiDeployContractGoSourceV1Request) Execute() (*DeployContractGoSourceV1Response, *http.Response, error) { + return r.ApiService.DeployContractGoSourceV1Execute(r) +} + +/* +DeployContractGoSourceV1 Deploys a chaincode contract in the form of a go sources. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractGoSourceV1Request +*/ +func (a *DefaultApiService) DeployContractGoSourceV1(ctx context.Context) ApiDeployContractGoSourceV1Request { + return ApiDeployContractGoSourceV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractGoSourceV1Response +func (a *DefaultApiService) DeployContractGoSourceV1Execute(r ApiDeployContractGoSourceV1Request) (*DeployContractGoSourceV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractGoSourceV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractGoSourceV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract-go-source" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractGoSourceV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 501 { + var v DeployContractGoSourceV1501Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeployContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractV1Request *DeployContractV1Request +} + +func (r ApiDeployContractV1Request) DeployContractV1Request(deployContractV1Request DeployContractV1Request) ApiDeployContractV1Request { + r.deployContractV1Request = &deployContractV1Request + return r +} + +func (r ApiDeployContractV1Request) Execute() (*DeployContractV1Response, *http.Response, error) { + return r.ApiService.DeployContractV1Execute(r) +} + +/* +DeployContractV1 Deploys a chaincode contract from a set of source files. Note: This endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers to the Cactus API version, not the supported Fabric ledger version. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractV1Request +*/ +func (a *DefaultApiService) DeployContractV1(ctx context.Context) ApiDeployContractV1Request { + return ApiDeployContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractV1Response +func (a *DefaultApiService) DeployContractV1Execute(r ApiDeployContractV1Request) (*DeployContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 501 { + var v DeployContractGoSourceV1501Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetBlockV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getBlockRequestV1 *GetBlockRequestV1 +} + +func (r ApiGetBlockV1Request) GetBlockRequestV1(getBlockRequestV1 GetBlockRequestV1) ApiGetBlockV1Request { + r.getBlockRequestV1 = &getBlockRequestV1 + return r +} + +func (r ApiGetBlockV1Request) Execute() (*GetBlockResponseV1, *http.Response, error) { + return r.ApiService.GetBlockV1Execute(r) +} + +/* +GetBlockV1 Get block from the channel using one of selectors from the input. Works only on Fabric 2.x. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetBlockV1Request +*/ +func (a *DefaultApiService) GetBlockV1(ctx context.Context) ApiGetBlockV1Request { + return ApiGetBlockV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetBlockResponseV1 +func (a *DefaultApiService) GetBlockV1Execute(r ApiGetBlockV1Request) (*GetBlockResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBlockResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBlockV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-block" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getBlockRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetTransactionReceiptByTxIDV1Request struct { + ctx context.Context + ApiService *DefaultApiService + runTransactionRequest *RunTransactionRequest +} + +func (r ApiGetTransactionReceiptByTxIDV1Request) RunTransactionRequest(runTransactionRequest RunTransactionRequest) ApiGetTransactionReceiptByTxIDV1Request { + r.runTransactionRequest = &runTransactionRequest + return r +} + +func (r ApiGetTransactionReceiptByTxIDV1Request) Execute() (*GetTransactionReceiptResponse, *http.Response, error) { + return r.ApiService.GetTransactionReceiptByTxIDV1Execute(r) +} + +/* +GetTransactionReceiptByTxIDV1 get a transaction receipt by tx id on a Fabric ledger. + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetTransactionReceiptByTxIDV1Request +*/ +func (a *DefaultApiService) GetTransactionReceiptByTxIDV1(ctx context.Context) ApiGetTransactionReceiptByTxIDV1Request { + return ApiGetTransactionReceiptByTxIDV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetTransactionReceiptResponse +func (a *DefaultApiService) GetTransactionReceiptByTxIDV1Execute(r ApiGetTransactionReceiptByTxIDV1Request) (*GetTransactionReceiptResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetTransactionReceiptResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetTransactionReceiptByTxIDV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-transaction-receipt-by-txid" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.runTransactionRequest == nil { + return localVarReturnValue, nil, reportError("runTransactionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.runTransactionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRunDelegatedSignTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + runDelegatedSignTransactionRequest *RunDelegatedSignTransactionRequest +} + +func (r ApiRunDelegatedSignTransactionV1Request) RunDelegatedSignTransactionRequest(runDelegatedSignTransactionRequest RunDelegatedSignTransactionRequest) ApiRunDelegatedSignTransactionV1Request { + r.runDelegatedSignTransactionRequest = &runDelegatedSignTransactionRequest + return r +} + +func (r ApiRunDelegatedSignTransactionV1Request) Execute() (*RunTransactionResponse, *http.Response, error) { + return r.ApiService.RunDelegatedSignTransactionV1Execute(r) +} + +/* +RunDelegatedSignTransactionV1 Runs a transaction on a Fabric ledger using user-provided signing callback. + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRunDelegatedSignTransactionV1Request +*/ +func (a *DefaultApiService) RunDelegatedSignTransactionV1(ctx context.Context) ApiRunDelegatedSignTransactionV1Request { + return ApiRunDelegatedSignTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionResponse +func (a *DefaultApiService) RunDelegatedSignTransactionV1Execute(r ApiRunDelegatedSignTransactionV1Request) (*RunTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RunDelegatedSignTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-delegated-sign-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.runDelegatedSignTransactionRequest == nil { + return localVarReturnValue, nil, reportError("runDelegatedSignTransactionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.runDelegatedSignTransactionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRunTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + runTransactionRequest *RunTransactionRequest +} + +func (r ApiRunTransactionV1Request) RunTransactionRequest(runTransactionRequest RunTransactionRequest) ApiRunTransactionV1Request { + r.runTransactionRequest = &runTransactionRequest + return r +} + +func (r ApiRunTransactionV1Request) Execute() (*RunTransactionResponse, *http.Response, error) { + return r.ApiService.RunTransactionV1Execute(r) +} + +/* +RunTransactionV1 Runs a transaction on a Fabric ledger. + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRunTransactionV1Request +*/ +func (a *DefaultApiService) RunTransactionV1(ctx context.Context) ApiRunTransactionV1Request { + return ApiRunTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionResponse +func (a *DefaultApiService) RunTransactionV1Execute(r ApiRunTransactionV1Request) (*RunTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RunTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.runTransactionRequest == nil { + return localVarReturnValue, nil, reportError("runTransactionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.runTransactionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..9d664de79a5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Connector Fabric API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..d4c7a62489a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..825dd715952 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_language_runtime.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_language_runtime.go new file mode 100644 index 00000000000..07637483449 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_language_runtime.go @@ -0,0 +1,113 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// ChainCodeLanguageRuntime Enumerates the supported programming language runtimes of Hyperledger Fabric +type ChainCodeLanguageRuntime string + +// List of ChainCodeLanguageRuntime +const ( + GOLANG ChainCodeLanguageRuntime = "golang" + NODE ChainCodeLanguageRuntime = "node" + JAVA ChainCodeLanguageRuntime = "java" +) + +// All allowed values of ChainCodeLanguageRuntime enum +var AllowedChainCodeLanguageRuntimeEnumValues = []ChainCodeLanguageRuntime{ + "golang", + "node", + "java", +} + +func (v *ChainCodeLanguageRuntime) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ChainCodeLanguageRuntime(value) + for _, existing := range AllowedChainCodeLanguageRuntimeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ChainCodeLanguageRuntime", value) +} + +// NewChainCodeLanguageRuntimeFromValue returns a pointer to a valid ChainCodeLanguageRuntime +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewChainCodeLanguageRuntimeFromValue(v string) (*ChainCodeLanguageRuntime, error) { + ev := ChainCodeLanguageRuntime(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ChainCodeLanguageRuntime: valid values are %v", v, AllowedChainCodeLanguageRuntimeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ChainCodeLanguageRuntime) IsValid() bool { + for _, existing := range AllowedChainCodeLanguageRuntimeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ChainCodeLanguageRuntime value +func (v ChainCodeLanguageRuntime) Ptr() *ChainCodeLanguageRuntime { + return &v +} + +type NullableChainCodeLanguageRuntime struct { + value *ChainCodeLanguageRuntime + isSet bool +} + +func (v NullableChainCodeLanguageRuntime) Get() *ChainCodeLanguageRuntime { + return v.value +} + +func (v *NullableChainCodeLanguageRuntime) Set(val *ChainCodeLanguageRuntime) { + v.value = val + v.isSet = true +} + +func (v NullableChainCodeLanguageRuntime) IsSet() bool { + return v.isSet +} + +func (v *NullableChainCodeLanguageRuntime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChainCodeLanguageRuntime(val *ChainCodeLanguageRuntime) *NullableChainCodeLanguageRuntime { + return &NullableChainCodeLanguageRuntime{value: val, isSet: true} +} + +func (v NullableChainCodeLanguageRuntime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChainCodeLanguageRuntime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_life_cycle_command_responses.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_life_cycle_command_responses.go new file mode 100644 index 00000000000..258fc15cd39 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_life_cycle_command_responses.go @@ -0,0 +1,315 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the ChainCodeLifeCycleCommandResponses type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ChainCodeLifeCycleCommandResponses{} + +// ChainCodeLifeCycleCommandResponses struct for ChainCodeLifeCycleCommandResponses +type ChainCodeLifeCycleCommandResponses struct { + Packaging *SSHExecCommandResponse `json:"packaging,omitempty"` + InstallList []SSHExecCommandResponse `json:"installList"` + QueryInstalledList []SSHExecCommandResponse `json:"queryInstalledList"` + ApproveForMyOrgList []SSHExecCommandResponse `json:"approveForMyOrgList"` + Commit *SSHExecCommandResponse `json:"commit,omitempty"` + QueryCommitted *SSHExecCommandResponse `json:"queryCommitted,omitempty"` + Init *SSHExecCommandResponse `json:"init,omitempty"` +} + +// NewChainCodeLifeCycleCommandResponses instantiates a new ChainCodeLifeCycleCommandResponses 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 +// will change when the set of required properties is changed +func NewChainCodeLifeCycleCommandResponses(installList []SSHExecCommandResponse, queryInstalledList []SSHExecCommandResponse, approveForMyOrgList []SSHExecCommandResponse) *ChainCodeLifeCycleCommandResponses { + this := ChainCodeLifeCycleCommandResponses{} + this.InstallList = installList + this.QueryInstalledList = queryInstalledList + this.ApproveForMyOrgList = approveForMyOrgList + return &this +} + +// NewChainCodeLifeCycleCommandResponsesWithDefaults instantiates a new ChainCodeLifeCycleCommandResponses object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewChainCodeLifeCycleCommandResponsesWithDefaults() *ChainCodeLifeCycleCommandResponses { + this := ChainCodeLifeCycleCommandResponses{} + return &this +} + +// GetPackaging returns the Packaging field value if set, zero value otherwise. +func (o *ChainCodeLifeCycleCommandResponses) GetPackaging() SSHExecCommandResponse { + if o == nil || IsNil(o.Packaging) { + var ret SSHExecCommandResponse + return ret + } + return *o.Packaging +} + +// GetPackagingOk returns a tuple with the Packaging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainCodeLifeCycleCommandResponses) GetPackagingOk() (*SSHExecCommandResponse, bool) { + if o == nil || IsNil(o.Packaging) { + return nil, false + } + return o.Packaging, true +} + +// HasPackaging returns a boolean if a field has been set. +func (o *ChainCodeLifeCycleCommandResponses) HasPackaging() bool { + if o != nil && !IsNil(o.Packaging) { + return true + } + + return false +} + +// SetPackaging gets a reference to the given SSHExecCommandResponse and assigns it to the Packaging field. +func (o *ChainCodeLifeCycleCommandResponses) SetPackaging(v SSHExecCommandResponse) { + o.Packaging = &v +} + +// GetInstallList returns the InstallList field value +func (o *ChainCodeLifeCycleCommandResponses) GetInstallList() []SSHExecCommandResponse { + if o == nil { + var ret []SSHExecCommandResponse + return ret + } + + return o.InstallList +} + +// GetInstallListOk returns a tuple with the InstallList field value +// and a boolean to check if the value has been set. +func (o *ChainCodeLifeCycleCommandResponses) GetInstallListOk() ([]SSHExecCommandResponse, bool) { + if o == nil { + return nil, false + } + return o.InstallList, true +} + +// SetInstallList sets field value +func (o *ChainCodeLifeCycleCommandResponses) SetInstallList(v []SSHExecCommandResponse) { + o.InstallList = v +} + +// GetQueryInstalledList returns the QueryInstalledList field value +func (o *ChainCodeLifeCycleCommandResponses) GetQueryInstalledList() []SSHExecCommandResponse { + if o == nil { + var ret []SSHExecCommandResponse + return ret + } + + return o.QueryInstalledList +} + +// GetQueryInstalledListOk returns a tuple with the QueryInstalledList field value +// and a boolean to check if the value has been set. +func (o *ChainCodeLifeCycleCommandResponses) GetQueryInstalledListOk() ([]SSHExecCommandResponse, bool) { + if o == nil { + return nil, false + } + return o.QueryInstalledList, true +} + +// SetQueryInstalledList sets field value +func (o *ChainCodeLifeCycleCommandResponses) SetQueryInstalledList(v []SSHExecCommandResponse) { + o.QueryInstalledList = v +} + +// GetApproveForMyOrgList returns the ApproveForMyOrgList field value +func (o *ChainCodeLifeCycleCommandResponses) GetApproveForMyOrgList() []SSHExecCommandResponse { + if o == nil { + var ret []SSHExecCommandResponse + return ret + } + + return o.ApproveForMyOrgList +} + +// GetApproveForMyOrgListOk returns a tuple with the ApproveForMyOrgList field value +// and a boolean to check if the value has been set. +func (o *ChainCodeLifeCycleCommandResponses) GetApproveForMyOrgListOk() ([]SSHExecCommandResponse, bool) { + if o == nil { + return nil, false + } + return o.ApproveForMyOrgList, true +} + +// SetApproveForMyOrgList sets field value +func (o *ChainCodeLifeCycleCommandResponses) SetApproveForMyOrgList(v []SSHExecCommandResponse) { + o.ApproveForMyOrgList = v +} + +// GetCommit returns the Commit field value if set, zero value otherwise. +func (o *ChainCodeLifeCycleCommandResponses) GetCommit() SSHExecCommandResponse { + if o == nil || IsNil(o.Commit) { + var ret SSHExecCommandResponse + return ret + } + return *o.Commit +} + +// GetCommitOk returns a tuple with the Commit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainCodeLifeCycleCommandResponses) GetCommitOk() (*SSHExecCommandResponse, bool) { + if o == nil || IsNil(o.Commit) { + return nil, false + } + return o.Commit, true +} + +// HasCommit returns a boolean if a field has been set. +func (o *ChainCodeLifeCycleCommandResponses) HasCommit() bool { + if o != nil && !IsNil(o.Commit) { + return true + } + + return false +} + +// SetCommit gets a reference to the given SSHExecCommandResponse and assigns it to the Commit field. +func (o *ChainCodeLifeCycleCommandResponses) SetCommit(v SSHExecCommandResponse) { + o.Commit = &v +} + +// GetQueryCommitted returns the QueryCommitted field value if set, zero value otherwise. +func (o *ChainCodeLifeCycleCommandResponses) GetQueryCommitted() SSHExecCommandResponse { + if o == nil || IsNil(o.QueryCommitted) { + var ret SSHExecCommandResponse + return ret + } + return *o.QueryCommitted +} + +// GetQueryCommittedOk returns a tuple with the QueryCommitted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainCodeLifeCycleCommandResponses) GetQueryCommittedOk() (*SSHExecCommandResponse, bool) { + if o == nil || IsNil(o.QueryCommitted) { + return nil, false + } + return o.QueryCommitted, true +} + +// HasQueryCommitted returns a boolean if a field has been set. +func (o *ChainCodeLifeCycleCommandResponses) HasQueryCommitted() bool { + if o != nil && !IsNil(o.QueryCommitted) { + return true + } + + return false +} + +// SetQueryCommitted gets a reference to the given SSHExecCommandResponse and assigns it to the QueryCommitted field. +func (o *ChainCodeLifeCycleCommandResponses) SetQueryCommitted(v SSHExecCommandResponse) { + o.QueryCommitted = &v +} + +// GetInit returns the Init field value if set, zero value otherwise. +func (o *ChainCodeLifeCycleCommandResponses) GetInit() SSHExecCommandResponse { + if o == nil || IsNil(o.Init) { + var ret SSHExecCommandResponse + return ret + } + return *o.Init +} + +// GetInitOk returns a tuple with the Init field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainCodeLifeCycleCommandResponses) GetInitOk() (*SSHExecCommandResponse, bool) { + if o == nil || IsNil(o.Init) { + return nil, false + } + return o.Init, true +} + +// HasInit returns a boolean if a field has been set. +func (o *ChainCodeLifeCycleCommandResponses) HasInit() bool { + if o != nil && !IsNil(o.Init) { + return true + } + + return false +} + +// SetInit gets a reference to the given SSHExecCommandResponse and assigns it to the Init field. +func (o *ChainCodeLifeCycleCommandResponses) SetInit(v SSHExecCommandResponse) { + o.Init = &v +} + +func (o ChainCodeLifeCycleCommandResponses) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ChainCodeLifeCycleCommandResponses) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Packaging) { + toSerialize["packaging"] = o.Packaging + } + toSerialize["installList"] = o.InstallList + toSerialize["queryInstalledList"] = o.QueryInstalledList + toSerialize["approveForMyOrgList"] = o.ApproveForMyOrgList + if !IsNil(o.Commit) { + toSerialize["commit"] = o.Commit + } + if !IsNil(o.QueryCommitted) { + toSerialize["queryCommitted"] = o.QueryCommitted + } + if !IsNil(o.Init) { + toSerialize["init"] = o.Init + } + return toSerialize, nil +} + +type NullableChainCodeLifeCycleCommandResponses struct { + value *ChainCodeLifeCycleCommandResponses + isSet bool +} + +func (v NullableChainCodeLifeCycleCommandResponses) Get() *ChainCodeLifeCycleCommandResponses { + return v.value +} + +func (v *NullableChainCodeLifeCycleCommandResponses) Set(val *ChainCodeLifeCycleCommandResponses) { + v.value = val + v.isSet = true +} + +func (v NullableChainCodeLifeCycleCommandResponses) IsSet() bool { + return v.isSet +} + +func (v *NullableChainCodeLifeCycleCommandResponses) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChainCodeLifeCycleCommandResponses(val *ChainCodeLifeCycleCommandResponses) *NullableChainCodeLifeCycleCommandResponses { + return &NullableChainCodeLifeCycleCommandResponses{value: val, isSet: true} +} + +func (v NullableChainCodeLifeCycleCommandResponses) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChainCodeLifeCycleCommandResponses) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_programming_language.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_programming_language.go new file mode 100644 index 00000000000..2645ca802e7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_chain_code_programming_language.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// ChainCodeProgrammingLanguage Enumerates the supported source code programming languages of Hyperledger Fabric +type ChainCodeProgrammingLanguage string + +// List of ChainCodeProgrammingLanguage +const ( + GOLANG ChainCodeProgrammingLanguage = "golang" + JAVASCRIPT ChainCodeProgrammingLanguage = "javascript" + TYPESCRIPT ChainCodeProgrammingLanguage = "typescript" + JAVA ChainCodeProgrammingLanguage = "java" +) + +// All allowed values of ChainCodeProgrammingLanguage enum +var AllowedChainCodeProgrammingLanguageEnumValues = []ChainCodeProgrammingLanguage{ + "golang", + "javascript", + "typescript", + "java", +} + +func (v *ChainCodeProgrammingLanguage) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ChainCodeProgrammingLanguage(value) + for _, existing := range AllowedChainCodeProgrammingLanguageEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ChainCodeProgrammingLanguage", value) +} + +// NewChainCodeProgrammingLanguageFromValue returns a pointer to a valid ChainCodeProgrammingLanguage +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewChainCodeProgrammingLanguageFromValue(v string) (*ChainCodeProgrammingLanguage, error) { + ev := ChainCodeProgrammingLanguage(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ChainCodeProgrammingLanguage: valid values are %v", v, AllowedChainCodeProgrammingLanguageEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ChainCodeProgrammingLanguage) IsValid() bool { + for _, existing := range AllowedChainCodeProgrammingLanguageEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ChainCodeProgrammingLanguage value +func (v ChainCodeProgrammingLanguage) Ptr() *ChainCodeProgrammingLanguage { + return &v +} + +type NullableChainCodeProgrammingLanguage struct { + value *ChainCodeProgrammingLanguage + isSet bool +} + +func (v NullableChainCodeProgrammingLanguage) Get() *ChainCodeProgrammingLanguage { + return v.value +} + +func (v *NullableChainCodeProgrammingLanguage) Set(val *ChainCodeProgrammingLanguage) { + v.value = val + v.isSet = true +} + +func (v NullableChainCodeProgrammingLanguage) IsSet() bool { + return v.isSet +} + +func (v *NullableChainCodeProgrammingLanguage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChainCodeProgrammingLanguage(val *ChainCodeProgrammingLanguage) *NullableChainCodeProgrammingLanguage { + return &NullableChainCodeProgrammingLanguage{value: val, isSet: true} +} + +func (v NullableChainCodeProgrammingLanguage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChainCodeProgrammingLanguage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_connection_profile.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_connection_profile.go new file mode 100644 index 00000000000..ec9e89674d8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_connection_profile.go @@ -0,0 +1,448 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the ConnectionProfile type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConnectionProfile{} + +// ConnectionProfile struct for ConnectionProfile +type ConnectionProfile struct { + Name string `json:"name"` + XType *string `json:"x-type,omitempty"` + Description *string `json:"description,omitempty"` + Version string `json:"version"` + Client *ConnectionProfileClient `json:"client,omitempty"` + Channels map[string]interface{} `json:"channels,omitempty"` + Organizations map[string]interface{} `json:"organizations"` + Orderers map[string]interface{} `json:"orderers,omitempty"` + Peers map[string]interface{} `json:"peers"` + CertificateAuthorities map[string]interface{} `json:"certificateAuthorities,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ConnectionProfile ConnectionProfile + +// NewConnectionProfile instantiates a new ConnectionProfile 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 +// will change when the set of required properties is changed +func NewConnectionProfile(name string, version string, organizations map[string]interface{}, peers map[string]interface{}) *ConnectionProfile { + this := ConnectionProfile{} + this.Name = name + this.Version = version + this.Organizations = organizations + this.Peers = peers + return &this +} + +// NewConnectionProfileWithDefaults instantiates a new ConnectionProfile object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConnectionProfileWithDefaults() *ConnectionProfile { + this := ConnectionProfile{} + return &this +} + +// GetName returns the Name field value +func (o *ConnectionProfile) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConnectionProfile) SetName(v string) { + o.Name = v +} + +// GetXType returns the XType field value if set, zero value otherwise. +func (o *ConnectionProfile) GetXType() string { + if o == nil || IsNil(o.XType) { + var ret string + return ret + } + return *o.XType +} + +// GetXTypeOk returns a tuple with the XType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetXTypeOk() (*string, bool) { + if o == nil || IsNil(o.XType) { + return nil, false + } + return o.XType, true +} + +// HasXType returns a boolean if a field has been set. +func (o *ConnectionProfile) HasXType() bool { + if o != nil && !IsNil(o.XType) { + return true + } + + return false +} + +// SetXType gets a reference to the given string and assigns it to the XType field. +func (o *ConnectionProfile) SetXType(v string) { + o.XType = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ConnectionProfile) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ConnectionProfile) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ConnectionProfile) SetDescription(v string) { + o.Description = &v +} + +// GetVersion returns the Version field value +func (o *ConnectionProfile) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *ConnectionProfile) SetVersion(v string) { + o.Version = v +} + +// GetClient returns the Client field value if set, zero value otherwise. +func (o *ConnectionProfile) GetClient() ConnectionProfileClient { + if o == nil || IsNil(o.Client) { + var ret ConnectionProfileClient + return ret + } + return *o.Client +} + +// GetClientOk returns a tuple with the Client field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetClientOk() (*ConnectionProfileClient, bool) { + if o == nil || IsNil(o.Client) { + return nil, false + } + return o.Client, true +} + +// HasClient returns a boolean if a field has been set. +func (o *ConnectionProfile) HasClient() bool { + if o != nil && !IsNil(o.Client) { + return true + } + + return false +} + +// SetClient gets a reference to the given ConnectionProfileClient and assigns it to the Client field. +func (o *ConnectionProfile) SetClient(v ConnectionProfileClient) { + o.Client = &v +} + +// GetChannels returns the Channels field value if set, zero value otherwise. +func (o *ConnectionProfile) GetChannels() map[string]interface{} { + if o == nil || IsNil(o.Channels) { + var ret map[string]interface{} + return ret + } + return o.Channels +} + +// GetChannelsOk returns a tuple with the Channels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetChannelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Channels) { + return map[string]interface{}{}, false + } + return o.Channels, true +} + +// HasChannels returns a boolean if a field has been set. +func (o *ConnectionProfile) HasChannels() bool { + if o != nil && !IsNil(o.Channels) { + return true + } + + return false +} + +// SetChannels gets a reference to the given map[string]interface{} and assigns it to the Channels field. +func (o *ConnectionProfile) SetChannels(v map[string]interface{}) { + o.Channels = v +} + +// GetOrganizations returns the Organizations field value +func (o *ConnectionProfile) GetOrganizations() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Organizations +} + +// GetOrganizationsOk returns a tuple with the Organizations field value +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetOrganizationsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Organizations, true +} + +// SetOrganizations sets field value +func (o *ConnectionProfile) SetOrganizations(v map[string]interface{}) { + o.Organizations = v +} + +// GetOrderers returns the Orderers field value if set, zero value otherwise. +func (o *ConnectionProfile) GetOrderers() map[string]interface{} { + if o == nil || IsNil(o.Orderers) { + var ret map[string]interface{} + return ret + } + return o.Orderers +} + +// GetOrderersOk returns a tuple with the Orderers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetOrderersOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Orderers) { + return map[string]interface{}{}, false + } + return o.Orderers, true +} + +// HasOrderers returns a boolean if a field has been set. +func (o *ConnectionProfile) HasOrderers() bool { + if o != nil && !IsNil(o.Orderers) { + return true + } + + return false +} + +// SetOrderers gets a reference to the given map[string]interface{} and assigns it to the Orderers field. +func (o *ConnectionProfile) SetOrderers(v map[string]interface{}) { + o.Orderers = v +} + +// GetPeers returns the Peers field value +func (o *ConnectionProfile) GetPeers() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Peers +} + +// GetPeersOk returns a tuple with the Peers field value +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetPeersOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Peers, true +} + +// SetPeers sets field value +func (o *ConnectionProfile) SetPeers(v map[string]interface{}) { + o.Peers = v +} + +// GetCertificateAuthorities returns the CertificateAuthorities field value if set, zero value otherwise. +func (o *ConnectionProfile) GetCertificateAuthorities() map[string]interface{} { + if o == nil || IsNil(o.CertificateAuthorities) { + var ret map[string]interface{} + return ret + } + return o.CertificateAuthorities +} + +// GetCertificateAuthoritiesOk returns a tuple with the CertificateAuthorities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionProfile) GetCertificateAuthoritiesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CertificateAuthorities) { + return map[string]interface{}{}, false + } + return o.CertificateAuthorities, true +} + +// HasCertificateAuthorities returns a boolean if a field has been set. +func (o *ConnectionProfile) HasCertificateAuthorities() bool { + if o != nil && !IsNil(o.CertificateAuthorities) { + return true + } + + return false +} + +// SetCertificateAuthorities gets a reference to the given map[string]interface{} and assigns it to the CertificateAuthorities field. +func (o *ConnectionProfile) SetCertificateAuthorities(v map[string]interface{}) { + o.CertificateAuthorities = v +} + +func (o ConnectionProfile) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConnectionProfile) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.XType) { + toSerialize["x-type"] = o.XType + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["version"] = o.Version + if !IsNil(o.Client) { + toSerialize["client"] = o.Client + } + if !IsNil(o.Channels) { + toSerialize["channels"] = o.Channels + } + toSerialize["organizations"] = o.Organizations + if !IsNil(o.Orderers) { + toSerialize["orderers"] = o.Orderers + } + toSerialize["peers"] = o.Peers + if !IsNil(o.CertificateAuthorities) { + toSerialize["certificateAuthorities"] = o.CertificateAuthorities + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConnectionProfile) UnmarshalJSON(bytes []byte) (err error) { + varConnectionProfile := _ConnectionProfile{} + + if err = json.Unmarshal(bytes, &varConnectionProfile); err == nil { + *o = ConnectionProfile(varConnectionProfile) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "x-type") + delete(additionalProperties, "description") + delete(additionalProperties, "version") + delete(additionalProperties, "client") + delete(additionalProperties, "channels") + delete(additionalProperties, "organizations") + delete(additionalProperties, "orderers") + delete(additionalProperties, "peers") + delete(additionalProperties, "certificateAuthorities") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConnectionProfile struct { + value *ConnectionProfile + isSet bool +} + +func (v NullableConnectionProfile) Get() *ConnectionProfile { + return v.value +} + +func (v *NullableConnectionProfile) Set(val *ConnectionProfile) { + v.value = val + v.isSet = true +} + +func (v NullableConnectionProfile) IsSet() bool { + return v.isSet +} + +func (v *NullableConnectionProfile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConnectionProfile(val *ConnectionProfile) *NullableConnectionProfile { + return &NullableConnectionProfile{value: val, isSet: true} +} + +func (v NullableConnectionProfile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConnectionProfile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_connection_profile_client.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_connection_profile_client.go new file mode 100644 index 00000000000..fa0dbe0dc2d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_connection_profile_client.go @@ -0,0 +1,126 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the ConnectionProfileClient type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConnectionProfileClient{} + +// ConnectionProfileClient struct for ConnectionProfileClient +type ConnectionProfileClient struct { + Organization *string `json:"organization,omitempty"` +} + +// NewConnectionProfileClient instantiates a new ConnectionProfileClient 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 +// will change when the set of required properties is changed +func NewConnectionProfileClient() *ConnectionProfileClient { + this := ConnectionProfileClient{} + return &this +} + +// NewConnectionProfileClientWithDefaults instantiates a new ConnectionProfileClient object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConnectionProfileClientWithDefaults() *ConnectionProfileClient { + this := ConnectionProfileClient{} + return &this +} + +// GetOrganization returns the Organization field value if set, zero value otherwise. +func (o *ConnectionProfileClient) GetOrganization() string { + if o == nil || IsNil(o.Organization) { + var ret string + return ret + } + return *o.Organization +} + +// GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionProfileClient) GetOrganizationOk() (*string, bool) { + if o == nil || IsNil(o.Organization) { + return nil, false + } + return o.Organization, true +} + +// HasOrganization returns a boolean if a field has been set. +func (o *ConnectionProfileClient) HasOrganization() bool { + if o != nil && !IsNil(o.Organization) { + return true + } + + return false +} + +// SetOrganization gets a reference to the given string and assigns it to the Organization field. +func (o *ConnectionProfileClient) SetOrganization(v string) { + o.Organization = &v +} + +func (o ConnectionProfileClient) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConnectionProfileClient) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Organization) { + toSerialize["organization"] = o.Organization + } + return toSerialize, nil +} + +type NullableConnectionProfileClient struct { + value *ConnectionProfileClient + isSet bool +} + +func (v NullableConnectionProfileClient) Get() *ConnectionProfileClient { + return v.value +} + +func (v *NullableConnectionProfileClient) Set(val *ConnectionProfileClient) { + v.value = val + v.isSet = true +} + +func (v NullableConnectionProfileClient) IsSet() bool { + return v.isSet +} + +func (v *NullableConnectionProfileClient) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConnectionProfileClient(val *ConnectionProfileClient) *NullableConnectionProfileClient { + return &NullableConnectionProfileClient{value: val, isSet: true} +} + +func (v NullableConnectionProfileClient) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConnectionProfileClient) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_default_event_handler_strategy.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_default_event_handler_strategy.go new file mode 100644 index 00000000000..51ace2be483 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_default_event_handler_strategy.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// DefaultEventHandlerStrategy the model 'DefaultEventHandlerStrategy' +type DefaultEventHandlerStrategy string + +// List of DefaultEventHandlerStrategy +const ( + MSPID_SCOPE_ALLFORTX DefaultEventHandlerStrategy = "MSPID_SCOPE_ALLFORTX" + MSPID_SCOPE_ANYFORTX DefaultEventHandlerStrategy = "MSPID_SCOPE_ANYFORTX" + NETWORK_SCOPE_ALLFORTX DefaultEventHandlerStrategy = "NETWORK_SCOPE_ALLFORTX" + NETWORK_SCOPE_ANYFORTX DefaultEventHandlerStrategy = "NETWORK_SCOPE_ANYFORTX" +) + +// All allowed values of DefaultEventHandlerStrategy enum +var AllowedDefaultEventHandlerStrategyEnumValues = []DefaultEventHandlerStrategy{ + "MSPID_SCOPE_ALLFORTX", + "MSPID_SCOPE_ANYFORTX", + "NETWORK_SCOPE_ALLFORTX", + "NETWORK_SCOPE_ANYFORTX", +} + +func (v *DefaultEventHandlerStrategy) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DefaultEventHandlerStrategy(value) + for _, existing := range AllowedDefaultEventHandlerStrategyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DefaultEventHandlerStrategy", value) +} + +// NewDefaultEventHandlerStrategyFromValue returns a pointer to a valid DefaultEventHandlerStrategy +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDefaultEventHandlerStrategyFromValue(v string) (*DefaultEventHandlerStrategy, error) { + ev := DefaultEventHandlerStrategy(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DefaultEventHandlerStrategy: valid values are %v", v, AllowedDefaultEventHandlerStrategyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DefaultEventHandlerStrategy) IsValid() bool { + for _, existing := range AllowedDefaultEventHandlerStrategyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DefaultEventHandlerStrategy value +func (v DefaultEventHandlerStrategy) Ptr() *DefaultEventHandlerStrategy { + return &v +} + +type NullableDefaultEventHandlerStrategy struct { + value *DefaultEventHandlerStrategy + isSet bool +} + +func (v NullableDefaultEventHandlerStrategy) Get() *DefaultEventHandlerStrategy { + return v.value +} + +func (v *NullableDefaultEventHandlerStrategy) Set(val *DefaultEventHandlerStrategy) { + v.value = val + v.isSet = true +} + +func (v NullableDefaultEventHandlerStrategy) IsSet() bool { + return v.isSet +} + +func (v *NullableDefaultEventHandlerStrategy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDefaultEventHandlerStrategy(val *DefaultEventHandlerStrategy) *NullableDefaultEventHandlerStrategy { + return &NullableDefaultEventHandlerStrategy{value: val, isSet: true} +} + +func (v NullableDefaultEventHandlerStrategy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDefaultEventHandlerStrategy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_501_response.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_501_response.go new file mode 100644 index 00000000000..3caaa6d7e66 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_501_response.go @@ -0,0 +1,126 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the DeployContractGoSourceV1501Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractGoSourceV1501Response{} + +// DeployContractGoSourceV1501Response struct for DeployContractGoSourceV1501Response +type DeployContractGoSourceV1501Response struct { + Message *string `json:"message,omitempty"` +} + +// NewDeployContractGoSourceV1501Response instantiates a new DeployContractGoSourceV1501Response 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 +// will change when the set of required properties is changed +func NewDeployContractGoSourceV1501Response() *DeployContractGoSourceV1501Response { + this := DeployContractGoSourceV1501Response{} + return &this +} + +// NewDeployContractGoSourceV1501ResponseWithDefaults instantiates a new DeployContractGoSourceV1501Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractGoSourceV1501ResponseWithDefaults() *DeployContractGoSourceV1501Response { + this := DeployContractGoSourceV1501Response{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *DeployContractGoSourceV1501Response) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1501Response) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *DeployContractGoSourceV1501Response) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *DeployContractGoSourceV1501Response) SetMessage(v string) { + o.Message = &v +} + +func (o DeployContractGoSourceV1501Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractGoSourceV1501Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableDeployContractGoSourceV1501Response struct { + value *DeployContractGoSourceV1501Response + isSet bool +} + +func (v NullableDeployContractGoSourceV1501Response) Get() *DeployContractGoSourceV1501Response { + return v.value +} + +func (v *NullableDeployContractGoSourceV1501Response) Set(val *DeployContractGoSourceV1501Response) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractGoSourceV1501Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractGoSourceV1501Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractGoSourceV1501Response(val *DeployContractGoSourceV1501Response) *NullableDeployContractGoSourceV1501Response { + return &NullableDeployContractGoSourceV1501Response{value: val, isSet: true} +} + +func (v NullableDeployContractGoSourceV1501Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractGoSourceV1501Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_request.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_request.go new file mode 100644 index 00000000000..518c8bd1f25 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_request.go @@ -0,0 +1,474 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the DeployContractGoSourceV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractGoSourceV1Request{} + +// DeployContractGoSourceV1Request struct for DeployContractGoSourceV1Request +type DeployContractGoSourceV1Request struct { + PolicyDslSource string `json:"policyDslSource"` + // The TLS root cert files that will be passed to the chaincode instantiation command. + TlsRootCertFiles string `json:"tlsRootCertFiles"` + // The name of the Fabric channel where the contract will get instantiated. + ChannelId string `json:"channelId"` + TargetOrganizations []DeploymentTargetOrganization `json:"targetOrganizations"` + // An array of peer addresses where the contract will be instantiated. Note that at present only the first item from this array will be used which is the behavior taken from the official Fabric samples repository and therefore it is assumed to be correct usage. + TargetPeerAddresses []string `json:"targetPeerAddresses"` + ConstructorArgs *DeployContractGoSourceV1RequestConstructorArgs `json:"constructorArgs,omitempty"` + ChainCodeVersion string `json:"chainCodeVersion"` + GoSource FileBase64 `json:"goSource"` + GoMod *FileBase64 `json:"goMod,omitempty"` + // The go module name that will be used for the go compilation process. + ModuleName *string `json:"moduleName,omitempty"` + PinnedDeps []string `json:"pinnedDeps,omitempty"` + // Indicates to the go chaincode compiler of Cactus if it should do an actual go compilation with the contact source or if it should just execute the go mod tidy command. + ModTidyOnly NullableBool `json:"modTidyOnly,omitempty"` +} + +// NewDeployContractGoSourceV1Request instantiates a new DeployContractGoSourceV1Request 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 +// will change when the set of required properties is changed +func NewDeployContractGoSourceV1Request(policyDslSource string, tlsRootCertFiles string, channelId string, targetOrganizations []DeploymentTargetOrganization, targetPeerAddresses []string, chainCodeVersion string, goSource FileBase64) *DeployContractGoSourceV1Request { + this := DeployContractGoSourceV1Request{} + this.PolicyDslSource = policyDslSource + this.TlsRootCertFiles = tlsRootCertFiles + this.ChannelId = channelId + this.TargetOrganizations = targetOrganizations + this.TargetPeerAddresses = targetPeerAddresses + this.ChainCodeVersion = chainCodeVersion + this.GoSource = goSource + return &this +} + +// NewDeployContractGoSourceV1RequestWithDefaults instantiates a new DeployContractGoSourceV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractGoSourceV1RequestWithDefaults() *DeployContractGoSourceV1Request { + this := DeployContractGoSourceV1Request{} + return &this +} + +// GetPolicyDslSource returns the PolicyDslSource field value +func (o *DeployContractGoSourceV1Request) GetPolicyDslSource() string { + if o == nil { + var ret string + return ret + } + + return o.PolicyDslSource +} + +// GetPolicyDslSourceOk returns a tuple with the PolicyDslSource field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetPolicyDslSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PolicyDslSource, true +} + +// SetPolicyDslSource sets field value +func (o *DeployContractGoSourceV1Request) SetPolicyDslSource(v string) { + o.PolicyDslSource = v +} + +// GetTlsRootCertFiles returns the TlsRootCertFiles field value +func (o *DeployContractGoSourceV1Request) GetTlsRootCertFiles() string { + if o == nil { + var ret string + return ret + } + + return o.TlsRootCertFiles +} + +// GetTlsRootCertFilesOk returns a tuple with the TlsRootCertFiles field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetTlsRootCertFilesOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TlsRootCertFiles, true +} + +// SetTlsRootCertFiles sets field value +func (o *DeployContractGoSourceV1Request) SetTlsRootCertFiles(v string) { + o.TlsRootCertFiles = v +} + +// GetChannelId returns the ChannelId field value +func (o *DeployContractGoSourceV1Request) GetChannelId() string { + if o == nil { + var ret string + return ret + } + + return o.ChannelId +} + +// GetChannelIdOk returns a tuple with the ChannelId field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetChannelIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelId, true +} + +// SetChannelId sets field value +func (o *DeployContractGoSourceV1Request) SetChannelId(v string) { + o.ChannelId = v +} + +// GetTargetOrganizations returns the TargetOrganizations field value +func (o *DeployContractGoSourceV1Request) GetTargetOrganizations() []DeploymentTargetOrganization { + if o == nil { + var ret []DeploymentTargetOrganization + return ret + } + + return o.TargetOrganizations +} + +// GetTargetOrganizationsOk returns a tuple with the TargetOrganizations field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetTargetOrganizationsOk() ([]DeploymentTargetOrganization, bool) { + if o == nil { + return nil, false + } + return o.TargetOrganizations, true +} + +// SetTargetOrganizations sets field value +func (o *DeployContractGoSourceV1Request) SetTargetOrganizations(v []DeploymentTargetOrganization) { + o.TargetOrganizations = v +} + +// GetTargetPeerAddresses returns the TargetPeerAddresses field value +func (o *DeployContractGoSourceV1Request) GetTargetPeerAddresses() []string { + if o == nil { + var ret []string + return ret + } + + return o.TargetPeerAddresses +} + +// GetTargetPeerAddressesOk returns a tuple with the TargetPeerAddresses field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetTargetPeerAddressesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.TargetPeerAddresses, true +} + +// SetTargetPeerAddresses sets field value +func (o *DeployContractGoSourceV1Request) SetTargetPeerAddresses(v []string) { + o.TargetPeerAddresses = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployContractGoSourceV1Request) GetConstructorArgs() DeployContractGoSourceV1RequestConstructorArgs { + if o == nil || IsNil(o.ConstructorArgs) { + var ret DeployContractGoSourceV1RequestConstructorArgs + return ret + } + return *o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetConstructorArgsOk() (*DeployContractGoSourceV1RequestConstructorArgs, bool) { + if o == nil || IsNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployContractGoSourceV1Request) HasConstructorArgs() bool { + if o != nil && !IsNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given DeployContractGoSourceV1RequestConstructorArgs and assigns it to the ConstructorArgs field. +func (o *DeployContractGoSourceV1Request) SetConstructorArgs(v DeployContractGoSourceV1RequestConstructorArgs) { + o.ConstructorArgs = &v +} + +// GetChainCodeVersion returns the ChainCodeVersion field value +func (o *DeployContractGoSourceV1Request) GetChainCodeVersion() string { + if o == nil { + var ret string + return ret + } + + return o.ChainCodeVersion +} + +// GetChainCodeVersionOk returns a tuple with the ChainCodeVersion field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetChainCodeVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChainCodeVersion, true +} + +// SetChainCodeVersion sets field value +func (o *DeployContractGoSourceV1Request) SetChainCodeVersion(v string) { + o.ChainCodeVersion = v +} + +// GetGoSource returns the GoSource field value +func (o *DeployContractGoSourceV1Request) GetGoSource() FileBase64 { + if o == nil { + var ret FileBase64 + return ret + } + + return o.GoSource +} + +// GetGoSourceOk returns a tuple with the GoSource field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetGoSourceOk() (*FileBase64, bool) { + if o == nil { + return nil, false + } + return &o.GoSource, true +} + +// SetGoSource sets field value +func (o *DeployContractGoSourceV1Request) SetGoSource(v FileBase64) { + o.GoSource = v +} + +// GetGoMod returns the GoMod field value if set, zero value otherwise. +func (o *DeployContractGoSourceV1Request) GetGoMod() FileBase64 { + if o == nil || IsNil(o.GoMod) { + var ret FileBase64 + return ret + } + return *o.GoMod +} + +// GetGoModOk returns a tuple with the GoMod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetGoModOk() (*FileBase64, bool) { + if o == nil || IsNil(o.GoMod) { + return nil, false + } + return o.GoMod, true +} + +// HasGoMod returns a boolean if a field has been set. +func (o *DeployContractGoSourceV1Request) HasGoMod() bool { + if o != nil && !IsNil(o.GoMod) { + return true + } + + return false +} + +// SetGoMod gets a reference to the given FileBase64 and assigns it to the GoMod field. +func (o *DeployContractGoSourceV1Request) SetGoMod(v FileBase64) { + o.GoMod = &v +} + +// GetModuleName returns the ModuleName field value if set, zero value otherwise. +func (o *DeployContractGoSourceV1Request) GetModuleName() string { + if o == nil || IsNil(o.ModuleName) { + var ret string + return ret + } + return *o.ModuleName +} + +// GetModuleNameOk returns a tuple with the ModuleName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetModuleNameOk() (*string, bool) { + if o == nil || IsNil(o.ModuleName) { + return nil, false + } + return o.ModuleName, true +} + +// HasModuleName returns a boolean if a field has been set. +func (o *DeployContractGoSourceV1Request) HasModuleName() bool { + if o != nil && !IsNil(o.ModuleName) { + return true + } + + return false +} + +// SetModuleName gets a reference to the given string and assigns it to the ModuleName field. +func (o *DeployContractGoSourceV1Request) SetModuleName(v string) { + o.ModuleName = &v +} + +// GetPinnedDeps returns the PinnedDeps field value if set, zero value otherwise. +func (o *DeployContractGoSourceV1Request) GetPinnedDeps() []string { + if o == nil || IsNil(o.PinnedDeps) { + var ret []string + return ret + } + return o.PinnedDeps +} + +// GetPinnedDepsOk returns a tuple with the PinnedDeps field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Request) GetPinnedDepsOk() ([]string, bool) { + if o == nil || IsNil(o.PinnedDeps) { + return nil, false + } + return o.PinnedDeps, true +} + +// HasPinnedDeps returns a boolean if a field has been set. +func (o *DeployContractGoSourceV1Request) HasPinnedDeps() bool { + if o != nil && !IsNil(o.PinnedDeps) { + return true + } + + return false +} + +// SetPinnedDeps gets a reference to the given []string and assigns it to the PinnedDeps field. +func (o *DeployContractGoSourceV1Request) SetPinnedDeps(v []string) { + o.PinnedDeps = v +} + +// GetModTidyOnly returns the ModTidyOnly field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeployContractGoSourceV1Request) GetModTidyOnly() bool { + if o == nil || IsNil(o.ModTidyOnly.Get()) { + var ret bool + return ret + } + return *o.ModTidyOnly.Get() +} + +// GetModTidyOnlyOk returns a tuple with the ModTidyOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeployContractGoSourceV1Request) GetModTidyOnlyOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.ModTidyOnly.Get(), o.ModTidyOnly.IsSet() +} + +// HasModTidyOnly returns a boolean if a field has been set. +func (o *DeployContractGoSourceV1Request) HasModTidyOnly() bool { + if o != nil && o.ModTidyOnly.IsSet() { + return true + } + + return false +} + +// SetModTidyOnly gets a reference to the given NullableBool and assigns it to the ModTidyOnly field. +func (o *DeployContractGoSourceV1Request) SetModTidyOnly(v bool) { + o.ModTidyOnly.Set(&v) +} +// SetModTidyOnlyNil sets the value for ModTidyOnly to be an explicit nil +func (o *DeployContractGoSourceV1Request) SetModTidyOnlyNil() { + o.ModTidyOnly.Set(nil) +} + +// UnsetModTidyOnly ensures that no value is present for ModTidyOnly, not even an explicit nil +func (o *DeployContractGoSourceV1Request) UnsetModTidyOnly() { + o.ModTidyOnly.Unset() +} + +func (o DeployContractGoSourceV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractGoSourceV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["policyDslSource"] = o.PolicyDslSource + toSerialize["tlsRootCertFiles"] = o.TlsRootCertFiles + toSerialize["channelId"] = o.ChannelId + toSerialize["targetOrganizations"] = o.TargetOrganizations + toSerialize["targetPeerAddresses"] = o.TargetPeerAddresses + if !IsNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + toSerialize["chainCodeVersion"] = o.ChainCodeVersion + toSerialize["goSource"] = o.GoSource + if !IsNil(o.GoMod) { + toSerialize["goMod"] = o.GoMod + } + if !IsNil(o.ModuleName) { + toSerialize["moduleName"] = o.ModuleName + } + if !IsNil(o.PinnedDeps) { + toSerialize["pinnedDeps"] = o.PinnedDeps + } + if o.ModTidyOnly.IsSet() { + toSerialize["modTidyOnly"] = o.ModTidyOnly.Get() + } + return toSerialize, nil +} + +type NullableDeployContractGoSourceV1Request struct { + value *DeployContractGoSourceV1Request + isSet bool +} + +func (v NullableDeployContractGoSourceV1Request) Get() *DeployContractGoSourceV1Request { + return v.value +} + +func (v *NullableDeployContractGoSourceV1Request) Set(val *DeployContractGoSourceV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractGoSourceV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractGoSourceV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractGoSourceV1Request(val *DeployContractGoSourceV1Request) *NullableDeployContractGoSourceV1Request { + return &NullableDeployContractGoSourceV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractGoSourceV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractGoSourceV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_request_constructor_args.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_request_constructor_args.go new file mode 100644 index 00000000000..99102e68d2b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_request_constructor_args.go @@ -0,0 +1,126 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the DeployContractGoSourceV1RequestConstructorArgs type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractGoSourceV1RequestConstructorArgs{} + +// DeployContractGoSourceV1RequestConstructorArgs struct for DeployContractGoSourceV1RequestConstructorArgs +type DeployContractGoSourceV1RequestConstructorArgs struct { + Args []interface{} `json:"Args,omitempty"` +} + +// NewDeployContractGoSourceV1RequestConstructorArgs instantiates a new DeployContractGoSourceV1RequestConstructorArgs 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 +// will change when the set of required properties is changed +func NewDeployContractGoSourceV1RequestConstructorArgs() *DeployContractGoSourceV1RequestConstructorArgs { + this := DeployContractGoSourceV1RequestConstructorArgs{} + return &this +} + +// NewDeployContractGoSourceV1RequestConstructorArgsWithDefaults instantiates a new DeployContractGoSourceV1RequestConstructorArgs object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractGoSourceV1RequestConstructorArgsWithDefaults() *DeployContractGoSourceV1RequestConstructorArgs { + this := DeployContractGoSourceV1RequestConstructorArgs{} + return &this +} + +// GetArgs returns the Args field value if set, zero value otherwise. +func (o *DeployContractGoSourceV1RequestConstructorArgs) GetArgs() []interface{} { + if o == nil || IsNil(o.Args) { + var ret []interface{} + return ret + } + return o.Args +} + +// GetArgsOk returns a tuple with the Args field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1RequestConstructorArgs) GetArgsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Args) { + return nil, false + } + return o.Args, true +} + +// HasArgs returns a boolean if a field has been set. +func (o *DeployContractGoSourceV1RequestConstructorArgs) HasArgs() bool { + if o != nil && !IsNil(o.Args) { + return true + } + + return false +} + +// SetArgs gets a reference to the given []interface{} and assigns it to the Args field. +func (o *DeployContractGoSourceV1RequestConstructorArgs) SetArgs(v []interface{}) { + o.Args = v +} + +func (o DeployContractGoSourceV1RequestConstructorArgs) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractGoSourceV1RequestConstructorArgs) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Args) { + toSerialize["Args"] = o.Args + } + return toSerialize, nil +} + +type NullableDeployContractGoSourceV1RequestConstructorArgs struct { + value *DeployContractGoSourceV1RequestConstructorArgs + isSet bool +} + +func (v NullableDeployContractGoSourceV1RequestConstructorArgs) Get() *DeployContractGoSourceV1RequestConstructorArgs { + return v.value +} + +func (v *NullableDeployContractGoSourceV1RequestConstructorArgs) Set(val *DeployContractGoSourceV1RequestConstructorArgs) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractGoSourceV1RequestConstructorArgs) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractGoSourceV1RequestConstructorArgs) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractGoSourceV1RequestConstructorArgs(val *DeployContractGoSourceV1RequestConstructorArgs) *NullableDeployContractGoSourceV1RequestConstructorArgs { + return &NullableDeployContractGoSourceV1RequestConstructorArgs{value: val, isSet: true} +} + +func (v NullableDeployContractGoSourceV1RequestConstructorArgs) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractGoSourceV1RequestConstructorArgs) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_response.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_response.go new file mode 100644 index 00000000000..d15a10acb22 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_go_source_v1_response.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the DeployContractGoSourceV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractGoSourceV1Response{} + +// DeployContractGoSourceV1Response struct for DeployContractGoSourceV1Response +type DeployContractGoSourceV1Response struct { + Success bool `json:"success"` + InstallationCommandResponses []SSHExecCommandResponse `json:"installationCommandResponses"` + InstantiationCommandResponse SSHExecCommandResponse `json:"instantiationCommandResponse"` +} + +// NewDeployContractGoSourceV1Response instantiates a new DeployContractGoSourceV1Response 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 +// will change when the set of required properties is changed +func NewDeployContractGoSourceV1Response(success bool, installationCommandResponses []SSHExecCommandResponse, instantiationCommandResponse SSHExecCommandResponse) *DeployContractGoSourceV1Response { + this := DeployContractGoSourceV1Response{} + this.Success = success + this.InstallationCommandResponses = installationCommandResponses + this.InstantiationCommandResponse = instantiationCommandResponse + return &this +} + +// NewDeployContractGoSourceV1ResponseWithDefaults instantiates a new DeployContractGoSourceV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractGoSourceV1ResponseWithDefaults() *DeployContractGoSourceV1Response { + this := DeployContractGoSourceV1Response{} + return &this +} + +// GetSuccess returns the Success field value +func (o *DeployContractGoSourceV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *DeployContractGoSourceV1Response) SetSuccess(v bool) { + o.Success = v +} + +// GetInstallationCommandResponses returns the InstallationCommandResponses field value +func (o *DeployContractGoSourceV1Response) GetInstallationCommandResponses() []SSHExecCommandResponse { + if o == nil { + var ret []SSHExecCommandResponse + return ret + } + + return o.InstallationCommandResponses +} + +// GetInstallationCommandResponsesOk returns a tuple with the InstallationCommandResponses field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Response) GetInstallationCommandResponsesOk() ([]SSHExecCommandResponse, bool) { + if o == nil { + return nil, false + } + return o.InstallationCommandResponses, true +} + +// SetInstallationCommandResponses sets field value +func (o *DeployContractGoSourceV1Response) SetInstallationCommandResponses(v []SSHExecCommandResponse) { + o.InstallationCommandResponses = v +} + +// GetInstantiationCommandResponse returns the InstantiationCommandResponse field value +func (o *DeployContractGoSourceV1Response) GetInstantiationCommandResponse() SSHExecCommandResponse { + if o == nil { + var ret SSHExecCommandResponse + return ret + } + + return o.InstantiationCommandResponse +} + +// GetInstantiationCommandResponseOk returns a tuple with the InstantiationCommandResponse field value +// and a boolean to check if the value has been set. +func (o *DeployContractGoSourceV1Response) GetInstantiationCommandResponseOk() (*SSHExecCommandResponse, bool) { + if o == nil { + return nil, false + } + return &o.InstantiationCommandResponse, true +} + +// SetInstantiationCommandResponse sets field value +func (o *DeployContractGoSourceV1Response) SetInstantiationCommandResponse(v SSHExecCommandResponse) { + o.InstantiationCommandResponse = v +} + +func (o DeployContractGoSourceV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractGoSourceV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["success"] = o.Success + toSerialize["installationCommandResponses"] = o.InstallationCommandResponses + toSerialize["instantiationCommandResponse"] = o.InstantiationCommandResponse + return toSerialize, nil +} + +type NullableDeployContractGoSourceV1Response struct { + value *DeployContractGoSourceV1Response + isSet bool +} + +func (v NullableDeployContractGoSourceV1Response) Get() *DeployContractGoSourceV1Response { + return v.value +} + +func (v *NullableDeployContractGoSourceV1Response) Set(val *DeployContractGoSourceV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractGoSourceV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractGoSourceV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractGoSourceV1Response(val *DeployContractGoSourceV1Response) *NullableDeployContractGoSourceV1Response { + return &NullableDeployContractGoSourceV1Response{value: val, isSet: true} +} + +func (v NullableDeployContractGoSourceV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractGoSourceV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go new file mode 100644 index 00000000000..a111e7c6bea --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go @@ -0,0 +1,540 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the DeployContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractV1Request{} + +// DeployContractV1Request struct for DeployContractV1Request +type DeployContractV1Request struct { + CcLang ChainCodeProgrammingLanguage `json:"ccLang"` + // File-system path pointing at the CA file. + CaFile string `json:"caFile"` + // Ordering service endpoint specified as : + Orderer string `json:"orderer"` + // The hostname override to use when validating the TLS connection to the orderer + OrdererTLSHostnameOverride string `json:"ordererTLSHostnameOverride"` + // Timeout for client to connect (default 3s) + ConnTimeout *int32 `json:"connTimeout,omitempty"` + // Passed in to the peer via the --signature-policy argument on the command line. See also: https://hyperledger-fabric.readthedocs.io/en/release-2.2/endorsement-policies.html#setting-chaincode-level-endorsement-policies + SignaturePolicy *string `json:"signaturePolicy,omitempty"` + // Name of the collections config file as present in the sourceFiles array of the request. + CollectionsConfigFile *string `json:"collectionsConfigFile,omitempty"` + // The name of the Fabric channel where the contract will get instantiated. + ChannelId string `json:"channelId"` + TargetOrganizations []DeploymentTargetOrganization `json:"targetOrganizations"` + ConstructorArgs *DeployContractGoSourceV1RequestConstructorArgs `json:"constructorArgs,omitempty"` + CcSequence float32 `json:"ccSequence"` + CcVersion string `json:"ccVersion"` + CcName string `json:"ccName"` + // Human readable label to uniquely identify the contract. Recommended to include in this at least the contract name and the exact version in order to make it easily distinguishable from other deployments of the same contract. + CcLabel string `json:"ccLabel"` + // The your-smart-contract.go file where the functionality of your contract is implemented. + SourceFiles []FileBase64 `json:"sourceFiles"` +} + +// NewDeployContractV1Request instantiates a new DeployContractV1Request 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 +// will change when the set of required properties is changed +func NewDeployContractV1Request(ccLang ChainCodeProgrammingLanguage, caFile string, orderer string, ordererTLSHostnameOverride string, channelId string, targetOrganizations []DeploymentTargetOrganization, ccSequence float32, ccVersion string, ccName string, ccLabel string, sourceFiles []FileBase64) *DeployContractV1Request { + this := DeployContractV1Request{} + this.CcLang = ccLang + this.CaFile = caFile + this.Orderer = orderer + this.OrdererTLSHostnameOverride = ordererTLSHostnameOverride + this.ChannelId = channelId + this.TargetOrganizations = targetOrganizations + this.CcSequence = ccSequence + this.CcVersion = ccVersion + this.CcName = ccName + this.CcLabel = ccLabel + this.SourceFiles = sourceFiles + return &this +} + +// NewDeployContractV1RequestWithDefaults instantiates a new DeployContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractV1RequestWithDefaults() *DeployContractV1Request { + this := DeployContractV1Request{} + return &this +} + +// GetCcLang returns the CcLang field value +func (o *DeployContractV1Request) GetCcLang() ChainCodeProgrammingLanguage { + if o == nil { + var ret ChainCodeProgrammingLanguage + return ret + } + + return o.CcLang +} + +// GetCcLangOk returns a tuple with the CcLang field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetCcLangOk() (*ChainCodeProgrammingLanguage, bool) { + if o == nil { + return nil, false + } + return &o.CcLang, true +} + +// SetCcLang sets field value +func (o *DeployContractV1Request) SetCcLang(v ChainCodeProgrammingLanguage) { + o.CcLang = v +} + +// GetCaFile returns the CaFile field value +func (o *DeployContractV1Request) GetCaFile() string { + if o == nil { + var ret string + return ret + } + + return o.CaFile +} + +// GetCaFileOk returns a tuple with the CaFile field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetCaFileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CaFile, true +} + +// SetCaFile sets field value +func (o *DeployContractV1Request) SetCaFile(v string) { + o.CaFile = v +} + +// GetOrderer returns the Orderer field value +func (o *DeployContractV1Request) GetOrderer() string { + if o == nil { + var ret string + return ret + } + + return o.Orderer +} + +// GetOrdererOk returns a tuple with the Orderer field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetOrdererOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Orderer, true +} + +// SetOrderer sets field value +func (o *DeployContractV1Request) SetOrderer(v string) { + o.Orderer = v +} + +// GetOrdererTLSHostnameOverride returns the OrdererTLSHostnameOverride field value +func (o *DeployContractV1Request) GetOrdererTLSHostnameOverride() string { + if o == nil { + var ret string + return ret + } + + return o.OrdererTLSHostnameOverride +} + +// GetOrdererTLSHostnameOverrideOk returns a tuple with the OrdererTLSHostnameOverride field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetOrdererTLSHostnameOverrideOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrdererTLSHostnameOverride, true +} + +// SetOrdererTLSHostnameOverride sets field value +func (o *DeployContractV1Request) SetOrdererTLSHostnameOverride(v string) { + o.OrdererTLSHostnameOverride = v +} + +// GetConnTimeout returns the ConnTimeout field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetConnTimeout() int32 { + if o == nil || IsNil(o.ConnTimeout) { + var ret int32 + return ret + } + return *o.ConnTimeout +} + +// GetConnTimeoutOk returns a tuple with the ConnTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetConnTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.ConnTimeout) { + return nil, false + } + return o.ConnTimeout, true +} + +// HasConnTimeout returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasConnTimeout() bool { + if o != nil && !IsNil(o.ConnTimeout) { + return true + } + + return false +} + +// SetConnTimeout gets a reference to the given int32 and assigns it to the ConnTimeout field. +func (o *DeployContractV1Request) SetConnTimeout(v int32) { + o.ConnTimeout = &v +} + +// GetSignaturePolicy returns the SignaturePolicy field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetSignaturePolicy() string { + if o == nil || IsNil(o.SignaturePolicy) { + var ret string + return ret + } + return *o.SignaturePolicy +} + +// GetSignaturePolicyOk returns a tuple with the SignaturePolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetSignaturePolicyOk() (*string, bool) { + if o == nil || IsNil(o.SignaturePolicy) { + return nil, false + } + return o.SignaturePolicy, true +} + +// HasSignaturePolicy returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasSignaturePolicy() bool { + if o != nil && !IsNil(o.SignaturePolicy) { + return true + } + + return false +} + +// SetSignaturePolicy gets a reference to the given string and assigns it to the SignaturePolicy field. +func (o *DeployContractV1Request) SetSignaturePolicy(v string) { + o.SignaturePolicy = &v +} + +// GetCollectionsConfigFile returns the CollectionsConfigFile field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetCollectionsConfigFile() string { + if o == nil || IsNil(o.CollectionsConfigFile) { + var ret string + return ret + } + return *o.CollectionsConfigFile +} + +// GetCollectionsConfigFileOk returns a tuple with the CollectionsConfigFile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetCollectionsConfigFileOk() (*string, bool) { + if o == nil || IsNil(o.CollectionsConfigFile) { + return nil, false + } + return o.CollectionsConfigFile, true +} + +// HasCollectionsConfigFile returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasCollectionsConfigFile() bool { + if o != nil && !IsNil(o.CollectionsConfigFile) { + return true + } + + return false +} + +// SetCollectionsConfigFile gets a reference to the given string and assigns it to the CollectionsConfigFile field. +func (o *DeployContractV1Request) SetCollectionsConfigFile(v string) { + o.CollectionsConfigFile = &v +} + +// GetChannelId returns the ChannelId field value +func (o *DeployContractV1Request) GetChannelId() string { + if o == nil { + var ret string + return ret + } + + return o.ChannelId +} + +// GetChannelIdOk returns a tuple with the ChannelId field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetChannelIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelId, true +} + +// SetChannelId sets field value +func (o *DeployContractV1Request) SetChannelId(v string) { + o.ChannelId = v +} + +// GetTargetOrganizations returns the TargetOrganizations field value +func (o *DeployContractV1Request) GetTargetOrganizations() []DeploymentTargetOrganization { + if o == nil { + var ret []DeploymentTargetOrganization + return ret + } + + return o.TargetOrganizations +} + +// GetTargetOrganizationsOk returns a tuple with the TargetOrganizations field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetTargetOrganizationsOk() ([]DeploymentTargetOrganization, bool) { + if o == nil { + return nil, false + } + return o.TargetOrganizations, true +} + +// SetTargetOrganizations sets field value +func (o *DeployContractV1Request) SetTargetOrganizations(v []DeploymentTargetOrganization) { + o.TargetOrganizations = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetConstructorArgs() DeployContractGoSourceV1RequestConstructorArgs { + if o == nil || IsNil(o.ConstructorArgs) { + var ret DeployContractGoSourceV1RequestConstructorArgs + return ret + } + return *o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetConstructorArgsOk() (*DeployContractGoSourceV1RequestConstructorArgs, bool) { + if o == nil || IsNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasConstructorArgs() bool { + if o != nil && !IsNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given DeployContractGoSourceV1RequestConstructorArgs and assigns it to the ConstructorArgs field. +func (o *DeployContractV1Request) SetConstructorArgs(v DeployContractGoSourceV1RequestConstructorArgs) { + o.ConstructorArgs = &v +} + +// GetCcSequence returns the CcSequence field value +func (o *DeployContractV1Request) GetCcSequence() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.CcSequence +} + +// GetCcSequenceOk returns a tuple with the CcSequence field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetCcSequenceOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.CcSequence, true +} + +// SetCcSequence sets field value +func (o *DeployContractV1Request) SetCcSequence(v float32) { + o.CcSequence = v +} + +// GetCcVersion returns the CcVersion field value +func (o *DeployContractV1Request) GetCcVersion() string { + if o == nil { + var ret string + return ret + } + + return o.CcVersion +} + +// GetCcVersionOk returns a tuple with the CcVersion field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetCcVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CcVersion, true +} + +// SetCcVersion sets field value +func (o *DeployContractV1Request) SetCcVersion(v string) { + o.CcVersion = v +} + +// GetCcName returns the CcName field value +func (o *DeployContractV1Request) GetCcName() string { + if o == nil { + var ret string + return ret + } + + return o.CcName +} + +// GetCcNameOk returns a tuple with the CcName field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetCcNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CcName, true +} + +// SetCcName sets field value +func (o *DeployContractV1Request) SetCcName(v string) { + o.CcName = v +} + +// GetCcLabel returns the CcLabel field value +func (o *DeployContractV1Request) GetCcLabel() string { + if o == nil { + var ret string + return ret + } + + return o.CcLabel +} + +// GetCcLabelOk returns a tuple with the CcLabel field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetCcLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CcLabel, true +} + +// SetCcLabel sets field value +func (o *DeployContractV1Request) SetCcLabel(v string) { + o.CcLabel = v +} + +// GetSourceFiles returns the SourceFiles field value +func (o *DeployContractV1Request) GetSourceFiles() []FileBase64 { + if o == nil { + var ret []FileBase64 + return ret + } + + return o.SourceFiles +} + +// GetSourceFilesOk returns a tuple with the SourceFiles field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetSourceFilesOk() ([]FileBase64, bool) { + if o == nil { + return nil, false + } + return o.SourceFiles, true +} + +// SetSourceFiles sets field value +func (o *DeployContractV1Request) SetSourceFiles(v []FileBase64) { + o.SourceFiles = v +} + +func (o DeployContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["ccLang"] = o.CcLang + toSerialize["caFile"] = o.CaFile + toSerialize["orderer"] = o.Orderer + toSerialize["ordererTLSHostnameOverride"] = o.OrdererTLSHostnameOverride + if !IsNil(o.ConnTimeout) { + toSerialize["connTimeout"] = o.ConnTimeout + } + if !IsNil(o.SignaturePolicy) { + toSerialize["signaturePolicy"] = o.SignaturePolicy + } + if !IsNil(o.CollectionsConfigFile) { + toSerialize["collectionsConfigFile"] = o.CollectionsConfigFile + } + toSerialize["channelId"] = o.ChannelId + toSerialize["targetOrganizations"] = o.TargetOrganizations + if !IsNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + toSerialize["ccSequence"] = o.CcSequence + toSerialize["ccVersion"] = o.CcVersion + toSerialize["ccName"] = o.CcName + toSerialize["ccLabel"] = o.CcLabel + toSerialize["sourceFiles"] = o.SourceFiles + return toSerialize, nil +} + +type NullableDeployContractV1Request struct { + value *DeployContractV1Request + isSet bool +} + +func (v NullableDeployContractV1Request) Get() *DeployContractV1Request { + return v.value +} + +func (v *NullableDeployContractV1Request) Set(val *DeployContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractV1Request(val *DeployContractV1Request) *NullableDeployContractV1Request { + return &NullableDeployContractV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_response.go new file mode 100644 index 00000000000..da5c210e78f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_response.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the DeployContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractV1Response{} + +// DeployContractV1Response struct for DeployContractV1Response +type DeployContractV1Response struct { + Success bool `json:"success"` + PackageIds []string `json:"packageIds"` + Lifecycle ChainCodeLifeCycleCommandResponses `json:"lifecycle"` +} + +// NewDeployContractV1Response instantiates a new DeployContractV1Response 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 +// will change when the set of required properties is changed +func NewDeployContractV1Response(success bool, packageIds []string, lifecycle ChainCodeLifeCycleCommandResponses) *DeployContractV1Response { + this := DeployContractV1Response{} + this.Success = success + this.PackageIds = packageIds + this.Lifecycle = lifecycle + return &this +} + +// NewDeployContractV1ResponseWithDefaults instantiates a new DeployContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractV1ResponseWithDefaults() *DeployContractV1Response { + this := DeployContractV1Response{} + return &this +} + +// GetSuccess returns the Success field value +func (o *DeployContractV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *DeployContractV1Response) SetSuccess(v bool) { + o.Success = v +} + +// GetPackageIds returns the PackageIds field value +func (o *DeployContractV1Response) GetPackageIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.PackageIds +} + +// GetPackageIdsOk returns a tuple with the PackageIds field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Response) GetPackageIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.PackageIds, true +} + +// SetPackageIds sets field value +func (o *DeployContractV1Response) SetPackageIds(v []string) { + o.PackageIds = v +} + +// GetLifecycle returns the Lifecycle field value +func (o *DeployContractV1Response) GetLifecycle() ChainCodeLifeCycleCommandResponses { + if o == nil { + var ret ChainCodeLifeCycleCommandResponses + return ret + } + + return o.Lifecycle +} + +// GetLifecycleOk returns a tuple with the Lifecycle field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Response) GetLifecycleOk() (*ChainCodeLifeCycleCommandResponses, bool) { + if o == nil { + return nil, false + } + return &o.Lifecycle, true +} + +// SetLifecycle sets field value +func (o *DeployContractV1Response) SetLifecycle(v ChainCodeLifeCycleCommandResponses) { + o.Lifecycle = v +} + +func (o DeployContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["success"] = o.Success + toSerialize["packageIds"] = o.PackageIds + toSerialize["lifecycle"] = o.Lifecycle + return toSerialize, nil +} + +type NullableDeployContractV1Response struct { + value *DeployContractV1Response + isSet bool +} + +func (v NullableDeployContractV1Response) Get() *DeployContractV1Response { + return v.value +} + +func (v *NullableDeployContractV1Response) Set(val *DeployContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractV1Response(val *DeployContractV1Response) *NullableDeployContractV1Response { + return &NullableDeployContractV1Response{value: val, isSet: true} +} + +func (v NullableDeployContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deployment_target_org_fabric2x.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deployment_target_org_fabric2x.go new file mode 100644 index 00000000000..dbf6245ed77 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deployment_target_org_fabric2x.go @@ -0,0 +1,267 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the DeploymentTargetOrgFabric2x type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeploymentTargetOrgFabric2x{} + +// DeploymentTargetOrgFabric2x struct for DeploymentTargetOrgFabric2x +type DeploymentTargetOrgFabric2x struct { + // Transient map of arguments in JSON encoding + Transient *string `json:"transient,omitempty"` + // Mapped to environment variables of the Fabric CLI container. + CORE_PEER_LOCALMSPID string `json:"CORE_PEER_LOCALMSPID"` + // Mapped to environment variables of the Fabric CLI container. + CORE_PEER_ADDRESS string `json:"CORE_PEER_ADDRESS"` + // Mapped to environment variables of the Fabric CLI container. + CORE_PEER_MSPCONFIGPATH string `json:"CORE_PEER_MSPCONFIGPATH"` + // Mapped to environment variables of the Fabric CLI container. + CORE_PEER_TLS_ROOTCERT_FILE string `json:"CORE_PEER_TLS_ROOTCERT_FILE"` + // Mapped to environment variables of the Fabric CLI container. + ORDERER_TLS_ROOTCERT_FILE string `json:"ORDERER_TLS_ROOTCERT_FILE"` +} + +// NewDeploymentTargetOrgFabric2x instantiates a new DeploymentTargetOrgFabric2x 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 +// will change when the set of required properties is changed +func NewDeploymentTargetOrgFabric2x(cOREPEERLOCALMSPID string, cOREPEERADDRESS string, cOREPEERMSPCONFIGPATH string, cOREPEERTLSROOTCERTFILE string, oRDERERTLSROOTCERTFILE string) *DeploymentTargetOrgFabric2x { + this := DeploymentTargetOrgFabric2x{} + this.CORE_PEER_LOCALMSPID = cOREPEERLOCALMSPID + this.CORE_PEER_ADDRESS = cOREPEERADDRESS + this.CORE_PEER_MSPCONFIGPATH = cOREPEERMSPCONFIGPATH + this.CORE_PEER_TLS_ROOTCERT_FILE = cOREPEERTLSROOTCERTFILE + this.ORDERER_TLS_ROOTCERT_FILE = oRDERERTLSROOTCERTFILE + return &this +} + +// NewDeploymentTargetOrgFabric2xWithDefaults instantiates a new DeploymentTargetOrgFabric2x object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeploymentTargetOrgFabric2xWithDefaults() *DeploymentTargetOrgFabric2x { + this := DeploymentTargetOrgFabric2x{} + return &this +} + +// GetTransient returns the Transient field value if set, zero value otherwise. +func (o *DeploymentTargetOrgFabric2x) GetTransient() string { + if o == nil || IsNil(o.Transient) { + var ret string + return ret + } + return *o.Transient +} + +// GetTransientOk returns a tuple with the Transient field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrgFabric2x) GetTransientOk() (*string, bool) { + if o == nil || IsNil(o.Transient) { + return nil, false + } + return o.Transient, true +} + +// HasTransient returns a boolean if a field has been set. +func (o *DeploymentTargetOrgFabric2x) HasTransient() bool { + if o != nil && !IsNil(o.Transient) { + return true + } + + return false +} + +// SetTransient gets a reference to the given string and assigns it to the Transient field. +func (o *DeploymentTargetOrgFabric2x) SetTransient(v string) { + o.Transient = &v +} + +// GetCORE_PEER_LOCALMSPID returns the CORE_PEER_LOCALMSPID field value +func (o *DeploymentTargetOrgFabric2x) GetCORE_PEER_LOCALMSPID() string { + if o == nil { + var ret string + return ret + } + + return o.CORE_PEER_LOCALMSPID +} + +// GetCORE_PEER_LOCALMSPIDOk returns a tuple with the CORE_PEER_LOCALMSPID field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrgFabric2x) GetCORE_PEER_LOCALMSPIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CORE_PEER_LOCALMSPID, true +} + +// SetCORE_PEER_LOCALMSPID sets field value +func (o *DeploymentTargetOrgFabric2x) SetCORE_PEER_LOCALMSPID(v string) { + o.CORE_PEER_LOCALMSPID = v +} + +// GetCORE_PEER_ADDRESS returns the CORE_PEER_ADDRESS field value +func (o *DeploymentTargetOrgFabric2x) GetCORE_PEER_ADDRESS() string { + if o == nil { + var ret string + return ret + } + + return o.CORE_PEER_ADDRESS +} + +// GetCORE_PEER_ADDRESSOk returns a tuple with the CORE_PEER_ADDRESS field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrgFabric2x) GetCORE_PEER_ADDRESSOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CORE_PEER_ADDRESS, true +} + +// SetCORE_PEER_ADDRESS sets field value +func (o *DeploymentTargetOrgFabric2x) SetCORE_PEER_ADDRESS(v string) { + o.CORE_PEER_ADDRESS = v +} + +// GetCORE_PEER_MSPCONFIGPATH returns the CORE_PEER_MSPCONFIGPATH field value +func (o *DeploymentTargetOrgFabric2x) GetCORE_PEER_MSPCONFIGPATH() string { + if o == nil { + var ret string + return ret + } + + return o.CORE_PEER_MSPCONFIGPATH +} + +// GetCORE_PEER_MSPCONFIGPATHOk returns a tuple with the CORE_PEER_MSPCONFIGPATH field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrgFabric2x) GetCORE_PEER_MSPCONFIGPATHOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CORE_PEER_MSPCONFIGPATH, true +} + +// SetCORE_PEER_MSPCONFIGPATH sets field value +func (o *DeploymentTargetOrgFabric2x) SetCORE_PEER_MSPCONFIGPATH(v string) { + o.CORE_PEER_MSPCONFIGPATH = v +} + +// GetCORE_PEER_TLS_ROOTCERT_FILE returns the CORE_PEER_TLS_ROOTCERT_FILE field value +func (o *DeploymentTargetOrgFabric2x) GetCORE_PEER_TLS_ROOTCERT_FILE() string { + if o == nil { + var ret string + return ret + } + + return o.CORE_PEER_TLS_ROOTCERT_FILE +} + +// GetCORE_PEER_TLS_ROOTCERT_FILEOk returns a tuple with the CORE_PEER_TLS_ROOTCERT_FILE field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrgFabric2x) GetCORE_PEER_TLS_ROOTCERT_FILEOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CORE_PEER_TLS_ROOTCERT_FILE, true +} + +// SetCORE_PEER_TLS_ROOTCERT_FILE sets field value +func (o *DeploymentTargetOrgFabric2x) SetCORE_PEER_TLS_ROOTCERT_FILE(v string) { + o.CORE_PEER_TLS_ROOTCERT_FILE = v +} + +// GetORDERER_TLS_ROOTCERT_FILE returns the ORDERER_TLS_ROOTCERT_FILE field value +func (o *DeploymentTargetOrgFabric2x) GetORDERER_TLS_ROOTCERT_FILE() string { + if o == nil { + var ret string + return ret + } + + return o.ORDERER_TLS_ROOTCERT_FILE +} + +// GetORDERER_TLS_ROOTCERT_FILEOk returns a tuple with the ORDERER_TLS_ROOTCERT_FILE field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrgFabric2x) GetORDERER_TLS_ROOTCERT_FILEOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ORDERER_TLS_ROOTCERT_FILE, true +} + +// SetORDERER_TLS_ROOTCERT_FILE sets field value +func (o *DeploymentTargetOrgFabric2x) SetORDERER_TLS_ROOTCERT_FILE(v string) { + o.ORDERER_TLS_ROOTCERT_FILE = v +} + +func (o DeploymentTargetOrgFabric2x) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeploymentTargetOrgFabric2x) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Transient) { + toSerialize["transient"] = o.Transient + } + toSerialize["CORE_PEER_LOCALMSPID"] = o.CORE_PEER_LOCALMSPID + toSerialize["CORE_PEER_ADDRESS"] = o.CORE_PEER_ADDRESS + toSerialize["CORE_PEER_MSPCONFIGPATH"] = o.CORE_PEER_MSPCONFIGPATH + toSerialize["CORE_PEER_TLS_ROOTCERT_FILE"] = o.CORE_PEER_TLS_ROOTCERT_FILE + toSerialize["ORDERER_TLS_ROOTCERT_FILE"] = o.ORDERER_TLS_ROOTCERT_FILE + return toSerialize, nil +} + +type NullableDeploymentTargetOrgFabric2x struct { + value *DeploymentTargetOrgFabric2x + isSet bool +} + +func (v NullableDeploymentTargetOrgFabric2x) Get() *DeploymentTargetOrgFabric2x { + return v.value +} + +func (v *NullableDeploymentTargetOrgFabric2x) Set(val *DeploymentTargetOrgFabric2x) { + v.value = val + v.isSet = true +} + +func (v NullableDeploymentTargetOrgFabric2x) IsSet() bool { + return v.isSet +} + +func (v *NullableDeploymentTargetOrgFabric2x) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeploymentTargetOrgFabric2x(val *DeploymentTargetOrgFabric2x) *NullableDeploymentTargetOrgFabric2x { + return &NullableDeploymentTargetOrgFabric2x{value: val, isSet: true} +} + +func (v NullableDeploymentTargetOrgFabric2x) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeploymentTargetOrgFabric2x) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deployment_target_organization.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deployment_target_organization.go new file mode 100644 index 00000000000..efecb744876 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_deployment_target_organization.go @@ -0,0 +1,230 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the DeploymentTargetOrganization type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeploymentTargetOrganization{} + +// DeploymentTargetOrganization struct for DeploymentTargetOrganization +type DeploymentTargetOrganization struct { + // Mapped to environment variables of the Fabric CLI container. + CORE_PEER_LOCALMSPID string `json:"CORE_PEER_LOCALMSPID"` + // Mapped to environment variables of the Fabric CLI container. + CORE_PEER_ADDRESS string `json:"CORE_PEER_ADDRESS"` + // Mapped to environment variables of the Fabric CLI container. + CORE_PEER_MSPCONFIGPATH string `json:"CORE_PEER_MSPCONFIGPATH"` + // Mapped to environment variables of the Fabric CLI container. + CORE_PEER_TLS_ROOTCERT_FILE string `json:"CORE_PEER_TLS_ROOTCERT_FILE"` + // Mapped to environment variables of the Fabric CLI container. + ORDERER_TLS_ROOTCERT_FILE string `json:"ORDERER_TLS_ROOTCERT_FILE"` +} + +// NewDeploymentTargetOrganization instantiates a new DeploymentTargetOrganization 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 +// will change when the set of required properties is changed +func NewDeploymentTargetOrganization(cOREPEERLOCALMSPID string, cOREPEERADDRESS string, cOREPEERMSPCONFIGPATH string, cOREPEERTLSROOTCERTFILE string, oRDERERTLSROOTCERTFILE string) *DeploymentTargetOrganization { + this := DeploymentTargetOrganization{} + this.CORE_PEER_LOCALMSPID = cOREPEERLOCALMSPID + this.CORE_PEER_ADDRESS = cOREPEERADDRESS + this.CORE_PEER_MSPCONFIGPATH = cOREPEERMSPCONFIGPATH + this.CORE_PEER_TLS_ROOTCERT_FILE = cOREPEERTLSROOTCERTFILE + this.ORDERER_TLS_ROOTCERT_FILE = oRDERERTLSROOTCERTFILE + return &this +} + +// NewDeploymentTargetOrganizationWithDefaults instantiates a new DeploymentTargetOrganization object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeploymentTargetOrganizationWithDefaults() *DeploymentTargetOrganization { + this := DeploymentTargetOrganization{} + return &this +} + +// GetCORE_PEER_LOCALMSPID returns the CORE_PEER_LOCALMSPID field value +func (o *DeploymentTargetOrganization) GetCORE_PEER_LOCALMSPID() string { + if o == nil { + var ret string + return ret + } + + return o.CORE_PEER_LOCALMSPID +} + +// GetCORE_PEER_LOCALMSPIDOk returns a tuple with the CORE_PEER_LOCALMSPID field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrganization) GetCORE_PEER_LOCALMSPIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CORE_PEER_LOCALMSPID, true +} + +// SetCORE_PEER_LOCALMSPID sets field value +func (o *DeploymentTargetOrganization) SetCORE_PEER_LOCALMSPID(v string) { + o.CORE_PEER_LOCALMSPID = v +} + +// GetCORE_PEER_ADDRESS returns the CORE_PEER_ADDRESS field value +func (o *DeploymentTargetOrganization) GetCORE_PEER_ADDRESS() string { + if o == nil { + var ret string + return ret + } + + return o.CORE_PEER_ADDRESS +} + +// GetCORE_PEER_ADDRESSOk returns a tuple with the CORE_PEER_ADDRESS field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrganization) GetCORE_PEER_ADDRESSOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CORE_PEER_ADDRESS, true +} + +// SetCORE_PEER_ADDRESS sets field value +func (o *DeploymentTargetOrganization) SetCORE_PEER_ADDRESS(v string) { + o.CORE_PEER_ADDRESS = v +} + +// GetCORE_PEER_MSPCONFIGPATH returns the CORE_PEER_MSPCONFIGPATH field value +func (o *DeploymentTargetOrganization) GetCORE_PEER_MSPCONFIGPATH() string { + if o == nil { + var ret string + return ret + } + + return o.CORE_PEER_MSPCONFIGPATH +} + +// GetCORE_PEER_MSPCONFIGPATHOk returns a tuple with the CORE_PEER_MSPCONFIGPATH field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrganization) GetCORE_PEER_MSPCONFIGPATHOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CORE_PEER_MSPCONFIGPATH, true +} + +// SetCORE_PEER_MSPCONFIGPATH sets field value +func (o *DeploymentTargetOrganization) SetCORE_PEER_MSPCONFIGPATH(v string) { + o.CORE_PEER_MSPCONFIGPATH = v +} + +// GetCORE_PEER_TLS_ROOTCERT_FILE returns the CORE_PEER_TLS_ROOTCERT_FILE field value +func (o *DeploymentTargetOrganization) GetCORE_PEER_TLS_ROOTCERT_FILE() string { + if o == nil { + var ret string + return ret + } + + return o.CORE_PEER_TLS_ROOTCERT_FILE +} + +// GetCORE_PEER_TLS_ROOTCERT_FILEOk returns a tuple with the CORE_PEER_TLS_ROOTCERT_FILE field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrganization) GetCORE_PEER_TLS_ROOTCERT_FILEOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CORE_PEER_TLS_ROOTCERT_FILE, true +} + +// SetCORE_PEER_TLS_ROOTCERT_FILE sets field value +func (o *DeploymentTargetOrganization) SetCORE_PEER_TLS_ROOTCERT_FILE(v string) { + o.CORE_PEER_TLS_ROOTCERT_FILE = v +} + +// GetORDERER_TLS_ROOTCERT_FILE returns the ORDERER_TLS_ROOTCERT_FILE field value +func (o *DeploymentTargetOrganization) GetORDERER_TLS_ROOTCERT_FILE() string { + if o == nil { + var ret string + return ret + } + + return o.ORDERER_TLS_ROOTCERT_FILE +} + +// GetORDERER_TLS_ROOTCERT_FILEOk returns a tuple with the ORDERER_TLS_ROOTCERT_FILE field value +// and a boolean to check if the value has been set. +func (o *DeploymentTargetOrganization) GetORDERER_TLS_ROOTCERT_FILEOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ORDERER_TLS_ROOTCERT_FILE, true +} + +// SetORDERER_TLS_ROOTCERT_FILE sets field value +func (o *DeploymentTargetOrganization) SetORDERER_TLS_ROOTCERT_FILE(v string) { + o.ORDERER_TLS_ROOTCERT_FILE = v +} + +func (o DeploymentTargetOrganization) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeploymentTargetOrganization) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["CORE_PEER_LOCALMSPID"] = o.CORE_PEER_LOCALMSPID + toSerialize["CORE_PEER_ADDRESS"] = o.CORE_PEER_ADDRESS + toSerialize["CORE_PEER_MSPCONFIGPATH"] = o.CORE_PEER_MSPCONFIGPATH + toSerialize["CORE_PEER_TLS_ROOTCERT_FILE"] = o.CORE_PEER_TLS_ROOTCERT_FILE + toSerialize["ORDERER_TLS_ROOTCERT_FILE"] = o.ORDERER_TLS_ROOTCERT_FILE + return toSerialize, nil +} + +type NullableDeploymentTargetOrganization struct { + value *DeploymentTargetOrganization + isSet bool +} + +func (v NullableDeploymentTargetOrganization) Get() *DeploymentTargetOrganization { + return v.value +} + +func (v *NullableDeploymentTargetOrganization) Set(val *DeploymentTargetOrganization) { + v.value = val + v.isSet = true +} + +func (v NullableDeploymentTargetOrganization) IsSet() bool { + return v.isSet +} + +func (v *NullableDeploymentTargetOrganization) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeploymentTargetOrganization(val *DeploymentTargetOrganization) *NullableDeploymentTargetOrganization { + return &NullableDeploymentTargetOrganization{value: val, isSet: true} +} + +func (v NullableDeploymentTargetOrganization) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeploymentTargetOrganization) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go new file mode 100644 index 00000000000..f49e6ee4052 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the ErrorExceptionResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorExceptionResponseV1{} + +// ErrorExceptionResponseV1 struct for ErrorExceptionResponseV1 +type ErrorExceptionResponseV1 struct { + Message string `json:"message"` + Error string `json:"error"` +} + +// NewErrorExceptionResponseV1 instantiates a new ErrorExceptionResponseV1 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 +// will change when the set of required properties is changed +func NewErrorExceptionResponseV1(message string, error_ string) *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + this.Message = message + this.Error = error_ + return &this +} + +// NewErrorExceptionResponseV1WithDefaults instantiates a new ErrorExceptionResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorExceptionResponseV1WithDefaults() *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + return &this +} + +// GetMessage returns the Message field value +func (o *ErrorExceptionResponseV1) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ErrorExceptionResponseV1) SetMessage(v string) { + o.Message = v +} + +// GetError returns the Error field value +func (o *ErrorExceptionResponseV1) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *ErrorExceptionResponseV1) SetError(v string) { + o.Error = v +} + +func (o ErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorExceptionResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + toSerialize["error"] = o.Error + return toSerialize, nil +} + +type NullableErrorExceptionResponseV1 struct { + value *ErrorExceptionResponseV1 + isSet bool +} + +func (v NullableErrorExceptionResponseV1) Get() *ErrorExceptionResponseV1 { + return v.value +} + +func (v *NullableErrorExceptionResponseV1) Set(val *ErrorExceptionResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableErrorExceptionResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorExceptionResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorExceptionResponseV1(val *ErrorExceptionResponseV1) *NullableErrorExceptionResponseV1 { + return &NullableErrorExceptionResponseV1{value: val, isSet: true} +} + +func (v NullableErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorExceptionResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_contract_invocation_type.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_contract_invocation_type.go new file mode 100644 index 00000000000..84b5b3e0e72 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_contract_invocation_type.go @@ -0,0 +1,113 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// FabricContractInvocationType the model 'FabricContractInvocationType' +type FabricContractInvocationType string + +// List of FabricContractInvocationType +const ( + SEND FabricContractInvocationType = "FabricContractInvocationType.SEND" + CALL FabricContractInvocationType = "FabricContractInvocationType.CALL" + SENDPRIVATE FabricContractInvocationType = "FabricContractInvocationType.SENDPRIVATE" +) + +// All allowed values of FabricContractInvocationType enum +var AllowedFabricContractInvocationTypeEnumValues = []FabricContractInvocationType{ + "FabricContractInvocationType.SEND", + "FabricContractInvocationType.CALL", + "FabricContractInvocationType.SENDPRIVATE", +} + +func (v *FabricContractInvocationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FabricContractInvocationType(value) + for _, existing := range AllowedFabricContractInvocationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FabricContractInvocationType", value) +} + +// NewFabricContractInvocationTypeFromValue returns a pointer to a valid FabricContractInvocationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFabricContractInvocationTypeFromValue(v string) (*FabricContractInvocationType, error) { + ev := FabricContractInvocationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FabricContractInvocationType: valid values are %v", v, AllowedFabricContractInvocationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FabricContractInvocationType) IsValid() bool { + for _, existing := range AllowedFabricContractInvocationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FabricContractInvocationType value +func (v FabricContractInvocationType) Ptr() *FabricContractInvocationType { + return &v +} + +type NullableFabricContractInvocationType struct { + value *FabricContractInvocationType + isSet bool +} + +func (v NullableFabricContractInvocationType) Get() *FabricContractInvocationType { + return v.value +} + +func (v *NullableFabricContractInvocationType) Set(val *FabricContractInvocationType) { + v.value = val + v.isSet = true +} + +func (v NullableFabricContractInvocationType) IsSet() bool { + return v.isSet +} + +func (v *NullableFabricContractInvocationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFabricContractInvocationType(val *FabricContractInvocationType) *NullableFabricContractInvocationType { + return &NullableFabricContractInvocationType{value: val, isSet: true} +} + +func (v NullableFabricContractInvocationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFabricContractInvocationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_signing_credential.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_signing_credential.go new file mode 100644 index 00000000000..f13788b3c33 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_signing_credential.go @@ -0,0 +1,252 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the FabricSigningCredential type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FabricSigningCredential{} + +// FabricSigningCredential struct for FabricSigningCredential +type FabricSigningCredential struct { + KeychainId string `json:"keychainId"` + KeychainRef string `json:"keychainRef"` + Type *FabricSigningCredentialType `json:"type,omitempty"` + VaultTransitKey *VaultTransitKey `json:"vaultTransitKey,omitempty"` + WebSocketKey *WebSocketKey `json:"webSocketKey,omitempty"` +} + +// NewFabricSigningCredential instantiates a new FabricSigningCredential 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 +// will change when the set of required properties is changed +func NewFabricSigningCredential(keychainId string, keychainRef string) *FabricSigningCredential { + this := FabricSigningCredential{} + this.KeychainId = keychainId + this.KeychainRef = keychainRef + return &this +} + +// NewFabricSigningCredentialWithDefaults instantiates a new FabricSigningCredential object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFabricSigningCredentialWithDefaults() *FabricSigningCredential { + this := FabricSigningCredential{} + return &this +} + +// GetKeychainId returns the KeychainId field value +func (o *FabricSigningCredential) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *FabricSigningCredential) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *FabricSigningCredential) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetKeychainRef returns the KeychainRef field value +func (o *FabricSigningCredential) GetKeychainRef() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainRef +} + +// GetKeychainRefOk returns a tuple with the KeychainRef field value +// and a boolean to check if the value has been set. +func (o *FabricSigningCredential) GetKeychainRefOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainRef, true +} + +// SetKeychainRef sets field value +func (o *FabricSigningCredential) SetKeychainRef(v string) { + o.KeychainRef = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *FabricSigningCredential) GetType() FabricSigningCredentialType { + if o == nil || IsNil(o.Type) { + var ret FabricSigningCredentialType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FabricSigningCredential) GetTypeOk() (*FabricSigningCredentialType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *FabricSigningCredential) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given FabricSigningCredentialType and assigns it to the Type field. +func (o *FabricSigningCredential) SetType(v FabricSigningCredentialType) { + o.Type = &v +} + +// GetVaultTransitKey returns the VaultTransitKey field value if set, zero value otherwise. +func (o *FabricSigningCredential) GetVaultTransitKey() VaultTransitKey { + if o == nil || IsNil(o.VaultTransitKey) { + var ret VaultTransitKey + return ret + } + return *o.VaultTransitKey +} + +// GetVaultTransitKeyOk returns a tuple with the VaultTransitKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FabricSigningCredential) GetVaultTransitKeyOk() (*VaultTransitKey, bool) { + if o == nil || IsNil(o.VaultTransitKey) { + return nil, false + } + return o.VaultTransitKey, true +} + +// HasVaultTransitKey returns a boolean if a field has been set. +func (o *FabricSigningCredential) HasVaultTransitKey() bool { + if o != nil && !IsNil(o.VaultTransitKey) { + return true + } + + return false +} + +// SetVaultTransitKey gets a reference to the given VaultTransitKey and assigns it to the VaultTransitKey field. +func (o *FabricSigningCredential) SetVaultTransitKey(v VaultTransitKey) { + o.VaultTransitKey = &v +} + +// GetWebSocketKey returns the WebSocketKey field value if set, zero value otherwise. +func (o *FabricSigningCredential) GetWebSocketKey() WebSocketKey { + if o == nil || IsNil(o.WebSocketKey) { + var ret WebSocketKey + return ret + } + return *o.WebSocketKey +} + +// GetWebSocketKeyOk returns a tuple with the WebSocketKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FabricSigningCredential) GetWebSocketKeyOk() (*WebSocketKey, bool) { + if o == nil || IsNil(o.WebSocketKey) { + return nil, false + } + return o.WebSocketKey, true +} + +// HasWebSocketKey returns a boolean if a field has been set. +func (o *FabricSigningCredential) HasWebSocketKey() bool { + if o != nil && !IsNil(o.WebSocketKey) { + return true + } + + return false +} + +// SetWebSocketKey gets a reference to the given WebSocketKey and assigns it to the WebSocketKey field. +func (o *FabricSigningCredential) SetWebSocketKey(v WebSocketKey) { + o.WebSocketKey = &v +} + +func (o FabricSigningCredential) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FabricSigningCredential) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["keychainId"] = o.KeychainId + toSerialize["keychainRef"] = o.KeychainRef + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.VaultTransitKey) { + toSerialize["vaultTransitKey"] = o.VaultTransitKey + } + if !IsNil(o.WebSocketKey) { + toSerialize["webSocketKey"] = o.WebSocketKey + } + return toSerialize, nil +} + +type NullableFabricSigningCredential struct { + value *FabricSigningCredential + isSet bool +} + +func (v NullableFabricSigningCredential) Get() *FabricSigningCredential { + return v.value +} + +func (v *NullableFabricSigningCredential) Set(val *FabricSigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableFabricSigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableFabricSigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFabricSigningCredential(val *FabricSigningCredential) *NullableFabricSigningCredential { + return &NullableFabricSigningCredential{value: val, isSet: true} +} + +func (v NullableFabricSigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFabricSigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_signing_credential_type.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_signing_credential_type.go new file mode 100644 index 00000000000..b48c4d1c3f8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_signing_credential_type.go @@ -0,0 +1,113 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// FabricSigningCredentialType different type of identity provider for singing fabric messages supported by this package +type FabricSigningCredentialType string + +// List of FabricSigningCredentialType +const ( + X_509 FabricSigningCredentialType = "X.509" + VAULT_X_509 FabricSigningCredentialType = "Vault-X.509" + WS_X_509 FabricSigningCredentialType = "WS-X.509" +) + +// All allowed values of FabricSigningCredentialType enum +var AllowedFabricSigningCredentialTypeEnumValues = []FabricSigningCredentialType{ + "X.509", + "Vault-X.509", + "WS-X.509", +} + +func (v *FabricSigningCredentialType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FabricSigningCredentialType(value) + for _, existing := range AllowedFabricSigningCredentialTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FabricSigningCredentialType", value) +} + +// NewFabricSigningCredentialTypeFromValue returns a pointer to a valid FabricSigningCredentialType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFabricSigningCredentialTypeFromValue(v string) (*FabricSigningCredentialType, error) { + ev := FabricSigningCredentialType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FabricSigningCredentialType: valid values are %v", v, AllowedFabricSigningCredentialTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FabricSigningCredentialType) IsValid() bool { + for _, existing := range AllowedFabricSigningCredentialTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FabricSigningCredentialType value +func (v FabricSigningCredentialType) Ptr() *FabricSigningCredentialType { + return &v +} + +type NullableFabricSigningCredentialType struct { + value *FabricSigningCredentialType + isSet bool +} + +func (v NullableFabricSigningCredentialType) Get() *FabricSigningCredentialType { + return v.value +} + +func (v *NullableFabricSigningCredentialType) Set(val *FabricSigningCredentialType) { + v.value = val + v.isSet = true +} + +func (v NullableFabricSigningCredentialType) IsSet() bool { + return v.isSet +} + +func (v *NullableFabricSigningCredentialType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFabricSigningCredentialType(val *FabricSigningCredentialType) *NullableFabricSigningCredentialType { + return &NullableFabricSigningCredentialType{value: val, isSet: true} +} + +func (v NullableFabricSigningCredentialType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFabricSigningCredentialType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_file_base64.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_file_base64.go new file mode 100644 index 00000000000..b84eca67052 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_file_base64.go @@ -0,0 +1,183 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the FileBase64 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FileBase64{} + +// FileBase64 Represents a file-system file that has a name and a body which holds the file contents as a Base64 encoded string +type FileBase64 struct { + // The file's contents encoded as a Base64 string. + Body string `json:"body"` + // The name as referred to on a file system + Filename string `json:"filename"` + // The relative path of the file, if it should be placed in a sub-directory + Filepath *string `json:"filepath,omitempty"` +} + +// NewFileBase64 instantiates a new FileBase64 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 +// will change when the set of required properties is changed +func NewFileBase64(body string, filename string) *FileBase64 { + this := FileBase64{} + this.Body = body + this.Filename = filename + return &this +} + +// NewFileBase64WithDefaults instantiates a new FileBase64 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFileBase64WithDefaults() *FileBase64 { + this := FileBase64{} + return &this +} + +// GetBody returns the Body field value +func (o *FileBase64) GetBody() string { + if o == nil { + var ret string + return ret + } + + return o.Body +} + +// GetBodyOk returns a tuple with the Body field value +// and a boolean to check if the value has been set. +func (o *FileBase64) GetBodyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Body, true +} + +// SetBody sets field value +func (o *FileBase64) SetBody(v string) { + o.Body = v +} + +// GetFilename returns the Filename field value +func (o *FileBase64) GetFilename() string { + if o == nil { + var ret string + return ret + } + + return o.Filename +} + +// GetFilenameOk returns a tuple with the Filename field value +// and a boolean to check if the value has been set. +func (o *FileBase64) GetFilenameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Filename, true +} + +// SetFilename sets field value +func (o *FileBase64) SetFilename(v string) { + o.Filename = v +} + +// GetFilepath returns the Filepath field value if set, zero value otherwise. +func (o *FileBase64) GetFilepath() string { + if o == nil || IsNil(o.Filepath) { + var ret string + return ret + } + return *o.Filepath +} + +// GetFilepathOk returns a tuple with the Filepath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FileBase64) GetFilepathOk() (*string, bool) { + if o == nil || IsNil(o.Filepath) { + return nil, false + } + return o.Filepath, true +} + +// HasFilepath returns a boolean if a field has been set. +func (o *FileBase64) HasFilepath() bool { + if o != nil && !IsNil(o.Filepath) { + return true + } + + return false +} + +// SetFilepath gets a reference to the given string and assigns it to the Filepath field. +func (o *FileBase64) SetFilepath(v string) { + o.Filepath = &v +} + +func (o FileBase64) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FileBase64) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["body"] = o.Body + toSerialize["filename"] = o.Filename + if !IsNil(o.Filepath) { + toSerialize["filepath"] = o.Filepath + } + return toSerialize, nil +} + +type NullableFileBase64 struct { + value *FileBase64 + isSet bool +} + +func (v NullableFileBase64) Get() *FileBase64 { + return v.value +} + +func (v *NullableFileBase64) Set(val *FileBase64) { + v.value = val + v.isSet = true +} + +func (v NullableFileBase64) IsSet() bool { + return v.isSet +} + +func (v *NullableFileBase64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFileBase64(val *FileBase64) *NullableFileBase64 { + return &NullableFileBase64{value: val, isSet: true} +} + +func (v NullableFileBase64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFileBase64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_discovery_options.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_discovery_options.go new file mode 100644 index 00000000000..eea7fa633fe --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_discovery_options.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GatewayDiscoveryOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GatewayDiscoveryOptions{} + +// GatewayDiscoveryOptions struct for GatewayDiscoveryOptions +type GatewayDiscoveryOptions struct { + AsLocalhost *bool `json:"asLocalhost,omitempty"` + Enabled *bool `json:"enabled,omitempty"` +} + +// NewGatewayDiscoveryOptions instantiates a new GatewayDiscoveryOptions 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 +// will change when the set of required properties is changed +func NewGatewayDiscoveryOptions() *GatewayDiscoveryOptions { + this := GatewayDiscoveryOptions{} + return &this +} + +// NewGatewayDiscoveryOptionsWithDefaults instantiates a new GatewayDiscoveryOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGatewayDiscoveryOptionsWithDefaults() *GatewayDiscoveryOptions { + this := GatewayDiscoveryOptions{} + return &this +} + +// GetAsLocalhost returns the AsLocalhost field value if set, zero value otherwise. +func (o *GatewayDiscoveryOptions) GetAsLocalhost() bool { + if o == nil || IsNil(o.AsLocalhost) { + var ret bool + return ret + } + return *o.AsLocalhost +} + +// GetAsLocalhostOk returns a tuple with the AsLocalhost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayDiscoveryOptions) GetAsLocalhostOk() (*bool, bool) { + if o == nil || IsNil(o.AsLocalhost) { + return nil, false + } + return o.AsLocalhost, true +} + +// HasAsLocalhost returns a boolean if a field has been set. +func (o *GatewayDiscoveryOptions) HasAsLocalhost() bool { + if o != nil && !IsNil(o.AsLocalhost) { + return true + } + + return false +} + +// SetAsLocalhost gets a reference to the given bool and assigns it to the AsLocalhost field. +func (o *GatewayDiscoveryOptions) SetAsLocalhost(v bool) { + o.AsLocalhost = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *GatewayDiscoveryOptions) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayDiscoveryOptions) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *GatewayDiscoveryOptions) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *GatewayDiscoveryOptions) SetEnabled(v bool) { + o.Enabled = &v +} + +func (o GatewayDiscoveryOptions) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GatewayDiscoveryOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AsLocalhost) { + toSerialize["asLocalhost"] = o.AsLocalhost + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + return toSerialize, nil +} + +type NullableGatewayDiscoveryOptions struct { + value *GatewayDiscoveryOptions + isSet bool +} + +func (v NullableGatewayDiscoveryOptions) Get() *GatewayDiscoveryOptions { + return v.value +} + +func (v *NullableGatewayDiscoveryOptions) Set(val *GatewayDiscoveryOptions) { + v.value = val + v.isSet = true +} + +func (v NullableGatewayDiscoveryOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableGatewayDiscoveryOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGatewayDiscoveryOptions(val *GatewayDiscoveryOptions) *NullableGatewayDiscoveryOptions { + return &NullableGatewayDiscoveryOptions{value: val, isSet: true} +} + +func (v NullableGatewayDiscoveryOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGatewayDiscoveryOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_event_handler_options.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_event_handler_options.go new file mode 100644 index 00000000000..c9b025bdd55 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_event_handler_options.go @@ -0,0 +1,189 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GatewayEventHandlerOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GatewayEventHandlerOptions{} + +// GatewayEventHandlerOptions struct for GatewayEventHandlerOptions +type GatewayEventHandlerOptions struct { + CommitTimeout *float32 `json:"commitTimeout,omitempty"` + EndorseTimeout *float32 `json:"endorseTimeout,omitempty"` + Strategy DefaultEventHandlerStrategy `json:"strategy"` +} + +// NewGatewayEventHandlerOptions instantiates a new GatewayEventHandlerOptions 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 +// will change when the set of required properties is changed +func NewGatewayEventHandlerOptions(strategy DefaultEventHandlerStrategy) *GatewayEventHandlerOptions { + this := GatewayEventHandlerOptions{} + this.Strategy = strategy + return &this +} + +// NewGatewayEventHandlerOptionsWithDefaults instantiates a new GatewayEventHandlerOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGatewayEventHandlerOptionsWithDefaults() *GatewayEventHandlerOptions { + this := GatewayEventHandlerOptions{} + return &this +} + +// GetCommitTimeout returns the CommitTimeout field value if set, zero value otherwise. +func (o *GatewayEventHandlerOptions) GetCommitTimeout() float32 { + if o == nil || IsNil(o.CommitTimeout) { + var ret float32 + return ret + } + return *o.CommitTimeout +} + +// GetCommitTimeoutOk returns a tuple with the CommitTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayEventHandlerOptions) GetCommitTimeoutOk() (*float32, bool) { + if o == nil || IsNil(o.CommitTimeout) { + return nil, false + } + return o.CommitTimeout, true +} + +// HasCommitTimeout returns a boolean if a field has been set. +func (o *GatewayEventHandlerOptions) HasCommitTimeout() bool { + if o != nil && !IsNil(o.CommitTimeout) { + return true + } + + return false +} + +// SetCommitTimeout gets a reference to the given float32 and assigns it to the CommitTimeout field. +func (o *GatewayEventHandlerOptions) SetCommitTimeout(v float32) { + o.CommitTimeout = &v +} + +// GetEndorseTimeout returns the EndorseTimeout field value if set, zero value otherwise. +func (o *GatewayEventHandlerOptions) GetEndorseTimeout() float32 { + if o == nil || IsNil(o.EndorseTimeout) { + var ret float32 + return ret + } + return *o.EndorseTimeout +} + +// GetEndorseTimeoutOk returns a tuple with the EndorseTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayEventHandlerOptions) GetEndorseTimeoutOk() (*float32, bool) { + if o == nil || IsNil(o.EndorseTimeout) { + return nil, false + } + return o.EndorseTimeout, true +} + +// HasEndorseTimeout returns a boolean if a field has been set. +func (o *GatewayEventHandlerOptions) HasEndorseTimeout() bool { + if o != nil && !IsNil(o.EndorseTimeout) { + return true + } + + return false +} + +// SetEndorseTimeout gets a reference to the given float32 and assigns it to the EndorseTimeout field. +func (o *GatewayEventHandlerOptions) SetEndorseTimeout(v float32) { + o.EndorseTimeout = &v +} + +// GetStrategy returns the Strategy field value +func (o *GatewayEventHandlerOptions) GetStrategy() DefaultEventHandlerStrategy { + if o == nil { + var ret DefaultEventHandlerStrategy + return ret + } + + return o.Strategy +} + +// GetStrategyOk returns a tuple with the Strategy field value +// and a boolean to check if the value has been set. +func (o *GatewayEventHandlerOptions) GetStrategyOk() (*DefaultEventHandlerStrategy, bool) { + if o == nil { + return nil, false + } + return &o.Strategy, true +} + +// SetStrategy sets field value +func (o *GatewayEventHandlerOptions) SetStrategy(v DefaultEventHandlerStrategy) { + o.Strategy = v +} + +func (o GatewayEventHandlerOptions) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GatewayEventHandlerOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CommitTimeout) { + toSerialize["commitTimeout"] = o.CommitTimeout + } + if !IsNil(o.EndorseTimeout) { + toSerialize["endorseTimeout"] = o.EndorseTimeout + } + toSerialize["strategy"] = o.Strategy + return toSerialize, nil +} + +type NullableGatewayEventHandlerOptions struct { + value *GatewayEventHandlerOptions + isSet bool +} + +func (v NullableGatewayEventHandlerOptions) Get() *GatewayEventHandlerOptions { + return v.value +} + +func (v *NullableGatewayEventHandlerOptions) Set(val *GatewayEventHandlerOptions) { + v.value = val + v.isSet = true +} + +func (v NullableGatewayEventHandlerOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableGatewayEventHandlerOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGatewayEventHandlerOptions(val *GatewayEventHandlerOptions) *NullableGatewayEventHandlerOptions { + return &NullableGatewayEventHandlerOptions{value: val, isSet: true} +} + +func (v NullableGatewayEventHandlerOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGatewayEventHandlerOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_options.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_options.go new file mode 100644 index 00000000000..729a35b7021 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_options.go @@ -0,0 +1,252 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GatewayOptions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GatewayOptions{} + +// GatewayOptions struct for GatewayOptions +type GatewayOptions struct { + ConnectionProfile *ConnectionProfile `json:"connectionProfile,omitempty"` + Discovery *GatewayDiscoveryOptions `json:"discovery,omitempty"` + EventHandlerOptions *GatewayEventHandlerOptions `json:"eventHandlerOptions,omitempty"` + Identity string `json:"identity"` + Wallet GatewayOptionsWallet `json:"wallet"` +} + +// NewGatewayOptions instantiates a new GatewayOptions 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 +// will change when the set of required properties is changed +func NewGatewayOptions(identity string, wallet GatewayOptionsWallet) *GatewayOptions { + this := GatewayOptions{} + this.Identity = identity + this.Wallet = wallet + return &this +} + +// NewGatewayOptionsWithDefaults instantiates a new GatewayOptions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGatewayOptionsWithDefaults() *GatewayOptions { + this := GatewayOptions{} + return &this +} + +// GetConnectionProfile returns the ConnectionProfile field value if set, zero value otherwise. +func (o *GatewayOptions) GetConnectionProfile() ConnectionProfile { + if o == nil || IsNil(o.ConnectionProfile) { + var ret ConnectionProfile + return ret + } + return *o.ConnectionProfile +} + +// GetConnectionProfileOk returns a tuple with the ConnectionProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayOptions) GetConnectionProfileOk() (*ConnectionProfile, bool) { + if o == nil || IsNil(o.ConnectionProfile) { + return nil, false + } + return o.ConnectionProfile, true +} + +// HasConnectionProfile returns a boolean if a field has been set. +func (o *GatewayOptions) HasConnectionProfile() bool { + if o != nil && !IsNil(o.ConnectionProfile) { + return true + } + + return false +} + +// SetConnectionProfile gets a reference to the given ConnectionProfile and assigns it to the ConnectionProfile field. +func (o *GatewayOptions) SetConnectionProfile(v ConnectionProfile) { + o.ConnectionProfile = &v +} + +// GetDiscovery returns the Discovery field value if set, zero value otherwise. +func (o *GatewayOptions) GetDiscovery() GatewayDiscoveryOptions { + if o == nil || IsNil(o.Discovery) { + var ret GatewayDiscoveryOptions + return ret + } + return *o.Discovery +} + +// GetDiscoveryOk returns a tuple with the Discovery field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayOptions) GetDiscoveryOk() (*GatewayDiscoveryOptions, bool) { + if o == nil || IsNil(o.Discovery) { + return nil, false + } + return o.Discovery, true +} + +// HasDiscovery returns a boolean if a field has been set. +func (o *GatewayOptions) HasDiscovery() bool { + if o != nil && !IsNil(o.Discovery) { + return true + } + + return false +} + +// SetDiscovery gets a reference to the given GatewayDiscoveryOptions and assigns it to the Discovery field. +func (o *GatewayOptions) SetDiscovery(v GatewayDiscoveryOptions) { + o.Discovery = &v +} + +// GetEventHandlerOptions returns the EventHandlerOptions field value if set, zero value otherwise. +func (o *GatewayOptions) GetEventHandlerOptions() GatewayEventHandlerOptions { + if o == nil || IsNil(o.EventHandlerOptions) { + var ret GatewayEventHandlerOptions + return ret + } + return *o.EventHandlerOptions +} + +// GetEventHandlerOptionsOk returns a tuple with the EventHandlerOptions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayOptions) GetEventHandlerOptionsOk() (*GatewayEventHandlerOptions, bool) { + if o == nil || IsNil(o.EventHandlerOptions) { + return nil, false + } + return o.EventHandlerOptions, true +} + +// HasEventHandlerOptions returns a boolean if a field has been set. +func (o *GatewayOptions) HasEventHandlerOptions() bool { + if o != nil && !IsNil(o.EventHandlerOptions) { + return true + } + + return false +} + +// SetEventHandlerOptions gets a reference to the given GatewayEventHandlerOptions and assigns it to the EventHandlerOptions field. +func (o *GatewayOptions) SetEventHandlerOptions(v GatewayEventHandlerOptions) { + o.EventHandlerOptions = &v +} + +// GetIdentity returns the Identity field value +func (o *GatewayOptions) GetIdentity() string { + if o == nil { + var ret string + return ret + } + + return o.Identity +} + +// GetIdentityOk returns a tuple with the Identity field value +// and a boolean to check if the value has been set. +func (o *GatewayOptions) GetIdentityOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identity, true +} + +// SetIdentity sets field value +func (o *GatewayOptions) SetIdentity(v string) { + o.Identity = v +} + +// GetWallet returns the Wallet field value +func (o *GatewayOptions) GetWallet() GatewayOptionsWallet { + if o == nil { + var ret GatewayOptionsWallet + return ret + } + + return o.Wallet +} + +// GetWalletOk returns a tuple with the Wallet field value +// and a boolean to check if the value has been set. +func (o *GatewayOptions) GetWalletOk() (*GatewayOptionsWallet, bool) { + if o == nil { + return nil, false + } + return &o.Wallet, true +} + +// SetWallet sets field value +func (o *GatewayOptions) SetWallet(v GatewayOptionsWallet) { + o.Wallet = v +} + +func (o GatewayOptions) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GatewayOptions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConnectionProfile) { + toSerialize["connectionProfile"] = o.ConnectionProfile + } + if !IsNil(o.Discovery) { + toSerialize["discovery"] = o.Discovery + } + if !IsNil(o.EventHandlerOptions) { + toSerialize["eventHandlerOptions"] = o.EventHandlerOptions + } + toSerialize["identity"] = o.Identity + toSerialize["wallet"] = o.Wallet + return toSerialize, nil +} + +type NullableGatewayOptions struct { + value *GatewayOptions + isSet bool +} + +func (v NullableGatewayOptions) Get() *GatewayOptions { + return v.value +} + +func (v *NullableGatewayOptions) Set(val *GatewayOptions) { + v.value = val + v.isSet = true +} + +func (v NullableGatewayOptions) IsSet() bool { + return v.isSet +} + +func (v *NullableGatewayOptions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGatewayOptions(val *GatewayOptions) *NullableGatewayOptions { + return &NullableGatewayOptions{value: val, isSet: true} +} + +func (v NullableGatewayOptions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGatewayOptions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_options_wallet.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_options_wallet.go new file mode 100644 index 00000000000..a79aaa6a8db --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_gateway_options_wallet.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GatewayOptionsWallet type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GatewayOptionsWallet{} + +// GatewayOptionsWallet struct for GatewayOptionsWallet +type GatewayOptionsWallet struct { + Keychain *FabricSigningCredential `json:"keychain,omitempty"` + Json *string `json:"json,omitempty"` +} + +// NewGatewayOptionsWallet instantiates a new GatewayOptionsWallet 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 +// will change when the set of required properties is changed +func NewGatewayOptionsWallet() *GatewayOptionsWallet { + this := GatewayOptionsWallet{} + return &this +} + +// NewGatewayOptionsWalletWithDefaults instantiates a new GatewayOptionsWallet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGatewayOptionsWalletWithDefaults() *GatewayOptionsWallet { + this := GatewayOptionsWallet{} + return &this +} + +// GetKeychain returns the Keychain field value if set, zero value otherwise. +func (o *GatewayOptionsWallet) GetKeychain() FabricSigningCredential { + if o == nil || IsNil(o.Keychain) { + var ret FabricSigningCredential + return ret + } + return *o.Keychain +} + +// GetKeychainOk returns a tuple with the Keychain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayOptionsWallet) GetKeychainOk() (*FabricSigningCredential, bool) { + if o == nil || IsNil(o.Keychain) { + return nil, false + } + return o.Keychain, true +} + +// HasKeychain returns a boolean if a field has been set. +func (o *GatewayOptionsWallet) HasKeychain() bool { + if o != nil && !IsNil(o.Keychain) { + return true + } + + return false +} + +// SetKeychain gets a reference to the given FabricSigningCredential and assigns it to the Keychain field. +func (o *GatewayOptionsWallet) SetKeychain(v FabricSigningCredential) { + o.Keychain = &v +} + +// GetJson returns the Json field value if set, zero value otherwise. +func (o *GatewayOptionsWallet) GetJson() string { + if o == nil || IsNil(o.Json) { + var ret string + return ret + } + return *o.Json +} + +// GetJsonOk returns a tuple with the Json field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayOptionsWallet) GetJsonOk() (*string, bool) { + if o == nil || IsNil(o.Json) { + return nil, false + } + return o.Json, true +} + +// HasJson returns a boolean if a field has been set. +func (o *GatewayOptionsWallet) HasJson() bool { + if o != nil && !IsNil(o.Json) { + return true + } + + return false +} + +// SetJson gets a reference to the given string and assigns it to the Json field. +func (o *GatewayOptionsWallet) SetJson(v string) { + o.Json = &v +} + +func (o GatewayOptionsWallet) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GatewayOptionsWallet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Keychain) { + toSerialize["keychain"] = o.Keychain + } + if !IsNil(o.Json) { + toSerialize["json"] = o.Json + } + return toSerialize, nil +} + +type NullableGatewayOptionsWallet struct { + value *GatewayOptionsWallet + isSet bool +} + +func (v NullableGatewayOptionsWallet) Get() *GatewayOptionsWallet { + return v.value +} + +func (v *NullableGatewayOptionsWallet) Set(val *GatewayOptionsWallet) { + v.value = val + v.isSet = true +} + +func (v NullableGatewayOptionsWallet) IsSet() bool { + return v.isSet +} + +func (v *NullableGatewayOptionsWallet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGatewayOptionsWallet(val *GatewayOptionsWallet) *NullableGatewayOptionsWallet { + return &NullableGatewayOptionsWallet{value: val, isSet: true} +} + +func (v NullableGatewayOptionsWallet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGatewayOptionsWallet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1.go new file mode 100644 index 00000000000..752cf543d84 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1.go @@ -0,0 +1,250 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GetBlockRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBlockRequestV1{} + +// GetBlockRequestV1 Request for GetBlock endpoint. +type GetBlockRequestV1 struct { + // Fabric channel which we want to query. + ChannelName string `json:"channelName"` + // Fabric channel we want to connect to. If not provided, then one from channelName parameter will be used + ConnectionChannelName *string `json:"connectionChannelName,omitempty"` + GatewayOptions GatewayOptions `json:"gatewayOptions"` + Query GetBlockRequestV1Query `json:"query"` + // If true, encoded buffer will be returned. Otherwise, entire block object is returned. + SkipDecode *bool `json:"skipDecode,omitempty"` +} + +// NewGetBlockRequestV1 instantiates a new GetBlockRequestV1 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 +// will change when the set of required properties is changed +func NewGetBlockRequestV1(channelName string, gatewayOptions GatewayOptions, query GetBlockRequestV1Query) *GetBlockRequestV1 { + this := GetBlockRequestV1{} + this.ChannelName = channelName + this.GatewayOptions = gatewayOptions + this.Query = query + var skipDecode bool = false + this.SkipDecode = &skipDecode + return &this +} + +// NewGetBlockRequestV1WithDefaults instantiates a new GetBlockRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBlockRequestV1WithDefaults() *GetBlockRequestV1 { + this := GetBlockRequestV1{} + var skipDecode bool = false + this.SkipDecode = &skipDecode + return &this +} + +// GetChannelName returns the ChannelName field value +func (o *GetBlockRequestV1) GetChannelName() string { + if o == nil { + var ret string + return ret + } + + return o.ChannelName +} + +// GetChannelNameOk returns a tuple with the ChannelName field value +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1) GetChannelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelName, true +} + +// SetChannelName sets field value +func (o *GetBlockRequestV1) SetChannelName(v string) { + o.ChannelName = v +} + +// GetConnectionChannelName returns the ConnectionChannelName field value if set, zero value otherwise. +func (o *GetBlockRequestV1) GetConnectionChannelName() string { + if o == nil || IsNil(o.ConnectionChannelName) { + var ret string + return ret + } + return *o.ConnectionChannelName +} + +// GetConnectionChannelNameOk returns a tuple with the ConnectionChannelName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1) GetConnectionChannelNameOk() (*string, bool) { + if o == nil || IsNil(o.ConnectionChannelName) { + return nil, false + } + return o.ConnectionChannelName, true +} + +// HasConnectionChannelName returns a boolean if a field has been set. +func (o *GetBlockRequestV1) HasConnectionChannelName() bool { + if o != nil && !IsNil(o.ConnectionChannelName) { + return true + } + + return false +} + +// SetConnectionChannelName gets a reference to the given string and assigns it to the ConnectionChannelName field. +func (o *GetBlockRequestV1) SetConnectionChannelName(v string) { + o.ConnectionChannelName = &v +} + +// GetGatewayOptions returns the GatewayOptions field value +func (o *GetBlockRequestV1) GetGatewayOptions() GatewayOptions { + if o == nil { + var ret GatewayOptions + return ret + } + + return o.GatewayOptions +} + +// GetGatewayOptionsOk returns a tuple with the GatewayOptions field value +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1) GetGatewayOptionsOk() (*GatewayOptions, bool) { + if o == nil { + return nil, false + } + return &o.GatewayOptions, true +} + +// SetGatewayOptions sets field value +func (o *GetBlockRequestV1) SetGatewayOptions(v GatewayOptions) { + o.GatewayOptions = v +} + +// GetQuery returns the Query field value +func (o *GetBlockRequestV1) GetQuery() GetBlockRequestV1Query { + if o == nil { + var ret GetBlockRequestV1Query + return ret + } + + return o.Query +} + +// GetQueryOk returns a tuple with the Query field value +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1) GetQueryOk() (*GetBlockRequestV1Query, bool) { + if o == nil { + return nil, false + } + return &o.Query, true +} + +// SetQuery sets field value +func (o *GetBlockRequestV1) SetQuery(v GetBlockRequestV1Query) { + o.Query = v +} + +// GetSkipDecode returns the SkipDecode field value if set, zero value otherwise. +func (o *GetBlockRequestV1) GetSkipDecode() bool { + if o == nil || IsNil(o.SkipDecode) { + var ret bool + return ret + } + return *o.SkipDecode +} + +// GetSkipDecodeOk returns a tuple with the SkipDecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1) GetSkipDecodeOk() (*bool, bool) { + if o == nil || IsNil(o.SkipDecode) { + return nil, false + } + return o.SkipDecode, true +} + +// HasSkipDecode returns a boolean if a field has been set. +func (o *GetBlockRequestV1) HasSkipDecode() bool { + if o != nil && !IsNil(o.SkipDecode) { + return true + } + + return false +} + +// SetSkipDecode gets a reference to the given bool and assigns it to the SkipDecode field. +func (o *GetBlockRequestV1) SetSkipDecode(v bool) { + o.SkipDecode = &v +} + +func (o GetBlockRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBlockRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["channelName"] = o.ChannelName + if !IsNil(o.ConnectionChannelName) { + toSerialize["connectionChannelName"] = o.ConnectionChannelName + } + toSerialize["gatewayOptions"] = o.GatewayOptions + toSerialize["query"] = o.Query + if !IsNil(o.SkipDecode) { + toSerialize["skipDecode"] = o.SkipDecode + } + return toSerialize, nil +} + +type NullableGetBlockRequestV1 struct { + value *GetBlockRequestV1 + isSet bool +} + +func (v NullableGetBlockRequestV1) Get() *GetBlockRequestV1 { + return v.value +} + +func (v *NullableGetBlockRequestV1) Set(val *GetBlockRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockRequestV1(val *GetBlockRequestV1) *NullableGetBlockRequestV1 { + return &NullableGetBlockRequestV1{value: val, isSet: true} +} + +func (v NullableGetBlockRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1_query.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1_query.go new file mode 100644 index 00000000000..37073b77e18 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1_query.go @@ -0,0 +1,200 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GetBlockRequestV1Query type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBlockRequestV1Query{} + +// GetBlockRequestV1Query Query selector, caller must provide at least one of them. First found will be used, rest will be ignored, so it's recommended to pass single selector. +type GetBlockRequestV1Query struct { + // Select block by it's number. + BlockNumber *string `json:"blockNumber,omitempty"` + BlockHash *GetBlockRequestV1QueryBlockHash `json:"blockHash,omitempty"` + // Select block by id of transaction that it contains. + TransactionId *string `json:"transactionId,omitempty"` +} + +// NewGetBlockRequestV1Query instantiates a new GetBlockRequestV1Query 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 +// will change when the set of required properties is changed +func NewGetBlockRequestV1Query() *GetBlockRequestV1Query { + this := GetBlockRequestV1Query{} + return &this +} + +// NewGetBlockRequestV1QueryWithDefaults instantiates a new GetBlockRequestV1Query object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBlockRequestV1QueryWithDefaults() *GetBlockRequestV1Query { + this := GetBlockRequestV1Query{} + return &this +} + +// GetBlockNumber returns the BlockNumber field value if set, zero value otherwise. +func (o *GetBlockRequestV1Query) GetBlockNumber() string { + if o == nil || IsNil(o.BlockNumber) { + var ret string + return ret + } + return *o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1Query) GetBlockNumberOk() (*string, bool) { + if o == nil || IsNil(o.BlockNumber) { + return nil, false + } + return o.BlockNumber, true +} + +// HasBlockNumber returns a boolean if a field has been set. +func (o *GetBlockRequestV1Query) HasBlockNumber() bool { + if o != nil && !IsNil(o.BlockNumber) { + return true + } + + return false +} + +// SetBlockNumber gets a reference to the given string and assigns it to the BlockNumber field. +func (o *GetBlockRequestV1Query) SetBlockNumber(v string) { + o.BlockNumber = &v +} + +// GetBlockHash returns the BlockHash field value if set, zero value otherwise. +func (o *GetBlockRequestV1Query) GetBlockHash() GetBlockRequestV1QueryBlockHash { + if o == nil || IsNil(o.BlockHash) { + var ret GetBlockRequestV1QueryBlockHash + return ret + } + return *o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1Query) GetBlockHashOk() (*GetBlockRequestV1QueryBlockHash, bool) { + if o == nil || IsNil(o.BlockHash) { + return nil, false + } + return o.BlockHash, true +} + +// HasBlockHash returns a boolean if a field has been set. +func (o *GetBlockRequestV1Query) HasBlockHash() bool { + if o != nil && !IsNil(o.BlockHash) { + return true + } + + return false +} + +// SetBlockHash gets a reference to the given GetBlockRequestV1QueryBlockHash and assigns it to the BlockHash field. +func (o *GetBlockRequestV1Query) SetBlockHash(v GetBlockRequestV1QueryBlockHash) { + o.BlockHash = &v +} + +// GetTransactionId returns the TransactionId field value if set, zero value otherwise. +func (o *GetBlockRequestV1Query) GetTransactionId() string { + if o == nil || IsNil(o.TransactionId) { + var ret string + return ret + } + return *o.TransactionId +} + +// GetTransactionIdOk returns a tuple with the TransactionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1Query) GetTransactionIdOk() (*string, bool) { + if o == nil || IsNil(o.TransactionId) { + return nil, false + } + return o.TransactionId, true +} + +// HasTransactionId returns a boolean if a field has been set. +func (o *GetBlockRequestV1Query) HasTransactionId() bool { + if o != nil && !IsNil(o.TransactionId) { + return true + } + + return false +} + +// SetTransactionId gets a reference to the given string and assigns it to the TransactionId field. +func (o *GetBlockRequestV1Query) SetTransactionId(v string) { + o.TransactionId = &v +} + +func (o GetBlockRequestV1Query) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBlockRequestV1Query) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BlockNumber) { + toSerialize["blockNumber"] = o.BlockNumber + } + if !IsNil(o.BlockHash) { + toSerialize["blockHash"] = o.BlockHash + } + if !IsNil(o.TransactionId) { + toSerialize["transactionId"] = o.TransactionId + } + return toSerialize, nil +} + +type NullableGetBlockRequestV1Query struct { + value *GetBlockRequestV1Query + isSet bool +} + +func (v NullableGetBlockRequestV1Query) Get() *GetBlockRequestV1Query { + return v.value +} + +func (v *NullableGetBlockRequestV1Query) Set(val *GetBlockRequestV1Query) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockRequestV1Query) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockRequestV1Query) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockRequestV1Query(val *GetBlockRequestV1Query) *NullableGetBlockRequestV1Query { + return &NullableGetBlockRequestV1Query{value: val, isSet: true} +} + +func (v NullableGetBlockRequestV1Query) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockRequestV1Query) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1_query_block_hash.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1_query_block_hash.go new file mode 100644 index 00000000000..246b71482d9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_request_v1_query_block_hash.go @@ -0,0 +1,155 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GetBlockRequestV1QueryBlockHash type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBlockRequestV1QueryBlockHash{} + +// GetBlockRequestV1QueryBlockHash Select block by it's hash. +type GetBlockRequestV1QueryBlockHash struct { + // NodeJS Buffer encoding (utf-8, hex, binary, base64, etc...). Passed directly to `Buffer.from()` call on hashBuffer. If not provided then JSON buffer format is assumed. + Encoding *string `json:"encoding,omitempty"` + // Buffer of blockHash. It's encoding should be described in `encoding` parameter. + Buffer string `json:"buffer"` +} + +// NewGetBlockRequestV1QueryBlockHash instantiates a new GetBlockRequestV1QueryBlockHash 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 +// will change when the set of required properties is changed +func NewGetBlockRequestV1QueryBlockHash(buffer string) *GetBlockRequestV1QueryBlockHash { + this := GetBlockRequestV1QueryBlockHash{} + this.Buffer = buffer + return &this +} + +// NewGetBlockRequestV1QueryBlockHashWithDefaults instantiates a new GetBlockRequestV1QueryBlockHash object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBlockRequestV1QueryBlockHashWithDefaults() *GetBlockRequestV1QueryBlockHash { + this := GetBlockRequestV1QueryBlockHash{} + return &this +} + +// GetEncoding returns the Encoding field value if set, zero value otherwise. +func (o *GetBlockRequestV1QueryBlockHash) GetEncoding() string { + if o == nil || IsNil(o.Encoding) { + var ret string + return ret + } + return *o.Encoding +} + +// GetEncodingOk returns a tuple with the Encoding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1QueryBlockHash) GetEncodingOk() (*string, bool) { + if o == nil || IsNil(o.Encoding) { + return nil, false + } + return o.Encoding, true +} + +// HasEncoding returns a boolean if a field has been set. +func (o *GetBlockRequestV1QueryBlockHash) HasEncoding() bool { + if o != nil && !IsNil(o.Encoding) { + return true + } + + return false +} + +// SetEncoding gets a reference to the given string and assigns it to the Encoding field. +func (o *GetBlockRequestV1QueryBlockHash) SetEncoding(v string) { + o.Encoding = &v +} + +// GetBuffer returns the Buffer field value +func (o *GetBlockRequestV1QueryBlockHash) GetBuffer() string { + if o == nil { + var ret string + return ret + } + + return o.Buffer +} + +// GetBufferOk returns a tuple with the Buffer field value +// and a boolean to check if the value has been set. +func (o *GetBlockRequestV1QueryBlockHash) GetBufferOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Buffer, true +} + +// SetBuffer sets field value +func (o *GetBlockRequestV1QueryBlockHash) SetBuffer(v string) { + o.Buffer = v +} + +func (o GetBlockRequestV1QueryBlockHash) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBlockRequestV1QueryBlockHash) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Encoding) { + toSerialize["encoding"] = o.Encoding + } + toSerialize["buffer"] = o.Buffer + return toSerialize, nil +} + +type NullableGetBlockRequestV1QueryBlockHash struct { + value *GetBlockRequestV1QueryBlockHash + isSet bool +} + +func (v NullableGetBlockRequestV1QueryBlockHash) Get() *GetBlockRequestV1QueryBlockHash { + return v.value +} + +func (v *NullableGetBlockRequestV1QueryBlockHash) Set(val *GetBlockRequestV1QueryBlockHash) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockRequestV1QueryBlockHash) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockRequestV1QueryBlockHash) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockRequestV1QueryBlockHash(val *GetBlockRequestV1QueryBlockHash) *NullableGetBlockRequestV1QueryBlockHash { + return &NullableGetBlockRequestV1QueryBlockHash{value: val, isSet: true} +} + +func (v NullableGetBlockRequestV1QueryBlockHash) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockRequestV1QueryBlockHash) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_decoded_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_decoded_v1.go new file mode 100644 index 00000000000..987e3662e55 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_decoded_v1.go @@ -0,0 +1,122 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GetBlockResponseDecodedV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBlockResponseDecodedV1{} + +// GetBlockResponseDecodedV1 When skipDecode is false (default) then decoded block object is returned. +type GetBlockResponseDecodedV1 struct { + // Full hyperledger fabric block data. + DecodedBlock interface{} `json:"decodedBlock"` +} + +// NewGetBlockResponseDecodedV1 instantiates a new GetBlockResponseDecodedV1 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 +// will change when the set of required properties is changed +func NewGetBlockResponseDecodedV1(decodedBlock interface{}) *GetBlockResponseDecodedV1 { + this := GetBlockResponseDecodedV1{} + this.DecodedBlock = decodedBlock + return &this +} + +// NewGetBlockResponseDecodedV1WithDefaults instantiates a new GetBlockResponseDecodedV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBlockResponseDecodedV1WithDefaults() *GetBlockResponseDecodedV1 { + this := GetBlockResponseDecodedV1{} + return &this +} + +// GetDecodedBlock returns the DecodedBlock field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *GetBlockResponseDecodedV1) GetDecodedBlock() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.DecodedBlock +} + +// GetDecodedBlockOk returns a tuple with the DecodedBlock field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GetBlockResponseDecodedV1) GetDecodedBlockOk() (*interface{}, bool) { + if o == nil || IsNil(o.DecodedBlock) { + return nil, false + } + return &o.DecodedBlock, true +} + +// SetDecodedBlock sets field value +func (o *GetBlockResponseDecodedV1) SetDecodedBlock(v interface{}) { + o.DecodedBlock = v +} + +func (o GetBlockResponseDecodedV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBlockResponseDecodedV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DecodedBlock != nil { + toSerialize["decodedBlock"] = o.DecodedBlock + } + return toSerialize, nil +} + +type NullableGetBlockResponseDecodedV1 struct { + value *GetBlockResponseDecodedV1 + isSet bool +} + +func (v NullableGetBlockResponseDecodedV1) Get() *GetBlockResponseDecodedV1 { + return v.value +} + +func (v *NullableGetBlockResponseDecodedV1) Set(val *GetBlockResponseDecodedV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockResponseDecodedV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockResponseDecodedV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockResponseDecodedV1(val *GetBlockResponseDecodedV1) *NullableGetBlockResponseDecodedV1 { + return &NullableGetBlockResponseDecodedV1{value: val, isSet: true} +} + +func (v NullableGetBlockResponseDecodedV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockResponseDecodedV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_encoded_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_encoded_v1.go new file mode 100644 index 00000000000..cd74e31dc84 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_encoded_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GetBlockResponseEncodedV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBlockResponseEncodedV1{} + +// GetBlockResponseEncodedV1 When skipDecode is true then encoded block Buffer is returned. +type GetBlockResponseEncodedV1 struct { + EncodedBlock string `json:"encodedBlock"` +} + +// NewGetBlockResponseEncodedV1 instantiates a new GetBlockResponseEncodedV1 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 +// will change when the set of required properties is changed +func NewGetBlockResponseEncodedV1(encodedBlock string) *GetBlockResponseEncodedV1 { + this := GetBlockResponseEncodedV1{} + this.EncodedBlock = encodedBlock + return &this +} + +// NewGetBlockResponseEncodedV1WithDefaults instantiates a new GetBlockResponseEncodedV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBlockResponseEncodedV1WithDefaults() *GetBlockResponseEncodedV1 { + this := GetBlockResponseEncodedV1{} + return &this +} + +// GetEncodedBlock returns the EncodedBlock field value +func (o *GetBlockResponseEncodedV1) GetEncodedBlock() string { + if o == nil { + var ret string + return ret + } + + return o.EncodedBlock +} + +// GetEncodedBlockOk returns a tuple with the EncodedBlock field value +// and a boolean to check if the value has been set. +func (o *GetBlockResponseEncodedV1) GetEncodedBlockOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EncodedBlock, true +} + +// SetEncodedBlock sets field value +func (o *GetBlockResponseEncodedV1) SetEncodedBlock(v string) { + o.EncodedBlock = v +} + +func (o GetBlockResponseEncodedV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBlockResponseEncodedV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["encodedBlock"] = o.EncodedBlock + return toSerialize, nil +} + +type NullableGetBlockResponseEncodedV1 struct { + value *GetBlockResponseEncodedV1 + isSet bool +} + +func (v NullableGetBlockResponseEncodedV1) Get() *GetBlockResponseEncodedV1 { + return v.value +} + +func (v *NullableGetBlockResponseEncodedV1) Set(val *GetBlockResponseEncodedV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockResponseEncodedV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockResponseEncodedV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockResponseEncodedV1(val *GetBlockResponseEncodedV1) *NullableGetBlockResponseEncodedV1 { + return &NullableGetBlockResponseEncodedV1{value: val, isSet: true} +} + +func (v NullableGetBlockResponseEncodedV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockResponseEncodedV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_v1.go new file mode 100644 index 00000000000..aef478f029b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_v1.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// GetBlockResponseV1 - Response from GetBlock endpoint. +type GetBlockResponseV1 struct { + GetBlockResponseDecodedV1 *GetBlockResponseDecodedV1 + GetBlockResponseEncodedV1 *GetBlockResponseEncodedV1 +} + +// GetBlockResponseDecodedV1AsGetBlockResponseV1 is a convenience function that returns GetBlockResponseDecodedV1 wrapped in GetBlockResponseV1 +func GetBlockResponseDecodedV1AsGetBlockResponseV1(v *GetBlockResponseDecodedV1) GetBlockResponseV1 { + return GetBlockResponseV1{ + GetBlockResponseDecodedV1: v, + } +} + +// GetBlockResponseEncodedV1AsGetBlockResponseV1 is a convenience function that returns GetBlockResponseEncodedV1 wrapped in GetBlockResponseV1 +func GetBlockResponseEncodedV1AsGetBlockResponseV1(v *GetBlockResponseEncodedV1) GetBlockResponseV1 { + return GetBlockResponseV1{ + GetBlockResponseEncodedV1: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *GetBlockResponseV1) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into GetBlockResponseDecodedV1 + err = newStrictDecoder(data).Decode(&dst.GetBlockResponseDecodedV1) + if err == nil { + jsonGetBlockResponseDecodedV1, _ := json.Marshal(dst.GetBlockResponseDecodedV1) + if string(jsonGetBlockResponseDecodedV1) == "{}" { // empty struct + dst.GetBlockResponseDecodedV1 = nil + } else { + match++ + } + } else { + dst.GetBlockResponseDecodedV1 = nil + } + + // try to unmarshal data into GetBlockResponseEncodedV1 + err = newStrictDecoder(data).Decode(&dst.GetBlockResponseEncodedV1) + if err == nil { + jsonGetBlockResponseEncodedV1, _ := json.Marshal(dst.GetBlockResponseEncodedV1) + if string(jsonGetBlockResponseEncodedV1) == "{}" { // empty struct + dst.GetBlockResponseEncodedV1 = nil + } else { + match++ + } + } else { + dst.GetBlockResponseEncodedV1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.GetBlockResponseDecodedV1 = nil + dst.GetBlockResponseEncodedV1 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(GetBlockResponseV1)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(GetBlockResponseV1)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src GetBlockResponseV1) MarshalJSON() ([]byte, error) { + if src.GetBlockResponseDecodedV1 != nil { + return json.Marshal(&src.GetBlockResponseDecodedV1) + } + + if src.GetBlockResponseEncodedV1 != nil { + return json.Marshal(&src.GetBlockResponseEncodedV1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *GetBlockResponseV1) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.GetBlockResponseDecodedV1 != nil { + return obj.GetBlockResponseDecodedV1 + } + + if obj.GetBlockResponseEncodedV1 != nil { + return obj.GetBlockResponseEncodedV1 + } + + // all schemas are nil + return nil +} + +type NullableGetBlockResponseV1 struct { + value *GetBlockResponseV1 + isSet bool +} + +func (v NullableGetBlockResponseV1) Get() *GetBlockResponseV1 { + return v.value +} + +func (v *NullableGetBlockResponseV1) Set(val *GetBlockResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockResponseV1(val *GetBlockResponseV1) *NullableGetBlockResponseV1 { + return &NullableGetBlockResponseV1{value: val, isSet: true} +} + +func (v NullableGetBlockResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_transaction_receipt_response.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_transaction_receipt_response.go new file mode 100644 index 00000000000..a95f65a1d6d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_transaction_receipt_response.go @@ -0,0 +1,450 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GetTransactionReceiptResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetTransactionReceiptResponse{} + +// GetTransactionReceiptResponse struct for GetTransactionReceiptResponse +type GetTransactionReceiptResponse struct { + BlockNumber *string `json:"blockNumber,omitempty"` + ChannelID *string `json:"channelID,omitempty"` + TransactionCreator *TransactReceiptTransactionCreator `json:"transactionCreator,omitempty"` + TransactionEndorsement []TransactReceiptTransactionEndorsement `json:"transactionEndorsement,omitempty"` + BlockMetaData *TransactReceiptBlockMetaData `json:"blockMetaData,omitempty"` + ChainCodeName *string `json:"chainCodeName,omitempty"` + ChainCodeVersion *string `json:"chainCodeVersion,omitempty"` + ResponseStatus *string `json:"responseStatus,omitempty"` + RwsetKey *string `json:"rwsetKey,omitempty"` + RwsetWriteData *string `json:"rwsetWriteData,omitempty"` +} + +// NewGetTransactionReceiptResponse instantiates a new GetTransactionReceiptResponse 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 +// will change when the set of required properties is changed +func NewGetTransactionReceiptResponse() *GetTransactionReceiptResponse { + this := GetTransactionReceiptResponse{} + return &this +} + +// NewGetTransactionReceiptResponseWithDefaults instantiates a new GetTransactionReceiptResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetTransactionReceiptResponseWithDefaults() *GetTransactionReceiptResponse { + this := GetTransactionReceiptResponse{} + return &this +} + +// GetBlockNumber returns the BlockNumber field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetBlockNumber() string { + if o == nil || IsNil(o.BlockNumber) { + var ret string + return ret + } + return *o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetBlockNumberOk() (*string, bool) { + if o == nil || IsNil(o.BlockNumber) { + return nil, false + } + return o.BlockNumber, true +} + +// HasBlockNumber returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasBlockNumber() bool { + if o != nil && !IsNil(o.BlockNumber) { + return true + } + + return false +} + +// SetBlockNumber gets a reference to the given string and assigns it to the BlockNumber field. +func (o *GetTransactionReceiptResponse) SetBlockNumber(v string) { + o.BlockNumber = &v +} + +// GetChannelID returns the ChannelID field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetChannelID() string { + if o == nil || IsNil(o.ChannelID) { + var ret string + return ret + } + return *o.ChannelID +} + +// GetChannelIDOk returns a tuple with the ChannelID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetChannelIDOk() (*string, bool) { + if o == nil || IsNil(o.ChannelID) { + return nil, false + } + return o.ChannelID, true +} + +// HasChannelID returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasChannelID() bool { + if o != nil && !IsNil(o.ChannelID) { + return true + } + + return false +} + +// SetChannelID gets a reference to the given string and assigns it to the ChannelID field. +func (o *GetTransactionReceiptResponse) SetChannelID(v string) { + o.ChannelID = &v +} + +// GetTransactionCreator returns the TransactionCreator field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetTransactionCreator() TransactReceiptTransactionCreator { + if o == nil || IsNil(o.TransactionCreator) { + var ret TransactReceiptTransactionCreator + return ret + } + return *o.TransactionCreator +} + +// GetTransactionCreatorOk returns a tuple with the TransactionCreator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetTransactionCreatorOk() (*TransactReceiptTransactionCreator, bool) { + if o == nil || IsNil(o.TransactionCreator) { + return nil, false + } + return o.TransactionCreator, true +} + +// HasTransactionCreator returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasTransactionCreator() bool { + if o != nil && !IsNil(o.TransactionCreator) { + return true + } + + return false +} + +// SetTransactionCreator gets a reference to the given TransactReceiptTransactionCreator and assigns it to the TransactionCreator field. +func (o *GetTransactionReceiptResponse) SetTransactionCreator(v TransactReceiptTransactionCreator) { + o.TransactionCreator = &v +} + +// GetTransactionEndorsement returns the TransactionEndorsement field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetTransactionEndorsement() []TransactReceiptTransactionEndorsement { + if o == nil || IsNil(o.TransactionEndorsement) { + var ret []TransactReceiptTransactionEndorsement + return ret + } + return o.TransactionEndorsement +} + +// GetTransactionEndorsementOk returns a tuple with the TransactionEndorsement field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetTransactionEndorsementOk() ([]TransactReceiptTransactionEndorsement, bool) { + if o == nil || IsNil(o.TransactionEndorsement) { + return nil, false + } + return o.TransactionEndorsement, true +} + +// HasTransactionEndorsement returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasTransactionEndorsement() bool { + if o != nil && !IsNil(o.TransactionEndorsement) { + return true + } + + return false +} + +// SetTransactionEndorsement gets a reference to the given []TransactReceiptTransactionEndorsement and assigns it to the TransactionEndorsement field. +func (o *GetTransactionReceiptResponse) SetTransactionEndorsement(v []TransactReceiptTransactionEndorsement) { + o.TransactionEndorsement = v +} + +// GetBlockMetaData returns the BlockMetaData field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetBlockMetaData() TransactReceiptBlockMetaData { + if o == nil || IsNil(o.BlockMetaData) { + var ret TransactReceiptBlockMetaData + return ret + } + return *o.BlockMetaData +} + +// GetBlockMetaDataOk returns a tuple with the BlockMetaData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetBlockMetaDataOk() (*TransactReceiptBlockMetaData, bool) { + if o == nil || IsNil(o.BlockMetaData) { + return nil, false + } + return o.BlockMetaData, true +} + +// HasBlockMetaData returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasBlockMetaData() bool { + if o != nil && !IsNil(o.BlockMetaData) { + return true + } + + return false +} + +// SetBlockMetaData gets a reference to the given TransactReceiptBlockMetaData and assigns it to the BlockMetaData field. +func (o *GetTransactionReceiptResponse) SetBlockMetaData(v TransactReceiptBlockMetaData) { + o.BlockMetaData = &v +} + +// GetChainCodeName returns the ChainCodeName field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetChainCodeName() string { + if o == nil || IsNil(o.ChainCodeName) { + var ret string + return ret + } + return *o.ChainCodeName +} + +// GetChainCodeNameOk returns a tuple with the ChainCodeName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetChainCodeNameOk() (*string, bool) { + if o == nil || IsNil(o.ChainCodeName) { + return nil, false + } + return o.ChainCodeName, true +} + +// HasChainCodeName returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasChainCodeName() bool { + if o != nil && !IsNil(o.ChainCodeName) { + return true + } + + return false +} + +// SetChainCodeName gets a reference to the given string and assigns it to the ChainCodeName field. +func (o *GetTransactionReceiptResponse) SetChainCodeName(v string) { + o.ChainCodeName = &v +} + +// GetChainCodeVersion returns the ChainCodeVersion field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetChainCodeVersion() string { + if o == nil || IsNil(o.ChainCodeVersion) { + var ret string + return ret + } + return *o.ChainCodeVersion +} + +// GetChainCodeVersionOk returns a tuple with the ChainCodeVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetChainCodeVersionOk() (*string, bool) { + if o == nil || IsNil(o.ChainCodeVersion) { + return nil, false + } + return o.ChainCodeVersion, true +} + +// HasChainCodeVersion returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasChainCodeVersion() bool { + if o != nil && !IsNil(o.ChainCodeVersion) { + return true + } + + return false +} + +// SetChainCodeVersion gets a reference to the given string and assigns it to the ChainCodeVersion field. +func (o *GetTransactionReceiptResponse) SetChainCodeVersion(v string) { + o.ChainCodeVersion = &v +} + +// GetResponseStatus returns the ResponseStatus field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetResponseStatus() string { + if o == nil || IsNil(o.ResponseStatus) { + var ret string + return ret + } + return *o.ResponseStatus +} + +// GetResponseStatusOk returns a tuple with the ResponseStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetResponseStatusOk() (*string, bool) { + if o == nil || IsNil(o.ResponseStatus) { + return nil, false + } + return o.ResponseStatus, true +} + +// HasResponseStatus returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasResponseStatus() bool { + if o != nil && !IsNil(o.ResponseStatus) { + return true + } + + return false +} + +// SetResponseStatus gets a reference to the given string and assigns it to the ResponseStatus field. +func (o *GetTransactionReceiptResponse) SetResponseStatus(v string) { + o.ResponseStatus = &v +} + +// GetRwsetKey returns the RwsetKey field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetRwsetKey() string { + if o == nil || IsNil(o.RwsetKey) { + var ret string + return ret + } + return *o.RwsetKey +} + +// GetRwsetKeyOk returns a tuple with the RwsetKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetRwsetKeyOk() (*string, bool) { + if o == nil || IsNil(o.RwsetKey) { + return nil, false + } + return o.RwsetKey, true +} + +// HasRwsetKey returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasRwsetKey() bool { + if o != nil && !IsNil(o.RwsetKey) { + return true + } + + return false +} + +// SetRwsetKey gets a reference to the given string and assigns it to the RwsetKey field. +func (o *GetTransactionReceiptResponse) SetRwsetKey(v string) { + o.RwsetKey = &v +} + +// GetRwsetWriteData returns the RwsetWriteData field value if set, zero value otherwise. +func (o *GetTransactionReceiptResponse) GetRwsetWriteData() string { + if o == nil || IsNil(o.RwsetWriteData) { + var ret string + return ret + } + return *o.RwsetWriteData +} + +// GetRwsetWriteDataOk returns a tuple with the RwsetWriteData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetTransactionReceiptResponse) GetRwsetWriteDataOk() (*string, bool) { + if o == nil || IsNil(o.RwsetWriteData) { + return nil, false + } + return o.RwsetWriteData, true +} + +// HasRwsetWriteData returns a boolean if a field has been set. +func (o *GetTransactionReceiptResponse) HasRwsetWriteData() bool { + if o != nil && !IsNil(o.RwsetWriteData) { + return true + } + + return false +} + +// SetRwsetWriteData gets a reference to the given string and assigns it to the RwsetWriteData field. +func (o *GetTransactionReceiptResponse) SetRwsetWriteData(v string) { + o.RwsetWriteData = &v +} + +func (o GetTransactionReceiptResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetTransactionReceiptResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BlockNumber) { + toSerialize["blockNumber"] = o.BlockNumber + } + if !IsNil(o.ChannelID) { + toSerialize["channelID"] = o.ChannelID + } + if !IsNil(o.TransactionCreator) { + toSerialize["transactionCreator"] = o.TransactionCreator + } + if !IsNil(o.TransactionEndorsement) { + toSerialize["transactionEndorsement"] = o.TransactionEndorsement + } + if !IsNil(o.BlockMetaData) { + toSerialize["blockMetaData"] = o.BlockMetaData + } + if !IsNil(o.ChainCodeName) { + toSerialize["chainCodeName"] = o.ChainCodeName + } + if !IsNil(o.ChainCodeVersion) { + toSerialize["chainCodeVersion"] = o.ChainCodeVersion + } + if !IsNil(o.ResponseStatus) { + toSerialize["responseStatus"] = o.ResponseStatus + } + if !IsNil(o.RwsetKey) { + toSerialize["rwsetKey"] = o.RwsetKey + } + if !IsNil(o.RwsetWriteData) { + toSerialize["rwsetWriteData"] = o.RwsetWriteData + } + return toSerialize, nil +} + +type NullableGetTransactionReceiptResponse struct { + value *GetTransactionReceiptResponse + isSet bool +} + +func (v NullableGetTransactionReceiptResponse) Get() *GetTransactionReceiptResponse { + return v.value +} + +func (v *NullableGetTransactionReceiptResponse) Set(val *GetTransactionReceiptResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetTransactionReceiptResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetTransactionReceiptResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetTransactionReceiptResponse(val *GetTransactionReceiptResponse) *NullableGetTransactionReceiptResponse { + return &NullableGetTransactionReceiptResponse{value: val, isSet: true} +} + +func (v NullableGetTransactionReceiptResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetTransactionReceiptResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_delegated_sign_transaction_request.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_delegated_sign_transaction_request.go new file mode 100644 index 00000000000..abbcc501850 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_delegated_sign_transaction_request.go @@ -0,0 +1,464 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the RunDelegatedSignTransactionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunDelegatedSignTransactionRequest{} + +// RunDelegatedSignTransactionRequest struct for RunDelegatedSignTransactionRequest +type RunDelegatedSignTransactionRequest struct { + // An array of endorsing peers (name or url) for the transaction. + EndorsingPeers []string `json:"endorsingPeers,omitempty"` + // An array of endorsing organizations (by mspID or issuer org name on certificate) for the transaction. + EndorsingOrgs []string `json:"endorsingOrgs,omitempty"` + TransientData map[string]interface{} `json:"transientData,omitempty"` + SignerCertificate string `json:"signerCertificate"` + SignerMspID string `json:"signerMspID"` + // Can be used to uniquely identify and authorize signing request + UniqueTransactionData interface{} `json:"uniqueTransactionData,omitempty"` + ChannelName string `json:"channelName"` + ContractName string `json:"contractName"` + InvocationType FabricContractInvocationType `json:"invocationType"` + MethodName string `json:"methodName"` + Params []*string `json:"params"` + ResponseType *RunTransactionResponseType `json:"responseType,omitempty"` +} + +// NewRunDelegatedSignTransactionRequest instantiates a new RunDelegatedSignTransactionRequest 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 +// will change when the set of required properties is changed +func NewRunDelegatedSignTransactionRequest(signerCertificate string, signerMspID string, channelName string, contractName string, invocationType FabricContractInvocationType, methodName string, params []*string) *RunDelegatedSignTransactionRequest { + this := RunDelegatedSignTransactionRequest{} + this.SignerCertificate = signerCertificate + this.SignerMspID = signerMspID + this.ChannelName = channelName + this.ContractName = contractName + this.InvocationType = invocationType + this.MethodName = methodName + this.Params = params + return &this +} + +// NewRunDelegatedSignTransactionRequestWithDefaults instantiates a new RunDelegatedSignTransactionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunDelegatedSignTransactionRequestWithDefaults() *RunDelegatedSignTransactionRequest { + this := RunDelegatedSignTransactionRequest{} + return &this +} + +// GetEndorsingPeers returns the EndorsingPeers field value if set, zero value otherwise. +func (o *RunDelegatedSignTransactionRequest) GetEndorsingPeers() []string { + if o == nil || IsNil(o.EndorsingPeers) { + var ret []string + return ret + } + return o.EndorsingPeers +} + +// GetEndorsingPeersOk returns a tuple with the EndorsingPeers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunDelegatedSignTransactionRequest) GetEndorsingPeersOk() ([]string, bool) { + if o == nil || IsNil(o.EndorsingPeers) { + return nil, false + } + return o.EndorsingPeers, true +} + +// HasEndorsingPeers returns a boolean if a field has been set. +func (o *RunDelegatedSignTransactionRequest) HasEndorsingPeers() bool { + if o != nil && !IsNil(o.EndorsingPeers) { + return true + } + + return false +} + +// SetEndorsingPeers gets a reference to the given []string and assigns it to the EndorsingPeers field. +func (o *RunDelegatedSignTransactionRequest) SetEndorsingPeers(v []string) { + o.EndorsingPeers = v +} + +// GetEndorsingOrgs returns the EndorsingOrgs field value if set, zero value otherwise. +func (o *RunDelegatedSignTransactionRequest) GetEndorsingOrgs() []string { + if o == nil || IsNil(o.EndorsingOrgs) { + var ret []string + return ret + } + return o.EndorsingOrgs +} + +// GetEndorsingOrgsOk returns a tuple with the EndorsingOrgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunDelegatedSignTransactionRequest) GetEndorsingOrgsOk() ([]string, bool) { + if o == nil || IsNil(o.EndorsingOrgs) { + return nil, false + } + return o.EndorsingOrgs, true +} + +// HasEndorsingOrgs returns a boolean if a field has been set. +func (o *RunDelegatedSignTransactionRequest) HasEndorsingOrgs() bool { + if o != nil && !IsNil(o.EndorsingOrgs) { + return true + } + + return false +} + +// SetEndorsingOrgs gets a reference to the given []string and assigns it to the EndorsingOrgs field. +func (o *RunDelegatedSignTransactionRequest) SetEndorsingOrgs(v []string) { + o.EndorsingOrgs = v +} + +// GetTransientData returns the TransientData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunDelegatedSignTransactionRequest) GetTransientData() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.TransientData +} + +// GetTransientDataOk returns a tuple with the TransientData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunDelegatedSignTransactionRequest) GetTransientDataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.TransientData) { + return map[string]interface{}{}, false + } + return o.TransientData, true +} + +// HasTransientData returns a boolean if a field has been set. +func (o *RunDelegatedSignTransactionRequest) HasTransientData() bool { + if o != nil && IsNil(o.TransientData) { + return true + } + + return false +} + +// SetTransientData gets a reference to the given map[string]interface{} and assigns it to the TransientData field. +func (o *RunDelegatedSignTransactionRequest) SetTransientData(v map[string]interface{}) { + o.TransientData = v +} + +// GetSignerCertificate returns the SignerCertificate field value +func (o *RunDelegatedSignTransactionRequest) GetSignerCertificate() string { + if o == nil { + var ret string + return ret + } + + return o.SignerCertificate +} + +// GetSignerCertificateOk returns a tuple with the SignerCertificate field value +// and a boolean to check if the value has been set. +func (o *RunDelegatedSignTransactionRequest) GetSignerCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SignerCertificate, true +} + +// SetSignerCertificate sets field value +func (o *RunDelegatedSignTransactionRequest) SetSignerCertificate(v string) { + o.SignerCertificate = v +} + +// GetSignerMspID returns the SignerMspID field value +func (o *RunDelegatedSignTransactionRequest) GetSignerMspID() string { + if o == nil { + var ret string + return ret + } + + return o.SignerMspID +} + +// GetSignerMspIDOk returns a tuple with the SignerMspID field value +// and a boolean to check if the value has been set. +func (o *RunDelegatedSignTransactionRequest) GetSignerMspIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SignerMspID, true +} + +// SetSignerMspID sets field value +func (o *RunDelegatedSignTransactionRequest) SetSignerMspID(v string) { + o.SignerMspID = v +} + +// GetUniqueTransactionData returns the UniqueTransactionData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunDelegatedSignTransactionRequest) GetUniqueTransactionData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.UniqueTransactionData +} + +// GetUniqueTransactionDataOk returns a tuple with the UniqueTransactionData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunDelegatedSignTransactionRequest) GetUniqueTransactionDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.UniqueTransactionData) { + return nil, false + } + return &o.UniqueTransactionData, true +} + +// HasUniqueTransactionData returns a boolean if a field has been set. +func (o *RunDelegatedSignTransactionRequest) HasUniqueTransactionData() bool { + if o != nil && IsNil(o.UniqueTransactionData) { + return true + } + + return false +} + +// SetUniqueTransactionData gets a reference to the given interface{} and assigns it to the UniqueTransactionData field. +func (o *RunDelegatedSignTransactionRequest) SetUniqueTransactionData(v interface{}) { + o.UniqueTransactionData = v +} + +// GetChannelName returns the ChannelName field value +func (o *RunDelegatedSignTransactionRequest) GetChannelName() string { + if o == nil { + var ret string + return ret + } + + return o.ChannelName +} + +// GetChannelNameOk returns a tuple with the ChannelName field value +// and a boolean to check if the value has been set. +func (o *RunDelegatedSignTransactionRequest) GetChannelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelName, true +} + +// SetChannelName sets field value +func (o *RunDelegatedSignTransactionRequest) SetChannelName(v string) { + o.ChannelName = v +} + +// GetContractName returns the ContractName field value +func (o *RunDelegatedSignTransactionRequest) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *RunDelegatedSignTransactionRequest) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *RunDelegatedSignTransactionRequest) SetContractName(v string) { + o.ContractName = v +} + +// GetInvocationType returns the InvocationType field value +func (o *RunDelegatedSignTransactionRequest) GetInvocationType() FabricContractInvocationType { + if o == nil { + var ret FabricContractInvocationType + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *RunDelegatedSignTransactionRequest) GetInvocationTypeOk() (*FabricContractInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *RunDelegatedSignTransactionRequest) SetInvocationType(v FabricContractInvocationType) { + o.InvocationType = v +} + +// GetMethodName returns the MethodName field value +func (o *RunDelegatedSignTransactionRequest) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *RunDelegatedSignTransactionRequest) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *RunDelegatedSignTransactionRequest) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value +func (o *RunDelegatedSignTransactionRequest) GetParams() []*string { + if o == nil { + var ret []*string + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *RunDelegatedSignTransactionRequest) GetParamsOk() ([]*string, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *RunDelegatedSignTransactionRequest) SetParams(v []*string) { + o.Params = v +} + +// GetResponseType returns the ResponseType field value if set, zero value otherwise. +func (o *RunDelegatedSignTransactionRequest) GetResponseType() RunTransactionResponseType { + if o == nil || IsNil(o.ResponseType) { + var ret RunTransactionResponseType + return ret + } + return *o.ResponseType +} + +// GetResponseTypeOk returns a tuple with the ResponseType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunDelegatedSignTransactionRequest) GetResponseTypeOk() (*RunTransactionResponseType, bool) { + if o == nil || IsNil(o.ResponseType) { + return nil, false + } + return o.ResponseType, true +} + +// HasResponseType returns a boolean if a field has been set. +func (o *RunDelegatedSignTransactionRequest) HasResponseType() bool { + if o != nil && !IsNil(o.ResponseType) { + return true + } + + return false +} + +// SetResponseType gets a reference to the given RunTransactionResponseType and assigns it to the ResponseType field. +func (o *RunDelegatedSignTransactionRequest) SetResponseType(v RunTransactionResponseType) { + o.ResponseType = &v +} + +func (o RunDelegatedSignTransactionRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunDelegatedSignTransactionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.EndorsingPeers) { + toSerialize["endorsingPeers"] = o.EndorsingPeers + } + if !IsNil(o.EndorsingOrgs) { + toSerialize["endorsingOrgs"] = o.EndorsingOrgs + } + if o.TransientData != nil { + toSerialize["transientData"] = o.TransientData + } + toSerialize["signerCertificate"] = o.SignerCertificate + toSerialize["signerMspID"] = o.SignerMspID + if o.UniqueTransactionData != nil { + toSerialize["uniqueTransactionData"] = o.UniqueTransactionData + } + toSerialize["channelName"] = o.ChannelName + toSerialize["contractName"] = o.ContractName + toSerialize["invocationType"] = o.InvocationType + toSerialize["methodName"] = o.MethodName + toSerialize["params"] = o.Params + if !IsNil(o.ResponseType) { + toSerialize["responseType"] = o.ResponseType + } + return toSerialize, nil +} + +type NullableRunDelegatedSignTransactionRequest struct { + value *RunDelegatedSignTransactionRequest + isSet bool +} + +func (v NullableRunDelegatedSignTransactionRequest) Get() *RunDelegatedSignTransactionRequest { + return v.value +} + +func (v *NullableRunDelegatedSignTransactionRequest) Set(val *RunDelegatedSignTransactionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRunDelegatedSignTransactionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRunDelegatedSignTransactionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunDelegatedSignTransactionRequest(val *RunDelegatedSignTransactionRequest) *NullableRunDelegatedSignTransactionRequest { + return &NullableRunDelegatedSignTransactionRequest{value: val, isSet: true} +} + +func (v NullableRunDelegatedSignTransactionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunDelegatedSignTransactionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_transaction_request.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_transaction_request.go new file mode 100644 index 00000000000..c7b3908051a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_transaction_request.go @@ -0,0 +1,435 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the RunTransactionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionRequest{} + +// RunTransactionRequest struct for RunTransactionRequest +type RunTransactionRequest struct { + // An array of endorsing peers (name or url) for the transaction. + EndorsingPeers []string `json:"endorsingPeers,omitempty"` + // An array of endorsing organizations (by mspID or issuer org name on certificate) for the transaction. + EndorsingOrgs []string `json:"endorsingOrgs,omitempty"` + TransientData map[string]interface{} `json:"transientData,omitempty"` + GatewayOptions *GatewayOptions `json:"gatewayOptions,omitempty"` + SigningCredential FabricSigningCredential `json:"signingCredential"` + ChannelName string `json:"channelName"` + ContractName string `json:"contractName"` + InvocationType FabricContractInvocationType `json:"invocationType"` + MethodName string `json:"methodName"` + Params []*string `json:"params"` + ResponseType *RunTransactionResponseType `json:"responseType,omitempty"` +} + +// NewRunTransactionRequest instantiates a new RunTransactionRequest 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 +// will change when the set of required properties is changed +func NewRunTransactionRequest(signingCredential FabricSigningCredential, channelName string, contractName string, invocationType FabricContractInvocationType, methodName string, params []*string) *RunTransactionRequest { + this := RunTransactionRequest{} + this.SigningCredential = signingCredential + this.ChannelName = channelName + this.ContractName = contractName + this.InvocationType = invocationType + this.MethodName = methodName + this.Params = params + return &this +} + +// NewRunTransactionRequestWithDefaults instantiates a new RunTransactionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionRequestWithDefaults() *RunTransactionRequest { + this := RunTransactionRequest{} + return &this +} + +// GetEndorsingPeers returns the EndorsingPeers field value if set, zero value otherwise. +func (o *RunTransactionRequest) GetEndorsingPeers() []string { + if o == nil || IsNil(o.EndorsingPeers) { + var ret []string + return ret + } + return o.EndorsingPeers +} + +// GetEndorsingPeersOk returns a tuple with the EndorsingPeers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetEndorsingPeersOk() ([]string, bool) { + if o == nil || IsNil(o.EndorsingPeers) { + return nil, false + } + return o.EndorsingPeers, true +} + +// HasEndorsingPeers returns a boolean if a field has been set. +func (o *RunTransactionRequest) HasEndorsingPeers() bool { + if o != nil && !IsNil(o.EndorsingPeers) { + return true + } + + return false +} + +// SetEndorsingPeers gets a reference to the given []string and assigns it to the EndorsingPeers field. +func (o *RunTransactionRequest) SetEndorsingPeers(v []string) { + o.EndorsingPeers = v +} + +// GetEndorsingOrgs returns the EndorsingOrgs field value if set, zero value otherwise. +func (o *RunTransactionRequest) GetEndorsingOrgs() []string { + if o == nil || IsNil(o.EndorsingOrgs) { + var ret []string + return ret + } + return o.EndorsingOrgs +} + +// GetEndorsingOrgsOk returns a tuple with the EndorsingOrgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetEndorsingOrgsOk() ([]string, bool) { + if o == nil || IsNil(o.EndorsingOrgs) { + return nil, false + } + return o.EndorsingOrgs, true +} + +// HasEndorsingOrgs returns a boolean if a field has been set. +func (o *RunTransactionRequest) HasEndorsingOrgs() bool { + if o != nil && !IsNil(o.EndorsingOrgs) { + return true + } + + return false +} + +// SetEndorsingOrgs gets a reference to the given []string and assigns it to the EndorsingOrgs field. +func (o *RunTransactionRequest) SetEndorsingOrgs(v []string) { + o.EndorsingOrgs = v +} + +// GetTransientData returns the TransientData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RunTransactionRequest) GetTransientData() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.TransientData +} + +// GetTransientDataOk returns a tuple with the TransientData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunTransactionRequest) GetTransientDataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.TransientData) { + return map[string]interface{}{}, false + } + return o.TransientData, true +} + +// HasTransientData returns a boolean if a field has been set. +func (o *RunTransactionRequest) HasTransientData() bool { + if o != nil && IsNil(o.TransientData) { + return true + } + + return false +} + +// SetTransientData gets a reference to the given map[string]interface{} and assigns it to the TransientData field. +func (o *RunTransactionRequest) SetTransientData(v map[string]interface{}) { + o.TransientData = v +} + +// GetGatewayOptions returns the GatewayOptions field value if set, zero value otherwise. +func (o *RunTransactionRequest) GetGatewayOptions() GatewayOptions { + if o == nil || IsNil(o.GatewayOptions) { + var ret GatewayOptions + return ret + } + return *o.GatewayOptions +} + +// GetGatewayOptionsOk returns a tuple with the GatewayOptions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetGatewayOptionsOk() (*GatewayOptions, bool) { + if o == nil || IsNil(o.GatewayOptions) { + return nil, false + } + return o.GatewayOptions, true +} + +// HasGatewayOptions returns a boolean if a field has been set. +func (o *RunTransactionRequest) HasGatewayOptions() bool { + if o != nil && !IsNil(o.GatewayOptions) { + return true + } + + return false +} + +// SetGatewayOptions gets a reference to the given GatewayOptions and assigns it to the GatewayOptions field. +func (o *RunTransactionRequest) SetGatewayOptions(v GatewayOptions) { + o.GatewayOptions = &v +} + +// GetSigningCredential returns the SigningCredential field value +func (o *RunTransactionRequest) GetSigningCredential() FabricSigningCredential { + if o == nil { + var ret FabricSigningCredential + return ret + } + + return o.SigningCredential +} + +// GetSigningCredentialOk returns a tuple with the SigningCredential field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetSigningCredentialOk() (*FabricSigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.SigningCredential, true +} + +// SetSigningCredential sets field value +func (o *RunTransactionRequest) SetSigningCredential(v FabricSigningCredential) { + o.SigningCredential = v +} + +// GetChannelName returns the ChannelName field value +func (o *RunTransactionRequest) GetChannelName() string { + if o == nil { + var ret string + return ret + } + + return o.ChannelName +} + +// GetChannelNameOk returns a tuple with the ChannelName field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetChannelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelName, true +} + +// SetChannelName sets field value +func (o *RunTransactionRequest) SetChannelName(v string) { + o.ChannelName = v +} + +// GetContractName returns the ContractName field value +func (o *RunTransactionRequest) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *RunTransactionRequest) SetContractName(v string) { + o.ContractName = v +} + +// GetInvocationType returns the InvocationType field value +func (o *RunTransactionRequest) GetInvocationType() FabricContractInvocationType { + if o == nil { + var ret FabricContractInvocationType + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetInvocationTypeOk() (*FabricContractInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *RunTransactionRequest) SetInvocationType(v FabricContractInvocationType) { + o.InvocationType = v +} + +// GetMethodName returns the MethodName field value +func (o *RunTransactionRequest) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *RunTransactionRequest) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value +func (o *RunTransactionRequest) GetParams() []*string { + if o == nil { + var ret []*string + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetParamsOk() ([]*string, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *RunTransactionRequest) SetParams(v []*string) { + o.Params = v +} + +// GetResponseType returns the ResponseType field value if set, zero value otherwise. +func (o *RunTransactionRequest) GetResponseType() RunTransactionResponseType { + if o == nil || IsNil(o.ResponseType) { + var ret RunTransactionResponseType + return ret + } + return *o.ResponseType +} + +// GetResponseTypeOk returns a tuple with the ResponseType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetResponseTypeOk() (*RunTransactionResponseType, bool) { + if o == nil || IsNil(o.ResponseType) { + return nil, false + } + return o.ResponseType, true +} + +// HasResponseType returns a boolean if a field has been set. +func (o *RunTransactionRequest) HasResponseType() bool { + if o != nil && !IsNil(o.ResponseType) { + return true + } + + return false +} + +// SetResponseType gets a reference to the given RunTransactionResponseType and assigns it to the ResponseType field. +func (o *RunTransactionRequest) SetResponseType(v RunTransactionResponseType) { + o.ResponseType = &v +} + +func (o RunTransactionRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.EndorsingPeers) { + toSerialize["endorsingPeers"] = o.EndorsingPeers + } + if !IsNil(o.EndorsingOrgs) { + toSerialize["endorsingOrgs"] = o.EndorsingOrgs + } + if o.TransientData != nil { + toSerialize["transientData"] = o.TransientData + } + if !IsNil(o.GatewayOptions) { + toSerialize["gatewayOptions"] = o.GatewayOptions + } + toSerialize["signingCredential"] = o.SigningCredential + toSerialize["channelName"] = o.ChannelName + toSerialize["contractName"] = o.ContractName + toSerialize["invocationType"] = o.InvocationType + toSerialize["methodName"] = o.MethodName + toSerialize["params"] = o.Params + if !IsNil(o.ResponseType) { + toSerialize["responseType"] = o.ResponseType + } + return toSerialize, nil +} + +type NullableRunTransactionRequest struct { + value *RunTransactionRequest + isSet bool +} + +func (v NullableRunTransactionRequest) Get() *RunTransactionRequest { + return v.value +} + +func (v *NullableRunTransactionRequest) Set(val *RunTransactionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionRequest(val *RunTransactionRequest) *NullableRunTransactionRequest { + return &NullableRunTransactionRequest{value: val, isSet: true} +} + +func (v NullableRunTransactionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_transaction_response.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_transaction_response.go new file mode 100644 index 00000000000..20c74f33571 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_transaction_response.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the RunTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionResponse{} + +// RunTransactionResponse struct for RunTransactionResponse +type RunTransactionResponse struct { + FunctionOutput string `json:"functionOutput"` + TransactionId string `json:"transactionId"` +} + +// NewRunTransactionResponse instantiates a new RunTransactionResponse 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 +// will change when the set of required properties is changed +func NewRunTransactionResponse(functionOutput string, transactionId string) *RunTransactionResponse { + this := RunTransactionResponse{} + this.FunctionOutput = functionOutput + this.TransactionId = transactionId + return &this +} + +// NewRunTransactionResponseWithDefaults instantiates a new RunTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionResponseWithDefaults() *RunTransactionResponse { + this := RunTransactionResponse{} + return &this +} + +// GetFunctionOutput returns the FunctionOutput field value +func (o *RunTransactionResponse) GetFunctionOutput() string { + if o == nil { + var ret string + return ret + } + + return o.FunctionOutput +} + +// GetFunctionOutputOk returns a tuple with the FunctionOutput field value +// and a boolean to check if the value has been set. +func (o *RunTransactionResponse) GetFunctionOutputOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FunctionOutput, true +} + +// SetFunctionOutput sets field value +func (o *RunTransactionResponse) SetFunctionOutput(v string) { + o.FunctionOutput = v +} + +// GetTransactionId returns the TransactionId field value +func (o *RunTransactionResponse) GetTransactionId() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionId +} + +// GetTransactionIdOk returns a tuple with the TransactionId field value +// and a boolean to check if the value has been set. +func (o *RunTransactionResponse) GetTransactionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionId, true +} + +// SetTransactionId sets field value +func (o *RunTransactionResponse) SetTransactionId(v string) { + o.TransactionId = v +} + +func (o RunTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["functionOutput"] = o.FunctionOutput + toSerialize["transactionId"] = o.TransactionId + return toSerialize, nil +} + +type NullableRunTransactionResponse struct { + value *RunTransactionResponse + isSet bool +} + +func (v NullableRunTransactionResponse) Get() *RunTransactionResponse { + return v.value +} + +func (v *NullableRunTransactionResponse) Set(val *RunTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionResponse(val *RunTransactionResponse) *NullableRunTransactionResponse { + return &NullableRunTransactionResponse{value: val, isSet: true} +} + +func (v NullableRunTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_transaction_response_type.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_transaction_response_type.go new file mode 100644 index 00000000000..721010bf2f3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_transaction_response_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// RunTransactionResponseType Response format from transaction / query execution +type RunTransactionResponseType string + +// List of RunTransactionResponseType +const ( + JSON RunTransactionResponseType = "org.hyperledger.cacti.api.hlfabric.RunTransactionResponseType.JSON" + UTF8 RunTransactionResponseType = "org.hyperledger.cacti.api.hlfabric.RunTransactionResponseType.UTF8" +) + +// All allowed values of RunTransactionResponseType enum +var AllowedRunTransactionResponseTypeEnumValues = []RunTransactionResponseType{ + "org.hyperledger.cacti.api.hlfabric.RunTransactionResponseType.JSON", + "org.hyperledger.cacti.api.hlfabric.RunTransactionResponseType.UTF8", +} + +func (v *RunTransactionResponseType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RunTransactionResponseType(value) + for _, existing := range AllowedRunTransactionResponseTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid RunTransactionResponseType", value) +} + +// NewRunTransactionResponseTypeFromValue returns a pointer to a valid RunTransactionResponseType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRunTransactionResponseTypeFromValue(v string) (*RunTransactionResponseType, error) { + ev := RunTransactionResponseType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RunTransactionResponseType: valid values are %v", v, AllowedRunTransactionResponseTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RunTransactionResponseType) IsValid() bool { + for _, existing := range AllowedRunTransactionResponseTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RunTransactionResponseType value +func (v RunTransactionResponseType) Ptr() *RunTransactionResponseType { + return &v +} + +type NullableRunTransactionResponseType struct { + value *RunTransactionResponseType + isSet bool +} + +func (v NullableRunTransactionResponseType) Get() *RunTransactionResponseType { + return v.value +} + +func (v *NullableRunTransactionResponseType) Set(val *RunTransactionResponseType) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionResponseType) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionResponseType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionResponseType(val *RunTransactionResponseType) *NullableRunTransactionResponseType { + return &NullableRunTransactionResponseType{value: val, isSet: true} +} + +func (v NullableRunTransactionResponseType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionResponseType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_ssh_exec_command_response.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_ssh_exec_command_response.go new file mode 100644 index 00000000000..e50c47a3444 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_ssh_exec_command_response.go @@ -0,0 +1,202 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the SSHExecCommandResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SSHExecCommandResponse{} + +// SSHExecCommandResponse struct for SSHExecCommandResponse +type SSHExecCommandResponse struct { + Stdout string `json:"stdout"` + Stderr string `json:"stderr"` + Code NullableInt32 `json:"code"` + Signal NullableString `json:"signal"` +} + +// NewSSHExecCommandResponse instantiates a new SSHExecCommandResponse 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 +// will change when the set of required properties is changed +func NewSSHExecCommandResponse(stdout string, stderr string, code NullableInt32, signal NullableString) *SSHExecCommandResponse { + this := SSHExecCommandResponse{} + this.Stdout = stdout + this.Stderr = stderr + this.Code = code + this.Signal = signal + return &this +} + +// NewSSHExecCommandResponseWithDefaults instantiates a new SSHExecCommandResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSSHExecCommandResponseWithDefaults() *SSHExecCommandResponse { + this := SSHExecCommandResponse{} + return &this +} + +// GetStdout returns the Stdout field value +func (o *SSHExecCommandResponse) GetStdout() string { + if o == nil { + var ret string + return ret + } + + return o.Stdout +} + +// GetStdoutOk returns a tuple with the Stdout field value +// and a boolean to check if the value has been set. +func (o *SSHExecCommandResponse) GetStdoutOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Stdout, true +} + +// SetStdout sets field value +func (o *SSHExecCommandResponse) SetStdout(v string) { + o.Stdout = v +} + +// GetStderr returns the Stderr field value +func (o *SSHExecCommandResponse) GetStderr() string { + if o == nil { + var ret string + return ret + } + + return o.Stderr +} + +// GetStderrOk returns a tuple with the Stderr field value +// and a boolean to check if the value has been set. +func (o *SSHExecCommandResponse) GetStderrOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Stderr, true +} + +// SetStderr sets field value +func (o *SSHExecCommandResponse) SetStderr(v string) { + o.Stderr = v +} + +// GetCode returns the Code field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *SSHExecCommandResponse) GetCode() int32 { + if o == nil || o.Code.Get() == nil { + var ret int32 + return ret + } + + return *o.Code.Get() +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SSHExecCommandResponse) GetCodeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Code.Get(), o.Code.IsSet() +} + +// SetCode sets field value +func (o *SSHExecCommandResponse) SetCode(v int32) { + o.Code.Set(&v) +} + +// GetSignal returns the Signal field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SSHExecCommandResponse) GetSignal() string { + if o == nil || o.Signal.Get() == nil { + var ret string + return ret + } + + return *o.Signal.Get() +} + +// GetSignalOk returns a tuple with the Signal field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SSHExecCommandResponse) GetSignalOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Signal.Get(), o.Signal.IsSet() +} + +// SetSignal sets field value +func (o *SSHExecCommandResponse) SetSignal(v string) { + o.Signal.Set(&v) +} + +func (o SSHExecCommandResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SSHExecCommandResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["stdout"] = o.Stdout + toSerialize["stderr"] = o.Stderr + toSerialize["code"] = o.Code.Get() + toSerialize["signal"] = o.Signal.Get() + return toSerialize, nil +} + +type NullableSSHExecCommandResponse struct { + value *SSHExecCommandResponse + isSet bool +} + +func (v NullableSSHExecCommandResponse) Get() *SSHExecCommandResponse { + return v.value +} + +func (v *NullableSSHExecCommandResponse) Set(val *SSHExecCommandResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSSHExecCommandResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSSHExecCommandResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSSHExecCommandResponse(val *SSHExecCommandResponse) *NullableSSHExecCommandResponse { + return &NullableSSHExecCommandResponse{value: val, isSet: true} +} + +func (v NullableSSHExecCommandResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSSHExecCommandResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_block_meta_data.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_block_meta_data.go new file mode 100644 index 00000000000..e1bf1a63dd0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_block_meta_data.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the TransactReceiptBlockMetaData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactReceiptBlockMetaData{} + +// TransactReceiptBlockMetaData struct for TransactReceiptBlockMetaData +type TransactReceiptBlockMetaData struct { + Mspid *string `json:"mspid,omitempty"` + BlockCreatorID *string `json:"blockCreatorID,omitempty"` + Signature *string `json:"signature,omitempty"` +} + +// NewTransactReceiptBlockMetaData instantiates a new TransactReceiptBlockMetaData 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 +// will change when the set of required properties is changed +func NewTransactReceiptBlockMetaData() *TransactReceiptBlockMetaData { + this := TransactReceiptBlockMetaData{} + return &this +} + +// NewTransactReceiptBlockMetaDataWithDefaults instantiates a new TransactReceiptBlockMetaData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactReceiptBlockMetaDataWithDefaults() *TransactReceiptBlockMetaData { + this := TransactReceiptBlockMetaData{} + return &this +} + +// GetMspid returns the Mspid field value if set, zero value otherwise. +func (o *TransactReceiptBlockMetaData) GetMspid() string { + if o == nil || IsNil(o.Mspid) { + var ret string + return ret + } + return *o.Mspid +} + +// GetMspidOk returns a tuple with the Mspid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactReceiptBlockMetaData) GetMspidOk() (*string, bool) { + if o == nil || IsNil(o.Mspid) { + return nil, false + } + return o.Mspid, true +} + +// HasMspid returns a boolean if a field has been set. +func (o *TransactReceiptBlockMetaData) HasMspid() bool { + if o != nil && !IsNil(o.Mspid) { + return true + } + + return false +} + +// SetMspid gets a reference to the given string and assigns it to the Mspid field. +func (o *TransactReceiptBlockMetaData) SetMspid(v string) { + o.Mspid = &v +} + +// GetBlockCreatorID returns the BlockCreatorID field value if set, zero value otherwise. +func (o *TransactReceiptBlockMetaData) GetBlockCreatorID() string { + if o == nil || IsNil(o.BlockCreatorID) { + var ret string + return ret + } + return *o.BlockCreatorID +} + +// GetBlockCreatorIDOk returns a tuple with the BlockCreatorID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactReceiptBlockMetaData) GetBlockCreatorIDOk() (*string, bool) { + if o == nil || IsNil(o.BlockCreatorID) { + return nil, false + } + return o.BlockCreatorID, true +} + +// HasBlockCreatorID returns a boolean if a field has been set. +func (o *TransactReceiptBlockMetaData) HasBlockCreatorID() bool { + if o != nil && !IsNil(o.BlockCreatorID) { + return true + } + + return false +} + +// SetBlockCreatorID gets a reference to the given string and assigns it to the BlockCreatorID field. +func (o *TransactReceiptBlockMetaData) SetBlockCreatorID(v string) { + o.BlockCreatorID = &v +} + +// GetSignature returns the Signature field value if set, zero value otherwise. +func (o *TransactReceiptBlockMetaData) GetSignature() string { + if o == nil || IsNil(o.Signature) { + var ret string + return ret + } + return *o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactReceiptBlockMetaData) GetSignatureOk() (*string, bool) { + if o == nil || IsNil(o.Signature) { + return nil, false + } + return o.Signature, true +} + +// HasSignature returns a boolean if a field has been set. +func (o *TransactReceiptBlockMetaData) HasSignature() bool { + if o != nil && !IsNil(o.Signature) { + return true + } + + return false +} + +// SetSignature gets a reference to the given string and assigns it to the Signature field. +func (o *TransactReceiptBlockMetaData) SetSignature(v string) { + o.Signature = &v +} + +func (o TransactReceiptBlockMetaData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactReceiptBlockMetaData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Mspid) { + toSerialize["mspid"] = o.Mspid + } + if !IsNil(o.BlockCreatorID) { + toSerialize["blockCreatorID"] = o.BlockCreatorID + } + if !IsNil(o.Signature) { + toSerialize["signature"] = o.Signature + } + return toSerialize, nil +} + +type NullableTransactReceiptBlockMetaData struct { + value *TransactReceiptBlockMetaData + isSet bool +} + +func (v NullableTransactReceiptBlockMetaData) Get() *TransactReceiptBlockMetaData { + return v.value +} + +func (v *NullableTransactReceiptBlockMetaData) Set(val *TransactReceiptBlockMetaData) { + v.value = val + v.isSet = true +} + +func (v NullableTransactReceiptBlockMetaData) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactReceiptBlockMetaData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactReceiptBlockMetaData(val *TransactReceiptBlockMetaData) *NullableTransactReceiptBlockMetaData { + return &NullableTransactReceiptBlockMetaData{value: val, isSet: true} +} + +func (v NullableTransactReceiptBlockMetaData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactReceiptBlockMetaData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_transaction_creator.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_transaction_creator.go new file mode 100644 index 00000000000..06e9b6ac958 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_transaction_creator.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the TransactReceiptTransactionCreator type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactReceiptTransactionCreator{} + +// TransactReceiptTransactionCreator struct for TransactReceiptTransactionCreator +type TransactReceiptTransactionCreator struct { + Mspid *string `json:"mspid,omitempty"` + CreatorID *string `json:"creatorID,omitempty"` +} + +// NewTransactReceiptTransactionCreator instantiates a new TransactReceiptTransactionCreator 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 +// will change when the set of required properties is changed +func NewTransactReceiptTransactionCreator() *TransactReceiptTransactionCreator { + this := TransactReceiptTransactionCreator{} + return &this +} + +// NewTransactReceiptTransactionCreatorWithDefaults instantiates a new TransactReceiptTransactionCreator object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactReceiptTransactionCreatorWithDefaults() *TransactReceiptTransactionCreator { + this := TransactReceiptTransactionCreator{} + return &this +} + +// GetMspid returns the Mspid field value if set, zero value otherwise. +func (o *TransactReceiptTransactionCreator) GetMspid() string { + if o == nil || IsNil(o.Mspid) { + var ret string + return ret + } + return *o.Mspid +} + +// GetMspidOk returns a tuple with the Mspid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactReceiptTransactionCreator) GetMspidOk() (*string, bool) { + if o == nil || IsNil(o.Mspid) { + return nil, false + } + return o.Mspid, true +} + +// HasMspid returns a boolean if a field has been set. +func (o *TransactReceiptTransactionCreator) HasMspid() bool { + if o != nil && !IsNil(o.Mspid) { + return true + } + + return false +} + +// SetMspid gets a reference to the given string and assigns it to the Mspid field. +func (o *TransactReceiptTransactionCreator) SetMspid(v string) { + o.Mspid = &v +} + +// GetCreatorID returns the CreatorID field value if set, zero value otherwise. +func (o *TransactReceiptTransactionCreator) GetCreatorID() string { + if o == nil || IsNil(o.CreatorID) { + var ret string + return ret + } + return *o.CreatorID +} + +// GetCreatorIDOk returns a tuple with the CreatorID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactReceiptTransactionCreator) GetCreatorIDOk() (*string, bool) { + if o == nil || IsNil(o.CreatorID) { + return nil, false + } + return o.CreatorID, true +} + +// HasCreatorID returns a boolean if a field has been set. +func (o *TransactReceiptTransactionCreator) HasCreatorID() bool { + if o != nil && !IsNil(o.CreatorID) { + return true + } + + return false +} + +// SetCreatorID gets a reference to the given string and assigns it to the CreatorID field. +func (o *TransactReceiptTransactionCreator) SetCreatorID(v string) { + o.CreatorID = &v +} + +func (o TransactReceiptTransactionCreator) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactReceiptTransactionCreator) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Mspid) { + toSerialize["mspid"] = o.Mspid + } + if !IsNil(o.CreatorID) { + toSerialize["creatorID"] = o.CreatorID + } + return toSerialize, nil +} + +type NullableTransactReceiptTransactionCreator struct { + value *TransactReceiptTransactionCreator + isSet bool +} + +func (v NullableTransactReceiptTransactionCreator) Get() *TransactReceiptTransactionCreator { + return v.value +} + +func (v *NullableTransactReceiptTransactionCreator) Set(val *TransactReceiptTransactionCreator) { + v.value = val + v.isSet = true +} + +func (v NullableTransactReceiptTransactionCreator) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactReceiptTransactionCreator) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactReceiptTransactionCreator(val *TransactReceiptTransactionCreator) *NullableTransactReceiptTransactionCreator { + return &NullableTransactReceiptTransactionCreator{value: val, isSet: true} +} + +func (v NullableTransactReceiptTransactionCreator) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactReceiptTransactionCreator) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_transaction_endorsement.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_transaction_endorsement.go new file mode 100644 index 00000000000..5544859e0de --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_transact_receipt_transaction_endorsement.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the TransactReceiptTransactionEndorsement type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactReceiptTransactionEndorsement{} + +// TransactReceiptTransactionEndorsement struct for TransactReceiptTransactionEndorsement +type TransactReceiptTransactionEndorsement struct { + Mspid *string `json:"mspid,omitempty"` + EndorserID *string `json:"endorserID,omitempty"` + Signature *string `json:"signature,omitempty"` +} + +// NewTransactReceiptTransactionEndorsement instantiates a new TransactReceiptTransactionEndorsement 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 +// will change when the set of required properties is changed +func NewTransactReceiptTransactionEndorsement() *TransactReceiptTransactionEndorsement { + this := TransactReceiptTransactionEndorsement{} + return &this +} + +// NewTransactReceiptTransactionEndorsementWithDefaults instantiates a new TransactReceiptTransactionEndorsement object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactReceiptTransactionEndorsementWithDefaults() *TransactReceiptTransactionEndorsement { + this := TransactReceiptTransactionEndorsement{} + return &this +} + +// GetMspid returns the Mspid field value if set, zero value otherwise. +func (o *TransactReceiptTransactionEndorsement) GetMspid() string { + if o == nil || IsNil(o.Mspid) { + var ret string + return ret + } + return *o.Mspid +} + +// GetMspidOk returns a tuple with the Mspid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactReceiptTransactionEndorsement) GetMspidOk() (*string, bool) { + if o == nil || IsNil(o.Mspid) { + return nil, false + } + return o.Mspid, true +} + +// HasMspid returns a boolean if a field has been set. +func (o *TransactReceiptTransactionEndorsement) HasMspid() bool { + if o != nil && !IsNil(o.Mspid) { + return true + } + + return false +} + +// SetMspid gets a reference to the given string and assigns it to the Mspid field. +func (o *TransactReceiptTransactionEndorsement) SetMspid(v string) { + o.Mspid = &v +} + +// GetEndorserID returns the EndorserID field value if set, zero value otherwise. +func (o *TransactReceiptTransactionEndorsement) GetEndorserID() string { + if o == nil || IsNil(o.EndorserID) { + var ret string + return ret + } + return *o.EndorserID +} + +// GetEndorserIDOk returns a tuple with the EndorserID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactReceiptTransactionEndorsement) GetEndorserIDOk() (*string, bool) { + if o == nil || IsNil(o.EndorserID) { + return nil, false + } + return o.EndorserID, true +} + +// HasEndorserID returns a boolean if a field has been set. +func (o *TransactReceiptTransactionEndorsement) HasEndorserID() bool { + if o != nil && !IsNil(o.EndorserID) { + return true + } + + return false +} + +// SetEndorserID gets a reference to the given string and assigns it to the EndorserID field. +func (o *TransactReceiptTransactionEndorsement) SetEndorserID(v string) { + o.EndorserID = &v +} + +// GetSignature returns the Signature field value if set, zero value otherwise. +func (o *TransactReceiptTransactionEndorsement) GetSignature() string { + if o == nil || IsNil(o.Signature) { + var ret string + return ret + } + return *o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactReceiptTransactionEndorsement) GetSignatureOk() (*string, bool) { + if o == nil || IsNil(o.Signature) { + return nil, false + } + return o.Signature, true +} + +// HasSignature returns a boolean if a field has been set. +func (o *TransactReceiptTransactionEndorsement) HasSignature() bool { + if o != nil && !IsNil(o.Signature) { + return true + } + + return false +} + +// SetSignature gets a reference to the given string and assigns it to the Signature field. +func (o *TransactReceiptTransactionEndorsement) SetSignature(v string) { + o.Signature = &v +} + +func (o TransactReceiptTransactionEndorsement) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactReceiptTransactionEndorsement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Mspid) { + toSerialize["mspid"] = o.Mspid + } + if !IsNil(o.EndorserID) { + toSerialize["endorserID"] = o.EndorserID + } + if !IsNil(o.Signature) { + toSerialize["signature"] = o.Signature + } + return toSerialize, nil +} + +type NullableTransactReceiptTransactionEndorsement struct { + value *TransactReceiptTransactionEndorsement + isSet bool +} + +func (v NullableTransactReceiptTransactionEndorsement) Get() *TransactReceiptTransactionEndorsement { + return v.value +} + +func (v *NullableTransactReceiptTransactionEndorsement) Set(val *TransactReceiptTransactionEndorsement) { + v.value = val + v.isSet = true +} + +func (v NullableTransactReceiptTransactionEndorsement) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactReceiptTransactionEndorsement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactReceiptTransactionEndorsement(val *TransactReceiptTransactionEndorsement) *NullableTransactReceiptTransactionEndorsement { + return &NullableTransactReceiptTransactionEndorsement{value: val, isSet: true} +} + +func (v NullableTransactReceiptTransactionEndorsement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactReceiptTransactionEndorsement) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_vault_transit_key.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_vault_transit_key.go new file mode 100644 index 00000000000..0ad1d2f1603 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_vault_transit_key.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the VaultTransitKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VaultTransitKey{} + +// VaultTransitKey vault key details for signing fabric message with private key stored with transit engine. +type VaultTransitKey struct { + // label of private key + KeyName string `json:"keyName"` + // token for accessing private key + Token string `json:"token"` +} + +// NewVaultTransitKey instantiates a new VaultTransitKey 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 +// will change when the set of required properties is changed +func NewVaultTransitKey(keyName string, token string) *VaultTransitKey { + this := VaultTransitKey{} + this.KeyName = keyName + this.Token = token + return &this +} + +// NewVaultTransitKeyWithDefaults instantiates a new VaultTransitKey object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVaultTransitKeyWithDefaults() *VaultTransitKey { + this := VaultTransitKey{} + return &this +} + +// GetKeyName returns the KeyName field value +func (o *VaultTransitKey) GetKeyName() string { + if o == nil { + var ret string + return ret + } + + return o.KeyName +} + +// GetKeyNameOk returns a tuple with the KeyName field value +// and a boolean to check if the value has been set. +func (o *VaultTransitKey) GetKeyNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeyName, true +} + +// SetKeyName sets field value +func (o *VaultTransitKey) SetKeyName(v string) { + o.KeyName = v +} + +// GetToken returns the Token field value +func (o *VaultTransitKey) GetToken() string { + if o == nil { + var ret string + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *VaultTransitKey) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Token, true +} + +// SetToken sets field value +func (o *VaultTransitKey) SetToken(v string) { + o.Token = v +} + +func (o VaultTransitKey) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VaultTransitKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["keyName"] = o.KeyName + toSerialize["token"] = o.Token + return toSerialize, nil +} + +type NullableVaultTransitKey struct { + value *VaultTransitKey + isSet bool +} + +func (v NullableVaultTransitKey) Get() *VaultTransitKey { + return v.value +} + +func (v *NullableVaultTransitKey) Set(val *VaultTransitKey) { + v.value = val + v.isSet = true +} + +func (v NullableVaultTransitKey) IsSet() bool { + return v.isSet +} + +func (v *NullableVaultTransitKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVaultTransitKey(val *VaultTransitKey) *NullableVaultTransitKey { + return &NullableVaultTransitKey{value: val, isSet: true} +} + +func (v NullableVaultTransitKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVaultTransitKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_error_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_error_response_v1.go new file mode 100644 index 00000000000..e9d86d8d219 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_error_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WatchBlocksCactusErrorResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksCactusErrorResponseV1{} + +// WatchBlocksCactusErrorResponseV1 Error response from WatchBlocks operation. +type WatchBlocksCactusErrorResponseV1 struct { + // Error code. + Code float32 `json:"code"` + // Description of the error. + ErrorMessage string `json:"errorMessage"` +} + +// NewWatchBlocksCactusErrorResponseV1 instantiates a new WatchBlocksCactusErrorResponseV1 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 +// will change when the set of required properties is changed +func NewWatchBlocksCactusErrorResponseV1(code float32, errorMessage string) *WatchBlocksCactusErrorResponseV1 { + this := WatchBlocksCactusErrorResponseV1{} + this.Code = code + this.ErrorMessage = errorMessage + return &this +} + +// NewWatchBlocksCactusErrorResponseV1WithDefaults instantiates a new WatchBlocksCactusErrorResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksCactusErrorResponseV1WithDefaults() *WatchBlocksCactusErrorResponseV1 { + this := WatchBlocksCactusErrorResponseV1{} + return &this +} + +// GetCode returns the Code field value +func (o *WatchBlocksCactusErrorResponseV1) GetCode() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksCactusErrorResponseV1) GetCodeOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *WatchBlocksCactusErrorResponseV1) SetCode(v float32) { + o.Code = v +} + +// GetErrorMessage returns the ErrorMessage field value +func (o *WatchBlocksCactusErrorResponseV1) GetErrorMessage() string { + if o == nil { + var ret string + return ret + } + + return o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksCactusErrorResponseV1) GetErrorMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ErrorMessage, true +} + +// SetErrorMessage sets field value +func (o *WatchBlocksCactusErrorResponseV1) SetErrorMessage(v string) { + o.ErrorMessage = v +} + +func (o WatchBlocksCactusErrorResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksCactusErrorResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["code"] = o.Code + toSerialize["errorMessage"] = o.ErrorMessage + return toSerialize, nil +} + +type NullableWatchBlocksCactusErrorResponseV1 struct { + value *WatchBlocksCactusErrorResponseV1 + isSet bool +} + +func (v NullableWatchBlocksCactusErrorResponseV1) Get() *WatchBlocksCactusErrorResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksCactusErrorResponseV1) Set(val *WatchBlocksCactusErrorResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksCactusErrorResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksCactusErrorResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksCactusErrorResponseV1(val *WatchBlocksCactusErrorResponseV1) *NullableWatchBlocksCactusErrorResponseV1 { + return &NullableWatchBlocksCactusErrorResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksCactusErrorResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksCactusErrorResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_transactions_event_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_transactions_event_v1.go new file mode 100644 index 00000000000..7b5cf178bf8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_transactions_event_v1.go @@ -0,0 +1,202 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WatchBlocksCactusTransactionsEventV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksCactusTransactionsEventV1{} + +// WatchBlocksCactusTransactionsEventV1 Transaction summary from commited block. +type WatchBlocksCactusTransactionsEventV1 struct { + // ChainCode containing function that was executed. + ChaincodeId string `json:"chaincodeId"` + // Transaction identifier. + TransactionId string `json:"transactionId"` + // Function name that was executed. + FunctionName string `json:"functionName"` + // List of function arguments. + FunctionArgs []string `json:"functionArgs"` +} + +// NewWatchBlocksCactusTransactionsEventV1 instantiates a new WatchBlocksCactusTransactionsEventV1 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 +// will change when the set of required properties is changed +func NewWatchBlocksCactusTransactionsEventV1(chaincodeId string, transactionId string, functionName string, functionArgs []string) *WatchBlocksCactusTransactionsEventV1 { + this := WatchBlocksCactusTransactionsEventV1{} + this.ChaincodeId = chaincodeId + this.TransactionId = transactionId + this.FunctionName = functionName + this.FunctionArgs = functionArgs + return &this +} + +// NewWatchBlocksCactusTransactionsEventV1WithDefaults instantiates a new WatchBlocksCactusTransactionsEventV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksCactusTransactionsEventV1WithDefaults() *WatchBlocksCactusTransactionsEventV1 { + this := WatchBlocksCactusTransactionsEventV1{} + return &this +} + +// GetChaincodeId returns the ChaincodeId field value +func (o *WatchBlocksCactusTransactionsEventV1) GetChaincodeId() string { + if o == nil { + var ret string + return ret + } + + return o.ChaincodeId +} + +// GetChaincodeIdOk returns a tuple with the ChaincodeId field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksCactusTransactionsEventV1) GetChaincodeIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChaincodeId, true +} + +// SetChaincodeId sets field value +func (o *WatchBlocksCactusTransactionsEventV1) SetChaincodeId(v string) { + o.ChaincodeId = v +} + +// GetTransactionId returns the TransactionId field value +func (o *WatchBlocksCactusTransactionsEventV1) GetTransactionId() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionId +} + +// GetTransactionIdOk returns a tuple with the TransactionId field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksCactusTransactionsEventV1) GetTransactionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionId, true +} + +// SetTransactionId sets field value +func (o *WatchBlocksCactusTransactionsEventV1) SetTransactionId(v string) { + o.TransactionId = v +} + +// GetFunctionName returns the FunctionName field value +func (o *WatchBlocksCactusTransactionsEventV1) GetFunctionName() string { + if o == nil { + var ret string + return ret + } + + return o.FunctionName +} + +// GetFunctionNameOk returns a tuple with the FunctionName field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksCactusTransactionsEventV1) GetFunctionNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FunctionName, true +} + +// SetFunctionName sets field value +func (o *WatchBlocksCactusTransactionsEventV1) SetFunctionName(v string) { + o.FunctionName = v +} + +// GetFunctionArgs returns the FunctionArgs field value +func (o *WatchBlocksCactusTransactionsEventV1) GetFunctionArgs() []string { + if o == nil { + var ret []string + return ret + } + + return o.FunctionArgs +} + +// GetFunctionArgsOk returns a tuple with the FunctionArgs field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksCactusTransactionsEventV1) GetFunctionArgsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.FunctionArgs, true +} + +// SetFunctionArgs sets field value +func (o *WatchBlocksCactusTransactionsEventV1) SetFunctionArgs(v []string) { + o.FunctionArgs = v +} + +func (o WatchBlocksCactusTransactionsEventV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksCactusTransactionsEventV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["chaincodeId"] = o.ChaincodeId + toSerialize["transactionId"] = o.TransactionId + toSerialize["functionName"] = o.FunctionName + toSerialize["functionArgs"] = o.FunctionArgs + return toSerialize, nil +} + +type NullableWatchBlocksCactusTransactionsEventV1 struct { + value *WatchBlocksCactusTransactionsEventV1 + isSet bool +} + +func (v NullableWatchBlocksCactusTransactionsEventV1) Get() *WatchBlocksCactusTransactionsEventV1 { + return v.value +} + +func (v *NullableWatchBlocksCactusTransactionsEventV1) Set(val *WatchBlocksCactusTransactionsEventV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksCactusTransactionsEventV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksCactusTransactionsEventV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksCactusTransactionsEventV1(val *WatchBlocksCactusTransactionsEventV1) *NullableWatchBlocksCactusTransactionsEventV1 { + return &NullableWatchBlocksCactusTransactionsEventV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksCactusTransactionsEventV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksCactusTransactionsEventV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_transactions_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_transactions_response_v1.go new file mode 100644 index 00000000000..53f1b3b6f61 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_cactus_transactions_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WatchBlocksCactusTransactionsResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksCactusTransactionsResponseV1{} + +// WatchBlocksCactusTransactionsResponseV1 Custom response containing block transactions summary. Compatible with legacy fabric-socketio connector monitoring. +type WatchBlocksCactusTransactionsResponseV1 struct { + // List of transactions summary + CactusTransactionsEvents []WatchBlocksCactusTransactionsEventV1 `json:"cactusTransactionsEvents"` +} + +// NewWatchBlocksCactusTransactionsResponseV1 instantiates a new WatchBlocksCactusTransactionsResponseV1 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 +// will change when the set of required properties is changed +func NewWatchBlocksCactusTransactionsResponseV1(cactusTransactionsEvents []WatchBlocksCactusTransactionsEventV1) *WatchBlocksCactusTransactionsResponseV1 { + this := WatchBlocksCactusTransactionsResponseV1{} + this.CactusTransactionsEvents = cactusTransactionsEvents + return &this +} + +// NewWatchBlocksCactusTransactionsResponseV1WithDefaults instantiates a new WatchBlocksCactusTransactionsResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksCactusTransactionsResponseV1WithDefaults() *WatchBlocksCactusTransactionsResponseV1 { + this := WatchBlocksCactusTransactionsResponseV1{} + return &this +} + +// GetCactusTransactionsEvents returns the CactusTransactionsEvents field value +func (o *WatchBlocksCactusTransactionsResponseV1) GetCactusTransactionsEvents() []WatchBlocksCactusTransactionsEventV1 { + if o == nil { + var ret []WatchBlocksCactusTransactionsEventV1 + return ret + } + + return o.CactusTransactionsEvents +} + +// GetCactusTransactionsEventsOk returns a tuple with the CactusTransactionsEvents field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksCactusTransactionsResponseV1) GetCactusTransactionsEventsOk() ([]WatchBlocksCactusTransactionsEventV1, bool) { + if o == nil { + return nil, false + } + return o.CactusTransactionsEvents, true +} + +// SetCactusTransactionsEvents sets field value +func (o *WatchBlocksCactusTransactionsResponseV1) SetCactusTransactionsEvents(v []WatchBlocksCactusTransactionsEventV1) { + o.CactusTransactionsEvents = v +} + +func (o WatchBlocksCactusTransactionsResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksCactusTransactionsResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cactusTransactionsEvents"] = o.CactusTransactionsEvents + return toSerialize, nil +} + +type NullableWatchBlocksCactusTransactionsResponseV1 struct { + value *WatchBlocksCactusTransactionsResponseV1 + isSet bool +} + +func (v NullableWatchBlocksCactusTransactionsResponseV1) Get() *WatchBlocksCactusTransactionsResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksCactusTransactionsResponseV1) Set(val *WatchBlocksCactusTransactionsResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksCactusTransactionsResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksCactusTransactionsResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksCactusTransactionsResponseV1(val *WatchBlocksCactusTransactionsResponseV1) *NullableWatchBlocksCactusTransactionsResponseV1 { + return &NullableWatchBlocksCactusTransactionsResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksCactusTransactionsResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksCactusTransactionsResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_delegated_sign_options_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_delegated_sign_options_v1.go new file mode 100644 index 00000000000..ec6d26540b0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_delegated_sign_options_v1.go @@ -0,0 +1,273 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WatchBlocksDelegatedSignOptionsV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksDelegatedSignOptionsV1{} + +// WatchBlocksDelegatedSignOptionsV1 Options passed when subscribing to block monitoring with delegated signing. +type WatchBlocksDelegatedSignOptionsV1 struct { + Type WatchBlocksListenerTypeV1 `json:"type"` + // From which block start monitoring. Defaults to latest. + StartBlock *string `json:"startBlock,omitempty"` + ChannelName string `json:"channelName"` + SignerCertificate string `json:"signerCertificate"` + SignerMspID string `json:"signerMspID"` + // Can be used to uniquely identify and authorize signing request + UniqueTransactionData interface{} `json:"uniqueTransactionData,omitempty"` +} + +// NewWatchBlocksDelegatedSignOptionsV1 instantiates a new WatchBlocksDelegatedSignOptionsV1 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 +// will change when the set of required properties is changed +func NewWatchBlocksDelegatedSignOptionsV1(type_ WatchBlocksListenerTypeV1, channelName string, signerCertificate string, signerMspID string) *WatchBlocksDelegatedSignOptionsV1 { + this := WatchBlocksDelegatedSignOptionsV1{} + this.Type = type_ + this.ChannelName = channelName + this.SignerCertificate = signerCertificate + this.SignerMspID = signerMspID + return &this +} + +// NewWatchBlocksDelegatedSignOptionsV1WithDefaults instantiates a new WatchBlocksDelegatedSignOptionsV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksDelegatedSignOptionsV1WithDefaults() *WatchBlocksDelegatedSignOptionsV1 { + this := WatchBlocksDelegatedSignOptionsV1{} + return &this +} + +// GetType returns the Type field value +func (o *WatchBlocksDelegatedSignOptionsV1) GetType() WatchBlocksListenerTypeV1 { + if o == nil { + var ret WatchBlocksListenerTypeV1 + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksDelegatedSignOptionsV1) GetTypeOk() (*WatchBlocksListenerTypeV1, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WatchBlocksDelegatedSignOptionsV1) SetType(v WatchBlocksListenerTypeV1) { + o.Type = v +} + +// GetStartBlock returns the StartBlock field value if set, zero value otherwise. +func (o *WatchBlocksDelegatedSignOptionsV1) GetStartBlock() string { + if o == nil || IsNil(o.StartBlock) { + var ret string + return ret + } + return *o.StartBlock +} + +// GetStartBlockOk returns a tuple with the StartBlock field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksDelegatedSignOptionsV1) GetStartBlockOk() (*string, bool) { + if o == nil || IsNil(o.StartBlock) { + return nil, false + } + return o.StartBlock, true +} + +// HasStartBlock returns a boolean if a field has been set. +func (o *WatchBlocksDelegatedSignOptionsV1) HasStartBlock() bool { + if o != nil && !IsNil(o.StartBlock) { + return true + } + + return false +} + +// SetStartBlock gets a reference to the given string and assigns it to the StartBlock field. +func (o *WatchBlocksDelegatedSignOptionsV1) SetStartBlock(v string) { + o.StartBlock = &v +} + +// GetChannelName returns the ChannelName field value +func (o *WatchBlocksDelegatedSignOptionsV1) GetChannelName() string { + if o == nil { + var ret string + return ret + } + + return o.ChannelName +} + +// GetChannelNameOk returns a tuple with the ChannelName field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksDelegatedSignOptionsV1) GetChannelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelName, true +} + +// SetChannelName sets field value +func (o *WatchBlocksDelegatedSignOptionsV1) SetChannelName(v string) { + o.ChannelName = v +} + +// GetSignerCertificate returns the SignerCertificate field value +func (o *WatchBlocksDelegatedSignOptionsV1) GetSignerCertificate() string { + if o == nil { + var ret string + return ret + } + + return o.SignerCertificate +} + +// GetSignerCertificateOk returns a tuple with the SignerCertificate field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksDelegatedSignOptionsV1) GetSignerCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SignerCertificate, true +} + +// SetSignerCertificate sets field value +func (o *WatchBlocksDelegatedSignOptionsV1) SetSignerCertificate(v string) { + o.SignerCertificate = v +} + +// GetSignerMspID returns the SignerMspID field value +func (o *WatchBlocksDelegatedSignOptionsV1) GetSignerMspID() string { + if o == nil { + var ret string + return ret + } + + return o.SignerMspID +} + +// GetSignerMspIDOk returns a tuple with the SignerMspID field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksDelegatedSignOptionsV1) GetSignerMspIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SignerMspID, true +} + +// SetSignerMspID sets field value +func (o *WatchBlocksDelegatedSignOptionsV1) SetSignerMspID(v string) { + o.SignerMspID = v +} + +// GetUniqueTransactionData returns the UniqueTransactionData field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WatchBlocksDelegatedSignOptionsV1) GetUniqueTransactionData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.UniqueTransactionData +} + +// GetUniqueTransactionDataOk returns a tuple with the UniqueTransactionData field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WatchBlocksDelegatedSignOptionsV1) GetUniqueTransactionDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.UniqueTransactionData) { + return nil, false + } + return &o.UniqueTransactionData, true +} + +// HasUniqueTransactionData returns a boolean if a field has been set. +func (o *WatchBlocksDelegatedSignOptionsV1) HasUniqueTransactionData() bool { + if o != nil && IsNil(o.UniqueTransactionData) { + return true + } + + return false +} + +// SetUniqueTransactionData gets a reference to the given interface{} and assigns it to the UniqueTransactionData field. +func (o *WatchBlocksDelegatedSignOptionsV1) SetUniqueTransactionData(v interface{}) { + o.UniqueTransactionData = v +} + +func (o WatchBlocksDelegatedSignOptionsV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksDelegatedSignOptionsV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + if !IsNil(o.StartBlock) { + toSerialize["startBlock"] = o.StartBlock + } + toSerialize["channelName"] = o.ChannelName + toSerialize["signerCertificate"] = o.SignerCertificate + toSerialize["signerMspID"] = o.SignerMspID + if o.UniqueTransactionData != nil { + toSerialize["uniqueTransactionData"] = o.UniqueTransactionData + } + return toSerialize, nil +} + +type NullableWatchBlocksDelegatedSignOptionsV1 struct { + value *WatchBlocksDelegatedSignOptionsV1 + isSet bool +} + +func (v NullableWatchBlocksDelegatedSignOptionsV1) Get() *WatchBlocksDelegatedSignOptionsV1 { + return v.value +} + +func (v *NullableWatchBlocksDelegatedSignOptionsV1) Set(val *WatchBlocksDelegatedSignOptionsV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksDelegatedSignOptionsV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksDelegatedSignOptionsV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksDelegatedSignOptionsV1(val *WatchBlocksDelegatedSignOptionsV1) *NullableWatchBlocksDelegatedSignOptionsV1 { + return &NullableWatchBlocksDelegatedSignOptionsV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksDelegatedSignOptionsV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksDelegatedSignOptionsV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_filtered_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_filtered_response_v1.go new file mode 100644 index 00000000000..92d2bc9d2bf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_filtered_response_v1.go @@ -0,0 +1,122 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WatchBlocksFilteredResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksFilteredResponseV1{} + +// WatchBlocksFilteredResponseV1 Response that corresponds to Fabric SDK 'filtered' EventType. +type WatchBlocksFilteredResponseV1 struct { + // Filtered commited block. + FilteredBlock interface{} `json:"filteredBlock"` +} + +// NewWatchBlocksFilteredResponseV1 instantiates a new WatchBlocksFilteredResponseV1 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 +// will change when the set of required properties is changed +func NewWatchBlocksFilteredResponseV1(filteredBlock interface{}) *WatchBlocksFilteredResponseV1 { + this := WatchBlocksFilteredResponseV1{} + this.FilteredBlock = filteredBlock + return &this +} + +// NewWatchBlocksFilteredResponseV1WithDefaults instantiates a new WatchBlocksFilteredResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksFilteredResponseV1WithDefaults() *WatchBlocksFilteredResponseV1 { + this := WatchBlocksFilteredResponseV1{} + return &this +} + +// GetFilteredBlock returns the FilteredBlock field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *WatchBlocksFilteredResponseV1) GetFilteredBlock() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.FilteredBlock +} + +// GetFilteredBlockOk returns a tuple with the FilteredBlock field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WatchBlocksFilteredResponseV1) GetFilteredBlockOk() (*interface{}, bool) { + if o == nil || IsNil(o.FilteredBlock) { + return nil, false + } + return &o.FilteredBlock, true +} + +// SetFilteredBlock sets field value +func (o *WatchBlocksFilteredResponseV1) SetFilteredBlock(v interface{}) { + o.FilteredBlock = v +} + +func (o WatchBlocksFilteredResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksFilteredResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.FilteredBlock != nil { + toSerialize["filteredBlock"] = o.FilteredBlock + } + return toSerialize, nil +} + +type NullableWatchBlocksFilteredResponseV1 struct { + value *WatchBlocksFilteredResponseV1 + isSet bool +} + +func (v NullableWatchBlocksFilteredResponseV1) Get() *WatchBlocksFilteredResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksFilteredResponseV1) Set(val *WatchBlocksFilteredResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksFilteredResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksFilteredResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksFilteredResponseV1(val *WatchBlocksFilteredResponseV1) *NullableWatchBlocksFilteredResponseV1 { + return &NullableWatchBlocksFilteredResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksFilteredResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksFilteredResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_full_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_full_response_v1.go new file mode 100644 index 00000000000..a03029fa7aa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_full_response_v1.go @@ -0,0 +1,122 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WatchBlocksFullResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksFullResponseV1{} + +// WatchBlocksFullResponseV1 Response that corresponds to Fabric SDK 'full' EventType. +type WatchBlocksFullResponseV1 struct { + // Full commited block. + FullBlock interface{} `json:"fullBlock"` +} + +// NewWatchBlocksFullResponseV1 instantiates a new WatchBlocksFullResponseV1 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 +// will change when the set of required properties is changed +func NewWatchBlocksFullResponseV1(fullBlock interface{}) *WatchBlocksFullResponseV1 { + this := WatchBlocksFullResponseV1{} + this.FullBlock = fullBlock + return &this +} + +// NewWatchBlocksFullResponseV1WithDefaults instantiates a new WatchBlocksFullResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksFullResponseV1WithDefaults() *WatchBlocksFullResponseV1 { + this := WatchBlocksFullResponseV1{} + return &this +} + +// GetFullBlock returns the FullBlock field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *WatchBlocksFullResponseV1) GetFullBlock() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.FullBlock +} + +// GetFullBlockOk returns a tuple with the FullBlock field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WatchBlocksFullResponseV1) GetFullBlockOk() (*interface{}, bool) { + if o == nil || IsNil(o.FullBlock) { + return nil, false + } + return &o.FullBlock, true +} + +// SetFullBlock sets field value +func (o *WatchBlocksFullResponseV1) SetFullBlock(v interface{}) { + o.FullBlock = v +} + +func (o WatchBlocksFullResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksFullResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.FullBlock != nil { + toSerialize["fullBlock"] = o.FullBlock + } + return toSerialize, nil +} + +type NullableWatchBlocksFullResponseV1 struct { + value *WatchBlocksFullResponseV1 + isSet bool +} + +func (v NullableWatchBlocksFullResponseV1) Get() *WatchBlocksFullResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksFullResponseV1) Set(val *WatchBlocksFullResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksFullResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksFullResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksFullResponseV1(val *WatchBlocksFullResponseV1) *NullableWatchBlocksFullResponseV1 { + return &NullableWatchBlocksFullResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksFullResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksFullResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_listener_type_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_listener_type_v1.go new file mode 100644 index 00000000000..b37438ecf96 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_listener_type_v1.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksListenerTypeV1 Response type from WatchBlocks. 'Cactus*' are custom views, others correspond to fabric SDK call. +type WatchBlocksListenerTypeV1 string + +// List of WatchBlocksListenerTypeV1 +const ( + Filtered WatchBlocksListenerTypeV1 = "filtered" + Full WatchBlocksListenerTypeV1 = "full" + Private WatchBlocksListenerTypeV1 = "private" + CactusTransactions WatchBlocksListenerTypeV1 = "cactus:transactions" +) + +// All allowed values of WatchBlocksListenerTypeV1 enum +var AllowedWatchBlocksListenerTypeV1EnumValues = []WatchBlocksListenerTypeV1{ + "filtered", + "full", + "private", + "cactus:transactions", +} + +func (v *WatchBlocksListenerTypeV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchBlocksListenerTypeV1(value) + for _, existing := range AllowedWatchBlocksListenerTypeV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchBlocksListenerTypeV1", value) +} + +// NewWatchBlocksListenerTypeV1FromValue returns a pointer to a valid WatchBlocksListenerTypeV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchBlocksListenerTypeV1FromValue(v string) (*WatchBlocksListenerTypeV1, error) { + ev := WatchBlocksListenerTypeV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchBlocksListenerTypeV1: valid values are %v", v, AllowedWatchBlocksListenerTypeV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchBlocksListenerTypeV1) IsValid() bool { + for _, existing := range AllowedWatchBlocksListenerTypeV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchBlocksListenerTypeV1 value +func (v WatchBlocksListenerTypeV1) Ptr() *WatchBlocksListenerTypeV1 { + return &v +} + +type NullableWatchBlocksListenerTypeV1 struct { + value *WatchBlocksListenerTypeV1 + isSet bool +} + +func (v NullableWatchBlocksListenerTypeV1) Get() *WatchBlocksListenerTypeV1 { + return v.value +} + +func (v *NullableWatchBlocksListenerTypeV1) Set(val *WatchBlocksListenerTypeV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksListenerTypeV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksListenerTypeV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksListenerTypeV1(val *WatchBlocksListenerTypeV1) *NullableWatchBlocksListenerTypeV1 { + return &NullableWatchBlocksListenerTypeV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksListenerTypeV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksListenerTypeV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_options_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_options_v1.go new file mode 100644 index 00000000000..f29dcf4eabc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_options_v1.go @@ -0,0 +1,209 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WatchBlocksOptionsV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksOptionsV1{} + +// WatchBlocksOptionsV1 Options passed when subscribing to block monitoring. +type WatchBlocksOptionsV1 struct { + // Hyperledger Fabric channel to connect to. + ChannelName string `json:"channelName"` + GatewayOptions GatewayOptions `json:"gatewayOptions"` + Type WatchBlocksListenerTypeV1 `json:"type"` + // From which block start monitoring. Defaults to latest. + StartBlock *string `json:"startBlock,omitempty"` +} + +// NewWatchBlocksOptionsV1 instantiates a new WatchBlocksOptionsV1 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 +// will change when the set of required properties is changed +func NewWatchBlocksOptionsV1(channelName string, gatewayOptions GatewayOptions, type_ WatchBlocksListenerTypeV1) *WatchBlocksOptionsV1 { + this := WatchBlocksOptionsV1{} + this.ChannelName = channelName + this.GatewayOptions = gatewayOptions + this.Type = type_ + return &this +} + +// NewWatchBlocksOptionsV1WithDefaults instantiates a new WatchBlocksOptionsV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksOptionsV1WithDefaults() *WatchBlocksOptionsV1 { + this := WatchBlocksOptionsV1{} + return &this +} + +// GetChannelName returns the ChannelName field value +func (o *WatchBlocksOptionsV1) GetChannelName() string { + if o == nil { + var ret string + return ret + } + + return o.ChannelName +} + +// GetChannelNameOk returns a tuple with the ChannelName field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksOptionsV1) GetChannelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelName, true +} + +// SetChannelName sets field value +func (o *WatchBlocksOptionsV1) SetChannelName(v string) { + o.ChannelName = v +} + +// GetGatewayOptions returns the GatewayOptions field value +func (o *WatchBlocksOptionsV1) GetGatewayOptions() GatewayOptions { + if o == nil { + var ret GatewayOptions + return ret + } + + return o.GatewayOptions +} + +// GetGatewayOptionsOk returns a tuple with the GatewayOptions field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksOptionsV1) GetGatewayOptionsOk() (*GatewayOptions, bool) { + if o == nil { + return nil, false + } + return &o.GatewayOptions, true +} + +// SetGatewayOptions sets field value +func (o *WatchBlocksOptionsV1) SetGatewayOptions(v GatewayOptions) { + o.GatewayOptions = v +} + +// GetType returns the Type field value +func (o *WatchBlocksOptionsV1) GetType() WatchBlocksListenerTypeV1 { + if o == nil { + var ret WatchBlocksListenerTypeV1 + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksOptionsV1) GetTypeOk() (*WatchBlocksListenerTypeV1, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WatchBlocksOptionsV1) SetType(v WatchBlocksListenerTypeV1) { + o.Type = v +} + +// GetStartBlock returns the StartBlock field value if set, zero value otherwise. +func (o *WatchBlocksOptionsV1) GetStartBlock() string { + if o == nil || IsNil(o.StartBlock) { + var ret string + return ret + } + return *o.StartBlock +} + +// GetStartBlockOk returns a tuple with the StartBlock field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksOptionsV1) GetStartBlockOk() (*string, bool) { + if o == nil || IsNil(o.StartBlock) { + return nil, false + } + return o.StartBlock, true +} + +// HasStartBlock returns a boolean if a field has been set. +func (o *WatchBlocksOptionsV1) HasStartBlock() bool { + if o != nil && !IsNil(o.StartBlock) { + return true + } + + return false +} + +// SetStartBlock gets a reference to the given string and assigns it to the StartBlock field. +func (o *WatchBlocksOptionsV1) SetStartBlock(v string) { + o.StartBlock = &v +} + +func (o WatchBlocksOptionsV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksOptionsV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["channelName"] = o.ChannelName + toSerialize["gatewayOptions"] = o.GatewayOptions + toSerialize["type"] = o.Type + if !IsNil(o.StartBlock) { + toSerialize["startBlock"] = o.StartBlock + } + return toSerialize, nil +} + +type NullableWatchBlocksOptionsV1 struct { + value *WatchBlocksOptionsV1 + isSet bool +} + +func (v NullableWatchBlocksOptionsV1) Get() *WatchBlocksOptionsV1 { + return v.value +} + +func (v *NullableWatchBlocksOptionsV1) Set(val *WatchBlocksOptionsV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksOptionsV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksOptionsV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksOptionsV1(val *WatchBlocksOptionsV1) *NullableWatchBlocksOptionsV1 { + return &NullableWatchBlocksOptionsV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksOptionsV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksOptionsV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_private_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_private_response_v1.go new file mode 100644 index 00000000000..43edcc07a02 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_private_response_v1.go @@ -0,0 +1,122 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WatchBlocksPrivateResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksPrivateResponseV1{} + +// WatchBlocksPrivateResponseV1 Response that corresponds to Fabric SDK 'private' EventType. +type WatchBlocksPrivateResponseV1 struct { + // Private commited block. + PrivateBlock interface{} `json:"privateBlock"` +} + +// NewWatchBlocksPrivateResponseV1 instantiates a new WatchBlocksPrivateResponseV1 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 +// will change when the set of required properties is changed +func NewWatchBlocksPrivateResponseV1(privateBlock interface{}) *WatchBlocksPrivateResponseV1 { + this := WatchBlocksPrivateResponseV1{} + this.PrivateBlock = privateBlock + return &this +} + +// NewWatchBlocksPrivateResponseV1WithDefaults instantiates a new WatchBlocksPrivateResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksPrivateResponseV1WithDefaults() *WatchBlocksPrivateResponseV1 { + this := WatchBlocksPrivateResponseV1{} + return &this +} + +// GetPrivateBlock returns the PrivateBlock field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *WatchBlocksPrivateResponseV1) GetPrivateBlock() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.PrivateBlock +} + +// GetPrivateBlockOk returns a tuple with the PrivateBlock field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WatchBlocksPrivateResponseV1) GetPrivateBlockOk() (*interface{}, bool) { + if o == nil || IsNil(o.PrivateBlock) { + return nil, false + } + return &o.PrivateBlock, true +} + +// SetPrivateBlock sets field value +func (o *WatchBlocksPrivateResponseV1) SetPrivateBlock(v interface{}) { + o.PrivateBlock = v +} + +func (o WatchBlocksPrivateResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksPrivateResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.PrivateBlock != nil { + toSerialize["privateBlock"] = o.PrivateBlock + } + return toSerialize, nil +} + +type NullableWatchBlocksPrivateResponseV1 struct { + value *WatchBlocksPrivateResponseV1 + isSet bool +} + +func (v NullableWatchBlocksPrivateResponseV1) Get() *WatchBlocksPrivateResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksPrivateResponseV1) Set(val *WatchBlocksPrivateResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksPrivateResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksPrivateResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksPrivateResponseV1(val *WatchBlocksPrivateResponseV1) *NullableWatchBlocksPrivateResponseV1 { + return &NullableWatchBlocksPrivateResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksPrivateResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksPrivateResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_response_v1.go new file mode 100644 index 00000000000..8e54bc0babd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_response_v1.go @@ -0,0 +1,238 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksResponseV1 - Response block from WatchBlocks endpoint. Depends on 'type' passed in subscription options. +type WatchBlocksResponseV1 struct { + WatchBlocksCactusErrorResponseV1 *WatchBlocksCactusErrorResponseV1 + WatchBlocksCactusTransactionsResponseV1 *WatchBlocksCactusTransactionsResponseV1 + WatchBlocksFilteredResponseV1 *WatchBlocksFilteredResponseV1 + WatchBlocksFullResponseV1 *WatchBlocksFullResponseV1 + WatchBlocksPrivateResponseV1 *WatchBlocksPrivateResponseV1 +} + +// WatchBlocksCactusErrorResponseV1AsWatchBlocksResponseV1 is a convenience function that returns WatchBlocksCactusErrorResponseV1 wrapped in WatchBlocksResponseV1 +func WatchBlocksCactusErrorResponseV1AsWatchBlocksResponseV1(v *WatchBlocksCactusErrorResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + WatchBlocksCactusErrorResponseV1: v, + } +} + +// WatchBlocksCactusTransactionsResponseV1AsWatchBlocksResponseV1 is a convenience function that returns WatchBlocksCactusTransactionsResponseV1 wrapped in WatchBlocksResponseV1 +func WatchBlocksCactusTransactionsResponseV1AsWatchBlocksResponseV1(v *WatchBlocksCactusTransactionsResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + WatchBlocksCactusTransactionsResponseV1: v, + } +} + +// WatchBlocksFilteredResponseV1AsWatchBlocksResponseV1 is a convenience function that returns WatchBlocksFilteredResponseV1 wrapped in WatchBlocksResponseV1 +func WatchBlocksFilteredResponseV1AsWatchBlocksResponseV1(v *WatchBlocksFilteredResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + WatchBlocksFilteredResponseV1: v, + } +} + +// WatchBlocksFullResponseV1AsWatchBlocksResponseV1 is a convenience function that returns WatchBlocksFullResponseV1 wrapped in WatchBlocksResponseV1 +func WatchBlocksFullResponseV1AsWatchBlocksResponseV1(v *WatchBlocksFullResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + WatchBlocksFullResponseV1: v, + } +} + +// WatchBlocksPrivateResponseV1AsWatchBlocksResponseV1 is a convenience function that returns WatchBlocksPrivateResponseV1 wrapped in WatchBlocksResponseV1 +func WatchBlocksPrivateResponseV1AsWatchBlocksResponseV1(v *WatchBlocksPrivateResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + WatchBlocksPrivateResponseV1: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *WatchBlocksResponseV1) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into WatchBlocksCactusErrorResponseV1 + err = newStrictDecoder(data).Decode(&dst.WatchBlocksCactusErrorResponseV1) + if err == nil { + jsonWatchBlocksCactusErrorResponseV1, _ := json.Marshal(dst.WatchBlocksCactusErrorResponseV1) + if string(jsonWatchBlocksCactusErrorResponseV1) == "{}" { // empty struct + dst.WatchBlocksCactusErrorResponseV1 = nil + } else { + match++ + } + } else { + dst.WatchBlocksCactusErrorResponseV1 = nil + } + + // try to unmarshal data into WatchBlocksCactusTransactionsResponseV1 + err = newStrictDecoder(data).Decode(&dst.WatchBlocksCactusTransactionsResponseV1) + if err == nil { + jsonWatchBlocksCactusTransactionsResponseV1, _ := json.Marshal(dst.WatchBlocksCactusTransactionsResponseV1) + if string(jsonWatchBlocksCactusTransactionsResponseV1) == "{}" { // empty struct + dst.WatchBlocksCactusTransactionsResponseV1 = nil + } else { + match++ + } + } else { + dst.WatchBlocksCactusTransactionsResponseV1 = nil + } + + // try to unmarshal data into WatchBlocksFilteredResponseV1 + err = newStrictDecoder(data).Decode(&dst.WatchBlocksFilteredResponseV1) + if err == nil { + jsonWatchBlocksFilteredResponseV1, _ := json.Marshal(dst.WatchBlocksFilteredResponseV1) + if string(jsonWatchBlocksFilteredResponseV1) == "{}" { // empty struct + dst.WatchBlocksFilteredResponseV1 = nil + } else { + match++ + } + } else { + dst.WatchBlocksFilteredResponseV1 = nil + } + + // try to unmarshal data into WatchBlocksFullResponseV1 + err = newStrictDecoder(data).Decode(&dst.WatchBlocksFullResponseV1) + if err == nil { + jsonWatchBlocksFullResponseV1, _ := json.Marshal(dst.WatchBlocksFullResponseV1) + if string(jsonWatchBlocksFullResponseV1) == "{}" { // empty struct + dst.WatchBlocksFullResponseV1 = nil + } else { + match++ + } + } else { + dst.WatchBlocksFullResponseV1 = nil + } + + // try to unmarshal data into WatchBlocksPrivateResponseV1 + err = newStrictDecoder(data).Decode(&dst.WatchBlocksPrivateResponseV1) + if err == nil { + jsonWatchBlocksPrivateResponseV1, _ := json.Marshal(dst.WatchBlocksPrivateResponseV1) + if string(jsonWatchBlocksPrivateResponseV1) == "{}" { // empty struct + dst.WatchBlocksPrivateResponseV1 = nil + } else { + match++ + } + } else { + dst.WatchBlocksPrivateResponseV1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.WatchBlocksCactusErrorResponseV1 = nil + dst.WatchBlocksCactusTransactionsResponseV1 = nil + dst.WatchBlocksFilteredResponseV1 = nil + dst.WatchBlocksFullResponseV1 = nil + dst.WatchBlocksPrivateResponseV1 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(WatchBlocksResponseV1)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(WatchBlocksResponseV1)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src WatchBlocksResponseV1) MarshalJSON() ([]byte, error) { + if src.WatchBlocksCactusErrorResponseV1 != nil { + return json.Marshal(&src.WatchBlocksCactusErrorResponseV1) + } + + if src.WatchBlocksCactusTransactionsResponseV1 != nil { + return json.Marshal(&src.WatchBlocksCactusTransactionsResponseV1) + } + + if src.WatchBlocksFilteredResponseV1 != nil { + return json.Marshal(&src.WatchBlocksFilteredResponseV1) + } + + if src.WatchBlocksFullResponseV1 != nil { + return json.Marshal(&src.WatchBlocksFullResponseV1) + } + + if src.WatchBlocksPrivateResponseV1 != nil { + return json.Marshal(&src.WatchBlocksPrivateResponseV1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *WatchBlocksResponseV1) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.WatchBlocksCactusErrorResponseV1 != nil { + return obj.WatchBlocksCactusErrorResponseV1 + } + + if obj.WatchBlocksCactusTransactionsResponseV1 != nil { + return obj.WatchBlocksCactusTransactionsResponseV1 + } + + if obj.WatchBlocksFilteredResponseV1 != nil { + return obj.WatchBlocksFilteredResponseV1 + } + + if obj.WatchBlocksFullResponseV1 != nil { + return obj.WatchBlocksFullResponseV1 + } + + if obj.WatchBlocksPrivateResponseV1 != nil { + return obj.WatchBlocksPrivateResponseV1 + } + + // all schemas are nil + return nil +} + +type NullableWatchBlocksResponseV1 struct { + value *WatchBlocksResponseV1 + isSet bool +} + +func (v NullableWatchBlocksResponseV1) Get() *WatchBlocksResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksResponseV1) Set(val *WatchBlocksResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksResponseV1(val *WatchBlocksResponseV1) *NullableWatchBlocksResponseV1 { + return &NullableWatchBlocksResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go new file mode 100644 index 00000000000..3038571e2bf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go @@ -0,0 +1,119 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksV1 Websocket requests for monitoring new blocks. +type WatchBlocksV1 string + +// List of WatchBlocksV1 +const ( + Subscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Subscribe" + SubscribeDelegatedSign WatchBlocksV1 = "org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.SubscribeDelegatedSign" + Next WatchBlocksV1 = "org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Next" + Unsubscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Unsubscribe" + Error WatchBlocksV1 = "org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Error" + Complete WatchBlocksV1 = "org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Complete" +) + +// All allowed values of WatchBlocksV1 enum +var AllowedWatchBlocksV1EnumValues = []WatchBlocksV1{ + "org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Subscribe", + "org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.SubscribeDelegatedSign", + "org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Next", + "org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Unsubscribe", + "org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Error", + "org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Complete", +} + +func (v *WatchBlocksV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchBlocksV1(value) + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchBlocksV1", value) +} + +// NewWatchBlocksV1FromValue returns a pointer to a valid WatchBlocksV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchBlocksV1FromValue(v string) (*WatchBlocksV1, error) { + ev := WatchBlocksV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchBlocksV1: valid values are %v", v, AllowedWatchBlocksV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchBlocksV1) IsValid() bool { + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchBlocksV1 value +func (v WatchBlocksV1) Ptr() *WatchBlocksV1 { + return &v +} + +type NullableWatchBlocksV1 struct { + value *WatchBlocksV1 + isSet bool +} + +func (v NullableWatchBlocksV1) Get() *WatchBlocksV1 { + return v.value +} + +func (v *NullableWatchBlocksV1) Set(val *WatchBlocksV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1(val *WatchBlocksV1) *NullableWatchBlocksV1 { + return &NullableWatchBlocksV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_web_socket_key.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_web_socket_key.go new file mode 100644 index 00000000000..322359188df --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_web_socket_key.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the WebSocketKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebSocketKey{} + +// WebSocketKey web-socket key details for signing fabric message with private key stored with external client +type WebSocketKey struct { + // session Id to access client + SessionId string `json:"sessionId"` + // signature of the session ID + Signature string `json:"signature"` +} + +// NewWebSocketKey instantiates a new WebSocketKey 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 +// will change when the set of required properties is changed +func NewWebSocketKey(sessionId string, signature string) *WebSocketKey { + this := WebSocketKey{} + this.SessionId = sessionId + this.Signature = signature + return &this +} + +// NewWebSocketKeyWithDefaults instantiates a new WebSocketKey object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebSocketKeyWithDefaults() *WebSocketKey { + this := WebSocketKey{} + return &this +} + +// GetSessionId returns the SessionId field value +func (o *WebSocketKey) GetSessionId() string { + if o == nil { + var ret string + return ret + } + + return o.SessionId +} + +// GetSessionIdOk returns a tuple with the SessionId field value +// and a boolean to check if the value has been set. +func (o *WebSocketKey) GetSessionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionId, true +} + +// SetSessionId sets field value +func (o *WebSocketKey) SetSessionId(v string) { + o.SessionId = v +} + +// GetSignature returns the Signature field value +func (o *WebSocketKey) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *WebSocketKey) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *WebSocketKey) SetSignature(v string) { + o.Signature = v +} + +func (o WebSocketKey) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebSocketKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionId"] = o.SessionId + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableWebSocketKey struct { + value *WebSocketKey + isSet bool +} + +func (v NullableWebSocketKey) Get() *WebSocketKey { + return v.value +} + +func (v *NullableWebSocketKey) Set(val *WebSocketKey) { + v.value = val + v.isSet = true +} + +func (v NullableWebSocketKey) IsSet() bool { + return v.isSet +} + +func (v *NullableWebSocketKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebSocketKey(val *WebSocketKey) *NullableWebSocketKey { + return &NullableWebSocketKey{value: val, isSet: true} +} + +func (v NullableWebSocketKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebSocketKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..e6d9da5f6bd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..4468fd0fe7d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,109 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-ledger-connector-fabric + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-ledger-connector-fabric_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService DeployContractGoSourceV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeployContractGoSourceV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService DeployContractV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeployContractV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetBlockV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetBlockV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPrometheusMetricsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPrometheusMetricsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetTransactionReceiptByTxIDV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetTransactionReceiptByTxIDV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RunDelegatedSignTransactionV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.RunDelegatedSignTransactionV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RunTransactionV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.RunTransactionV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..3fafbc69d84 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..03421c42d2a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - Connector Fabric + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..7a9f4f39664 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,134 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/ChainCodeLanguageRuntime.java +src/main/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponses.java +src/main/java/org/openapitools/client/model/ChainCodeProgrammingLanguage.java +src/main/java/org/openapitools/client/model/ConnectionProfile.java +src/main/java/org/openapitools/client/model/ConnectionProfileClient.java +src/main/java/org/openapitools/client/model/DefaultEventHandlerStrategy.java +src/main/java/org/openapitools/client/model/DeployContractGoSourceV1501Response.java +src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Request.java +src/main/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgs.java +src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Response.java +src/main/java/org/openapitools/client/model/DeployContractV1Request.java +src/main/java/org/openapitools/client/model/DeployContractV1Response.java +src/main/java/org/openapitools/client/model/DeploymentTargetOrgFabric2x.java +src/main/java/org/openapitools/client/model/DeploymentTargetOrganization.java +src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java +src/main/java/org/openapitools/client/model/FabricContractInvocationType.java +src/main/java/org/openapitools/client/model/FabricSigningCredential.java +src/main/java/org/openapitools/client/model/FabricSigningCredentialType.java +src/main/java/org/openapitools/client/model/FileBase64.java +src/main/java/org/openapitools/client/model/GatewayDiscoveryOptions.java +src/main/java/org/openapitools/client/model/GatewayEventHandlerOptions.java +src/main/java/org/openapitools/client/model/GatewayOptions.java +src/main/java/org/openapitools/client/model/GatewayOptionsWallet.java +src/main/java/org/openapitools/client/model/GetBlockRequestV1.java +src/main/java/org/openapitools/client/model/GetBlockRequestV1Query.java +src/main/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHash.java +src/main/java/org/openapitools/client/model/GetBlockResponseDecodedV1.java +src/main/java/org/openapitools/client/model/GetBlockResponseEncodedV1.java +src/main/java/org/openapitools/client/model/GetBlockResponseV1.java +src/main/java/org/openapitools/client/model/GetTransactionReceiptResponse.java +src/main/java/org/openapitools/client/model/RunDelegatedSignTransactionRequest.java +src/main/java/org/openapitools/client/model/RunTransactionRequest.java +src/main/java/org/openapitools/client/model/RunTransactionResponse.java +src/main/java/org/openapitools/client/model/RunTransactionResponseType.java +src/main/java/org/openapitools/client/model/SSHExecCommandResponse.java +src/main/java/org/openapitools/client/model/TransactReceiptBlockMetaData.java +src/main/java/org/openapitools/client/model/TransactReceiptTransactionCreator.java +src/main/java/org/openapitools/client/model/TransactReceiptTransactionEndorsement.java +src/main/java/org/openapitools/client/model/VaultTransitKey.java +src/main/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1.java +src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksDelegatedSignOptionsV1.java +src/main/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksFullResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksListenerTypeV1.java +src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java +src/main/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksV1.java +src/main/java/org/openapitools/client/model/WebSocketKey.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/ChainCodeLanguageRuntimeTest.java +src/test/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponsesTest.java +src/test/java/org/openapitools/client/model/ChainCodeProgrammingLanguageTest.java +src/test/java/org/openapitools/client/model/ConnectionProfileClientTest.java +src/test/java/org/openapitools/client/model/ConnectionProfileTest.java +src/test/java/org/openapitools/client/model/DefaultEventHandlerStrategyTest.java +src/test/java/org/openapitools/client/model/DeployContractGoSourceV1501ResponseTest.java +src/test/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgsTest.java +src/test/java/org/openapitools/client/model/DeployContractGoSourceV1RequestTest.java +src/test/java/org/openapitools/client/model/DeployContractGoSourceV1ResponseTest.java +src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java +src/test/java/org/openapitools/client/model/DeployContractV1ResponseTest.java +src/test/java/org/openapitools/client/model/DeploymentTargetOrgFabric2xTest.java +src/test/java/org/openapitools/client/model/DeploymentTargetOrganizationTest.java +src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java +src/test/java/org/openapitools/client/model/FabricContractInvocationTypeTest.java +src/test/java/org/openapitools/client/model/FabricSigningCredentialTest.java +src/test/java/org/openapitools/client/model/FabricSigningCredentialTypeTest.java +src/test/java/org/openapitools/client/model/FileBase64Test.java +src/test/java/org/openapitools/client/model/GatewayDiscoveryOptionsTest.java +src/test/java/org/openapitools/client/model/GatewayEventHandlerOptionsTest.java +src/test/java/org/openapitools/client/model/GatewayOptionsTest.java +src/test/java/org/openapitools/client/model/GatewayOptionsWalletTest.java +src/test/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHashTest.java +src/test/java/org/openapitools/client/model/GetBlockRequestV1QueryTest.java +src/test/java/org/openapitools/client/model/GetBlockRequestV1Test.java +src/test/java/org/openapitools/client/model/GetBlockResponseDecodedV1Test.java +src/test/java/org/openapitools/client/model/GetBlockResponseEncodedV1Test.java +src/test/java/org/openapitools/client/model/GetBlockResponseV1Test.java +src/test/java/org/openapitools/client/model/GetTransactionReceiptResponseTest.java +src/test/java/org/openapitools/client/model/RunDelegatedSignTransactionRequestTest.java +src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java +src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java +src/test/java/org/openapitools/client/model/RunTransactionResponseTypeTest.java +src/test/java/org/openapitools/client/model/SSHExecCommandResponseTest.java +src/test/java/org/openapitools/client/model/TransactReceiptBlockMetaDataTest.java +src/test/java/org/openapitools/client/model/TransactReceiptTransactionCreatorTest.java +src/test/java/org/openapitools/client/model/TransactReceiptTransactionEndorsementTest.java +src/test/java/org/openapitools/client/model/VaultTransitKeyTest.java +src/test/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksDelegatedSignOptionsV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksFullResponseV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksListenerTypeV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksOptionsV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksResponseV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java +src/test/java/org/openapitools/client/model/WebSocketKeyTest.java diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..56f02534352 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,193 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Connector Fabric +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a fabric ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeployContractGoSourceV1Request deployContractGoSourceV1Request = new DeployContractGoSourceV1Request(); // DeployContractGoSourceV1Request | + try { + DeployContractGoSourceV1Response result = apiInstance.deployContractGoSourceV1(deployContractGoSourceV1Request); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deployContractGoSourceV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deployContractGoSourceV1**](docs/DefaultApi.md#deployContractGoSourceV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract-go-source | Deploys a chaincode contract in the form of a go sources. +*DefaultApi* | [**deployContractV1**](docs/DefaultApi.md#deployContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract | Deploys a chaincode contract from a set of source files. Note: This endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers to the Cactus API version, not the supported Fabric ledger version. +*DefaultApi* | [**getBlockV1**](docs/DefaultApi.md#getBlockV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-block | Get block from the channel using one of selectors from the input. Works only on Fabric 2.x. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**getTransactionReceiptByTxIDV1**](docs/DefaultApi.md#getTransactionReceiptByTxIDV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-transaction-receipt-by-txid | get a transaction receipt by tx id on a Fabric ledger. +*DefaultApi* | [**runDelegatedSignTransactionV1**](docs/DefaultApi.md#runDelegatedSignTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-delegated-sign-transaction | Runs a transaction on a Fabric ledger using user-provided signing callback. +*DefaultApi* | [**runTransactionV1**](docs/DefaultApi.md#runTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction | Runs a transaction on a Fabric ledger. + + +## Documentation for Models + + - [ChainCodeLanguageRuntime](docs/ChainCodeLanguageRuntime.md) + - [ChainCodeLifeCycleCommandResponses](docs/ChainCodeLifeCycleCommandResponses.md) + - [ChainCodeProgrammingLanguage](docs/ChainCodeProgrammingLanguage.md) + - [ConnectionProfile](docs/ConnectionProfile.md) + - [ConnectionProfileClient](docs/ConnectionProfileClient.md) + - [DefaultEventHandlerStrategy](docs/DefaultEventHandlerStrategy.md) + - [DeployContractGoSourceV1501Response](docs/DeployContractGoSourceV1501Response.md) + - [DeployContractGoSourceV1Request](docs/DeployContractGoSourceV1Request.md) + - [DeployContractGoSourceV1RequestConstructorArgs](docs/DeployContractGoSourceV1RequestConstructorArgs.md) + - [DeployContractGoSourceV1Response](docs/DeployContractGoSourceV1Response.md) + - [DeployContractV1Request](docs/DeployContractV1Request.md) + - [DeployContractV1Response](docs/DeployContractV1Response.md) + - [DeploymentTargetOrgFabric2x](docs/DeploymentTargetOrgFabric2x.md) + - [DeploymentTargetOrganization](docs/DeploymentTargetOrganization.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [FabricContractInvocationType](docs/FabricContractInvocationType.md) + - [FabricSigningCredential](docs/FabricSigningCredential.md) + - [FabricSigningCredentialType](docs/FabricSigningCredentialType.md) + - [FileBase64](docs/FileBase64.md) + - [GatewayDiscoveryOptions](docs/GatewayDiscoveryOptions.md) + - [GatewayEventHandlerOptions](docs/GatewayEventHandlerOptions.md) + - [GatewayOptions](docs/GatewayOptions.md) + - [GatewayOptionsWallet](docs/GatewayOptionsWallet.md) + - [GetBlockRequestV1](docs/GetBlockRequestV1.md) + - [GetBlockRequestV1Query](docs/GetBlockRequestV1Query.md) + - [GetBlockRequestV1QueryBlockHash](docs/GetBlockRequestV1QueryBlockHash.md) + - [GetBlockResponseDecodedV1](docs/GetBlockResponseDecodedV1.md) + - [GetBlockResponseEncodedV1](docs/GetBlockResponseEncodedV1.md) + - [GetBlockResponseV1](docs/GetBlockResponseV1.md) + - [GetTransactionReceiptResponse](docs/GetTransactionReceiptResponse.md) + - [RunDelegatedSignTransactionRequest](docs/RunDelegatedSignTransactionRequest.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [RunTransactionResponseType](docs/RunTransactionResponseType.md) + - [SSHExecCommandResponse](docs/SSHExecCommandResponse.md) + - [TransactReceiptBlockMetaData](docs/TransactReceiptBlockMetaData.md) + - [TransactReceiptTransactionCreator](docs/TransactReceiptTransactionCreator.md) + - [TransactReceiptTransactionEndorsement](docs/TransactReceiptTransactionEndorsement.md) + - [VaultTransitKey](docs/VaultTransitKey.md) + - [WatchBlocksCactusErrorResponseV1](docs/WatchBlocksCactusErrorResponseV1.md) + - [WatchBlocksCactusTransactionsEventV1](docs/WatchBlocksCactusTransactionsEventV1.md) + - [WatchBlocksCactusTransactionsResponseV1](docs/WatchBlocksCactusTransactionsResponseV1.md) + - [WatchBlocksDelegatedSignOptionsV1](docs/WatchBlocksDelegatedSignOptionsV1.md) + - [WatchBlocksFilteredResponseV1](docs/WatchBlocksFilteredResponseV1.md) + - [WatchBlocksFullResponseV1](docs/WatchBlocksFullResponseV1.md) + - [WatchBlocksListenerTypeV1](docs/WatchBlocksListenerTypeV1.md) + - [WatchBlocksOptionsV1](docs/WatchBlocksOptionsV1.md) + - [WatchBlocksPrivateResponseV1](docs/WatchBlocksPrivateResponseV1.md) + - [WatchBlocksResponseV1](docs/WatchBlocksResponseV1.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WebSocketKey](docs/WebSocketKey.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..68d87002abb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,1822 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a fabric ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Fabric + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction: + post: + description: "" + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Runs a transaction on a Fabric ledger. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-delegated-sign-transaction: + post: + description: "" + operationId: runDelegatedSignTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunDelegatedSignTransactionRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Runs a transaction on a Fabric ledger using user-provided signing callback. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-delegated-sign-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-transaction-receipt-by-txid: + post: + description: "" + operationId: getTransactionReceiptByTxIDV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetTransactionReceiptResponse' + description: OK + "404": + description: "" + summary: get a transaction receipt by tx id on a Fabric ledger. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-transaction-receipt-by-txid + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract-go-source: + post: + operationId: deployContractGoSourceV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractGoSourceV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractGoSourceV1Response' + description: OK + "501": + content: + text/plain: + schema: + $ref: '#/components/schemas/deployContractGoSourceV1_501_response' + description: Not implemented + summary: Deploys a chaincode contract in the form of a go sources. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract-go-source + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract: + post: + operationId: deployContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Response' + description: OK + "501": + content: + text/plain: + schema: + $ref: '#/components/schemas/deployContractGoSourceV1_501_response' + description: Not implemented + summary: "Deploys a chaincode contract from a set of source files. Note: This\ + \ endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers\ + \ to the Cactus API version, not the supported Fabric ledger version." + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-block: + post: + operationId: getBlockV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetBlockRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetBlockResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Get block from the channel using one of selectors from the input. Works + only on Fabric 2.x. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-block + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-prometheus-exporter-metrics + x-accepts: text/plain +components: + schemas: + TransactReceiptTransactionEndorsement: + example: + mspid: mspid + signature: signature + endorserID: endorserID + properties: + mspid: + type: string + endorserID: + type: string + signature: + type: string + type: object + TransactReceiptTransactionCreator: + example: + mspid: mspid + creatorID: creatorID + properties: + mspid: + type: string + creatorID: + type: string + type: object + TransactReceiptBlockMetaData: + example: + mspid: mspid + blockCreatorID: blockCreatorID + signature: signature + properties: + mspid: + type: string + blockCreatorID: + type: string + signature: + type: string + type: object + VaultTransitKey: + description: vault key details for signing fabric message with private key stored + with transit engine. + example: + keyName: keyName + token: token + nullable: false + properties: + keyName: + description: label of private key + maxLength: 100 + minLength: 1 + nullable: false + type: string + token: + description: token for accessing private key + maxLength: 100 + minLength: 1 + nullable: false + type: string + required: + - keyName + - token + type: object + WebSocketKey: + description: web-socket key details for signing fabric message with private + key stored with external client + example: + signature: signature + sessionId: sessionId + nullable: false + properties: + sessionId: + description: session Id to access client + maxLength: 100 + minLength: 1 + nullable: false + type: string + signature: + description: signature of the session ID + maxLength: 100 + minLength: 1 + nullable: false + type: string + required: + - sessionId + - signature + type: object + FabricSigningCredentialType: + description: different type of identity provider for singing fabric messages + supported by this package + enum: + - X.509 + - Vault-X.509 + - WS-X.509 + nullable: false + type: string + FabricSigningCredential: + example: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + properties: + keychainId: + maxLength: 100 + minLength: 1 + nullable: false + type: string + keychainRef: + maxLength: 100 + minLength: 1 + nullable: false + type: string + type: + $ref: '#/components/schemas/FabricSigningCredentialType' + vaultTransitKey: + $ref: '#/components/schemas/VaultTransitKey' + webSocketKey: + $ref: '#/components/schemas/WebSocketKey' + required: + - keychainId + - keychainRef + type: object + ChainCodeLifeCycleCommandResponses: + example: + init: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + commit: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + installList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + queryCommitted: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + packaging: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + approveForMyOrgList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + queryInstalledList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + properties: + packaging: + $ref: '#/components/schemas/SSHExecCommandResponse' + installList: + items: + $ref: '#/components/schemas/SSHExecCommandResponse' + minItems: 1 + type: array + queryInstalledList: + items: + $ref: '#/components/schemas/SSHExecCommandResponse' + minItems: 1 + type: array + approveForMyOrgList: + items: + $ref: '#/components/schemas/SSHExecCommandResponse' + minItems: 1 + type: array + commit: + $ref: '#/components/schemas/SSHExecCommandResponse' + queryCommitted: + $ref: '#/components/schemas/SSHExecCommandResponse' + init: + $ref: '#/components/schemas/SSHExecCommandResponse' + required: + - approveForMyOrgList + - installList + - queryInstalledList + type: object + ChainCodeProgrammingLanguage: + description: Enumerates the supported source code programming languages of Hyperledger + Fabric + enum: + - golang + - javascript + - typescript + - java + type: string + ChainCodeLanguageRuntime: + description: Enumerates the supported programming language runtimes of Hyperledger + Fabric + enum: + - golang + - node + - java + type: string + ConnectionProfile: + additionalProperties: true + example: + channels: + key: "" + certificateAuthorities: + key: "" + name: basic-network + organizations: + key: "" + peers: + key: "" + x-type: hlfv1 + description: The basic network + client: + organization: Org1 + orderers: + key: "" + version: "1.0" + properties: + name: + example: basic-network + maxLength: 1024 + minLength: 1 + type: string + x-type: + example: hlfv1 + minLength: 1 + type: string + description: + example: The basic network + type: string + version: + example: "1.0" + type: string + client: + $ref: '#/components/schemas/ConnectionProfile_client' + channels: + additionalProperties: true + type: object + organizations: + additionalProperties: true + type: object + orderers: + additionalProperties: true + type: object + peers: + additionalProperties: true + type: object + certificateAuthorities: + additionalProperties: true + type: object + required: + - name + - organizations + - peers + - version + type: object + GatewayDiscoveryOptions: + additionalProperties: false + example: + asLocalhost: true + enabled: true + properties: + asLocalhost: + nullable: false + type: boolean + enabled: + nullable: false + type: boolean + type: object + GatewayOptions: + example: + wallet: + keychain: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + json: json + connectionProfile: + channels: + key: "" + certificateAuthorities: + key: "" + name: basic-network + organizations: + key: "" + peers: + key: "" + x-type: hlfv1 + description: The basic network + client: + organization: Org1 + orderers: + key: "" + version: "1.0" + discovery: + asLocalhost: true + enabled: true + identity: identity + eventHandlerOptions: + commitTimeout: 0.8008281904610115 + strategy: null + endorseTimeout: 6.027456183070403 + properties: + connectionProfile: + $ref: '#/components/schemas/ConnectionProfile' + discovery: + $ref: '#/components/schemas/GatewayDiscoveryOptions' + eventHandlerOptions: + $ref: '#/components/schemas/GatewayEventHandlerOptions' + identity: + type: string + wallet: + $ref: '#/components/schemas/GatewayOptions_wallet' + required: + - identity + - wallet + type: object + DefaultEventHandlerStrategy: + enum: + - MSPID_SCOPE_ALLFORTX + - MSPID_SCOPE_ANYFORTX + - NETWORK_SCOPE_ALLFORTX + - NETWORK_SCOPE_ANYFORTX + type: string + GatewayEventHandlerOptions: + additionalProperties: false + example: + commitTimeout: 0.8008281904610115 + strategy: null + endorseTimeout: 6.027456183070403 + properties: + commitTimeout: + nullable: false + type: number + endorseTimeout: + nullable: false + type: number + strategy: + $ref: '#/components/schemas/DefaultEventHandlerStrategy' + required: + - strategy + type: object + FileBase64: + description: Represents a file-system file that has a name and a body which + holds the file contents as a Base64 encoded string + example: + filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + properties: + body: + description: The file's contents encoded as a Base64 string. + maxLength: 104857600 + minLength: 1 + nullable: false + type: string + filename: + description: The name as referred to on a file system + example: my-cool-file-full-of-wonders-and-fun-stuff.go + maxLength: 255 + minLength: 1 + nullable: false + type: string + filepath: + description: "The relative path of the file, if it should be placed in a\ + \ sub-directory" + example: ./my/sub-folder/structure/ + maxLength: 512 + minLength: 1 + nullable: false + type: string + required: + - body + - filename + type: object + FabricContractInvocationType: + enum: + - FabricContractInvocationType.SEND + - FabricContractInvocationType.CALL + - FabricContractInvocationType.SENDPRIVATE + type: string + SSHExecCommandResponse: + example: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + properties: + stdout: + nullable: false + type: string + stderr: + nullable: false + type: string + code: + nullable: true + type: integer + signal: + nullable: true + type: string + required: + - code + - signal + - stderr + - stdout + type: object + RunTransactionResponseType: + description: Response format from transaction / query execution + enum: + - org.hyperledger.cacti.api.hlfabric.RunTransactionResponseType.JSON + - org.hyperledger.cacti.api.hlfabric.RunTransactionResponseType.UTF8 + type: string + x-enum-varnames: + - JSON + - UTF8 + RunTransactionRequest: + additionalProperties: false + example: + gatewayOptions: + wallet: + keychain: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + json: json + connectionProfile: + channels: + key: "" + certificateAuthorities: + key: "" + name: basic-network + organizations: + key: "" + peers: + key: "" + x-type: hlfv1 + description: The basic network + client: + organization: Org1 + orderers: + key: "" + version: "1.0" + discovery: + asLocalhost: true + enabled: true + identity: identity + eventHandlerOptions: + commitTimeout: 0.8008281904610115 + strategy: null + endorseTimeout: 6.027456183070403 + invocationType: null + responseType: null + transientData: "{}" + endorsingPeers: + - endorsingPeers + - endorsingPeers + endorsingOrgs: + - endorsingOrgs + - endorsingOrgs + methodName: methodName + channelName: channelName + contractName: contractName + params: + - params + - params + signingCredential: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + properties: + endorsingPeers: + description: An array of endorsing peers (name or url) for the transaction. + items: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + type: array + endorsingOrgs: + description: An array of endorsing organizations (by mspID or issuer org + name on certificate) for the transaction. + items: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + type: array + transientData: + nullable: true + type: object + gatewayOptions: + $ref: '#/components/schemas/GatewayOptions' + signingCredential: + $ref: '#/components/schemas/FabricSigningCredential' + channelName: + maxLength: 100 + minLength: 1 + nullable: false + type: string + contractName: + maxLength: 100 + minLength: 1 + nullable: false + type: string + invocationType: + $ref: '#/components/schemas/FabricContractInvocationType' + methodName: + maxLength: 100 + minLength: 1 + nullable: false + type: string + params: + default: [] + items: + nullable: true + type: string + nullable: false + type: array + responseType: + $ref: '#/components/schemas/RunTransactionResponseType' + required: + - channelName + - contractName + - invocationType + - methodName + - params + - signingCredential + type: object + RunTransactionResponse: + example: + functionOutput: functionOutput + transactionId: transactionId + properties: + functionOutput: + nullable: false + type: string + transactionId: + nullable: false + type: string + required: + - functionOutput + - transactionId + type: object + RunDelegatedSignTransactionRequest: + additionalProperties: false + example: + signerCertificate: signerCertificate + invocationType: null + responseType: null + transientData: "{}" + endorsingPeers: + - endorsingPeers + - endorsingPeers + endorsingOrgs: + - endorsingOrgs + - endorsingOrgs + methodName: methodName + channelName: channelName + contractName: contractName + uniqueTransactionData: "" + params: + - params + - params + signerMspID: signerMspID + properties: + endorsingPeers: + description: An array of endorsing peers (name or url) for the transaction. + items: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + type: array + endorsingOrgs: + description: An array of endorsing organizations (by mspID or issuer org + name on certificate) for the transaction. + items: + maxLength: 4096 + minLength: 1 + nullable: false + type: string + type: array + transientData: + nullable: true + type: object + signerCertificate: + nullable: false + type: string + signerMspID: + nullable: false + type: string + uniqueTransactionData: + description: Can be used to uniquely identify and authorize signing request + nullable: false + channelName: + maxLength: 100 + minLength: 1 + nullable: false + type: string + contractName: + maxLength: 100 + minLength: 1 + nullable: false + type: string + invocationType: + $ref: '#/components/schemas/FabricContractInvocationType' + methodName: + maxLength: 100 + minLength: 1 + nullable: false + type: string + params: + default: [] + items: + nullable: true + type: string + nullable: false + type: array + responseType: + $ref: '#/components/schemas/RunTransactionResponseType' + required: + - channelName + - contractName + - invocationType + - methodName + - params + - signerCertificate + - signerMspID + type: object + GetTransactionReceiptResponse: + example: + chainCodeVersion: chainCodeVersion + blockMetaData: + mspid: mspid + blockCreatorID: blockCreatorID + signature: signature + transactionCreator: + mspid: mspid + creatorID: creatorID + blockNumber: blockNumber + chainCodeName: chainCodeName + transactionEndorsement: + - mspid: mspid + signature: signature + endorserID: endorserID + - mspid: mspid + signature: signature + endorserID: endorserID + responseStatus: responseStatus + channelID: channelID + rwsetWriteData: rwsetWriteData + rwsetKey: rwsetKey + properties: + blockNumber: + type: string + channelID: + type: string + transactionCreator: + $ref: '#/components/schemas/TransactReceiptTransactionCreator' + transactionEndorsement: + items: + $ref: '#/components/schemas/TransactReceiptTransactionEndorsement' + type: array + blockMetaData: + $ref: '#/components/schemas/TransactReceiptBlockMetaData' + chainCodeName: + type: string + chainCodeVersion: + type: string + responseStatus: + type: string + rwsetKey: + type: string + rwsetWriteData: + type: string + type: object + DeploymentTargetOrganization: + example: + CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + properties: + CORE_PEER_LOCALMSPID: + description: Mapped to environment variables of the Fabric CLI container. + example: Org1MSP + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_ADDRESS: + description: Mapped to environment variables of the Fabric CLI container. + example: peer0.org1.example.com:7051 + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_MSPCONFIGPATH: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_TLS_ROOTCERT_FILE: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + maxLength: 1024 + minLength: 1 + nullable: false + type: string + ORDERER_TLS_ROOTCERT_FILE: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - CORE_PEER_ADDRESS + - CORE_PEER_LOCALMSPID + - CORE_PEER_MSPCONFIGPATH + - CORE_PEER_TLS_ROOTCERT_FILE + - ORDERER_TLS_ROOTCERT_FILE + type: object + DeploymentTargetOrgFabric2x: + properties: + transient: + description: Transient map of arguments in JSON encoding + example: orderer.example.com:7050 + maxLength: 1073741824 + minLength: 1 + type: string + CORE_PEER_LOCALMSPID: + description: Mapped to environment variables of the Fabric CLI container. + example: Org1MSP + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_ADDRESS: + description: Mapped to environment variables of the Fabric CLI container. + example: peer0.org1.example.com:7051 + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_MSPCONFIGPATH: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + maxLength: 1024 + minLength: 1 + nullable: false + type: string + CORE_PEER_TLS_ROOTCERT_FILE: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + maxLength: 1024 + minLength: 1 + nullable: false + type: string + ORDERER_TLS_ROOTCERT_FILE: + description: Mapped to environment variables of the Fabric CLI container. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + maxLength: 1024 + minLength: 1 + nullable: false + type: string + required: + - CORE_PEER_ADDRESS + - CORE_PEER_LOCALMSPID + - CORE_PEER_MSPCONFIGPATH + - CORE_PEER_TLS_ROOTCERT_FILE + - ORDERER_TLS_ROOTCERT_FILE + type: object + DeployContractGoSourceV1Request: + additionalProperties: false + example: + chainCodeVersion: 1.0.0 + pinnedDeps: + - github.com/hyperledger/fabric@v1.4.8 + - github.com/hyperledger/fabric@v1.4.8 + - github.com/hyperledger/fabric@v1.4.8 + - github.com/hyperledger/fabric@v1.4.8 + - github.com/hyperledger/fabric@v1.4.8 + goSource: + filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + targetPeerAddresses: + - peer0.org1.example.com:7051 + goMod: + filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + constructorArgs: "{} - An empty object literal can be sufficient if your contract\ + \ does not have parameters." + targetOrganizations: + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + tlsRootCertFiles: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + moduleName: hello-world-contract + policyDslSource: "AND('Org1MSP.member','Org2MSP.member')" + channelId: mychannel + modTidyOnly: true + properties: + policyDslSource: + example: "AND('Org1MSP.member','Org2MSP.member')" + maxLength: 65535 + minLength: 1 + nullable: false + type: string + tlsRootCertFiles: + description: The TLS root cert files that will be passed to the chaincode + instantiation command. + example: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + maxLength: 65535 + minLength: 1 + nullable: false + type: string + channelId: + description: The name of the Fabric channel where the contract will get + instantiated. + example: mychannel + maxLength: 2048 + minLength: 1 + nullable: false + type: string + targetOrganizations: + items: + $ref: '#/components/schemas/DeploymentTargetOrganization' + maxItems: 1024 + minItems: 1 + nullable: false + type: array + targetPeerAddresses: + description: An array of peer addresses where the contract will be instantiated. + Note that at present only the first item from this array will be used + which is the behavior taken from the official Fabric samples repository + and therefore it is assumed to be correct usage. + example: + - peer0.org1.example.com:7051 + items: + maxLength: 4096 + minLength: 1 + type: string + maxItems: 2048 + minItems: 1 + type: array + constructorArgs: + $ref: '#/components/schemas/DeployContractGoSourceV1Request_constructorArgs' + chainCodeVersion: + example: 1.0.0 + maxLength: 128 + minLength: 1 + nullable: false + type: string + goSource: + $ref: '#/components/schemas/FileBase64' + goMod: + $ref: '#/components/schemas/FileBase64' + moduleName: + description: The go module name that will be used for the go compilation + process. + example: hello-world-contract + maxLength: 255 + minLength: 1 + nullable: false + type: string + pinnedDeps: + items: + example: github.com/hyperledger/fabric@v1.4.8 + nullable: false + type: string + maxItems: 1024 + minItems: 0 + type: array + modTidyOnly: + description: Indicates to the go chaincode compiler of Cactus if it should + do an actual go compilation with the contact source or if it should just + execute the go mod tidy command. + nullable: true + type: boolean + required: + - chainCodeVersion + - channelId + - goSource + - policyDslSource + - targetOrganizations + - targetPeerAddresses + - tlsRootCertFiles + type: object + DeployContractGoSourceV1Response: + example: + success: true + instantiationCommandResponse: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + installationCommandResponses: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + properties: + success: + type: boolean + installationCommandResponses: + items: + $ref: '#/components/schemas/SSHExecCommandResponse' + type: array + instantiationCommandResponse: + $ref: '#/components/schemas/SSHExecCommandResponse' + required: + - installationCommandResponses + - instantiationCommandResponse + - success + type: object + DeployContractV1Request: + additionalProperties: false + example: + ccVersion: 1.0.0 + ccLabel: hello-world-contract + constructorArgs: "{} - An empty object literal can be sufficient if your contract\ + \ does not have parameters." + ccLang: null + ccSequence: 1 + ccName: my-hello-world-contract + connTimeout: 0 + caFile: "${orgCfgDir}ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" + signaturePolicy: "AND('Org1MSP.member','Org2MSP.member')" + sourceFiles: + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + - filename: my-cool-file-full-of-wonders-and-fun-stuff.go + filepath: ./my/sub-folder/structure/ + body: body + ordererTLSHostnameOverride: orderer.example.com:7050 + orderer: orderer.example.com:7050 + targetOrganizations: + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + - CORE_PEER_LOCALMSPID: Org1MSP + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp + ORDERER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem + CORE_PEER_ADDRESS: peer0.org1.example.com:7051 + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt + collectionsConfigFile: collectionsConfigFile + channelId: mychannel + properties: + ccLang: + $ref: '#/components/schemas/ChainCodeProgrammingLanguage' + caFile: + description: File-system path pointing at the CA file. + example: "${orgCfgDir}ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" + maxLength: 4096 + minLength: 1 + type: string + orderer: + description: Ordering service endpoint specified as : + example: orderer.example.com:7050 + maxLength: 65535 + minLength: 1 + type: string + ordererTLSHostnameOverride: + description: The hostname override to use when validating the TLS connection + to the orderer + example: orderer.example.com:7050 + maxLength: 65535 + minLength: 1 + type: string + connTimeout: + description: Timeout for client to connect (default 3s) + nullable: false + type: integer + signaturePolicy: + description: "Passed in to the peer via the --signature-policy argument\ + \ on the command line. See also: https://hyperledger-fabric.readthedocs.io/en/release-2.2/endorsement-policies.html#setting-chaincode-level-endorsement-policies" + example: "AND('Org1MSP.member','Org2MSP.member')" + maxLength: 65535 + minLength: 1 + nullable: false + type: string + collectionsConfigFile: + description: Name of the collections config file as present in the sourceFiles + array of the request. + maxLength: 255 + minLength: 1 + nullable: false + type: string + channelId: + description: The name of the Fabric channel where the contract will get + instantiated. + example: mychannel + maxLength: 2048 + minLength: 1 + nullable: false + type: string + targetOrganizations: + items: + $ref: '#/components/schemas/DeploymentTargetOrganization' + maxItems: 1024 + minItems: 1 + nullable: false + type: array + constructorArgs: + $ref: '#/components/schemas/DeployContractGoSourceV1Request_constructorArgs' + ccSequence: + example: 1 + nullable: false + type: number + ccVersion: + example: 1.0.0 + maxLength: 128 + minLength: 1 + nullable: false + type: string + ccName: + example: my-hello-world-contract + maxLength: 128 + minLength: 1 + nullable: false + type: string + ccLabel: + description: Human readable label to uniquely identify the contract. Recommended + to include in this at least the contract name and the exact version in + order to make it easily distinguishable from other deployments of the + same contract. + example: hello-world-contract + maxLength: 255 + minLength: 1 + nullable: false + type: string + sourceFiles: + description: The your-smart-contract.go file where the functionality of + your contract is implemented. + items: + $ref: '#/components/schemas/FileBase64' + maxItems: 65535 + minItems: 1 + nullable: false + type: array + required: + - caFile + - ccLabel + - ccLang + - ccName + - ccSequence + - ccVersion + - channelId + - orderer + - ordererTLSHostnameOverride + - sourceFiles + - targetOrganizations + type: object + DeployContractV1Response: + example: + lifecycle: + init: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + commit: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + installList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + queryCommitted: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + packaging: + code: 0 + stdout: stdout + stderr: stderr + signal: signal + approveForMyOrgList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + queryInstalledList: + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + - code: 0 + stdout: stdout + stderr: stderr + signal: signal + success: true + packageIds: + - f8c8e06bfc27771028c4bbc3564341887881e29b92a844c66c30bac0ff83966e + - f8c8e06bfc27771028c4bbc3564341887881e29b92a844c66c30bac0ff83966e + properties: + success: + type: boolean + packageIds: + items: + example: f8c8e06bfc27771028c4bbc3564341887881e29b92a844c66c30bac0ff83966e + maxLength: 4096 + minLength: 1 + nullable: false + type: string + type: array + lifecycle: + $ref: '#/components/schemas/ChainCodeLifeCycleCommandResponses' + required: + - lifecycle + - packageIds + - success + type: object + GetBlockRequestV1: + description: Request for GetBlock endpoint. + example: + gatewayOptions: + wallet: + keychain: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + json: json + connectionProfile: + channels: + key: "" + certificateAuthorities: + key: "" + name: basic-network + organizations: + key: "" + peers: + key: "" + x-type: hlfv1 + description: The basic network + client: + organization: Org1 + orderers: + key: "" + version: "1.0" + discovery: + asLocalhost: true + enabled: true + identity: identity + eventHandlerOptions: + commitTimeout: 0.8008281904610115 + strategy: null + endorseTimeout: 6.027456183070403 + query: + blockHash: + buffer: buffer + encoding: encoding + blockNumber: blockNumber + transactionId: transactionId + skipDecode: false + channelName: channelName + connectionChannelName: connectionChannelName + properties: + channelName: + description: Fabric channel which we want to query. + maxLength: 100 + minLength: 1 + nullable: false + type: string + connectionChannelName: + description: "Fabric channel we want to connect to. If not provided, then\ + \ one from channelName parameter will be used" + maxLength: 100 + minLength: 1 + nullable: false + type: string + gatewayOptions: + $ref: '#/components/schemas/GatewayOptions' + query: + $ref: '#/components/schemas/GetBlockRequestV1_query' + skipDecode: + default: false + description: "If true, encoded buffer will be returned. Otherwise, entire\ + \ block object is returned." + nullable: false + type: boolean + required: + - channelName + - gatewayOptions + - query + type: object + FabricFullBlockDataV1: + description: Full hyperledger fabric block data. + GetBlockResponseDecodedV1: + description: When skipDecode is false (default) then decoded block object is + returned. + properties: + decodedBlock: + description: Full hyperledger fabric block data. + required: + - decodedBlock + type: object + GetBlockResponseEncodedV1: + description: When skipDecode is true then encoded block Buffer is returned. + properties: + encodedBlock: + type: string + required: + - encodedBlock + type: object + GetBlockResponseV1: + description: Response from GetBlock endpoint. + oneOf: + - $ref: '#/components/schemas/GetBlockResponseDecodedV1' + - $ref: '#/components/schemas/GetBlockResponseEncodedV1' + ErrorExceptionResponseV1: + properties: + message: + nullable: false + type: string + error: + nullable: false + type: string + required: + - error + - message + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + WatchBlocksV1: + description: Websocket requests for monitoring new blocks. + enum: + - org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.SubscribeDelegatedSign + - org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - SubscribeDelegatedSign + - Next + - Unsubscribe + - Error + - Complete + WatchBlocksListenerTypeV1: + description: "Response type from WatchBlocks. 'Cactus*' are custom views, others\ + \ correspond to fabric SDK call." + enum: + - filtered + - full + - private + - cactus:transactions + type: string + x-enum-varnames: + - Filtered + - Full + - Private + - CactusTransactions + WatchBlocksOptionsV1: + description: Options passed when subscribing to block monitoring. + properties: + channelName: + description: Hyperledger Fabric channel to connect to. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gatewayOptions: + $ref: '#/components/schemas/GatewayOptions' + type: + $ref: '#/components/schemas/WatchBlocksListenerTypeV1' + startBlock: + description: From which block start monitoring. Defaults to latest. + maxLength: 100 + minLength: 1 + nullable: false + type: string + required: + - channelName + - gatewayOptions + - type + type: object + WatchBlocksDelegatedSignOptionsV1: + description: Options passed when subscribing to block monitoring with delegated + signing. + properties: + type: + $ref: '#/components/schemas/WatchBlocksListenerTypeV1' + startBlock: + description: From which block start monitoring. Defaults to latest. + maxLength: 100 + minLength: 1 + nullable: false + type: string + channelName: + maxLength: 100 + minLength: 1 + nullable: false + type: string + signerCertificate: + nullable: false + type: string + signerMspID: + nullable: false + type: string + uniqueTransactionData: + description: Can be used to uniquely identify and authorize signing request + nullable: false + required: + - channelName + - signerCertificate + - signerMspID + - type + type: object + WatchBlocksCactusTransactionsEventV1: + description: Transaction summary from commited block. + properties: + chaincodeId: + description: ChainCode containing function that was executed. + nullable: false + type: string + transactionId: + description: Transaction identifier. + nullable: false + type: string + functionName: + description: Function name that was executed. + nullable: false + type: string + functionArgs: + description: List of function arguments. + items: + minLength: 0 + nullable: false + type: string + type: array + required: + - chaincodeId + - functionArgs + - functionName + - transactionId + type: object + WatchBlocksCactusTransactionsResponseV1: + description: Custom response containing block transactions summary. Compatible + with legacy fabric-socketio connector monitoring. + properties: + cactusTransactionsEvents: + description: List of transactions summary + items: + $ref: '#/components/schemas/WatchBlocksCactusTransactionsEventV1' + type: array + required: + - cactusTransactionsEvents + type: object + WatchBlocksFullResponseV1: + description: Response that corresponds to Fabric SDK 'full' EventType. + properties: + fullBlock: + description: Full commited block. + nullable: false + required: + - fullBlock + type: object + WatchBlocksFilteredResponseV1: + description: Response that corresponds to Fabric SDK 'filtered' EventType. + properties: + filteredBlock: + description: Filtered commited block. + nullable: false + required: + - filteredBlock + type: object + WatchBlocksPrivateResponseV1: + description: Response that corresponds to Fabric SDK 'private' EventType. + properties: + privateBlock: + description: Private commited block. + nullable: false + required: + - privateBlock + type: object + WatchBlocksCactusErrorResponseV1: + description: Error response from WatchBlocks operation. + properties: + code: + description: Error code. + type: number + errorMessage: + description: Description of the error. + type: string + required: + - code + - errorMessage + type: object + WatchBlocksResponseV1: + description: Response block from WatchBlocks endpoint. Depends on 'type' passed + in subscription options. + oneOf: + - $ref: '#/components/schemas/WatchBlocksCactusTransactionsResponseV1' + - $ref: '#/components/schemas/WatchBlocksFullResponseV1' + - $ref: '#/components/schemas/WatchBlocksFilteredResponseV1' + - $ref: '#/components/schemas/WatchBlocksPrivateResponseV1' + - $ref: '#/components/schemas/WatchBlocksCactusErrorResponseV1' + deployContractGoSourceV1_501_response: + properties: + message: + maxLength: 2048 + minLength: 1 + nullable: false + type: string + type: object + ConnectionProfile_client: + example: + organization: Org1 + properties: + organization: + example: Org1 + type: string + type: object + GatewayOptions_wallet: + example: + keychain: + vaultTransitKey: + keyName: keyName + token: token + keychainId: keychainId + keychainRef: keychainRef + webSocketKey: + signature: signature + sessionId: sessionId + type: null + json: json + maxProperties: 1 + minProperties: 1 + properties: + keychain: + $ref: '#/components/schemas/FabricSigningCredential' + json: + maxLength: 65535 + minLength: 1 + nullable: false + type: string + type: object + DeployContractGoSourceV1Request_constructorArgs: + example: "{} - An empty object literal can be sufficient if your contract does\ + \ not have parameters." + nullable: false + properties: + Args: + items: {} + maxLength: 2048 + minLength: 0 + type: array + type: object + GetBlockRequestV1_query_blockHash: + description: Select block by it's hash. + example: + buffer: buffer + encoding: encoding + nullable: false + properties: + encoding: + description: "NodeJS Buffer encoding (utf-8, hex, binary, base64, etc...).\ + \ Passed directly to `Buffer.from()` call on hashBuffer. If not provided\ + \ then JSON buffer format is assumed." + nullable: false + type: string + buffer: + description: Buffer of blockHash. It's encoding should be described in `encoding` + parameter. + nullable: false + type: string + required: + - buffer + type: object + GetBlockRequestV1_query: + description: "Query selector, caller must provide at least one of them. First\ + \ found will be used, rest will be ignored, so it's recommended to pass single\ + \ selector." + example: + blockHash: + buffer: buffer + encoding: encoding + blockNumber: blockNumber + transactionId: transactionId + properties: + blockNumber: + description: Select block by it's number. + nullable: false + type: string + blockHash: + $ref: '#/components/schemas/GetBlockRequestV1_query_blockHash' + transactionId: + description: Select block by id of transaction that it contains. + nullable: false + type: string + type: object + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..dc9abe99ff9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..3843f0cbf45 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..55bd143a196 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..945b2b14c53 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..c2fbdd46e21 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..423222206ec --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..3716562b008 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,443 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.ChainCodeLifeCycleCommandResponses.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ConnectionProfile.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ConnectionProfileClient.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractGoSourceV1501Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractGoSourceV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractGoSourceV1RequestConstructorArgs.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractGoSourceV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeploymentTargetOrgFabric2x.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeploymentTargetOrganization.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ErrorExceptionResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.FabricSigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.FileBase64.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GatewayDiscoveryOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GatewayEventHandlerOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GatewayOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GatewayOptionsWallet.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockRequestV1Query.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockRequestV1QueryBlockHash.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockResponseDecodedV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockResponseEncodedV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetTransactionReceiptResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunDelegatedSignTransactionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SSHExecCommandResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactReceiptBlockMetaData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactReceiptTransactionCreator.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactReceiptTransactionEndorsement.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.VaultTransitKey.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksCactusErrorResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksCactusTransactionsEventV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksCactusTransactionsResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksDelegatedSignOptionsV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksFilteredResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksFullResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksOptionsV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksPrivateResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WebSocketKey.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); + } + } + } + + /** + * 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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..e58da262723 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..73d57e430ad --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..24cb0a59793 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..5f5437d5463 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..39b06b9b7f0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,949 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeployContractGoSourceV1501Response; +import org.openapitools.client.model.DeployContractGoSourceV1Request; +import org.openapitools.client.model.DeployContractGoSourceV1Response; +import org.openapitools.client.model.DeployContractV1Request; +import org.openapitools.client.model.DeployContractV1Response; +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.GetBlockRequestV1; +import org.openapitools.client.model.GetBlockResponseV1; +import org.openapitools.client.model.GetTransactionReceiptResponse; +import org.openapitools.client.model.RunDelegatedSignTransactionRequest; +import org.openapitools.client.model.RunTransactionRequest; +import org.openapitools.client.model.RunTransactionResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 deployContractGoSourceV1 + * @param deployContractGoSourceV1Request (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 + + + + +
Status Code Description Response Headers
200 OK -
501 Not implemented -
+ */ + public okhttp3.Call deployContractGoSourceV1Call(DeployContractGoSourceV1Request deployContractGoSourceV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractGoSourceV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract-go-source"; + + 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", + "text/plain" + }; + 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 deployContractGoSourceV1ValidateBeforeCall(DeployContractGoSourceV1Request deployContractGoSourceV1Request, final ApiCallback _callback) throws ApiException { + return deployContractGoSourceV1Call(deployContractGoSourceV1Request, _callback); + + } + + /** + * Deploys a chaincode contract in the form of a go sources. + * + * @param deployContractGoSourceV1Request (optional) + * @return DeployContractGoSourceV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
501 Not implemented -
+ */ + public DeployContractGoSourceV1Response deployContractGoSourceV1(DeployContractGoSourceV1Request deployContractGoSourceV1Request) throws ApiException { + ApiResponse localVarResp = deployContractGoSourceV1WithHttpInfo(deployContractGoSourceV1Request); + return localVarResp.getData(); + } + + /** + * Deploys a chaincode contract in the form of a go sources. + * + * @param deployContractGoSourceV1Request (optional) + * @return ApiResponse<DeployContractGoSourceV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
501 Not implemented -
+ */ + public ApiResponse deployContractGoSourceV1WithHttpInfo(DeployContractGoSourceV1Request deployContractGoSourceV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractGoSourceV1ValidateBeforeCall(deployContractGoSourceV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys a chaincode contract in the form of a go sources. (asynchronously) + * + * @param deployContractGoSourceV1Request (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 + + + + +
Status Code Description Response Headers
200 OK -
501 Not implemented -
+ */ + public okhttp3.Call deployContractGoSourceV1Async(DeployContractGoSourceV1Request deployContractGoSourceV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractGoSourceV1ValidateBeforeCall(deployContractGoSourceV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deployContractV1 + * @param deployContractV1Request (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 + + + + +
Status Code Description Response Headers
200 OK -
501 Not implemented -
+ */ + public okhttp3.Call deployContractV1Call(DeployContractV1Request deployContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/deploy-contract"; + + 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", + "text/plain" + }; + 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 deployContractV1ValidateBeforeCall(DeployContractV1Request deployContractV1Request, final ApiCallback _callback) throws ApiException { + return deployContractV1Call(deployContractV1Request, _callback); + + } + + /** + * Deploys a chaincode contract from a set of source files. Note: This endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers to the Cactus API version, not the supported Fabric ledger version. + * + * @param deployContractV1Request (optional) + * @return DeployContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
501 Not implemented -
+ */ + public DeployContractV1Response deployContractV1(DeployContractV1Request deployContractV1Request) throws ApiException { + ApiResponse localVarResp = deployContractV1WithHttpInfo(deployContractV1Request); + return localVarResp.getData(); + } + + /** + * Deploys a chaincode contract from a set of source files. Note: This endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers to the Cactus API version, not the supported Fabric ledger version. + * + * @param deployContractV1Request (optional) + * @return ApiResponse<DeployContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
501 Not implemented -
+ */ + public ApiResponse deployContractV1WithHttpInfo(DeployContractV1Request deployContractV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractV1ValidateBeforeCall(deployContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys a chaincode contract from a set of source files. Note: This endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers to the Cactus API version, not the supported Fabric ledger version. (asynchronously) + * + * @param deployContractV1Request (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 + + + + +
Status Code Description Response Headers
200 OK -
501 Not implemented -
+ */ + public okhttp3.Call deployContractV1Async(DeployContractV1Request deployContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractV1ValidateBeforeCall(deployContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getBlockV1 + * @param getBlockRequestV1 (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call getBlockV1Call(GetBlockRequestV1 getBlockRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getBlockRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-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 = { + "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 getBlockV1ValidateBeforeCall(GetBlockRequestV1 getBlockRequestV1, final ApiCallback _callback) throws ApiException { + return getBlockV1Call(getBlockRequestV1, _callback); + + } + + /** + * Get block from the channel using one of selectors from the input. Works only on Fabric 2.x. + * + * @param getBlockRequestV1 (optional) + * @return GetBlockResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public GetBlockResponseV1 getBlockV1(GetBlockRequestV1 getBlockRequestV1) throws ApiException { + ApiResponse localVarResp = getBlockV1WithHttpInfo(getBlockRequestV1); + return localVarResp.getData(); + } + + /** + * Get block from the channel using one of selectors from the input. Works only on Fabric 2.x. + * + * @param getBlockRequestV1 (optional) + * @return ApiResponse<GetBlockResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public ApiResponse getBlockV1WithHttpInfo(GetBlockRequestV1 getBlockRequestV1) throws ApiException { + okhttp3.Call localVarCall = getBlockV1ValidateBeforeCall(getBlockRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get block from the channel using one of selectors from the input. Works only on Fabric 2.x. (asynchronously) + * + * @param getBlockRequestV1 (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call getBlockV1Async(GetBlockRequestV1 getBlockRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getBlockV1ValidateBeforeCall(getBlockRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + 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 getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getTransactionReceiptByTxIDV1 + * @param runTransactionRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 -
+ */ + public okhttp3.Call getTransactionReceiptByTxIDV1Call(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = runTransactionRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-transaction-receipt-by-txid"; + + 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 getTransactionReceiptByTxIDV1ValidateBeforeCall(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'runTransactionRequest' is set + if (runTransactionRequest == null) { + throw new ApiException("Missing the required parameter 'runTransactionRequest' when calling getTransactionReceiptByTxIDV1(Async)"); + } + + return getTransactionReceiptByTxIDV1Call(runTransactionRequest, _callback); + + } + + /** + * get a transaction receipt by tx id on a Fabric ledger. + * + * @param runTransactionRequest (required) + * @return GetTransactionReceiptResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 -
+ */ + public GetTransactionReceiptResponse getTransactionReceiptByTxIDV1(RunTransactionRequest runTransactionRequest) throws ApiException { + ApiResponse localVarResp = getTransactionReceiptByTxIDV1WithHttpInfo(runTransactionRequest); + return localVarResp.getData(); + } + + /** + * get a transaction receipt by tx id on a Fabric ledger. + * + * @param runTransactionRequest (required) + * @return ApiResponse<GetTransactionReceiptResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 -
+ */ + public ApiResponse getTransactionReceiptByTxIDV1WithHttpInfo(RunTransactionRequest runTransactionRequest) throws ApiException { + okhttp3.Call localVarCall = getTransactionReceiptByTxIDV1ValidateBeforeCall(runTransactionRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * get a transaction receipt by tx id on a Fabric ledger. (asynchronously) + * + * @param runTransactionRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 -
+ */ + public okhttp3.Call getTransactionReceiptByTxIDV1Async(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getTransactionReceiptByTxIDV1ValidateBeforeCall(runTransactionRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for runDelegatedSignTransactionV1 + * @param runDelegatedSignTransactionRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call runDelegatedSignTransactionV1Call(RunDelegatedSignTransactionRequest runDelegatedSignTransactionRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = runDelegatedSignTransactionRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-delegated-sign-transaction"; + + 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 runDelegatedSignTransactionV1ValidateBeforeCall(RunDelegatedSignTransactionRequest runDelegatedSignTransactionRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'runDelegatedSignTransactionRequest' is set + if (runDelegatedSignTransactionRequest == null) { + throw new ApiException("Missing the required parameter 'runDelegatedSignTransactionRequest' when calling runDelegatedSignTransactionV1(Async)"); + } + + return runDelegatedSignTransactionV1Call(runDelegatedSignTransactionRequest, _callback); + + } + + /** + * Runs a transaction on a Fabric ledger using user-provided signing callback. + * + * @param runDelegatedSignTransactionRequest (required) + * @return RunTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public RunTransactionResponse runDelegatedSignTransactionV1(RunDelegatedSignTransactionRequest runDelegatedSignTransactionRequest) throws ApiException { + ApiResponse localVarResp = runDelegatedSignTransactionV1WithHttpInfo(runDelegatedSignTransactionRequest); + return localVarResp.getData(); + } + + /** + * Runs a transaction on a Fabric ledger using user-provided signing callback. + * + * @param runDelegatedSignTransactionRequest (required) + * @return ApiResponse<RunTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public ApiResponse runDelegatedSignTransactionV1WithHttpInfo(RunDelegatedSignTransactionRequest runDelegatedSignTransactionRequest) throws ApiException { + okhttp3.Call localVarCall = runDelegatedSignTransactionV1ValidateBeforeCall(runDelegatedSignTransactionRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Runs a transaction on a Fabric ledger using user-provided signing callback. (asynchronously) + * + * @param runDelegatedSignTransactionRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call runDelegatedSignTransactionV1Async(RunDelegatedSignTransactionRequest runDelegatedSignTransactionRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = runDelegatedSignTransactionV1ValidateBeforeCall(runDelegatedSignTransactionRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for runTransactionV1 + * @param runTransactionRequest (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call runTransactionV1Call(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = runTransactionRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction"; + + 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 runTransactionV1ValidateBeforeCall(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'runTransactionRequest' is set + if (runTransactionRequest == null) { + throw new ApiException("Missing the required parameter 'runTransactionRequest' when calling runTransactionV1(Async)"); + } + + return runTransactionV1Call(runTransactionRequest, _callback); + + } + + /** + * Runs a transaction on a Fabric ledger. + * + * @param runTransactionRequest (required) + * @return RunTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public RunTransactionResponse runTransactionV1(RunTransactionRequest runTransactionRequest) throws ApiException { + ApiResponse localVarResp = runTransactionV1WithHttpInfo(runTransactionRequest); + return localVarResp.getData(); + } + + /** + * Runs a transaction on a Fabric ledger. + * + * @param runTransactionRequest (required) + * @return ApiResponse<RunTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public ApiResponse runTransactionV1WithHttpInfo(RunTransactionRequest runTransactionRequest) throws ApiException { + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Runs a transaction on a Fabric ledger. (asynchronously) + * + * @param runTransactionRequest (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call runTransactionV1Async(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..8116a55364b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..695cd18c5bd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..d15f68c2553 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..72aec74b8b1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..189fe9e2567 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeLanguageRuntime.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeLanguageRuntime.java new file mode 100644 index 00000000000..48fe5ab3acc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeLanguageRuntime.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates the supported programming language runtimes of Hyperledger Fabric + */ +@JsonAdapter(ChainCodeLanguageRuntime.Adapter.class) +public enum ChainCodeLanguageRuntime { + + GOLANG("golang"), + + NODE("node"), + + JAVA("java"); + + private String value; + + ChainCodeLanguageRuntime(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ChainCodeLanguageRuntime fromValue(String value) { + for (ChainCodeLanguageRuntime b : ChainCodeLanguageRuntime.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ChainCodeLanguageRuntime enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ChainCodeLanguageRuntime read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ChainCodeLanguageRuntime.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponses.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponses.java new file mode 100644 index 00000000000..afb15409390 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponses.java @@ -0,0 +1,456 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.SSHExecCommandResponse; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ChainCodeLifeCycleCommandResponses + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ChainCodeLifeCycleCommandResponses { + public static final String SERIALIZED_NAME_PACKAGING = "packaging"; + @SerializedName(SERIALIZED_NAME_PACKAGING) + private SSHExecCommandResponse packaging; + + public static final String SERIALIZED_NAME_INSTALL_LIST = "installList"; + @SerializedName(SERIALIZED_NAME_INSTALL_LIST) + private List installList = new ArrayList<>(); + + public static final String SERIALIZED_NAME_QUERY_INSTALLED_LIST = "queryInstalledList"; + @SerializedName(SERIALIZED_NAME_QUERY_INSTALLED_LIST) + private List queryInstalledList = new ArrayList<>(); + + public static final String SERIALIZED_NAME_APPROVE_FOR_MY_ORG_LIST = "approveForMyOrgList"; + @SerializedName(SERIALIZED_NAME_APPROVE_FOR_MY_ORG_LIST) + private List approveForMyOrgList = new ArrayList<>(); + + public static final String SERIALIZED_NAME_COMMIT = "commit"; + @SerializedName(SERIALIZED_NAME_COMMIT) + private SSHExecCommandResponse commit; + + public static final String SERIALIZED_NAME_QUERY_COMMITTED = "queryCommitted"; + @SerializedName(SERIALIZED_NAME_QUERY_COMMITTED) + private SSHExecCommandResponse queryCommitted; + + public static final String SERIALIZED_NAME_INIT = "init"; + @SerializedName(SERIALIZED_NAME_INIT) + private SSHExecCommandResponse init; + + public ChainCodeLifeCycleCommandResponses() { + } + + public ChainCodeLifeCycleCommandResponses packaging(SSHExecCommandResponse packaging) { + + this.packaging = packaging; + return this; + } + + /** + * Get packaging + * @return packaging + **/ + @javax.annotation.Nullable + public SSHExecCommandResponse getPackaging() { + return packaging; + } + + + public void setPackaging(SSHExecCommandResponse packaging) { + this.packaging = packaging; + } + + + public ChainCodeLifeCycleCommandResponses installList(List installList) { + + this.installList = installList; + return this; + } + + public ChainCodeLifeCycleCommandResponses addInstallListItem(SSHExecCommandResponse installListItem) { + if (this.installList == null) { + this.installList = new ArrayList<>(); + } + this.installList.add(installListItem); + return this; + } + + /** + * Get installList + * @return installList + **/ + @javax.annotation.Nonnull + public List getInstallList() { + return installList; + } + + + public void setInstallList(List installList) { + this.installList = installList; + } + + + public ChainCodeLifeCycleCommandResponses queryInstalledList(List queryInstalledList) { + + this.queryInstalledList = queryInstalledList; + return this; + } + + public ChainCodeLifeCycleCommandResponses addQueryInstalledListItem(SSHExecCommandResponse queryInstalledListItem) { + if (this.queryInstalledList == null) { + this.queryInstalledList = new ArrayList<>(); + } + this.queryInstalledList.add(queryInstalledListItem); + return this; + } + + /** + * Get queryInstalledList + * @return queryInstalledList + **/ + @javax.annotation.Nonnull + public List getQueryInstalledList() { + return queryInstalledList; + } + + + public void setQueryInstalledList(List queryInstalledList) { + this.queryInstalledList = queryInstalledList; + } + + + public ChainCodeLifeCycleCommandResponses approveForMyOrgList(List approveForMyOrgList) { + + this.approveForMyOrgList = approveForMyOrgList; + return this; + } + + public ChainCodeLifeCycleCommandResponses addApproveForMyOrgListItem(SSHExecCommandResponse approveForMyOrgListItem) { + if (this.approveForMyOrgList == null) { + this.approveForMyOrgList = new ArrayList<>(); + } + this.approveForMyOrgList.add(approveForMyOrgListItem); + return this; + } + + /** + * Get approveForMyOrgList + * @return approveForMyOrgList + **/ + @javax.annotation.Nonnull + public List getApproveForMyOrgList() { + return approveForMyOrgList; + } + + + public void setApproveForMyOrgList(List approveForMyOrgList) { + this.approveForMyOrgList = approveForMyOrgList; + } + + + public ChainCodeLifeCycleCommandResponses commit(SSHExecCommandResponse commit) { + + this.commit = commit; + return this; + } + + /** + * Get commit + * @return commit + **/ + @javax.annotation.Nullable + public SSHExecCommandResponse getCommit() { + return commit; + } + + + public void setCommit(SSHExecCommandResponse commit) { + this.commit = commit; + } + + + public ChainCodeLifeCycleCommandResponses queryCommitted(SSHExecCommandResponse queryCommitted) { + + this.queryCommitted = queryCommitted; + return this; + } + + /** + * Get queryCommitted + * @return queryCommitted + **/ + @javax.annotation.Nullable + public SSHExecCommandResponse getQueryCommitted() { + return queryCommitted; + } + + + public void setQueryCommitted(SSHExecCommandResponse queryCommitted) { + this.queryCommitted = queryCommitted; + } + + + public ChainCodeLifeCycleCommandResponses init(SSHExecCommandResponse init) { + + this.init = init; + return this; + } + + /** + * Get init + * @return init + **/ + @javax.annotation.Nullable + public SSHExecCommandResponse getInit() { + return init; + } + + + public void setInit(SSHExecCommandResponse init) { + this.init = init; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChainCodeLifeCycleCommandResponses chainCodeLifeCycleCommandResponses = (ChainCodeLifeCycleCommandResponses) o; + return Objects.equals(this.packaging, chainCodeLifeCycleCommandResponses.packaging) && + Objects.equals(this.installList, chainCodeLifeCycleCommandResponses.installList) && + Objects.equals(this.queryInstalledList, chainCodeLifeCycleCommandResponses.queryInstalledList) && + Objects.equals(this.approveForMyOrgList, chainCodeLifeCycleCommandResponses.approveForMyOrgList) && + Objects.equals(this.commit, chainCodeLifeCycleCommandResponses.commit) && + Objects.equals(this.queryCommitted, chainCodeLifeCycleCommandResponses.queryCommitted) && + Objects.equals(this.init, chainCodeLifeCycleCommandResponses.init); + } + + @Override + public int hashCode() { + return Objects.hash(packaging, installList, queryInstalledList, approveForMyOrgList, commit, queryCommitted, init); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChainCodeLifeCycleCommandResponses {\n"); + sb.append(" packaging: ").append(toIndentedString(packaging)).append("\n"); + sb.append(" installList: ").append(toIndentedString(installList)).append("\n"); + sb.append(" queryInstalledList: ").append(toIndentedString(queryInstalledList)).append("\n"); + sb.append(" approveForMyOrgList: ").append(toIndentedString(approveForMyOrgList)).append("\n"); + sb.append(" commit: ").append(toIndentedString(commit)).append("\n"); + sb.append(" queryCommitted: ").append(toIndentedString(queryCommitted)).append("\n"); + sb.append(" init: ").append(toIndentedString(init)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("packaging"); + openapiFields.add("installList"); + openapiFields.add("queryInstalledList"); + openapiFields.add("approveForMyOrgList"); + openapiFields.add("commit"); + openapiFields.add("queryCommitted"); + openapiFields.add("init"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("installList"); + openapiRequiredFields.add("queryInstalledList"); + openapiRequiredFields.add("approveForMyOrgList"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ChainCodeLifeCycleCommandResponses + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ChainCodeLifeCycleCommandResponses.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ChainCodeLifeCycleCommandResponses is not found in the empty JSON string", ChainCodeLifeCycleCommandResponses.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ChainCodeLifeCycleCommandResponses.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ChainCodeLifeCycleCommandResponses` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ChainCodeLifeCycleCommandResponses.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `packaging` + if (jsonObj.get("packaging") != null && !jsonObj.get("packaging").isJsonNull()) { + SSHExecCommandResponse.validateJsonObject(jsonObj.getAsJsonObject("packaging")); + } + // ensure the json data is an array + if (!jsonObj.get("installList").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `installList` to be an array in the JSON string but got `%s`", jsonObj.get("installList").toString())); + } + + JsonArray jsonArrayinstallList = jsonObj.getAsJsonArray("installList"); + // validate the required field `installList` (array) + for (int i = 0; i < jsonArrayinstallList.size(); i++) { + SSHExecCommandResponse.validateJsonObject(jsonArrayinstallList.get(i).getAsJsonObject()); + }; + // ensure the json data is an array + if (!jsonObj.get("queryInstalledList").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `queryInstalledList` to be an array in the JSON string but got `%s`", jsonObj.get("queryInstalledList").toString())); + } + + JsonArray jsonArrayqueryInstalledList = jsonObj.getAsJsonArray("queryInstalledList"); + // validate the required field `queryInstalledList` (array) + for (int i = 0; i < jsonArrayqueryInstalledList.size(); i++) { + SSHExecCommandResponse.validateJsonObject(jsonArrayqueryInstalledList.get(i).getAsJsonObject()); + }; + // ensure the json data is an array + if (!jsonObj.get("approveForMyOrgList").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `approveForMyOrgList` to be an array in the JSON string but got `%s`", jsonObj.get("approveForMyOrgList").toString())); + } + + JsonArray jsonArrayapproveForMyOrgList = jsonObj.getAsJsonArray("approveForMyOrgList"); + // validate the required field `approveForMyOrgList` (array) + for (int i = 0; i < jsonArrayapproveForMyOrgList.size(); i++) { + SSHExecCommandResponse.validateJsonObject(jsonArrayapproveForMyOrgList.get(i).getAsJsonObject()); + }; + // validate the optional field `commit` + if (jsonObj.get("commit") != null && !jsonObj.get("commit").isJsonNull()) { + SSHExecCommandResponse.validateJsonObject(jsonObj.getAsJsonObject("commit")); + } + // validate the optional field `queryCommitted` + if (jsonObj.get("queryCommitted") != null && !jsonObj.get("queryCommitted").isJsonNull()) { + SSHExecCommandResponse.validateJsonObject(jsonObj.getAsJsonObject("queryCommitted")); + } + // validate the optional field `init` + if (jsonObj.get("init") != null && !jsonObj.get("init").isJsonNull()) { + SSHExecCommandResponse.validateJsonObject(jsonObj.getAsJsonObject("init")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ChainCodeLifeCycleCommandResponses.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ChainCodeLifeCycleCommandResponses' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ChainCodeLifeCycleCommandResponses.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ChainCodeLifeCycleCommandResponses value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ChainCodeLifeCycleCommandResponses read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ChainCodeLifeCycleCommandResponses given an JSON string + * + * @param jsonString JSON string + * @return An instance of ChainCodeLifeCycleCommandResponses + * @throws IOException if the JSON string is invalid with respect to ChainCodeLifeCycleCommandResponses + */ + public static ChainCodeLifeCycleCommandResponses fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ChainCodeLifeCycleCommandResponses.class); + } + + /** + * Convert an instance of ChainCodeLifeCycleCommandResponses to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeProgrammingLanguage.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeProgrammingLanguage.java new file mode 100644 index 00000000000..07da8013d54 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ChainCodeProgrammingLanguage.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates the supported source code programming languages of Hyperledger Fabric + */ +@JsonAdapter(ChainCodeProgrammingLanguage.Adapter.class) +public enum ChainCodeProgrammingLanguage { + + GOLANG("golang"), + + JAVASCRIPT("javascript"), + + TYPESCRIPT("typescript"), + + JAVA("java"); + + private String value; + + ChainCodeProgrammingLanguage(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ChainCodeProgrammingLanguage fromValue(String value) { + for (ChainCodeProgrammingLanguage b : ChainCodeProgrammingLanguage.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ChainCodeProgrammingLanguage enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ChainCodeProgrammingLanguage read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ChainCodeProgrammingLanguage.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConnectionProfile.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConnectionProfile.java new file mode 100644 index 00000000000..ad70b1f4c3d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConnectionProfile.java @@ -0,0 +1,602 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.ConnectionProfileClient; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ConnectionProfile + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConnectionProfile { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_X_TYPE = "x-type"; + @SerializedName(SERIALIZED_NAME_X_TYPE) + private String xType; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public static final String SERIALIZED_NAME_CLIENT = "client"; + @SerializedName(SERIALIZED_NAME_CLIENT) + private ConnectionProfileClient client; + + public static final String SERIALIZED_NAME_CHANNELS = "channels"; + @SerializedName(SERIALIZED_NAME_CHANNELS) + private Map channels = new HashMap<>(); + + public static final String SERIALIZED_NAME_ORGANIZATIONS = "organizations"; + @SerializedName(SERIALIZED_NAME_ORGANIZATIONS) + private Map organizations = new HashMap<>(); + + public static final String SERIALIZED_NAME_ORDERERS = "orderers"; + @SerializedName(SERIALIZED_NAME_ORDERERS) + private Map orderers = new HashMap<>(); + + public static final String SERIALIZED_NAME_PEERS = "peers"; + @SerializedName(SERIALIZED_NAME_PEERS) + private Map peers = new HashMap<>(); + + public static final String SERIALIZED_NAME_CERTIFICATE_AUTHORITIES = "certificateAuthorities"; + @SerializedName(SERIALIZED_NAME_CERTIFICATE_AUTHORITIES) + private Map certificateAuthorities = new HashMap<>(); + + public ConnectionProfile() { + } + + public ConnectionProfile name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public ConnectionProfile xType(String xType) { + + this.xType = xType; + return this; + } + + /** + * Get xType + * @return xType + **/ + @javax.annotation.Nullable + public String getxType() { + return xType; + } + + + public void setxType(String xType) { + this.xType = xType; + } + + + public ConnectionProfile description(String description) { + + this.description = description; + return this; + } + + /** + * Get description + * @return description + **/ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public ConnectionProfile version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @javax.annotation.Nonnull + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + + public ConnectionProfile client(ConnectionProfileClient client) { + + this.client = client; + return this; + } + + /** + * Get client + * @return client + **/ + @javax.annotation.Nullable + public ConnectionProfileClient getClient() { + return client; + } + + + public void setClient(ConnectionProfileClient client) { + this.client = client; + } + + + public ConnectionProfile channels(Map channels) { + + this.channels = channels; + return this; + } + + public ConnectionProfile putChannelsItem(String key, Object channelsItem) { + if (this.channels == null) { + this.channels = new HashMap<>(); + } + this.channels.put(key, channelsItem); + return this; + } + + /** + * Get channels + * @return channels + **/ + @javax.annotation.Nullable + public Map getChannels() { + return channels; + } + + + public void setChannels(Map channels) { + this.channels = channels; + } + + + public ConnectionProfile organizations(Map organizations) { + + this.organizations = organizations; + return this; + } + + public ConnectionProfile putOrganizationsItem(String key, Object organizationsItem) { + if (this.organizations == null) { + this.organizations = new HashMap<>(); + } + this.organizations.put(key, organizationsItem); + return this; + } + + /** + * Get organizations + * @return organizations + **/ + @javax.annotation.Nonnull + public Map getOrganizations() { + return organizations; + } + + + public void setOrganizations(Map organizations) { + this.organizations = organizations; + } + + + public ConnectionProfile orderers(Map orderers) { + + this.orderers = orderers; + return this; + } + + public ConnectionProfile putOrderersItem(String key, Object orderersItem) { + if (this.orderers == null) { + this.orderers = new HashMap<>(); + } + this.orderers.put(key, orderersItem); + return this; + } + + /** + * Get orderers + * @return orderers + **/ + @javax.annotation.Nullable + public Map getOrderers() { + return orderers; + } + + + public void setOrderers(Map orderers) { + this.orderers = orderers; + } + + + public ConnectionProfile peers(Map peers) { + + this.peers = peers; + return this; + } + + public ConnectionProfile putPeersItem(String key, Object peersItem) { + if (this.peers == null) { + this.peers = new HashMap<>(); + } + this.peers.put(key, peersItem); + return this; + } + + /** + * Get peers + * @return peers + **/ + @javax.annotation.Nonnull + public Map getPeers() { + return peers; + } + + + public void setPeers(Map peers) { + this.peers = peers; + } + + + public ConnectionProfile certificateAuthorities(Map certificateAuthorities) { + + this.certificateAuthorities = certificateAuthorities; + return this; + } + + public ConnectionProfile putCertificateAuthoritiesItem(String key, Object certificateAuthoritiesItem) { + if (this.certificateAuthorities == null) { + this.certificateAuthorities = new HashMap<>(); + } + this.certificateAuthorities.put(key, certificateAuthoritiesItem); + return this; + } + + /** + * Get certificateAuthorities + * @return certificateAuthorities + **/ + @javax.annotation.Nullable + public Map getCertificateAuthorities() { + return certificateAuthorities; + } + + + public void setCertificateAuthorities(Map certificateAuthorities) { + this.certificateAuthorities = certificateAuthorities; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectionProfile instance itself + */ + public ConnectionProfile putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionProfile connectionProfile = (ConnectionProfile) o; + return Objects.equals(this.name, connectionProfile.name) && + Objects.equals(this.xType, connectionProfile.xType) && + Objects.equals(this.description, connectionProfile.description) && + Objects.equals(this.version, connectionProfile.version) && + Objects.equals(this.client, connectionProfile.client) && + Objects.equals(this.channels, connectionProfile.channels) && + Objects.equals(this.organizations, connectionProfile.organizations) && + Objects.equals(this.orderers, connectionProfile.orderers) && + Objects.equals(this.peers, connectionProfile.peers) && + Objects.equals(this.certificateAuthorities, connectionProfile.certificateAuthorities)&& + Objects.equals(this.additionalProperties, connectionProfile.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, xType, description, version, client, channels, organizations, orderers, peers, certificateAuthorities, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionProfile {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" xType: ").append(toIndentedString(xType)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append(" channels: ").append(toIndentedString(channels)).append("\n"); + sb.append(" organizations: ").append(toIndentedString(organizations)).append("\n"); + sb.append(" orderers: ").append(toIndentedString(orderers)).append("\n"); + sb.append(" peers: ").append(toIndentedString(peers)).append("\n"); + sb.append(" certificateAuthorities: ").append(toIndentedString(certificateAuthorities)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("x-type"); + openapiFields.add("description"); + openapiFields.add("version"); + openapiFields.add("client"); + openapiFields.add("channels"); + openapiFields.add("organizations"); + openapiFields.add("orderers"); + openapiFields.add("peers"); + openapiFields.add("certificateAuthorities"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("version"); + openapiRequiredFields.add("organizations"); + openapiRequiredFields.add("peers"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConnectionProfile + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ConnectionProfile.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectionProfile is not found in the empty JSON string", ConnectionProfile.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConnectionProfile.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("x-type") != null && !jsonObj.get("x-type").isJsonNull()) && !jsonObj.get("x-type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `x-type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("x-type").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (!jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + // validate the optional field `client` + if (jsonObj.get("client") != null && !jsonObj.get("client").isJsonNull()) { + ConnectionProfileClient.validateJsonObject(jsonObj.getAsJsonObject("client")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConnectionProfile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectionProfile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectionProfile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConnectionProfile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConnectionProfile read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ConnectionProfile instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectionProfile given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectionProfile + * @throws IOException if the JSON string is invalid with respect to ConnectionProfile + */ + public static ConnectionProfile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectionProfile.class); + } + + /** + * Convert an instance of ConnectionProfile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConnectionProfileClient.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConnectionProfileClient.java new file mode 100644 index 00000000000..a4670c54894 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConnectionProfileClient.java @@ -0,0 +1,208 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ConnectionProfileClient + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConnectionProfileClient { + public static final String SERIALIZED_NAME_ORGANIZATION = "organization"; + @SerializedName(SERIALIZED_NAME_ORGANIZATION) + private String organization; + + public ConnectionProfileClient() { + } + + public ConnectionProfileClient organization(String organization) { + + this.organization = organization; + return this; + } + + /** + * Get organization + * @return organization + **/ + @javax.annotation.Nullable + public String getOrganization() { + return organization; + } + + + public void setOrganization(String organization) { + this.organization = organization; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionProfileClient connectionProfileClient = (ConnectionProfileClient) o; + return Objects.equals(this.organization, connectionProfileClient.organization); + } + + @Override + public int hashCode() { + return Objects.hash(organization); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionProfileClient {\n"); + sb.append(" organization: ").append(toIndentedString(organization)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("organization"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConnectionProfileClient + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ConnectionProfileClient.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectionProfileClient is not found in the empty JSON string", ConnectionProfileClient.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConnectionProfileClient.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConnectionProfileClient` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("organization") != null && !jsonObj.get("organization").isJsonNull()) && !jsonObj.get("organization").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `organization` to be a primitive type in the JSON string but got `%s`", jsonObj.get("organization").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConnectionProfileClient.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectionProfileClient' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectionProfileClient.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConnectionProfileClient value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConnectionProfileClient read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectionProfileClient given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectionProfileClient + * @throws IOException if the JSON string is invalid with respect to ConnectionProfileClient + */ + public static ConnectionProfileClient fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectionProfileClient.class); + } + + /** + * Convert an instance of ConnectionProfileClient to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DefaultEventHandlerStrategy.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DefaultEventHandlerStrategy.java new file mode 100644 index 00000000000..7c4401e52b4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DefaultEventHandlerStrategy.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets DefaultEventHandlerStrategy + */ +@JsonAdapter(DefaultEventHandlerStrategy.Adapter.class) +public enum DefaultEventHandlerStrategy { + + MSPID_SCOPE_ALLFORTX("MSPID_SCOPE_ALLFORTX"), + + MSPID_SCOPE_ANYFORTX("MSPID_SCOPE_ANYFORTX"), + + NETWORK_SCOPE_ALLFORTX("NETWORK_SCOPE_ALLFORTX"), + + NETWORK_SCOPE_ANYFORTX("NETWORK_SCOPE_ANYFORTX"); + + private String value; + + DefaultEventHandlerStrategy(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DefaultEventHandlerStrategy fromValue(String value) { + for (DefaultEventHandlerStrategy b : DefaultEventHandlerStrategy.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final DefaultEventHandlerStrategy enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DefaultEventHandlerStrategy read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DefaultEventHandlerStrategy.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1501Response.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1501Response.java new file mode 100644 index 00000000000..4930f3d6d0b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1501Response.java @@ -0,0 +1,208 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractGoSourceV1501Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractGoSourceV1501Response { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public DeployContractGoSourceV1501Response() { + } + + public DeployContractGoSourceV1501Response message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractGoSourceV1501Response deployContractGoSourceV1501Response = (DeployContractGoSourceV1501Response) o; + return Objects.equals(this.message, deployContractGoSourceV1501Response.message); + } + + @Override + public int hashCode() { + return Objects.hash(message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractGoSourceV1501Response {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractGoSourceV1501Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractGoSourceV1501Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractGoSourceV1501Response is not found in the empty JSON string", DeployContractGoSourceV1501Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractGoSourceV1501Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractGoSourceV1501Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractGoSourceV1501Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractGoSourceV1501Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractGoSourceV1501Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractGoSourceV1501Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractGoSourceV1501Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractGoSourceV1501Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractGoSourceV1501Response + * @throws IOException if the JSON string is invalid with respect to DeployContractGoSourceV1501Response + */ + public static DeployContractGoSourceV1501Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractGoSourceV1501Response.class); + } + + /** + * Convert an instance of DeployContractGoSourceV1501Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Request.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Request.java new file mode 100644 index 00000000000..adc54ace523 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Request.java @@ -0,0 +1,613 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.DeployContractGoSourceV1RequestConstructorArgs; +import org.openapitools.client.model.DeploymentTargetOrganization; +import org.openapitools.client.model.FileBase64; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractGoSourceV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractGoSourceV1Request { + public static final String SERIALIZED_NAME_POLICY_DSL_SOURCE = "policyDslSource"; + @SerializedName(SERIALIZED_NAME_POLICY_DSL_SOURCE) + private String policyDslSource; + + public static final String SERIALIZED_NAME_TLS_ROOT_CERT_FILES = "tlsRootCertFiles"; + @SerializedName(SERIALIZED_NAME_TLS_ROOT_CERT_FILES) + private String tlsRootCertFiles; + + public static final String SERIALIZED_NAME_CHANNEL_ID = "channelId"; + @SerializedName(SERIALIZED_NAME_CHANNEL_ID) + private String channelId; + + public static final String SERIALIZED_NAME_TARGET_ORGANIZATIONS = "targetOrganizations"; + @SerializedName(SERIALIZED_NAME_TARGET_ORGANIZATIONS) + private List targetOrganizations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TARGET_PEER_ADDRESSES = "targetPeerAddresses"; + @SerializedName(SERIALIZED_NAME_TARGET_PEER_ADDRESSES) + private List targetPeerAddresses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private DeployContractGoSourceV1RequestConstructorArgs constructorArgs; + + public static final String SERIALIZED_NAME_CHAIN_CODE_VERSION = "chainCodeVersion"; + @SerializedName(SERIALIZED_NAME_CHAIN_CODE_VERSION) + private String chainCodeVersion; + + public static final String SERIALIZED_NAME_GO_SOURCE = "goSource"; + @SerializedName(SERIALIZED_NAME_GO_SOURCE) + private FileBase64 goSource; + + public static final String SERIALIZED_NAME_GO_MOD = "goMod"; + @SerializedName(SERIALIZED_NAME_GO_MOD) + private FileBase64 goMod; + + public static final String SERIALIZED_NAME_MODULE_NAME = "moduleName"; + @SerializedName(SERIALIZED_NAME_MODULE_NAME) + private String moduleName; + + public static final String SERIALIZED_NAME_PINNED_DEPS = "pinnedDeps"; + @SerializedName(SERIALIZED_NAME_PINNED_DEPS) + private List pinnedDeps; + + public static final String SERIALIZED_NAME_MOD_TIDY_ONLY = "modTidyOnly"; + @SerializedName(SERIALIZED_NAME_MOD_TIDY_ONLY) + private Boolean modTidyOnly; + + public DeployContractGoSourceV1Request() { + } + + public DeployContractGoSourceV1Request policyDslSource(String policyDslSource) { + + this.policyDslSource = policyDslSource; + return this; + } + + /** + * Get policyDslSource + * @return policyDslSource + **/ + @javax.annotation.Nonnull + public String getPolicyDslSource() { + return policyDslSource; + } + + + public void setPolicyDslSource(String policyDslSource) { + this.policyDslSource = policyDslSource; + } + + + public DeployContractGoSourceV1Request tlsRootCertFiles(String tlsRootCertFiles) { + + this.tlsRootCertFiles = tlsRootCertFiles; + return this; + } + + /** + * The TLS root cert files that will be passed to the chaincode instantiation command. + * @return tlsRootCertFiles + **/ + @javax.annotation.Nonnull + public String getTlsRootCertFiles() { + return tlsRootCertFiles; + } + + + public void setTlsRootCertFiles(String tlsRootCertFiles) { + this.tlsRootCertFiles = tlsRootCertFiles; + } + + + public DeployContractGoSourceV1Request channelId(String channelId) { + + this.channelId = channelId; + return this; + } + + /** + * The name of the Fabric channel where the contract will get instantiated. + * @return channelId + **/ + @javax.annotation.Nonnull + public String getChannelId() { + return channelId; + } + + + public void setChannelId(String channelId) { + this.channelId = channelId; + } + + + public DeployContractGoSourceV1Request targetOrganizations(List targetOrganizations) { + + this.targetOrganizations = targetOrganizations; + return this; + } + + public DeployContractGoSourceV1Request addTargetOrganizationsItem(DeploymentTargetOrganization targetOrganizationsItem) { + if (this.targetOrganizations == null) { + this.targetOrganizations = new ArrayList<>(); + } + this.targetOrganizations.add(targetOrganizationsItem); + return this; + } + + /** + * Get targetOrganizations + * @return targetOrganizations + **/ + @javax.annotation.Nonnull + public List getTargetOrganizations() { + return targetOrganizations; + } + + + public void setTargetOrganizations(List targetOrganizations) { + this.targetOrganizations = targetOrganizations; + } + + + public DeployContractGoSourceV1Request targetPeerAddresses(List targetPeerAddresses) { + + this.targetPeerAddresses = targetPeerAddresses; + return this; + } + + public DeployContractGoSourceV1Request addTargetPeerAddressesItem(String targetPeerAddressesItem) { + if (this.targetPeerAddresses == null) { + this.targetPeerAddresses = new ArrayList<>(); + } + this.targetPeerAddresses.add(targetPeerAddressesItem); + return this; + } + + /** + * An array of peer addresses where the contract will be instantiated. Note that at present only the first item from this array will be used which is the behavior taken from the official Fabric samples repository and therefore it is assumed to be correct usage. + * @return targetPeerAddresses + **/ + @javax.annotation.Nonnull + public List getTargetPeerAddresses() { + return targetPeerAddresses; + } + + + public void setTargetPeerAddresses(List targetPeerAddresses) { + this.targetPeerAddresses = targetPeerAddresses; + } + + + public DeployContractGoSourceV1Request constructorArgs(DeployContractGoSourceV1RequestConstructorArgs constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + /** + * Get constructorArgs + * @return constructorArgs + **/ + @javax.annotation.Nullable + public DeployContractGoSourceV1RequestConstructorArgs getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(DeployContractGoSourceV1RequestConstructorArgs constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public DeployContractGoSourceV1Request chainCodeVersion(String chainCodeVersion) { + + this.chainCodeVersion = chainCodeVersion; + return this; + } + + /** + * Get chainCodeVersion + * @return chainCodeVersion + **/ + @javax.annotation.Nonnull + public String getChainCodeVersion() { + return chainCodeVersion; + } + + + public void setChainCodeVersion(String chainCodeVersion) { + this.chainCodeVersion = chainCodeVersion; + } + + + public DeployContractGoSourceV1Request goSource(FileBase64 goSource) { + + this.goSource = goSource; + return this; + } + + /** + * Get goSource + * @return goSource + **/ + @javax.annotation.Nonnull + public FileBase64 getGoSource() { + return goSource; + } + + + public void setGoSource(FileBase64 goSource) { + this.goSource = goSource; + } + + + public DeployContractGoSourceV1Request goMod(FileBase64 goMod) { + + this.goMod = goMod; + return this; + } + + /** + * Get goMod + * @return goMod + **/ + @javax.annotation.Nullable + public FileBase64 getGoMod() { + return goMod; + } + + + public void setGoMod(FileBase64 goMod) { + this.goMod = goMod; + } + + + public DeployContractGoSourceV1Request moduleName(String moduleName) { + + this.moduleName = moduleName; + return this; + } + + /** + * The go module name that will be used for the go compilation process. + * @return moduleName + **/ + @javax.annotation.Nullable + public String getModuleName() { + return moduleName; + } + + + public void setModuleName(String moduleName) { + this.moduleName = moduleName; + } + + + public DeployContractGoSourceV1Request pinnedDeps(List pinnedDeps) { + + this.pinnedDeps = pinnedDeps; + return this; + } + + public DeployContractGoSourceV1Request addPinnedDepsItem(String pinnedDepsItem) { + if (this.pinnedDeps == null) { + this.pinnedDeps = new ArrayList<>(); + } + this.pinnedDeps.add(pinnedDepsItem); + return this; + } + + /** + * Get pinnedDeps + * @return pinnedDeps + **/ + @javax.annotation.Nullable + public List getPinnedDeps() { + return pinnedDeps; + } + + + public void setPinnedDeps(List pinnedDeps) { + this.pinnedDeps = pinnedDeps; + } + + + public DeployContractGoSourceV1Request modTidyOnly(Boolean modTidyOnly) { + + this.modTidyOnly = modTidyOnly; + return this; + } + + /** + * Indicates to the go chaincode compiler of Cactus if it should do an actual go compilation with the contact source or if it should just execute the go mod tidy command. + * @return modTidyOnly + **/ + @javax.annotation.Nullable + public Boolean getModTidyOnly() { + return modTidyOnly; + } + + + public void setModTidyOnly(Boolean modTidyOnly) { + this.modTidyOnly = modTidyOnly; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractGoSourceV1Request deployContractGoSourceV1Request = (DeployContractGoSourceV1Request) o; + return Objects.equals(this.policyDslSource, deployContractGoSourceV1Request.policyDslSource) && + Objects.equals(this.tlsRootCertFiles, deployContractGoSourceV1Request.tlsRootCertFiles) && + Objects.equals(this.channelId, deployContractGoSourceV1Request.channelId) && + Objects.equals(this.targetOrganizations, deployContractGoSourceV1Request.targetOrganizations) && + Objects.equals(this.targetPeerAddresses, deployContractGoSourceV1Request.targetPeerAddresses) && + Objects.equals(this.constructorArgs, deployContractGoSourceV1Request.constructorArgs) && + Objects.equals(this.chainCodeVersion, deployContractGoSourceV1Request.chainCodeVersion) && + Objects.equals(this.goSource, deployContractGoSourceV1Request.goSource) && + Objects.equals(this.goMod, deployContractGoSourceV1Request.goMod) && + Objects.equals(this.moduleName, deployContractGoSourceV1Request.moduleName) && + Objects.equals(this.pinnedDeps, deployContractGoSourceV1Request.pinnedDeps) && + Objects.equals(this.modTidyOnly, deployContractGoSourceV1Request.modTidyOnly); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(policyDslSource, tlsRootCertFiles, channelId, targetOrganizations, targetPeerAddresses, constructorArgs, chainCodeVersion, goSource, goMod, moduleName, pinnedDeps, modTidyOnly); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractGoSourceV1Request {\n"); + sb.append(" policyDslSource: ").append(toIndentedString(policyDslSource)).append("\n"); + sb.append(" tlsRootCertFiles: ").append(toIndentedString(tlsRootCertFiles)).append("\n"); + sb.append(" channelId: ").append(toIndentedString(channelId)).append("\n"); + sb.append(" targetOrganizations: ").append(toIndentedString(targetOrganizations)).append("\n"); + sb.append(" targetPeerAddresses: ").append(toIndentedString(targetPeerAddresses)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" chainCodeVersion: ").append(toIndentedString(chainCodeVersion)).append("\n"); + sb.append(" goSource: ").append(toIndentedString(goSource)).append("\n"); + sb.append(" goMod: ").append(toIndentedString(goMod)).append("\n"); + sb.append(" moduleName: ").append(toIndentedString(moduleName)).append("\n"); + sb.append(" pinnedDeps: ").append(toIndentedString(pinnedDeps)).append("\n"); + sb.append(" modTidyOnly: ").append(toIndentedString(modTidyOnly)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("policyDslSource"); + openapiFields.add("tlsRootCertFiles"); + openapiFields.add("channelId"); + openapiFields.add("targetOrganizations"); + openapiFields.add("targetPeerAddresses"); + openapiFields.add("constructorArgs"); + openapiFields.add("chainCodeVersion"); + openapiFields.add("goSource"); + openapiFields.add("goMod"); + openapiFields.add("moduleName"); + openapiFields.add("pinnedDeps"); + openapiFields.add("modTidyOnly"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("policyDslSource"); + openapiRequiredFields.add("tlsRootCertFiles"); + openapiRequiredFields.add("channelId"); + openapiRequiredFields.add("targetOrganizations"); + openapiRequiredFields.add("targetPeerAddresses"); + openapiRequiredFields.add("chainCodeVersion"); + openapiRequiredFields.add("goSource"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractGoSourceV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractGoSourceV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractGoSourceV1Request is not found in the empty JSON string", DeployContractGoSourceV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractGoSourceV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractGoSourceV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractGoSourceV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("policyDslSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `policyDslSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("policyDslSource").toString())); + } + if (!jsonObj.get("tlsRootCertFiles").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tlsRootCertFiles` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tlsRootCertFiles").toString())); + } + if (!jsonObj.get("channelId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `channelId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("channelId").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("targetOrganizations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `targetOrganizations` to be an array in the JSON string but got `%s`", jsonObj.get("targetOrganizations").toString())); + } + + JsonArray jsonArraytargetOrganizations = jsonObj.getAsJsonArray("targetOrganizations"); + // validate the required field `targetOrganizations` (array) + for (int i = 0; i < jsonArraytargetOrganizations.size(); i++) { + DeploymentTargetOrganization.validateJsonObject(jsonArraytargetOrganizations.get(i).getAsJsonObject()); + }; + // ensure the required json array is present + if (jsonObj.get("targetPeerAddresses") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("targetPeerAddresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `targetPeerAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("targetPeerAddresses").toString())); + } + // validate the optional field `constructorArgs` + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonNull()) { + DeployContractGoSourceV1RequestConstructorArgs.validateJsonObject(jsonObj.getAsJsonObject("constructorArgs")); + } + if (!jsonObj.get("chainCodeVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `chainCodeVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chainCodeVersion").toString())); + } + // validate the required field `goSource` + FileBase64.validateJsonObject(jsonObj.getAsJsonObject("goSource")); + // validate the optional field `goMod` + if (jsonObj.get("goMod") != null && !jsonObj.get("goMod").isJsonNull()) { + FileBase64.validateJsonObject(jsonObj.getAsJsonObject("goMod")); + } + if ((jsonObj.get("moduleName") != null && !jsonObj.get("moduleName").isJsonNull()) && !jsonObj.get("moduleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `moduleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("moduleName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("pinnedDeps") != null && !jsonObj.get("pinnedDeps").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `pinnedDeps` to be an array in the JSON string but got `%s`", jsonObj.get("pinnedDeps").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractGoSourceV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractGoSourceV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractGoSourceV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractGoSourceV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractGoSourceV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractGoSourceV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractGoSourceV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractGoSourceV1Request + */ + public static DeployContractGoSourceV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractGoSourceV1Request.class); + } + + /** + * Convert an instance of DeployContractGoSourceV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgs.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgs.java new file mode 100644 index 00000000000..9a51cefe5dc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgs.java @@ -0,0 +1,219 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractGoSourceV1RequestConstructorArgs + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractGoSourceV1RequestConstructorArgs { + public static final String SERIALIZED_NAME_ARGS = "Args"; + @SerializedName(SERIALIZED_NAME_ARGS) + private List args; + + public DeployContractGoSourceV1RequestConstructorArgs() { + } + + public DeployContractGoSourceV1RequestConstructorArgs args(List args) { + + this.args = args; + return this; + } + + public DeployContractGoSourceV1RequestConstructorArgs addArgsItem(Object argsItem) { + if (this.args == null) { + this.args = new ArrayList<>(); + } + this.args.add(argsItem); + return this; + } + + /** + * Get args + * @return args + **/ + @javax.annotation.Nullable + public List getArgs() { + return args; + } + + + public void setArgs(List args) { + this.args = args; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractGoSourceV1RequestConstructorArgs deployContractGoSourceV1RequestConstructorArgs = (DeployContractGoSourceV1RequestConstructorArgs) o; + return Objects.equals(this.args, deployContractGoSourceV1RequestConstructorArgs.args); + } + + @Override + public int hashCode() { + return Objects.hash(args); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractGoSourceV1RequestConstructorArgs {\n"); + sb.append(" args: ").append(toIndentedString(args)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Args"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractGoSourceV1RequestConstructorArgs + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractGoSourceV1RequestConstructorArgs.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractGoSourceV1RequestConstructorArgs is not found in the empty JSON string", DeployContractGoSourceV1RequestConstructorArgs.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractGoSourceV1RequestConstructorArgs.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractGoSourceV1RequestConstructorArgs` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("Args") != null && !jsonObj.get("Args").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Args` to be an array in the JSON string but got `%s`", jsonObj.get("Args").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractGoSourceV1RequestConstructorArgs.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractGoSourceV1RequestConstructorArgs' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractGoSourceV1RequestConstructorArgs.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractGoSourceV1RequestConstructorArgs value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractGoSourceV1RequestConstructorArgs read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractGoSourceV1RequestConstructorArgs given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractGoSourceV1RequestConstructorArgs + * @throws IOException if the JSON string is invalid with respect to DeployContractGoSourceV1RequestConstructorArgs + */ + public static DeployContractGoSourceV1RequestConstructorArgs fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractGoSourceV1RequestConstructorArgs.class); + } + + /** + * Convert an instance of DeployContractGoSourceV1RequestConstructorArgs to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Response.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Response.java new file mode 100644 index 00000000000..52dc95a7296 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractGoSourceV1Response.java @@ -0,0 +1,294 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.SSHExecCommandResponse; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractGoSourceV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractGoSourceV1Response { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_INSTALLATION_COMMAND_RESPONSES = "installationCommandResponses"; + @SerializedName(SERIALIZED_NAME_INSTALLATION_COMMAND_RESPONSES) + private List installationCommandResponses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INSTANTIATION_COMMAND_RESPONSE = "instantiationCommandResponse"; + @SerializedName(SERIALIZED_NAME_INSTANTIATION_COMMAND_RESPONSE) + private SSHExecCommandResponse instantiationCommandResponse; + + public DeployContractGoSourceV1Response() { + } + + public DeployContractGoSourceV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public DeployContractGoSourceV1Response installationCommandResponses(List installationCommandResponses) { + + this.installationCommandResponses = installationCommandResponses; + return this; + } + + public DeployContractGoSourceV1Response addInstallationCommandResponsesItem(SSHExecCommandResponse installationCommandResponsesItem) { + if (this.installationCommandResponses == null) { + this.installationCommandResponses = new ArrayList<>(); + } + this.installationCommandResponses.add(installationCommandResponsesItem); + return this; + } + + /** + * Get installationCommandResponses + * @return installationCommandResponses + **/ + @javax.annotation.Nonnull + public List getInstallationCommandResponses() { + return installationCommandResponses; + } + + + public void setInstallationCommandResponses(List installationCommandResponses) { + this.installationCommandResponses = installationCommandResponses; + } + + + public DeployContractGoSourceV1Response instantiationCommandResponse(SSHExecCommandResponse instantiationCommandResponse) { + + this.instantiationCommandResponse = instantiationCommandResponse; + return this; + } + + /** + * Get instantiationCommandResponse + * @return instantiationCommandResponse + **/ + @javax.annotation.Nonnull + public SSHExecCommandResponse getInstantiationCommandResponse() { + return instantiationCommandResponse; + } + + + public void setInstantiationCommandResponse(SSHExecCommandResponse instantiationCommandResponse) { + this.instantiationCommandResponse = instantiationCommandResponse; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractGoSourceV1Response deployContractGoSourceV1Response = (DeployContractGoSourceV1Response) o; + return Objects.equals(this.success, deployContractGoSourceV1Response.success) && + Objects.equals(this.installationCommandResponses, deployContractGoSourceV1Response.installationCommandResponses) && + Objects.equals(this.instantiationCommandResponse, deployContractGoSourceV1Response.instantiationCommandResponse); + } + + @Override + public int hashCode() { + return Objects.hash(success, installationCommandResponses, instantiationCommandResponse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractGoSourceV1Response {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" installationCommandResponses: ").append(toIndentedString(installationCommandResponses)).append("\n"); + sb.append(" instantiationCommandResponse: ").append(toIndentedString(instantiationCommandResponse)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("installationCommandResponses"); + openapiFields.add("instantiationCommandResponse"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("installationCommandResponses"); + openapiRequiredFields.add("instantiationCommandResponse"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractGoSourceV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractGoSourceV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractGoSourceV1Response is not found in the empty JSON string", DeployContractGoSourceV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractGoSourceV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractGoSourceV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractGoSourceV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("installationCommandResponses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `installationCommandResponses` to be an array in the JSON string but got `%s`", jsonObj.get("installationCommandResponses").toString())); + } + + JsonArray jsonArrayinstallationCommandResponses = jsonObj.getAsJsonArray("installationCommandResponses"); + // validate the required field `installationCommandResponses` (array) + for (int i = 0; i < jsonArrayinstallationCommandResponses.size(); i++) { + SSHExecCommandResponse.validateJsonObject(jsonArrayinstallationCommandResponses.get(i).getAsJsonObject()); + }; + // validate the required field `instantiationCommandResponse` + SSHExecCommandResponse.validateJsonObject(jsonObj.getAsJsonObject("instantiationCommandResponse")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractGoSourceV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractGoSourceV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractGoSourceV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractGoSourceV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractGoSourceV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractGoSourceV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractGoSourceV1Response + * @throws IOException if the JSON string is invalid with respect to DeployContractGoSourceV1Response + */ + public static DeployContractGoSourceV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractGoSourceV1Response.class); + } + + /** + * Convert an instance of DeployContractGoSourceV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java new file mode 100644 index 00000000000..0db35dced84 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java @@ -0,0 +1,689 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ChainCodeProgrammingLanguage; +import org.openapitools.client.model.DeployContractGoSourceV1RequestConstructorArgs; +import org.openapitools.client.model.DeploymentTargetOrganization; +import org.openapitools.client.model.FileBase64; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractV1Request { + public static final String SERIALIZED_NAME_CC_LANG = "ccLang"; + @SerializedName(SERIALIZED_NAME_CC_LANG) + private ChainCodeProgrammingLanguage ccLang; + + public static final String SERIALIZED_NAME_CA_FILE = "caFile"; + @SerializedName(SERIALIZED_NAME_CA_FILE) + private String caFile; + + public static final String SERIALIZED_NAME_ORDERER = "orderer"; + @SerializedName(SERIALIZED_NAME_ORDERER) + private String orderer; + + public static final String SERIALIZED_NAME_ORDERER_T_L_S_HOSTNAME_OVERRIDE = "ordererTLSHostnameOverride"; + @SerializedName(SERIALIZED_NAME_ORDERER_T_L_S_HOSTNAME_OVERRIDE) + private String ordererTLSHostnameOverride; + + public static final String SERIALIZED_NAME_CONN_TIMEOUT = "connTimeout"; + @SerializedName(SERIALIZED_NAME_CONN_TIMEOUT) + private Integer connTimeout; + + public static final String SERIALIZED_NAME_SIGNATURE_POLICY = "signaturePolicy"; + @SerializedName(SERIALIZED_NAME_SIGNATURE_POLICY) + private String signaturePolicy; + + public static final String SERIALIZED_NAME_COLLECTIONS_CONFIG_FILE = "collectionsConfigFile"; + @SerializedName(SERIALIZED_NAME_COLLECTIONS_CONFIG_FILE) + private String collectionsConfigFile; + + public static final String SERIALIZED_NAME_CHANNEL_ID = "channelId"; + @SerializedName(SERIALIZED_NAME_CHANNEL_ID) + private String channelId; + + public static final String SERIALIZED_NAME_TARGET_ORGANIZATIONS = "targetOrganizations"; + @SerializedName(SERIALIZED_NAME_TARGET_ORGANIZATIONS) + private List targetOrganizations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private DeployContractGoSourceV1RequestConstructorArgs constructorArgs; + + public static final String SERIALIZED_NAME_CC_SEQUENCE = "ccSequence"; + @SerializedName(SERIALIZED_NAME_CC_SEQUENCE) + private BigDecimal ccSequence; + + public static final String SERIALIZED_NAME_CC_VERSION = "ccVersion"; + @SerializedName(SERIALIZED_NAME_CC_VERSION) + private String ccVersion; + + public static final String SERIALIZED_NAME_CC_NAME = "ccName"; + @SerializedName(SERIALIZED_NAME_CC_NAME) + private String ccName; + + public static final String SERIALIZED_NAME_CC_LABEL = "ccLabel"; + @SerializedName(SERIALIZED_NAME_CC_LABEL) + private String ccLabel; + + public static final String SERIALIZED_NAME_SOURCE_FILES = "sourceFiles"; + @SerializedName(SERIALIZED_NAME_SOURCE_FILES) + private List sourceFiles = new ArrayList<>(); + + public DeployContractV1Request() { + } + + public DeployContractV1Request ccLang(ChainCodeProgrammingLanguage ccLang) { + + this.ccLang = ccLang; + return this; + } + + /** + * Get ccLang + * @return ccLang + **/ + @javax.annotation.Nonnull + public ChainCodeProgrammingLanguage getCcLang() { + return ccLang; + } + + + public void setCcLang(ChainCodeProgrammingLanguage ccLang) { + this.ccLang = ccLang; + } + + + public DeployContractV1Request caFile(String caFile) { + + this.caFile = caFile; + return this; + } + + /** + * File-system path pointing at the CA file. + * @return caFile + **/ + @javax.annotation.Nonnull + public String getCaFile() { + return caFile; + } + + + public void setCaFile(String caFile) { + this.caFile = caFile; + } + + + public DeployContractV1Request orderer(String orderer) { + + this.orderer = orderer; + return this; + } + + /** + * Ordering service endpoint specified as <hostname or IP address>:<port> + * @return orderer + **/ + @javax.annotation.Nonnull + public String getOrderer() { + return orderer; + } + + + public void setOrderer(String orderer) { + this.orderer = orderer; + } + + + public DeployContractV1Request ordererTLSHostnameOverride(String ordererTLSHostnameOverride) { + + this.ordererTLSHostnameOverride = ordererTLSHostnameOverride; + return this; + } + + /** + * The hostname override to use when validating the TLS connection to the orderer + * @return ordererTLSHostnameOverride + **/ + @javax.annotation.Nonnull + public String getOrdererTLSHostnameOverride() { + return ordererTLSHostnameOverride; + } + + + public void setOrdererTLSHostnameOverride(String ordererTLSHostnameOverride) { + this.ordererTLSHostnameOverride = ordererTLSHostnameOverride; + } + + + public DeployContractV1Request connTimeout(Integer connTimeout) { + + this.connTimeout = connTimeout; + return this; + } + + /** + * Timeout for client to connect (default 3s) + * @return connTimeout + **/ + @javax.annotation.Nullable + public Integer getConnTimeout() { + return connTimeout; + } + + + public void setConnTimeout(Integer connTimeout) { + this.connTimeout = connTimeout; + } + + + public DeployContractV1Request signaturePolicy(String signaturePolicy) { + + this.signaturePolicy = signaturePolicy; + return this; + } + + /** + * Passed in to the peer via the --signature-policy argument on the command line. See also: https://hyperledger-fabric.readthedocs.io/en/release-2.2/endorsement-policies.html#setting-chaincode-level-endorsement-policies + * @return signaturePolicy + **/ + @javax.annotation.Nullable + public String getSignaturePolicy() { + return signaturePolicy; + } + + + public void setSignaturePolicy(String signaturePolicy) { + this.signaturePolicy = signaturePolicy; + } + + + public DeployContractV1Request collectionsConfigFile(String collectionsConfigFile) { + + this.collectionsConfigFile = collectionsConfigFile; + return this; + } + + /** + * Name of the collections config file as present in the sourceFiles array of the request. + * @return collectionsConfigFile + **/ + @javax.annotation.Nullable + public String getCollectionsConfigFile() { + return collectionsConfigFile; + } + + + public void setCollectionsConfigFile(String collectionsConfigFile) { + this.collectionsConfigFile = collectionsConfigFile; + } + + + public DeployContractV1Request channelId(String channelId) { + + this.channelId = channelId; + return this; + } + + /** + * The name of the Fabric channel where the contract will get instantiated. + * @return channelId + **/ + @javax.annotation.Nonnull + public String getChannelId() { + return channelId; + } + + + public void setChannelId(String channelId) { + this.channelId = channelId; + } + + + public DeployContractV1Request targetOrganizations(List targetOrganizations) { + + this.targetOrganizations = targetOrganizations; + return this; + } + + public DeployContractV1Request addTargetOrganizationsItem(DeploymentTargetOrganization targetOrganizationsItem) { + if (this.targetOrganizations == null) { + this.targetOrganizations = new ArrayList<>(); + } + this.targetOrganizations.add(targetOrganizationsItem); + return this; + } + + /** + * Get targetOrganizations + * @return targetOrganizations + **/ + @javax.annotation.Nonnull + public List getTargetOrganizations() { + return targetOrganizations; + } + + + public void setTargetOrganizations(List targetOrganizations) { + this.targetOrganizations = targetOrganizations; + } + + + public DeployContractV1Request constructorArgs(DeployContractGoSourceV1RequestConstructorArgs constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + /** + * Get constructorArgs + * @return constructorArgs + **/ + @javax.annotation.Nullable + public DeployContractGoSourceV1RequestConstructorArgs getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(DeployContractGoSourceV1RequestConstructorArgs constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public DeployContractV1Request ccSequence(BigDecimal ccSequence) { + + this.ccSequence = ccSequence; + return this; + } + + /** + * Get ccSequence + * @return ccSequence + **/ + @javax.annotation.Nonnull + public BigDecimal getCcSequence() { + return ccSequence; + } + + + public void setCcSequence(BigDecimal ccSequence) { + this.ccSequence = ccSequence; + } + + + public DeployContractV1Request ccVersion(String ccVersion) { + + this.ccVersion = ccVersion; + return this; + } + + /** + * Get ccVersion + * @return ccVersion + **/ + @javax.annotation.Nonnull + public String getCcVersion() { + return ccVersion; + } + + + public void setCcVersion(String ccVersion) { + this.ccVersion = ccVersion; + } + + + public DeployContractV1Request ccName(String ccName) { + + this.ccName = ccName; + return this; + } + + /** + * Get ccName + * @return ccName + **/ + @javax.annotation.Nonnull + public String getCcName() { + return ccName; + } + + + public void setCcName(String ccName) { + this.ccName = ccName; + } + + + public DeployContractV1Request ccLabel(String ccLabel) { + + this.ccLabel = ccLabel; + return this; + } + + /** + * Human readable label to uniquely identify the contract. Recommended to include in this at least the contract name and the exact version in order to make it easily distinguishable from other deployments of the same contract. + * @return ccLabel + **/ + @javax.annotation.Nonnull + public String getCcLabel() { + return ccLabel; + } + + + public void setCcLabel(String ccLabel) { + this.ccLabel = ccLabel; + } + + + public DeployContractV1Request sourceFiles(List sourceFiles) { + + this.sourceFiles = sourceFiles; + return this; + } + + public DeployContractV1Request addSourceFilesItem(FileBase64 sourceFilesItem) { + if (this.sourceFiles == null) { + this.sourceFiles = new ArrayList<>(); + } + this.sourceFiles.add(sourceFilesItem); + return this; + } + + /** + * The your-smart-contract.go file where the functionality of your contract is implemented. + * @return sourceFiles + **/ + @javax.annotation.Nonnull + public List getSourceFiles() { + return sourceFiles; + } + + + public void setSourceFiles(List sourceFiles) { + this.sourceFiles = sourceFiles; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractV1Request deployContractV1Request = (DeployContractV1Request) o; + return Objects.equals(this.ccLang, deployContractV1Request.ccLang) && + Objects.equals(this.caFile, deployContractV1Request.caFile) && + Objects.equals(this.orderer, deployContractV1Request.orderer) && + Objects.equals(this.ordererTLSHostnameOverride, deployContractV1Request.ordererTLSHostnameOverride) && + Objects.equals(this.connTimeout, deployContractV1Request.connTimeout) && + Objects.equals(this.signaturePolicy, deployContractV1Request.signaturePolicy) && + Objects.equals(this.collectionsConfigFile, deployContractV1Request.collectionsConfigFile) && + Objects.equals(this.channelId, deployContractV1Request.channelId) && + Objects.equals(this.targetOrganizations, deployContractV1Request.targetOrganizations) && + Objects.equals(this.constructorArgs, deployContractV1Request.constructorArgs) && + Objects.equals(this.ccSequence, deployContractV1Request.ccSequence) && + Objects.equals(this.ccVersion, deployContractV1Request.ccVersion) && + Objects.equals(this.ccName, deployContractV1Request.ccName) && + Objects.equals(this.ccLabel, deployContractV1Request.ccLabel) && + Objects.equals(this.sourceFiles, deployContractV1Request.sourceFiles); + } + + @Override + public int hashCode() { + return Objects.hash(ccLang, caFile, orderer, ordererTLSHostnameOverride, connTimeout, signaturePolicy, collectionsConfigFile, channelId, targetOrganizations, constructorArgs, ccSequence, ccVersion, ccName, ccLabel, sourceFiles); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractV1Request {\n"); + sb.append(" ccLang: ").append(toIndentedString(ccLang)).append("\n"); + sb.append(" caFile: ").append(toIndentedString(caFile)).append("\n"); + sb.append(" orderer: ").append(toIndentedString(orderer)).append("\n"); + sb.append(" ordererTLSHostnameOverride: ").append(toIndentedString(ordererTLSHostnameOverride)).append("\n"); + sb.append(" connTimeout: ").append(toIndentedString(connTimeout)).append("\n"); + sb.append(" signaturePolicy: ").append(toIndentedString(signaturePolicy)).append("\n"); + sb.append(" collectionsConfigFile: ").append(toIndentedString(collectionsConfigFile)).append("\n"); + sb.append(" channelId: ").append(toIndentedString(channelId)).append("\n"); + sb.append(" targetOrganizations: ").append(toIndentedString(targetOrganizations)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" ccSequence: ").append(toIndentedString(ccSequence)).append("\n"); + sb.append(" ccVersion: ").append(toIndentedString(ccVersion)).append("\n"); + sb.append(" ccName: ").append(toIndentedString(ccName)).append("\n"); + sb.append(" ccLabel: ").append(toIndentedString(ccLabel)).append("\n"); + sb.append(" sourceFiles: ").append(toIndentedString(sourceFiles)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ccLang"); + openapiFields.add("caFile"); + openapiFields.add("orderer"); + openapiFields.add("ordererTLSHostnameOverride"); + openapiFields.add("connTimeout"); + openapiFields.add("signaturePolicy"); + openapiFields.add("collectionsConfigFile"); + openapiFields.add("channelId"); + openapiFields.add("targetOrganizations"); + openapiFields.add("constructorArgs"); + openapiFields.add("ccSequence"); + openapiFields.add("ccVersion"); + openapiFields.add("ccName"); + openapiFields.add("ccLabel"); + openapiFields.add("sourceFiles"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ccLang"); + openapiRequiredFields.add("caFile"); + openapiRequiredFields.add("orderer"); + openapiRequiredFields.add("ordererTLSHostnameOverride"); + openapiRequiredFields.add("channelId"); + openapiRequiredFields.add("targetOrganizations"); + openapiRequiredFields.add("ccSequence"); + openapiRequiredFields.add("ccVersion"); + openapiRequiredFields.add("ccName"); + openapiRequiredFields.add("ccLabel"); + openapiRequiredFields.add("sourceFiles"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractV1Request is not found in the empty JSON string", DeployContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("caFile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `caFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("caFile").toString())); + } + if (!jsonObj.get("orderer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `orderer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderer").toString())); + } + if (!jsonObj.get("ordererTLSHostnameOverride").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ordererTLSHostnameOverride` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ordererTLSHostnameOverride").toString())); + } + if ((jsonObj.get("signaturePolicy") != null && !jsonObj.get("signaturePolicy").isJsonNull()) && !jsonObj.get("signaturePolicy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signaturePolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signaturePolicy").toString())); + } + if ((jsonObj.get("collectionsConfigFile") != null && !jsonObj.get("collectionsConfigFile").isJsonNull()) && !jsonObj.get("collectionsConfigFile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `collectionsConfigFile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collectionsConfigFile").toString())); + } + if (!jsonObj.get("channelId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `channelId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("channelId").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("targetOrganizations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `targetOrganizations` to be an array in the JSON string but got `%s`", jsonObj.get("targetOrganizations").toString())); + } + + JsonArray jsonArraytargetOrganizations = jsonObj.getAsJsonArray("targetOrganizations"); + // validate the required field `targetOrganizations` (array) + for (int i = 0; i < jsonArraytargetOrganizations.size(); i++) { + DeploymentTargetOrganization.validateJsonObject(jsonArraytargetOrganizations.get(i).getAsJsonObject()); + }; + // validate the optional field `constructorArgs` + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonNull()) { + DeployContractGoSourceV1RequestConstructorArgs.validateJsonObject(jsonObj.getAsJsonObject("constructorArgs")); + } + if (!jsonObj.get("ccVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ccVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ccVersion").toString())); + } + if (!jsonObj.get("ccName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ccName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ccName").toString())); + } + if (!jsonObj.get("ccLabel").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ccLabel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ccLabel").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("sourceFiles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceFiles` to be an array in the JSON string but got `%s`", jsonObj.get("sourceFiles").toString())); + } + + JsonArray jsonArraysourceFiles = jsonObj.getAsJsonArray("sourceFiles"); + // validate the required field `sourceFiles` (array) + for (int i = 0; i < jsonArraysourceFiles.size(); i++) { + FileBase64.validateJsonObject(jsonArraysourceFiles.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractV1Request + */ + public static DeployContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractV1Request.class); + } + + /** + * Convert an instance of DeployContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Response.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Response.java new file mode 100644 index 00000000000..0328449cdfd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Response.java @@ -0,0 +1,290 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.ChainCodeLifeCycleCommandResponses; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractV1Response { + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_PACKAGE_IDS = "packageIds"; + @SerializedName(SERIALIZED_NAME_PACKAGE_IDS) + private List packageIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LIFECYCLE = "lifecycle"; + @SerializedName(SERIALIZED_NAME_LIFECYCLE) + private ChainCodeLifeCycleCommandResponses lifecycle; + + public DeployContractV1Response() { + } + + public DeployContractV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public DeployContractV1Response packageIds(List packageIds) { + + this.packageIds = packageIds; + return this; + } + + public DeployContractV1Response addPackageIdsItem(String packageIdsItem) { + if (this.packageIds == null) { + this.packageIds = new ArrayList<>(); + } + this.packageIds.add(packageIdsItem); + return this; + } + + /** + * Get packageIds + * @return packageIds + **/ + @javax.annotation.Nonnull + public List getPackageIds() { + return packageIds; + } + + + public void setPackageIds(List packageIds) { + this.packageIds = packageIds; + } + + + public DeployContractV1Response lifecycle(ChainCodeLifeCycleCommandResponses lifecycle) { + + this.lifecycle = lifecycle; + return this; + } + + /** + * Get lifecycle + * @return lifecycle + **/ + @javax.annotation.Nonnull + public ChainCodeLifeCycleCommandResponses getLifecycle() { + return lifecycle; + } + + + public void setLifecycle(ChainCodeLifeCycleCommandResponses lifecycle) { + this.lifecycle = lifecycle; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractV1Response deployContractV1Response = (DeployContractV1Response) o; + return Objects.equals(this.success, deployContractV1Response.success) && + Objects.equals(this.packageIds, deployContractV1Response.packageIds) && + Objects.equals(this.lifecycle, deployContractV1Response.lifecycle); + } + + @Override + public int hashCode() { + return Objects.hash(success, packageIds, lifecycle); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractV1Response {\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" packageIds: ").append(toIndentedString(packageIds)).append("\n"); + sb.append(" lifecycle: ").append(toIndentedString(lifecycle)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("success"); + openapiFields.add("packageIds"); + openapiFields.add("lifecycle"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("packageIds"); + openapiRequiredFields.add("lifecycle"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractV1Response is not found in the empty JSON string", DeployContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("packageIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("packageIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `packageIds` to be an array in the JSON string but got `%s`", jsonObj.get("packageIds").toString())); + } + // validate the required field `lifecycle` + ChainCodeLifeCycleCommandResponses.validateJsonObject(jsonObj.getAsJsonObject("lifecycle")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractV1Response + * @throws IOException if the JSON string is invalid with respect to DeployContractV1Response + */ + public static DeployContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractV1Response.class); + } + + /** + * Convert an instance of DeployContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeploymentTargetOrgFabric2x.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeploymentTargetOrgFabric2x.java new file mode 100644 index 00000000000..f7a5636c6fd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeploymentTargetOrgFabric2x.java @@ -0,0 +1,375 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeploymentTargetOrgFabric2x + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeploymentTargetOrgFabric2x { + public static final String SERIALIZED_NAME_TRANSIENT = "transient"; + @SerializedName(SERIALIZED_NAME_TRANSIENT) + private String _transient; + + public static final String SERIALIZED_NAME_C_O_R_E_P_E_E_R_L_O_C_A_L_M_S_P_I_D = "CORE_PEER_LOCALMSPID"; + @SerializedName(SERIALIZED_NAME_C_O_R_E_P_E_E_R_L_O_C_A_L_M_S_P_I_D) + private String CORE_PEER_LOCALMSPID; + + public static final String SERIALIZED_NAME_C_O_R_E_P_E_E_R_A_D_D_R_E_S_S = "CORE_PEER_ADDRESS"; + @SerializedName(SERIALIZED_NAME_C_O_R_E_P_E_E_R_A_D_D_R_E_S_S) + private String CORE_PEER_ADDRESS; + + public static final String SERIALIZED_NAME_C_O_R_E_P_E_E_R_M_S_P_C_O_N_F_I_G_P_A_T_H = "CORE_PEER_MSPCONFIGPATH"; + @SerializedName(SERIALIZED_NAME_C_O_R_E_P_E_E_R_M_S_P_C_O_N_F_I_G_P_A_T_H) + private String CORE_PEER_MSPCONFIGPATH; + + public static final String SERIALIZED_NAME_C_O_R_E_P_E_E_R_T_L_S_R_O_O_T_C_E_R_T_F_I_L_E = "CORE_PEER_TLS_ROOTCERT_FILE"; + @SerializedName(SERIALIZED_NAME_C_O_R_E_P_E_E_R_T_L_S_R_O_O_T_C_E_R_T_F_I_L_E) + private String CORE_PEER_TLS_ROOTCERT_FILE; + + public static final String SERIALIZED_NAME_O_R_D_E_R_E_R_T_L_S_R_O_O_T_C_E_R_T_F_I_L_E = "ORDERER_TLS_ROOTCERT_FILE"; + @SerializedName(SERIALIZED_NAME_O_R_D_E_R_E_R_T_L_S_R_O_O_T_C_E_R_T_F_I_L_E) + private String ORDERER_TLS_ROOTCERT_FILE; + + public DeploymentTargetOrgFabric2x() { + } + + public DeploymentTargetOrgFabric2x _transient(String _transient) { + + this._transient = _transient; + return this; + } + + /** + * Transient map of arguments in JSON encoding + * @return _transient + **/ + @javax.annotation.Nullable + public String getTransient() { + return _transient; + } + + + public void setTransient(String _transient) { + this._transient = _transient; + } + + + public DeploymentTargetOrgFabric2x CORE_PEER_LOCALMSPID(String CORE_PEER_LOCALMSPID) { + + this.CORE_PEER_LOCALMSPID = CORE_PEER_LOCALMSPID; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return CORE_PEER_LOCALMSPID + **/ + @javax.annotation.Nonnull + public String getCOREPEERLOCALMSPID() { + return CORE_PEER_LOCALMSPID; + } + + + public void setCOREPEERLOCALMSPID(String CORE_PEER_LOCALMSPID) { + this.CORE_PEER_LOCALMSPID = CORE_PEER_LOCALMSPID; + } + + + public DeploymentTargetOrgFabric2x CORE_PEER_ADDRESS(String CORE_PEER_ADDRESS) { + + this.CORE_PEER_ADDRESS = CORE_PEER_ADDRESS; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return CORE_PEER_ADDRESS + **/ + @javax.annotation.Nonnull + public String getCOREPEERADDRESS() { + return CORE_PEER_ADDRESS; + } + + + public void setCOREPEERADDRESS(String CORE_PEER_ADDRESS) { + this.CORE_PEER_ADDRESS = CORE_PEER_ADDRESS; + } + + + public DeploymentTargetOrgFabric2x CORE_PEER_MSPCONFIGPATH(String CORE_PEER_MSPCONFIGPATH) { + + this.CORE_PEER_MSPCONFIGPATH = CORE_PEER_MSPCONFIGPATH; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return CORE_PEER_MSPCONFIGPATH + **/ + @javax.annotation.Nonnull + public String getCOREPEERMSPCONFIGPATH() { + return CORE_PEER_MSPCONFIGPATH; + } + + + public void setCOREPEERMSPCONFIGPATH(String CORE_PEER_MSPCONFIGPATH) { + this.CORE_PEER_MSPCONFIGPATH = CORE_PEER_MSPCONFIGPATH; + } + + + public DeploymentTargetOrgFabric2x CORE_PEER_TLS_ROOTCERT_FILE(String CORE_PEER_TLS_ROOTCERT_FILE) { + + this.CORE_PEER_TLS_ROOTCERT_FILE = CORE_PEER_TLS_ROOTCERT_FILE; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return CORE_PEER_TLS_ROOTCERT_FILE + **/ + @javax.annotation.Nonnull + public String getCOREPEERTLSROOTCERTFILE() { + return CORE_PEER_TLS_ROOTCERT_FILE; + } + + + public void setCOREPEERTLSROOTCERTFILE(String CORE_PEER_TLS_ROOTCERT_FILE) { + this.CORE_PEER_TLS_ROOTCERT_FILE = CORE_PEER_TLS_ROOTCERT_FILE; + } + + + public DeploymentTargetOrgFabric2x ORDERER_TLS_ROOTCERT_FILE(String ORDERER_TLS_ROOTCERT_FILE) { + + this.ORDERER_TLS_ROOTCERT_FILE = ORDERER_TLS_ROOTCERT_FILE; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return ORDERER_TLS_ROOTCERT_FILE + **/ + @javax.annotation.Nonnull + public String getORDERERTLSROOTCERTFILE() { + return ORDERER_TLS_ROOTCERT_FILE; + } + + + public void setORDERERTLSROOTCERTFILE(String ORDERER_TLS_ROOTCERT_FILE) { + this.ORDERER_TLS_ROOTCERT_FILE = ORDERER_TLS_ROOTCERT_FILE; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentTargetOrgFabric2x deploymentTargetOrgFabric2x = (DeploymentTargetOrgFabric2x) o; + return Objects.equals(this._transient, deploymentTargetOrgFabric2x._transient) && + Objects.equals(this.CORE_PEER_LOCALMSPID, deploymentTargetOrgFabric2x.CORE_PEER_LOCALMSPID) && + Objects.equals(this.CORE_PEER_ADDRESS, deploymentTargetOrgFabric2x.CORE_PEER_ADDRESS) && + Objects.equals(this.CORE_PEER_MSPCONFIGPATH, deploymentTargetOrgFabric2x.CORE_PEER_MSPCONFIGPATH) && + Objects.equals(this.CORE_PEER_TLS_ROOTCERT_FILE, deploymentTargetOrgFabric2x.CORE_PEER_TLS_ROOTCERT_FILE) && + Objects.equals(this.ORDERER_TLS_ROOTCERT_FILE, deploymentTargetOrgFabric2x.ORDERER_TLS_ROOTCERT_FILE); + } + + @Override + public int hashCode() { + return Objects.hash(_transient, CORE_PEER_LOCALMSPID, CORE_PEER_ADDRESS, CORE_PEER_MSPCONFIGPATH, CORE_PEER_TLS_ROOTCERT_FILE, ORDERER_TLS_ROOTCERT_FILE); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentTargetOrgFabric2x {\n"); + sb.append(" _transient: ").append(toIndentedString(_transient)).append("\n"); + sb.append(" CORE_PEER_LOCALMSPID: ").append(toIndentedString(CORE_PEER_LOCALMSPID)).append("\n"); + sb.append(" CORE_PEER_ADDRESS: ").append(toIndentedString(CORE_PEER_ADDRESS)).append("\n"); + sb.append(" CORE_PEER_MSPCONFIGPATH: ").append(toIndentedString(CORE_PEER_MSPCONFIGPATH)).append("\n"); + sb.append(" CORE_PEER_TLS_ROOTCERT_FILE: ").append(toIndentedString(CORE_PEER_TLS_ROOTCERT_FILE)).append("\n"); + sb.append(" ORDERER_TLS_ROOTCERT_FILE: ").append(toIndentedString(ORDERER_TLS_ROOTCERT_FILE)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transient"); + openapiFields.add("CORE_PEER_LOCALMSPID"); + openapiFields.add("CORE_PEER_ADDRESS"); + openapiFields.add("CORE_PEER_MSPCONFIGPATH"); + openapiFields.add("CORE_PEER_TLS_ROOTCERT_FILE"); + openapiFields.add("ORDERER_TLS_ROOTCERT_FILE"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("CORE_PEER_LOCALMSPID"); + openapiRequiredFields.add("CORE_PEER_ADDRESS"); + openapiRequiredFields.add("CORE_PEER_MSPCONFIGPATH"); + openapiRequiredFields.add("CORE_PEER_TLS_ROOTCERT_FILE"); + openapiRequiredFields.add("ORDERER_TLS_ROOTCERT_FILE"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeploymentTargetOrgFabric2x + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeploymentTargetOrgFabric2x.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeploymentTargetOrgFabric2x is not found in the empty JSON string", DeploymentTargetOrgFabric2x.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeploymentTargetOrgFabric2x.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeploymentTargetOrgFabric2x` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeploymentTargetOrgFabric2x.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("transient") != null && !jsonObj.get("transient").isJsonNull()) && !jsonObj.get("transient").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transient` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transient").toString())); + } + if (!jsonObj.get("CORE_PEER_LOCALMSPID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CORE_PEER_LOCALMSPID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CORE_PEER_LOCALMSPID").toString())); + } + if (!jsonObj.get("CORE_PEER_ADDRESS").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CORE_PEER_ADDRESS` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CORE_PEER_ADDRESS").toString())); + } + if (!jsonObj.get("CORE_PEER_MSPCONFIGPATH").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CORE_PEER_MSPCONFIGPATH` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CORE_PEER_MSPCONFIGPATH").toString())); + } + if (!jsonObj.get("CORE_PEER_TLS_ROOTCERT_FILE").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CORE_PEER_TLS_ROOTCERT_FILE` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CORE_PEER_TLS_ROOTCERT_FILE").toString())); + } + if (!jsonObj.get("ORDERER_TLS_ROOTCERT_FILE").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ORDERER_TLS_ROOTCERT_FILE` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ORDERER_TLS_ROOTCERT_FILE").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeploymentTargetOrgFabric2x.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeploymentTargetOrgFabric2x' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeploymentTargetOrgFabric2x.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeploymentTargetOrgFabric2x value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeploymentTargetOrgFabric2x read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeploymentTargetOrgFabric2x given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeploymentTargetOrgFabric2x + * @throws IOException if the JSON string is invalid with respect to DeploymentTargetOrgFabric2x + */ + public static DeploymentTargetOrgFabric2x fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeploymentTargetOrgFabric2x.class); + } + + /** + * Convert an instance of DeploymentTargetOrgFabric2x to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeploymentTargetOrganization.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeploymentTargetOrganization.java new file mode 100644 index 00000000000..e9d07a29e9c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeploymentTargetOrganization.java @@ -0,0 +1,344 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeploymentTargetOrganization + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeploymentTargetOrganization { + public static final String SERIALIZED_NAME_C_O_R_E_P_E_E_R_L_O_C_A_L_M_S_P_I_D = "CORE_PEER_LOCALMSPID"; + @SerializedName(SERIALIZED_NAME_C_O_R_E_P_E_E_R_L_O_C_A_L_M_S_P_I_D) + private String CORE_PEER_LOCALMSPID; + + public static final String SERIALIZED_NAME_C_O_R_E_P_E_E_R_A_D_D_R_E_S_S = "CORE_PEER_ADDRESS"; + @SerializedName(SERIALIZED_NAME_C_O_R_E_P_E_E_R_A_D_D_R_E_S_S) + private String CORE_PEER_ADDRESS; + + public static final String SERIALIZED_NAME_C_O_R_E_P_E_E_R_M_S_P_C_O_N_F_I_G_P_A_T_H = "CORE_PEER_MSPCONFIGPATH"; + @SerializedName(SERIALIZED_NAME_C_O_R_E_P_E_E_R_M_S_P_C_O_N_F_I_G_P_A_T_H) + private String CORE_PEER_MSPCONFIGPATH; + + public static final String SERIALIZED_NAME_C_O_R_E_P_E_E_R_T_L_S_R_O_O_T_C_E_R_T_F_I_L_E = "CORE_PEER_TLS_ROOTCERT_FILE"; + @SerializedName(SERIALIZED_NAME_C_O_R_E_P_E_E_R_T_L_S_R_O_O_T_C_E_R_T_F_I_L_E) + private String CORE_PEER_TLS_ROOTCERT_FILE; + + public static final String SERIALIZED_NAME_O_R_D_E_R_E_R_T_L_S_R_O_O_T_C_E_R_T_F_I_L_E = "ORDERER_TLS_ROOTCERT_FILE"; + @SerializedName(SERIALIZED_NAME_O_R_D_E_R_E_R_T_L_S_R_O_O_T_C_E_R_T_F_I_L_E) + private String ORDERER_TLS_ROOTCERT_FILE; + + public DeploymentTargetOrganization() { + } + + public DeploymentTargetOrganization CORE_PEER_LOCALMSPID(String CORE_PEER_LOCALMSPID) { + + this.CORE_PEER_LOCALMSPID = CORE_PEER_LOCALMSPID; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return CORE_PEER_LOCALMSPID + **/ + @javax.annotation.Nonnull + public String getCOREPEERLOCALMSPID() { + return CORE_PEER_LOCALMSPID; + } + + + public void setCOREPEERLOCALMSPID(String CORE_PEER_LOCALMSPID) { + this.CORE_PEER_LOCALMSPID = CORE_PEER_LOCALMSPID; + } + + + public DeploymentTargetOrganization CORE_PEER_ADDRESS(String CORE_PEER_ADDRESS) { + + this.CORE_PEER_ADDRESS = CORE_PEER_ADDRESS; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return CORE_PEER_ADDRESS + **/ + @javax.annotation.Nonnull + public String getCOREPEERADDRESS() { + return CORE_PEER_ADDRESS; + } + + + public void setCOREPEERADDRESS(String CORE_PEER_ADDRESS) { + this.CORE_PEER_ADDRESS = CORE_PEER_ADDRESS; + } + + + public DeploymentTargetOrganization CORE_PEER_MSPCONFIGPATH(String CORE_PEER_MSPCONFIGPATH) { + + this.CORE_PEER_MSPCONFIGPATH = CORE_PEER_MSPCONFIGPATH; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return CORE_PEER_MSPCONFIGPATH + **/ + @javax.annotation.Nonnull + public String getCOREPEERMSPCONFIGPATH() { + return CORE_PEER_MSPCONFIGPATH; + } + + + public void setCOREPEERMSPCONFIGPATH(String CORE_PEER_MSPCONFIGPATH) { + this.CORE_PEER_MSPCONFIGPATH = CORE_PEER_MSPCONFIGPATH; + } + + + public DeploymentTargetOrganization CORE_PEER_TLS_ROOTCERT_FILE(String CORE_PEER_TLS_ROOTCERT_FILE) { + + this.CORE_PEER_TLS_ROOTCERT_FILE = CORE_PEER_TLS_ROOTCERT_FILE; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return CORE_PEER_TLS_ROOTCERT_FILE + **/ + @javax.annotation.Nonnull + public String getCOREPEERTLSROOTCERTFILE() { + return CORE_PEER_TLS_ROOTCERT_FILE; + } + + + public void setCOREPEERTLSROOTCERTFILE(String CORE_PEER_TLS_ROOTCERT_FILE) { + this.CORE_PEER_TLS_ROOTCERT_FILE = CORE_PEER_TLS_ROOTCERT_FILE; + } + + + public DeploymentTargetOrganization ORDERER_TLS_ROOTCERT_FILE(String ORDERER_TLS_ROOTCERT_FILE) { + + this.ORDERER_TLS_ROOTCERT_FILE = ORDERER_TLS_ROOTCERT_FILE; + return this; + } + + /** + * Mapped to environment variables of the Fabric CLI container. + * @return ORDERER_TLS_ROOTCERT_FILE + **/ + @javax.annotation.Nonnull + public String getORDERERTLSROOTCERTFILE() { + return ORDERER_TLS_ROOTCERT_FILE; + } + + + public void setORDERERTLSROOTCERTFILE(String ORDERER_TLS_ROOTCERT_FILE) { + this.ORDERER_TLS_ROOTCERT_FILE = ORDERER_TLS_ROOTCERT_FILE; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentTargetOrganization deploymentTargetOrganization = (DeploymentTargetOrganization) o; + return Objects.equals(this.CORE_PEER_LOCALMSPID, deploymentTargetOrganization.CORE_PEER_LOCALMSPID) && + Objects.equals(this.CORE_PEER_ADDRESS, deploymentTargetOrganization.CORE_PEER_ADDRESS) && + Objects.equals(this.CORE_PEER_MSPCONFIGPATH, deploymentTargetOrganization.CORE_PEER_MSPCONFIGPATH) && + Objects.equals(this.CORE_PEER_TLS_ROOTCERT_FILE, deploymentTargetOrganization.CORE_PEER_TLS_ROOTCERT_FILE) && + Objects.equals(this.ORDERER_TLS_ROOTCERT_FILE, deploymentTargetOrganization.ORDERER_TLS_ROOTCERT_FILE); + } + + @Override + public int hashCode() { + return Objects.hash(CORE_PEER_LOCALMSPID, CORE_PEER_ADDRESS, CORE_PEER_MSPCONFIGPATH, CORE_PEER_TLS_ROOTCERT_FILE, ORDERER_TLS_ROOTCERT_FILE); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentTargetOrganization {\n"); + sb.append(" CORE_PEER_LOCALMSPID: ").append(toIndentedString(CORE_PEER_LOCALMSPID)).append("\n"); + sb.append(" CORE_PEER_ADDRESS: ").append(toIndentedString(CORE_PEER_ADDRESS)).append("\n"); + sb.append(" CORE_PEER_MSPCONFIGPATH: ").append(toIndentedString(CORE_PEER_MSPCONFIGPATH)).append("\n"); + sb.append(" CORE_PEER_TLS_ROOTCERT_FILE: ").append(toIndentedString(CORE_PEER_TLS_ROOTCERT_FILE)).append("\n"); + sb.append(" ORDERER_TLS_ROOTCERT_FILE: ").append(toIndentedString(ORDERER_TLS_ROOTCERT_FILE)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("CORE_PEER_LOCALMSPID"); + openapiFields.add("CORE_PEER_ADDRESS"); + openapiFields.add("CORE_PEER_MSPCONFIGPATH"); + openapiFields.add("CORE_PEER_TLS_ROOTCERT_FILE"); + openapiFields.add("ORDERER_TLS_ROOTCERT_FILE"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("CORE_PEER_LOCALMSPID"); + openapiRequiredFields.add("CORE_PEER_ADDRESS"); + openapiRequiredFields.add("CORE_PEER_MSPCONFIGPATH"); + openapiRequiredFields.add("CORE_PEER_TLS_ROOTCERT_FILE"); + openapiRequiredFields.add("ORDERER_TLS_ROOTCERT_FILE"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeploymentTargetOrganization + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeploymentTargetOrganization.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeploymentTargetOrganization is not found in the empty JSON string", DeploymentTargetOrganization.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeploymentTargetOrganization.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeploymentTargetOrganization` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeploymentTargetOrganization.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("CORE_PEER_LOCALMSPID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CORE_PEER_LOCALMSPID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CORE_PEER_LOCALMSPID").toString())); + } + if (!jsonObj.get("CORE_PEER_ADDRESS").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CORE_PEER_ADDRESS` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CORE_PEER_ADDRESS").toString())); + } + if (!jsonObj.get("CORE_PEER_MSPCONFIGPATH").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CORE_PEER_MSPCONFIGPATH` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CORE_PEER_MSPCONFIGPATH").toString())); + } + if (!jsonObj.get("CORE_PEER_TLS_ROOTCERT_FILE").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CORE_PEER_TLS_ROOTCERT_FILE` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CORE_PEER_TLS_ROOTCERT_FILE").toString())); + } + if (!jsonObj.get("ORDERER_TLS_ROOTCERT_FILE").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ORDERER_TLS_ROOTCERT_FILE` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ORDERER_TLS_ROOTCERT_FILE").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeploymentTargetOrganization.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeploymentTargetOrganization' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeploymentTargetOrganization.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeploymentTargetOrganization value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeploymentTargetOrganization read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeploymentTargetOrganization given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeploymentTargetOrganization + * @throws IOException if the JSON string is invalid with respect to DeploymentTargetOrganization + */ + public static DeploymentTargetOrganization fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeploymentTargetOrganization.class); + } + + /** + * Convert an instance of DeploymentTargetOrganization to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java new file mode 100644 index 00000000000..031c7033ad4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ErrorExceptionResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ErrorExceptionResponseV1 { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private String error; + + public ErrorExceptionResponseV1() { + } + + public ErrorExceptionResponseV1 message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ErrorExceptionResponseV1 error(String error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nonnull + public String getError() { + return error; + } + + + public void setError(String error) { + this.error = error; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorExceptionResponseV1 errorExceptionResponseV1 = (ErrorExceptionResponseV1) o; + return Objects.equals(this.message, errorExceptionResponseV1.message) && + Objects.equals(this.error, errorExceptionResponseV1.error); + } + + @Override + public int hashCode() { + return Objects.hash(message, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorExceptionResponseV1 {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + openapiFields.add("error"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("error"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ErrorExceptionResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ErrorExceptionResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorExceptionResponseV1 is not found in the empty JSON string", ErrorExceptionResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ErrorExceptionResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorExceptionResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorExceptionResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if (!jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorExceptionResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorExceptionResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorExceptionResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorExceptionResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorExceptionResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorExceptionResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorExceptionResponseV1 + * @throws IOException if the JSON string is invalid with respect to ErrorExceptionResponseV1 + */ + public static ErrorExceptionResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorExceptionResponseV1.class); + } + + /** + * Convert an instance of ErrorExceptionResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricContractInvocationType.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricContractInvocationType.java new file mode 100644 index 00000000000..3c5a25337e1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricContractInvocationType.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets FabricContractInvocationType + */ +@JsonAdapter(FabricContractInvocationType.Adapter.class) +public enum FabricContractInvocationType { + + SEND("FabricContractInvocationType.SEND"), + + CALL("FabricContractInvocationType.CALL"), + + SENDPRIVATE("FabricContractInvocationType.SENDPRIVATE"); + + private String value; + + FabricContractInvocationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FabricContractInvocationType fromValue(String value) { + for (FabricContractInvocationType b : FabricContractInvocationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FabricContractInvocationType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FabricContractInvocationType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FabricContractInvocationType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricSigningCredential.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricSigningCredential.java new file mode 100644 index 00000000000..cdff9df6f4a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricSigningCredential.java @@ -0,0 +1,343 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.FabricSigningCredentialType; +import org.openapitools.client.model.VaultTransitKey; +import org.openapitools.client.model.WebSocketKey; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * FabricSigningCredential + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FabricSigningCredential { + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_KEYCHAIN_REF = "keychainRef"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_REF) + private String keychainRef; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private FabricSigningCredentialType type; + + public static final String SERIALIZED_NAME_VAULT_TRANSIT_KEY = "vaultTransitKey"; + @SerializedName(SERIALIZED_NAME_VAULT_TRANSIT_KEY) + private VaultTransitKey vaultTransitKey; + + public static final String SERIALIZED_NAME_WEB_SOCKET_KEY = "webSocketKey"; + @SerializedName(SERIALIZED_NAME_WEB_SOCKET_KEY) + private WebSocketKey webSocketKey; + + public FabricSigningCredential() { + } + + public FabricSigningCredential keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * Get keychainId + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public FabricSigningCredential keychainRef(String keychainRef) { + + this.keychainRef = keychainRef; + return this; + } + + /** + * Get keychainRef + * @return keychainRef + **/ + @javax.annotation.Nonnull + public String getKeychainRef() { + return keychainRef; + } + + + public void setKeychainRef(String keychainRef) { + this.keychainRef = keychainRef; + } + + + public FabricSigningCredential type(FabricSigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + public FabricSigningCredentialType getType() { + return type; + } + + + public void setType(FabricSigningCredentialType type) { + this.type = type; + } + + + public FabricSigningCredential vaultTransitKey(VaultTransitKey vaultTransitKey) { + + this.vaultTransitKey = vaultTransitKey; + return this; + } + + /** + * Get vaultTransitKey + * @return vaultTransitKey + **/ + @javax.annotation.Nullable + public VaultTransitKey getVaultTransitKey() { + return vaultTransitKey; + } + + + public void setVaultTransitKey(VaultTransitKey vaultTransitKey) { + this.vaultTransitKey = vaultTransitKey; + } + + + public FabricSigningCredential webSocketKey(WebSocketKey webSocketKey) { + + this.webSocketKey = webSocketKey; + return this; + } + + /** + * Get webSocketKey + * @return webSocketKey + **/ + @javax.annotation.Nullable + public WebSocketKey getWebSocketKey() { + return webSocketKey; + } + + + public void setWebSocketKey(WebSocketKey webSocketKey) { + this.webSocketKey = webSocketKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FabricSigningCredential fabricSigningCredential = (FabricSigningCredential) o; + return Objects.equals(this.keychainId, fabricSigningCredential.keychainId) && + Objects.equals(this.keychainRef, fabricSigningCredential.keychainRef) && + Objects.equals(this.type, fabricSigningCredential.type) && + Objects.equals(this.vaultTransitKey, fabricSigningCredential.vaultTransitKey) && + Objects.equals(this.webSocketKey, fabricSigningCredential.webSocketKey); + } + + @Override + public int hashCode() { + return Objects.hash(keychainId, keychainRef, type, vaultTransitKey, webSocketKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FabricSigningCredential {\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" keychainRef: ").append(toIndentedString(keychainRef)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" vaultTransitKey: ").append(toIndentedString(vaultTransitKey)).append("\n"); + sb.append(" webSocketKey: ").append(toIndentedString(webSocketKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("keychainId"); + openapiFields.add("keychainRef"); + openapiFields.add("type"); + openapiFields.add("vaultTransitKey"); + openapiFields.add("webSocketKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("keychainId"); + openapiRequiredFields.add("keychainRef"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FabricSigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!FabricSigningCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FabricSigningCredential is not found in the empty JSON string", FabricSigningCredential.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FabricSigningCredential.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FabricSigningCredential` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FabricSigningCredential.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + if (!jsonObj.get("keychainRef").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainRef` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainRef").toString())); + } + // validate the optional field `vaultTransitKey` + if (jsonObj.get("vaultTransitKey") != null && !jsonObj.get("vaultTransitKey").isJsonNull()) { + VaultTransitKey.validateJsonObject(jsonObj.getAsJsonObject("vaultTransitKey")); + } + // validate the optional field `webSocketKey` + if (jsonObj.get("webSocketKey") != null && !jsonObj.get("webSocketKey").isJsonNull()) { + WebSocketKey.validateJsonObject(jsonObj.getAsJsonObject("webSocketKey")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FabricSigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FabricSigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FabricSigningCredential.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FabricSigningCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FabricSigningCredential read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FabricSigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of FabricSigningCredential + * @throws IOException if the JSON string is invalid with respect to FabricSigningCredential + */ + public static FabricSigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FabricSigningCredential.class); + } + + /** + * Convert an instance of FabricSigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricSigningCredentialType.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricSigningCredentialType.java new file mode 100644 index 00000000000..c8ebdd2fbc9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FabricSigningCredentialType.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * different type of identity provider for singing fabric messages supported by this package + */ +@JsonAdapter(FabricSigningCredentialType.Adapter.class) +public enum FabricSigningCredentialType { + + X_509("X.509"), + + VAULT_X_509("Vault-X.509"), + + WS_X_509("WS-X.509"); + + private String value; + + FabricSigningCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FabricSigningCredentialType fromValue(String value) { + for (FabricSigningCredentialType b : FabricSigningCredentialType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FabricSigningCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FabricSigningCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FabricSigningCredentialType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FileBase64.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FileBase64.java new file mode 100644 index 00000000000..c46fd2d93b0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/FileBase64.java @@ -0,0 +1,279 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Represents a file-system file that has a name and a body which holds the file contents as a Base64 encoded string + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class FileBase64 { + public static final String SERIALIZED_NAME_BODY = "body"; + @SerializedName(SERIALIZED_NAME_BODY) + private String body; + + public static final String SERIALIZED_NAME_FILENAME = "filename"; + @SerializedName(SERIALIZED_NAME_FILENAME) + private String filename; + + public static final String SERIALIZED_NAME_FILEPATH = "filepath"; + @SerializedName(SERIALIZED_NAME_FILEPATH) + private String filepath; + + public FileBase64() { + } + + public FileBase64 body(String body) { + + this.body = body; + return this; + } + + /** + * The file's contents encoded as a Base64 string. + * @return body + **/ + @javax.annotation.Nonnull + public String getBody() { + return body; + } + + + public void setBody(String body) { + this.body = body; + } + + + public FileBase64 filename(String filename) { + + this.filename = filename; + return this; + } + + /** + * The name as referred to on a file system + * @return filename + **/ + @javax.annotation.Nonnull + public String getFilename() { + return filename; + } + + + public void setFilename(String filename) { + this.filename = filename; + } + + + public FileBase64 filepath(String filepath) { + + this.filepath = filepath; + return this; + } + + /** + * The relative path of the file, if it should be placed in a sub-directory + * @return filepath + **/ + @javax.annotation.Nullable + public String getFilepath() { + return filepath; + } + + + public void setFilepath(String filepath) { + this.filepath = filepath; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileBase64 fileBase64 = (FileBase64) o; + return Objects.equals(this.body, fileBase64.body) && + Objects.equals(this.filename, fileBase64.filename) && + Objects.equals(this.filepath, fileBase64.filepath); + } + + @Override + public int hashCode() { + return Objects.hash(body, filename, filepath); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileBase64 {\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); + sb.append(" filepath: ").append(toIndentedString(filepath)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("body"); + openapiFields.add("filename"); + openapiFields.add("filepath"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("body"); + openapiRequiredFields.add("filename"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FileBase64 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!FileBase64.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FileBase64 is not found in the empty JSON string", FileBase64.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FileBase64.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FileBase64` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FileBase64.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("body").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("body").toString())); + } + if (!jsonObj.get("filename").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `filename` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filename").toString())); + } + if ((jsonObj.get("filepath") != null && !jsonObj.get("filepath").isJsonNull()) && !jsonObj.get("filepath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `filepath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filepath").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FileBase64.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FileBase64' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FileBase64.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FileBase64 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FileBase64 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FileBase64 given an JSON string + * + * @param jsonString JSON string + * @return An instance of FileBase64 + * @throws IOException if the JSON string is invalid with respect to FileBase64 + */ + public static FileBase64 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FileBase64.class); + } + + /** + * Convert an instance of FileBase64 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayDiscoveryOptions.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayDiscoveryOptions.java new file mode 100644 index 00000000000..5d31258cb85 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayDiscoveryOptions.java @@ -0,0 +1,233 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GatewayDiscoveryOptions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GatewayDiscoveryOptions { + public static final String SERIALIZED_NAME_AS_LOCALHOST = "asLocalhost"; + @SerializedName(SERIALIZED_NAME_AS_LOCALHOST) + private Boolean asLocalhost; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public GatewayDiscoveryOptions() { + } + + public GatewayDiscoveryOptions asLocalhost(Boolean asLocalhost) { + + this.asLocalhost = asLocalhost; + return this; + } + + /** + * Get asLocalhost + * @return asLocalhost + **/ + @javax.annotation.Nullable + public Boolean getAsLocalhost() { + return asLocalhost; + } + + + public void setAsLocalhost(Boolean asLocalhost) { + this.asLocalhost = asLocalhost; + } + + + public GatewayDiscoveryOptions enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * @return enabled + **/ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GatewayDiscoveryOptions gatewayDiscoveryOptions = (GatewayDiscoveryOptions) o; + return Objects.equals(this.asLocalhost, gatewayDiscoveryOptions.asLocalhost) && + Objects.equals(this.enabled, gatewayDiscoveryOptions.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(asLocalhost, enabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GatewayDiscoveryOptions {\n"); + sb.append(" asLocalhost: ").append(toIndentedString(asLocalhost)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("asLocalhost"); + openapiFields.add("enabled"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GatewayDiscoveryOptions + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GatewayDiscoveryOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GatewayDiscoveryOptions is not found in the empty JSON string", GatewayDiscoveryOptions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GatewayDiscoveryOptions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GatewayDiscoveryOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GatewayDiscoveryOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GatewayDiscoveryOptions' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GatewayDiscoveryOptions.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GatewayDiscoveryOptions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GatewayDiscoveryOptions read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GatewayDiscoveryOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of GatewayDiscoveryOptions + * @throws IOException if the JSON string is invalid with respect to GatewayDiscoveryOptions + */ + public static GatewayDiscoveryOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GatewayDiscoveryOptions.class); + } + + /** + * Convert an instance of GatewayDiscoveryOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayEventHandlerOptions.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayEventHandlerOptions.java new file mode 100644 index 00000000000..ecd47083cfa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayEventHandlerOptions.java @@ -0,0 +1,271 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.DefaultEventHandlerStrategy; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GatewayEventHandlerOptions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GatewayEventHandlerOptions { + public static final String SERIALIZED_NAME_COMMIT_TIMEOUT = "commitTimeout"; + @SerializedName(SERIALIZED_NAME_COMMIT_TIMEOUT) + private BigDecimal commitTimeout; + + public static final String SERIALIZED_NAME_ENDORSE_TIMEOUT = "endorseTimeout"; + @SerializedName(SERIALIZED_NAME_ENDORSE_TIMEOUT) + private BigDecimal endorseTimeout; + + public static final String SERIALIZED_NAME_STRATEGY = "strategy"; + @SerializedName(SERIALIZED_NAME_STRATEGY) + private DefaultEventHandlerStrategy strategy; + + public GatewayEventHandlerOptions() { + } + + public GatewayEventHandlerOptions commitTimeout(BigDecimal commitTimeout) { + + this.commitTimeout = commitTimeout; + return this; + } + + /** + * Get commitTimeout + * @return commitTimeout + **/ + @javax.annotation.Nullable + public BigDecimal getCommitTimeout() { + return commitTimeout; + } + + + public void setCommitTimeout(BigDecimal commitTimeout) { + this.commitTimeout = commitTimeout; + } + + + public GatewayEventHandlerOptions endorseTimeout(BigDecimal endorseTimeout) { + + this.endorseTimeout = endorseTimeout; + return this; + } + + /** + * Get endorseTimeout + * @return endorseTimeout + **/ + @javax.annotation.Nullable + public BigDecimal getEndorseTimeout() { + return endorseTimeout; + } + + + public void setEndorseTimeout(BigDecimal endorseTimeout) { + this.endorseTimeout = endorseTimeout; + } + + + public GatewayEventHandlerOptions strategy(DefaultEventHandlerStrategy strategy) { + + this.strategy = strategy; + return this; + } + + /** + * Get strategy + * @return strategy + **/ + @javax.annotation.Nonnull + public DefaultEventHandlerStrategy getStrategy() { + return strategy; + } + + + public void setStrategy(DefaultEventHandlerStrategy strategy) { + this.strategy = strategy; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GatewayEventHandlerOptions gatewayEventHandlerOptions = (GatewayEventHandlerOptions) o; + return Objects.equals(this.commitTimeout, gatewayEventHandlerOptions.commitTimeout) && + Objects.equals(this.endorseTimeout, gatewayEventHandlerOptions.endorseTimeout) && + Objects.equals(this.strategy, gatewayEventHandlerOptions.strategy); + } + + @Override + public int hashCode() { + return Objects.hash(commitTimeout, endorseTimeout, strategy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GatewayEventHandlerOptions {\n"); + sb.append(" commitTimeout: ").append(toIndentedString(commitTimeout)).append("\n"); + sb.append(" endorseTimeout: ").append(toIndentedString(endorseTimeout)).append("\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("commitTimeout"); + openapiFields.add("endorseTimeout"); + openapiFields.add("strategy"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("strategy"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GatewayEventHandlerOptions + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GatewayEventHandlerOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GatewayEventHandlerOptions is not found in the empty JSON string", GatewayEventHandlerOptions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GatewayEventHandlerOptions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GatewayEventHandlerOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GatewayEventHandlerOptions.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GatewayEventHandlerOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GatewayEventHandlerOptions' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GatewayEventHandlerOptions.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GatewayEventHandlerOptions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GatewayEventHandlerOptions read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GatewayEventHandlerOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of GatewayEventHandlerOptions + * @throws IOException if the JSON string is invalid with respect to GatewayEventHandlerOptions + */ + public static GatewayEventHandlerOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GatewayEventHandlerOptions.class); + } + + /** + * Convert an instance of GatewayEventHandlerOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayOptions.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayOptions.java new file mode 100644 index 00000000000..e3025ba3c54 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayOptions.java @@ -0,0 +1,343 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ConnectionProfile; +import org.openapitools.client.model.GatewayDiscoveryOptions; +import org.openapitools.client.model.GatewayEventHandlerOptions; +import org.openapitools.client.model.GatewayOptionsWallet; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GatewayOptions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GatewayOptions { + public static final String SERIALIZED_NAME_CONNECTION_PROFILE = "connectionProfile"; + @SerializedName(SERIALIZED_NAME_CONNECTION_PROFILE) + private ConnectionProfile connectionProfile; + + public static final String SERIALIZED_NAME_DISCOVERY = "discovery"; + @SerializedName(SERIALIZED_NAME_DISCOVERY) + private GatewayDiscoveryOptions discovery; + + public static final String SERIALIZED_NAME_EVENT_HANDLER_OPTIONS = "eventHandlerOptions"; + @SerializedName(SERIALIZED_NAME_EVENT_HANDLER_OPTIONS) + private GatewayEventHandlerOptions eventHandlerOptions; + + public static final String SERIALIZED_NAME_IDENTITY = "identity"; + @SerializedName(SERIALIZED_NAME_IDENTITY) + private String identity; + + public static final String SERIALIZED_NAME_WALLET = "wallet"; + @SerializedName(SERIALIZED_NAME_WALLET) + private GatewayOptionsWallet wallet; + + public GatewayOptions() { + } + + public GatewayOptions connectionProfile(ConnectionProfile connectionProfile) { + + this.connectionProfile = connectionProfile; + return this; + } + + /** + * Get connectionProfile + * @return connectionProfile + **/ + @javax.annotation.Nullable + public ConnectionProfile getConnectionProfile() { + return connectionProfile; + } + + + public void setConnectionProfile(ConnectionProfile connectionProfile) { + this.connectionProfile = connectionProfile; + } + + + public GatewayOptions discovery(GatewayDiscoveryOptions discovery) { + + this.discovery = discovery; + return this; + } + + /** + * Get discovery + * @return discovery + **/ + @javax.annotation.Nullable + public GatewayDiscoveryOptions getDiscovery() { + return discovery; + } + + + public void setDiscovery(GatewayDiscoveryOptions discovery) { + this.discovery = discovery; + } + + + public GatewayOptions eventHandlerOptions(GatewayEventHandlerOptions eventHandlerOptions) { + + this.eventHandlerOptions = eventHandlerOptions; + return this; + } + + /** + * Get eventHandlerOptions + * @return eventHandlerOptions + **/ + @javax.annotation.Nullable + public GatewayEventHandlerOptions getEventHandlerOptions() { + return eventHandlerOptions; + } + + + public void setEventHandlerOptions(GatewayEventHandlerOptions eventHandlerOptions) { + this.eventHandlerOptions = eventHandlerOptions; + } + + + public GatewayOptions identity(String identity) { + + this.identity = identity; + return this; + } + + /** + * Get identity + * @return identity + **/ + @javax.annotation.Nonnull + public String getIdentity() { + return identity; + } + + + public void setIdentity(String identity) { + this.identity = identity; + } + + + public GatewayOptions wallet(GatewayOptionsWallet wallet) { + + this.wallet = wallet; + return this; + } + + /** + * Get wallet + * @return wallet + **/ + @javax.annotation.Nonnull + public GatewayOptionsWallet getWallet() { + return wallet; + } + + + public void setWallet(GatewayOptionsWallet wallet) { + this.wallet = wallet; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GatewayOptions gatewayOptions = (GatewayOptions) o; + return Objects.equals(this.connectionProfile, gatewayOptions.connectionProfile) && + Objects.equals(this.discovery, gatewayOptions.discovery) && + Objects.equals(this.eventHandlerOptions, gatewayOptions.eventHandlerOptions) && + Objects.equals(this.identity, gatewayOptions.identity) && + Objects.equals(this.wallet, gatewayOptions.wallet); + } + + @Override + public int hashCode() { + return Objects.hash(connectionProfile, discovery, eventHandlerOptions, identity, wallet); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GatewayOptions {\n"); + sb.append(" connectionProfile: ").append(toIndentedString(connectionProfile)).append("\n"); + sb.append(" discovery: ").append(toIndentedString(discovery)).append("\n"); + sb.append(" eventHandlerOptions: ").append(toIndentedString(eventHandlerOptions)).append("\n"); + sb.append(" identity: ").append(toIndentedString(identity)).append("\n"); + sb.append(" wallet: ").append(toIndentedString(wallet)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("connectionProfile"); + openapiFields.add("discovery"); + openapiFields.add("eventHandlerOptions"); + openapiFields.add("identity"); + openapiFields.add("wallet"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("identity"); + openapiRequiredFields.add("wallet"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GatewayOptions + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GatewayOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GatewayOptions is not found in the empty JSON string", GatewayOptions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GatewayOptions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GatewayOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GatewayOptions.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `discovery` + if (jsonObj.get("discovery") != null && !jsonObj.get("discovery").isJsonNull()) { + GatewayDiscoveryOptions.validateJsonObject(jsonObj.getAsJsonObject("discovery")); + } + // validate the optional field `eventHandlerOptions` + if (jsonObj.get("eventHandlerOptions") != null && !jsonObj.get("eventHandlerOptions").isJsonNull()) { + GatewayEventHandlerOptions.validateJsonObject(jsonObj.getAsJsonObject("eventHandlerOptions")); + } + if (!jsonObj.get("identity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `identity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identity").toString())); + } + // validate the required field `wallet` + GatewayOptionsWallet.validateJsonObject(jsonObj.getAsJsonObject("wallet")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GatewayOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GatewayOptions' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GatewayOptions.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GatewayOptions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GatewayOptions read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GatewayOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of GatewayOptions + * @throws IOException if the JSON string is invalid with respect to GatewayOptions + */ + public static GatewayOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GatewayOptions.class); + } + + /** + * Convert an instance of GatewayOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayOptionsWallet.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayOptionsWallet.java new file mode 100644 index 00000000000..549a06547c8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GatewayOptionsWallet.java @@ -0,0 +1,241 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.FabricSigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GatewayOptionsWallet + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GatewayOptionsWallet { + public static final String SERIALIZED_NAME_KEYCHAIN = "keychain"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN) + private FabricSigningCredential keychain; + + public static final String SERIALIZED_NAME_JSON = "json"; + @SerializedName(SERIALIZED_NAME_JSON) + private String json; + + public GatewayOptionsWallet() { + } + + public GatewayOptionsWallet keychain(FabricSigningCredential keychain) { + + this.keychain = keychain; + return this; + } + + /** + * Get keychain + * @return keychain + **/ + @javax.annotation.Nullable + public FabricSigningCredential getKeychain() { + return keychain; + } + + + public void setKeychain(FabricSigningCredential keychain) { + this.keychain = keychain; + } + + + public GatewayOptionsWallet json(String json) { + + this.json = json; + return this; + } + + /** + * Get json + * @return json + **/ + @javax.annotation.Nullable + public String getJson() { + return json; + } + + + public void setJson(String json) { + this.json = json; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GatewayOptionsWallet gatewayOptionsWallet = (GatewayOptionsWallet) o; + return Objects.equals(this.keychain, gatewayOptionsWallet.keychain) && + Objects.equals(this.json, gatewayOptionsWallet.json); + } + + @Override + public int hashCode() { + return Objects.hash(keychain, json); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GatewayOptionsWallet {\n"); + sb.append(" keychain: ").append(toIndentedString(keychain)).append("\n"); + sb.append(" json: ").append(toIndentedString(json)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("keychain"); + openapiFields.add("json"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GatewayOptionsWallet + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GatewayOptionsWallet.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GatewayOptionsWallet is not found in the empty JSON string", GatewayOptionsWallet.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GatewayOptionsWallet.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GatewayOptionsWallet` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `keychain` + if (jsonObj.get("keychain") != null && !jsonObj.get("keychain").isJsonNull()) { + FabricSigningCredential.validateJsonObject(jsonObj.getAsJsonObject("keychain")); + } + if ((jsonObj.get("json") != null && !jsonObj.get("json").isJsonNull()) && !jsonObj.get("json").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `json` to be a primitive type in the JSON string but got `%s`", jsonObj.get("json").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GatewayOptionsWallet.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GatewayOptionsWallet' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GatewayOptionsWallet.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GatewayOptionsWallet value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GatewayOptionsWallet read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GatewayOptionsWallet given an JSON string + * + * @param jsonString JSON string + * @return An instance of GatewayOptionsWallet + * @throws IOException if the JSON string is invalid with respect to GatewayOptionsWallet + */ + public static GatewayOptionsWallet fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GatewayOptionsWallet.class); + } + + /** + * Convert an instance of GatewayOptionsWallet to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1.java new file mode 100644 index 00000000000..8162ba99806 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1.java @@ -0,0 +1,339 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GatewayOptions; +import org.openapitools.client.model.GetBlockRequestV1Query; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Request for GetBlock endpoint. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockRequestV1 { + public static final String SERIALIZED_NAME_CHANNEL_NAME = "channelName"; + @SerializedName(SERIALIZED_NAME_CHANNEL_NAME) + private String channelName; + + public static final String SERIALIZED_NAME_CONNECTION_CHANNEL_NAME = "connectionChannelName"; + @SerializedName(SERIALIZED_NAME_CONNECTION_CHANNEL_NAME) + private String connectionChannelName; + + public static final String SERIALIZED_NAME_GATEWAY_OPTIONS = "gatewayOptions"; + @SerializedName(SERIALIZED_NAME_GATEWAY_OPTIONS) + private GatewayOptions gatewayOptions; + + public static final String SERIALIZED_NAME_QUERY = "query"; + @SerializedName(SERIALIZED_NAME_QUERY) + private GetBlockRequestV1Query query; + + public static final String SERIALIZED_NAME_SKIP_DECODE = "skipDecode"; + @SerializedName(SERIALIZED_NAME_SKIP_DECODE) + private Boolean skipDecode = false; + + public GetBlockRequestV1() { + } + + public GetBlockRequestV1 channelName(String channelName) { + + this.channelName = channelName; + return this; + } + + /** + * Fabric channel which we want to query. + * @return channelName + **/ + @javax.annotation.Nonnull + public String getChannelName() { + return channelName; + } + + + public void setChannelName(String channelName) { + this.channelName = channelName; + } + + + public GetBlockRequestV1 connectionChannelName(String connectionChannelName) { + + this.connectionChannelName = connectionChannelName; + return this; + } + + /** + * Fabric channel we want to connect to. If not provided, then one from channelName parameter will be used + * @return connectionChannelName + **/ + @javax.annotation.Nullable + public String getConnectionChannelName() { + return connectionChannelName; + } + + + public void setConnectionChannelName(String connectionChannelName) { + this.connectionChannelName = connectionChannelName; + } + + + public GetBlockRequestV1 gatewayOptions(GatewayOptions gatewayOptions) { + + this.gatewayOptions = gatewayOptions; + return this; + } + + /** + * Get gatewayOptions + * @return gatewayOptions + **/ + @javax.annotation.Nonnull + public GatewayOptions getGatewayOptions() { + return gatewayOptions; + } + + + public void setGatewayOptions(GatewayOptions gatewayOptions) { + this.gatewayOptions = gatewayOptions; + } + + + public GetBlockRequestV1 query(GetBlockRequestV1Query query) { + + this.query = query; + return this; + } + + /** + * Get query + * @return query + **/ + @javax.annotation.Nonnull + public GetBlockRequestV1Query getQuery() { + return query; + } + + + public void setQuery(GetBlockRequestV1Query query) { + this.query = query; + } + + + public GetBlockRequestV1 skipDecode(Boolean skipDecode) { + + this.skipDecode = skipDecode; + return this; + } + + /** + * If true, encoded buffer will be returned. Otherwise, entire block object is returned. + * @return skipDecode + **/ + @javax.annotation.Nullable + public Boolean getSkipDecode() { + return skipDecode; + } + + + public void setSkipDecode(Boolean skipDecode) { + this.skipDecode = skipDecode; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockRequestV1 getBlockRequestV1 = (GetBlockRequestV1) o; + return Objects.equals(this.channelName, getBlockRequestV1.channelName) && + Objects.equals(this.connectionChannelName, getBlockRequestV1.connectionChannelName) && + Objects.equals(this.gatewayOptions, getBlockRequestV1.gatewayOptions) && + Objects.equals(this.query, getBlockRequestV1.query) && + Objects.equals(this.skipDecode, getBlockRequestV1.skipDecode); + } + + @Override + public int hashCode() { + return Objects.hash(channelName, connectionChannelName, gatewayOptions, query, skipDecode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockRequestV1 {\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" connectionChannelName: ").append(toIndentedString(connectionChannelName)).append("\n"); + sb.append(" gatewayOptions: ").append(toIndentedString(gatewayOptions)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" skipDecode: ").append(toIndentedString(skipDecode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("channelName"); + openapiFields.add("connectionChannelName"); + openapiFields.add("gatewayOptions"); + openapiFields.add("query"); + openapiFields.add("skipDecode"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("channelName"); + openapiRequiredFields.add("gatewayOptions"); + openapiRequiredFields.add("query"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBlockRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBlockRequestV1 is not found in the empty JSON string", GetBlockRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBlockRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBlockRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBlockRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("channelName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `channelName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("channelName").toString())); + } + if ((jsonObj.get("connectionChannelName") != null && !jsonObj.get("connectionChannelName").isJsonNull()) && !jsonObj.get("connectionChannelName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `connectionChannelName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("connectionChannelName").toString())); + } + // validate the required field `gatewayOptions` + GatewayOptions.validateJsonObject(jsonObj.getAsJsonObject("gatewayOptions")); + // validate the required field `query` + GetBlockRequestV1Query.validateJsonObject(jsonObj.getAsJsonObject("query")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBlockRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBlockRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBlockRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockRequestV1 + * @throws IOException if the JSON string is invalid with respect to GetBlockRequestV1 + */ + public static GetBlockRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockRequestV1.class); + } + + /** + * Convert an instance of GetBlockRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1Query.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1Query.java new file mode 100644 index 00000000000..448175bbba8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1Query.java @@ -0,0 +1,272 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GetBlockRequestV1QueryBlockHash; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Query selector, caller must provide at least one of them. First found will be used, rest will be ignored, so it's recommended to pass single selector. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockRequestV1Query { + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private String blockNumber; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private GetBlockRequestV1QueryBlockHash blockHash; + + public static final String SERIALIZED_NAME_TRANSACTION_ID = "transactionId"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_ID) + private String transactionId; + + public GetBlockRequestV1Query() { + } + + public GetBlockRequestV1Query blockNumber(String blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Select block by it's number. + * @return blockNumber + **/ + @javax.annotation.Nullable + public String getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(String blockNumber) { + this.blockNumber = blockNumber; + } + + + public GetBlockRequestV1Query blockHash(GetBlockRequestV1QueryBlockHash blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nullable + public GetBlockRequestV1QueryBlockHash getBlockHash() { + return blockHash; + } + + + public void setBlockHash(GetBlockRequestV1QueryBlockHash blockHash) { + this.blockHash = blockHash; + } + + + public GetBlockRequestV1Query transactionId(String transactionId) { + + this.transactionId = transactionId; + return this; + } + + /** + * Select block by id of transaction that it contains. + * @return transactionId + **/ + @javax.annotation.Nullable + public String getTransactionId() { + return transactionId; + } + + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockRequestV1Query getBlockRequestV1Query = (GetBlockRequestV1Query) o; + return Objects.equals(this.blockNumber, getBlockRequestV1Query.blockNumber) && + Objects.equals(this.blockHash, getBlockRequestV1Query.blockHash) && + Objects.equals(this.transactionId, getBlockRequestV1Query.transactionId); + } + + @Override + public int hashCode() { + return Objects.hash(blockNumber, blockHash, transactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockRequestV1Query {\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("blockNumber"); + openapiFields.add("blockHash"); + openapiFields.add("transactionId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockRequestV1Query + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBlockRequestV1Query.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBlockRequestV1Query is not found in the empty JSON string", GetBlockRequestV1Query.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBlockRequestV1Query.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBlockRequestV1Query` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("blockNumber") != null && !jsonObj.get("blockNumber").isJsonNull()) && !jsonObj.get("blockNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockNumber").toString())); + } + // validate the optional field `blockHash` + if (jsonObj.get("blockHash") != null && !jsonObj.get("blockHash").isJsonNull()) { + GetBlockRequestV1QueryBlockHash.validateJsonObject(jsonObj.getAsJsonObject("blockHash")); + } + if ((jsonObj.get("transactionId") != null && !jsonObj.get("transactionId").isJsonNull()) && !jsonObj.get("transactionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockRequestV1Query.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockRequestV1Query' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBlockRequestV1Query.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockRequestV1Query value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBlockRequestV1Query read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBlockRequestV1Query given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockRequestV1Query + * @throws IOException if the JSON string is invalid with respect to GetBlockRequestV1Query + */ + public static GetBlockRequestV1Query fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockRequestV1Query.class); + } + + /** + * Convert an instance of GetBlockRequestV1Query to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHash.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHash.java new file mode 100644 index 00000000000..26500258169 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHash.java @@ -0,0 +1,247 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Select block by it's hash. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockRequestV1QueryBlockHash { + public static final String SERIALIZED_NAME_ENCODING = "encoding"; + @SerializedName(SERIALIZED_NAME_ENCODING) + private String encoding; + + public static final String SERIALIZED_NAME_BUFFER = "buffer"; + @SerializedName(SERIALIZED_NAME_BUFFER) + private String buffer; + + public GetBlockRequestV1QueryBlockHash() { + } + + public GetBlockRequestV1QueryBlockHash encoding(String encoding) { + + this.encoding = encoding; + return this; + } + + /** + * NodeJS Buffer encoding (utf-8, hex, binary, base64, etc...). Passed directly to `Buffer.from()` call on hashBuffer. If not provided then JSON buffer format is assumed. + * @return encoding + **/ + @javax.annotation.Nullable + public String getEncoding() { + return encoding; + } + + + public void setEncoding(String encoding) { + this.encoding = encoding; + } + + + public GetBlockRequestV1QueryBlockHash buffer(String buffer) { + + this.buffer = buffer; + return this; + } + + /** + * Buffer of blockHash. It's encoding should be described in `encoding` parameter. + * @return buffer + **/ + @javax.annotation.Nonnull + public String getBuffer() { + return buffer; + } + + + public void setBuffer(String buffer) { + this.buffer = buffer; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockRequestV1QueryBlockHash getBlockRequestV1QueryBlockHash = (GetBlockRequestV1QueryBlockHash) o; + return Objects.equals(this.encoding, getBlockRequestV1QueryBlockHash.encoding) && + Objects.equals(this.buffer, getBlockRequestV1QueryBlockHash.buffer); + } + + @Override + public int hashCode() { + return Objects.hash(encoding, buffer); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockRequestV1QueryBlockHash {\n"); + sb.append(" encoding: ").append(toIndentedString(encoding)).append("\n"); + sb.append(" buffer: ").append(toIndentedString(buffer)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("encoding"); + openapiFields.add("buffer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("buffer"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockRequestV1QueryBlockHash + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBlockRequestV1QueryBlockHash.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBlockRequestV1QueryBlockHash is not found in the empty JSON string", GetBlockRequestV1QueryBlockHash.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBlockRequestV1QueryBlockHash.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBlockRequestV1QueryBlockHash` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBlockRequestV1QueryBlockHash.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("encoding") != null && !jsonObj.get("encoding").isJsonNull()) && !jsonObj.get("encoding").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `encoding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encoding").toString())); + } + if (!jsonObj.get("buffer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `buffer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("buffer").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockRequestV1QueryBlockHash.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockRequestV1QueryBlockHash' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBlockRequestV1QueryBlockHash.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockRequestV1QueryBlockHash value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBlockRequestV1QueryBlockHash read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBlockRequestV1QueryBlockHash given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockRequestV1QueryBlockHash + * @throws IOException if the JSON string is invalid with respect to GetBlockRequestV1QueryBlockHash + */ + public static GetBlockRequestV1QueryBlockHash fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockRequestV1QueryBlockHash.class); + } + + /** + * Convert an instance of GetBlockRequestV1QueryBlockHash to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseDecodedV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseDecodedV1.java new file mode 100644 index 00000000000..390704b8e2b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseDecodedV1.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * When skipDecode is false (default) then decoded block object is returned. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockResponseDecodedV1 { + public static final String SERIALIZED_NAME_DECODED_BLOCK = "decodedBlock"; + @SerializedName(SERIALIZED_NAME_DECODED_BLOCK) + private Object decodedBlock = null; + + public GetBlockResponseDecodedV1() { + } + + public GetBlockResponseDecodedV1 decodedBlock(Object decodedBlock) { + + this.decodedBlock = decodedBlock; + return this; + } + + /** + * Full hyperledger fabric block data. + * @return decodedBlock + **/ + @javax.annotation.Nullable + public Object getDecodedBlock() { + return decodedBlock; + } + + + public void setDecodedBlock(Object decodedBlock) { + this.decodedBlock = decodedBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockResponseDecodedV1 getBlockResponseDecodedV1 = (GetBlockResponseDecodedV1) o; + return Objects.equals(this.decodedBlock, getBlockResponseDecodedV1.decodedBlock); + } + + @Override + public int hashCode() { + return Objects.hash(decodedBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockResponseDecodedV1 {\n"); + sb.append(" decodedBlock: ").append(toIndentedString(decodedBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("decodedBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("decodedBlock"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockResponseDecodedV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBlockResponseDecodedV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBlockResponseDecodedV1 is not found in the empty JSON string", GetBlockResponseDecodedV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBlockResponseDecodedV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBlockResponseDecodedV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBlockResponseDecodedV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockResponseDecodedV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockResponseDecodedV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBlockResponseDecodedV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockResponseDecodedV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBlockResponseDecodedV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBlockResponseDecodedV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockResponseDecodedV1 + * @throws IOException if the JSON string is invalid with respect to GetBlockResponseDecodedV1 + */ + public static GetBlockResponseDecodedV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockResponseDecodedV1.class); + } + + /** + * Convert an instance of GetBlockResponseDecodedV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseEncodedV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseEncodedV1.java new file mode 100644 index 00000000000..ddaa3df9a27 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseEncodedV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * When skipDecode is true then encoded block Buffer is returned. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockResponseEncodedV1 { + public static final String SERIALIZED_NAME_ENCODED_BLOCK = "encodedBlock"; + @SerializedName(SERIALIZED_NAME_ENCODED_BLOCK) + private String encodedBlock; + + public GetBlockResponseEncodedV1() { + } + + public GetBlockResponseEncodedV1 encodedBlock(String encodedBlock) { + + this.encodedBlock = encodedBlock; + return this; + } + + /** + * Get encodedBlock + * @return encodedBlock + **/ + @javax.annotation.Nonnull + public String getEncodedBlock() { + return encodedBlock; + } + + + public void setEncodedBlock(String encodedBlock) { + this.encodedBlock = encodedBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockResponseEncodedV1 getBlockResponseEncodedV1 = (GetBlockResponseEncodedV1) o; + return Objects.equals(this.encodedBlock, getBlockResponseEncodedV1.encodedBlock); + } + + @Override + public int hashCode() { + return Objects.hash(encodedBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockResponseEncodedV1 {\n"); + sb.append(" encodedBlock: ").append(toIndentedString(encodedBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("encodedBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("encodedBlock"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockResponseEncodedV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBlockResponseEncodedV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBlockResponseEncodedV1 is not found in the empty JSON string", GetBlockResponseEncodedV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBlockResponseEncodedV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBlockResponseEncodedV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBlockResponseEncodedV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("encodedBlock").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `encodedBlock` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encodedBlock").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockResponseEncodedV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockResponseEncodedV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBlockResponseEncodedV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockResponseEncodedV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBlockResponseEncodedV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBlockResponseEncodedV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockResponseEncodedV1 + * @throws IOException if the JSON string is invalid with respect to GetBlockResponseEncodedV1 + */ + public static GetBlockResponseEncodedV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockResponseEncodedV1.class); + } + + /** + * Convert an instance of GetBlockResponseEncodedV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseV1.java new file mode 100644 index 00000000000..511210e587a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockResponseV1.java @@ -0,0 +1,284 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GetBlockResponseDecodedV1; +import org.openapitools.client.model.GetBlockResponseEncodedV1; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockResponseV1 extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(GetBlockResponseV1.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterGetBlockResponseDecodedV1 = gson.getDelegateAdapter(this, TypeToken.get(GetBlockResponseDecodedV1.class)); + final TypeAdapter adapterGetBlockResponseEncodedV1 = gson.getDelegateAdapter(this, TypeToken.get(GetBlockResponseEncodedV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockResponseV1 value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `GetBlockResponseDecodedV1` + if (value.getActualInstance() instanceof GetBlockResponseDecodedV1) { + JsonObject obj = adapterGetBlockResponseDecodedV1.toJsonTree((GetBlockResponseDecodedV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetBlockResponseEncodedV1` + if (value.getActualInstance() instanceof GetBlockResponseEncodedV1) { + JsonObject obj = adapterGetBlockResponseEncodedV1.toJsonTree((GetBlockResponseEncodedV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: GetBlockResponseDecodedV1, GetBlockResponseEncodedV1"); + } + + @Override + public GetBlockResponseV1 read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize GetBlockResponseDecodedV1 + try { + // validate the JSON object to see if any exception is thrown + GetBlockResponseDecodedV1.validateJsonObject(jsonObject); + actualAdapter = adapterGetBlockResponseDecodedV1; + match++; + log.log(Level.FINER, "Input data matches schema 'GetBlockResponseDecodedV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetBlockResponseDecodedV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetBlockResponseDecodedV1'", e); + } + + // deserialize GetBlockResponseEncodedV1 + try { + // validate the JSON object to see if any exception is thrown + GetBlockResponseEncodedV1.validateJsonObject(jsonObject); + actualAdapter = adapterGetBlockResponseEncodedV1; + match++; + log.log(Level.FINER, "Input data matches schema 'GetBlockResponseEncodedV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetBlockResponseEncodedV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetBlockResponseEncodedV1'", e); + } + + if (match == 1) { + GetBlockResponseV1 ret = new GetBlockResponseV1(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for GetBlockResponseV1: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public GetBlockResponseV1() { + super("oneOf", Boolean.FALSE); + } + + public GetBlockResponseV1(GetBlockResponseDecodedV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public GetBlockResponseV1(GetBlockResponseEncodedV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("GetBlockResponseDecodedV1", new GenericType() { + }); + schemas.put("GetBlockResponseEncodedV1", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return GetBlockResponseV1.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * GetBlockResponseDecodedV1, GetBlockResponseEncodedV1 + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof GetBlockResponseDecodedV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetBlockResponseEncodedV1) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be GetBlockResponseDecodedV1, GetBlockResponseEncodedV1"); + } + + /** + * Get the actual instance, which can be the following: + * GetBlockResponseDecodedV1, GetBlockResponseEncodedV1 + * + * @return The actual instance (GetBlockResponseDecodedV1, GetBlockResponseEncodedV1) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `GetBlockResponseDecodedV1`. If the actual instance is not `GetBlockResponseDecodedV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetBlockResponseDecodedV1` + * @throws ClassCastException if the instance is not `GetBlockResponseDecodedV1` + */ + public GetBlockResponseDecodedV1 getGetBlockResponseDecodedV1() throws ClassCastException { + return (GetBlockResponseDecodedV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetBlockResponseEncodedV1`. If the actual instance is not `GetBlockResponseEncodedV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetBlockResponseEncodedV1` + * @throws ClassCastException if the instance is not `GetBlockResponseEncodedV1` + */ + public GetBlockResponseEncodedV1 getGetBlockResponseEncodedV1() throws ClassCastException { + return (GetBlockResponseEncodedV1)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with GetBlockResponseDecodedV1 + try { + GetBlockResponseDecodedV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetBlockResponseDecodedV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetBlockResponseEncodedV1 + try { + GetBlockResponseEncodedV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetBlockResponseEncodedV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for GetBlockResponseV1 with oneOf schemas: GetBlockResponseDecodedV1, GetBlockResponseEncodedV1. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of GetBlockResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockResponseV1 + * @throws IOException if the JSON string is invalid with respect to GetBlockResponseV1 + */ + public static GetBlockResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockResponseV1.class); + } + + /** + * Convert an instance of GetBlockResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionReceiptResponse.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionReceiptResponse.java new file mode 100644 index 00000000000..07dbc7065a6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionReceiptResponse.java @@ -0,0 +1,513 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.TransactReceiptBlockMetaData; +import org.openapitools.client.model.TransactReceiptTransactionCreator; +import org.openapitools.client.model.TransactReceiptTransactionEndorsement; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GetTransactionReceiptResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransactionReceiptResponse { + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private String blockNumber; + + public static final String SERIALIZED_NAME_CHANNEL_I_D = "channelID"; + @SerializedName(SERIALIZED_NAME_CHANNEL_I_D) + private String channelID; + + public static final String SERIALIZED_NAME_TRANSACTION_CREATOR = "transactionCreator"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_CREATOR) + private TransactReceiptTransactionCreator transactionCreator; + + public static final String SERIALIZED_NAME_TRANSACTION_ENDORSEMENT = "transactionEndorsement"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_ENDORSEMENT) + private List transactionEndorsement; + + public static final String SERIALIZED_NAME_BLOCK_META_DATA = "blockMetaData"; + @SerializedName(SERIALIZED_NAME_BLOCK_META_DATA) + private TransactReceiptBlockMetaData blockMetaData; + + public static final String SERIALIZED_NAME_CHAIN_CODE_NAME = "chainCodeName"; + @SerializedName(SERIALIZED_NAME_CHAIN_CODE_NAME) + private String chainCodeName; + + public static final String SERIALIZED_NAME_CHAIN_CODE_VERSION = "chainCodeVersion"; + @SerializedName(SERIALIZED_NAME_CHAIN_CODE_VERSION) + private String chainCodeVersion; + + public static final String SERIALIZED_NAME_RESPONSE_STATUS = "responseStatus"; + @SerializedName(SERIALIZED_NAME_RESPONSE_STATUS) + private String responseStatus; + + public static final String SERIALIZED_NAME_RWSET_KEY = "rwsetKey"; + @SerializedName(SERIALIZED_NAME_RWSET_KEY) + private String rwsetKey; + + public static final String SERIALIZED_NAME_RWSET_WRITE_DATA = "rwsetWriteData"; + @SerializedName(SERIALIZED_NAME_RWSET_WRITE_DATA) + private String rwsetWriteData; + + public GetTransactionReceiptResponse() { + } + + public GetTransactionReceiptResponse blockNumber(String blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nullable + public String getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(String blockNumber) { + this.blockNumber = blockNumber; + } + + + public GetTransactionReceiptResponse channelID(String channelID) { + + this.channelID = channelID; + return this; + } + + /** + * Get channelID + * @return channelID + **/ + @javax.annotation.Nullable + public String getChannelID() { + return channelID; + } + + + public void setChannelID(String channelID) { + this.channelID = channelID; + } + + + public GetTransactionReceiptResponse transactionCreator(TransactReceiptTransactionCreator transactionCreator) { + + this.transactionCreator = transactionCreator; + return this; + } + + /** + * Get transactionCreator + * @return transactionCreator + **/ + @javax.annotation.Nullable + public TransactReceiptTransactionCreator getTransactionCreator() { + return transactionCreator; + } + + + public void setTransactionCreator(TransactReceiptTransactionCreator transactionCreator) { + this.transactionCreator = transactionCreator; + } + + + public GetTransactionReceiptResponse transactionEndorsement(List transactionEndorsement) { + + this.transactionEndorsement = transactionEndorsement; + return this; + } + + public GetTransactionReceiptResponse addTransactionEndorsementItem(TransactReceiptTransactionEndorsement transactionEndorsementItem) { + if (this.transactionEndorsement == null) { + this.transactionEndorsement = new ArrayList<>(); + } + this.transactionEndorsement.add(transactionEndorsementItem); + return this; + } + + /** + * Get transactionEndorsement + * @return transactionEndorsement + **/ + @javax.annotation.Nullable + public List getTransactionEndorsement() { + return transactionEndorsement; + } + + + public void setTransactionEndorsement(List transactionEndorsement) { + this.transactionEndorsement = transactionEndorsement; + } + + + public GetTransactionReceiptResponse blockMetaData(TransactReceiptBlockMetaData blockMetaData) { + + this.blockMetaData = blockMetaData; + return this; + } + + /** + * Get blockMetaData + * @return blockMetaData + **/ + @javax.annotation.Nullable + public TransactReceiptBlockMetaData getBlockMetaData() { + return blockMetaData; + } + + + public void setBlockMetaData(TransactReceiptBlockMetaData blockMetaData) { + this.blockMetaData = blockMetaData; + } + + + public GetTransactionReceiptResponse chainCodeName(String chainCodeName) { + + this.chainCodeName = chainCodeName; + return this; + } + + /** + * Get chainCodeName + * @return chainCodeName + **/ + @javax.annotation.Nullable + public String getChainCodeName() { + return chainCodeName; + } + + + public void setChainCodeName(String chainCodeName) { + this.chainCodeName = chainCodeName; + } + + + public GetTransactionReceiptResponse chainCodeVersion(String chainCodeVersion) { + + this.chainCodeVersion = chainCodeVersion; + return this; + } + + /** + * Get chainCodeVersion + * @return chainCodeVersion + **/ + @javax.annotation.Nullable + public String getChainCodeVersion() { + return chainCodeVersion; + } + + + public void setChainCodeVersion(String chainCodeVersion) { + this.chainCodeVersion = chainCodeVersion; + } + + + public GetTransactionReceiptResponse responseStatus(String responseStatus) { + + this.responseStatus = responseStatus; + return this; + } + + /** + * Get responseStatus + * @return responseStatus + **/ + @javax.annotation.Nullable + public String getResponseStatus() { + return responseStatus; + } + + + public void setResponseStatus(String responseStatus) { + this.responseStatus = responseStatus; + } + + + public GetTransactionReceiptResponse rwsetKey(String rwsetKey) { + + this.rwsetKey = rwsetKey; + return this; + } + + /** + * Get rwsetKey + * @return rwsetKey + **/ + @javax.annotation.Nullable + public String getRwsetKey() { + return rwsetKey; + } + + + public void setRwsetKey(String rwsetKey) { + this.rwsetKey = rwsetKey; + } + + + public GetTransactionReceiptResponse rwsetWriteData(String rwsetWriteData) { + + this.rwsetWriteData = rwsetWriteData; + return this; + } + + /** + * Get rwsetWriteData + * @return rwsetWriteData + **/ + @javax.annotation.Nullable + public String getRwsetWriteData() { + return rwsetWriteData; + } + + + public void setRwsetWriteData(String rwsetWriteData) { + this.rwsetWriteData = rwsetWriteData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransactionReceiptResponse getTransactionReceiptResponse = (GetTransactionReceiptResponse) o; + return Objects.equals(this.blockNumber, getTransactionReceiptResponse.blockNumber) && + Objects.equals(this.channelID, getTransactionReceiptResponse.channelID) && + Objects.equals(this.transactionCreator, getTransactionReceiptResponse.transactionCreator) && + Objects.equals(this.transactionEndorsement, getTransactionReceiptResponse.transactionEndorsement) && + Objects.equals(this.blockMetaData, getTransactionReceiptResponse.blockMetaData) && + Objects.equals(this.chainCodeName, getTransactionReceiptResponse.chainCodeName) && + Objects.equals(this.chainCodeVersion, getTransactionReceiptResponse.chainCodeVersion) && + Objects.equals(this.responseStatus, getTransactionReceiptResponse.responseStatus) && + Objects.equals(this.rwsetKey, getTransactionReceiptResponse.rwsetKey) && + Objects.equals(this.rwsetWriteData, getTransactionReceiptResponse.rwsetWriteData); + } + + @Override + public int hashCode() { + return Objects.hash(blockNumber, channelID, transactionCreator, transactionEndorsement, blockMetaData, chainCodeName, chainCodeVersion, responseStatus, rwsetKey, rwsetWriteData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransactionReceiptResponse {\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" channelID: ").append(toIndentedString(channelID)).append("\n"); + sb.append(" transactionCreator: ").append(toIndentedString(transactionCreator)).append("\n"); + sb.append(" transactionEndorsement: ").append(toIndentedString(transactionEndorsement)).append("\n"); + sb.append(" blockMetaData: ").append(toIndentedString(blockMetaData)).append("\n"); + sb.append(" chainCodeName: ").append(toIndentedString(chainCodeName)).append("\n"); + sb.append(" chainCodeVersion: ").append(toIndentedString(chainCodeVersion)).append("\n"); + sb.append(" responseStatus: ").append(toIndentedString(responseStatus)).append("\n"); + sb.append(" rwsetKey: ").append(toIndentedString(rwsetKey)).append("\n"); + sb.append(" rwsetWriteData: ").append(toIndentedString(rwsetWriteData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("blockNumber"); + openapiFields.add("channelID"); + openapiFields.add("transactionCreator"); + openapiFields.add("transactionEndorsement"); + openapiFields.add("blockMetaData"); + openapiFields.add("chainCodeName"); + openapiFields.add("chainCodeVersion"); + openapiFields.add("responseStatus"); + openapiFields.add("rwsetKey"); + openapiFields.add("rwsetWriteData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransactionReceiptResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransactionReceiptResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetTransactionReceiptResponse is not found in the empty JSON string", GetTransactionReceiptResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransactionReceiptResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTransactionReceiptResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("blockNumber") != null && !jsonObj.get("blockNumber").isJsonNull()) && !jsonObj.get("blockNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockNumber").toString())); + } + if ((jsonObj.get("channelID") != null && !jsonObj.get("channelID").isJsonNull()) && !jsonObj.get("channelID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `channelID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("channelID").toString())); + } + // validate the optional field `transactionCreator` + if (jsonObj.get("transactionCreator") != null && !jsonObj.get("transactionCreator").isJsonNull()) { + TransactReceiptTransactionCreator.validateJsonObject(jsonObj.getAsJsonObject("transactionCreator")); + } + if (jsonObj.get("transactionEndorsement") != null && !jsonObj.get("transactionEndorsement").isJsonNull()) { + JsonArray jsonArraytransactionEndorsement = jsonObj.getAsJsonArray("transactionEndorsement"); + if (jsonArraytransactionEndorsement != null) { + // ensure the json data is an array + if (!jsonObj.get("transactionEndorsement").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionEndorsement` to be an array in the JSON string but got `%s`", jsonObj.get("transactionEndorsement").toString())); + } + + // validate the optional field `transactionEndorsement` (array) + for (int i = 0; i < jsonArraytransactionEndorsement.size(); i++) { + TransactReceiptTransactionEndorsement.validateJsonObject(jsonArraytransactionEndorsement.get(i).getAsJsonObject()); + }; + } + } + // validate the optional field `blockMetaData` + if (jsonObj.get("blockMetaData") != null && !jsonObj.get("blockMetaData").isJsonNull()) { + TransactReceiptBlockMetaData.validateJsonObject(jsonObj.getAsJsonObject("blockMetaData")); + } + if ((jsonObj.get("chainCodeName") != null && !jsonObj.get("chainCodeName").isJsonNull()) && !jsonObj.get("chainCodeName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `chainCodeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chainCodeName").toString())); + } + if ((jsonObj.get("chainCodeVersion") != null && !jsonObj.get("chainCodeVersion").isJsonNull()) && !jsonObj.get("chainCodeVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `chainCodeVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chainCodeVersion").toString())); + } + if ((jsonObj.get("responseStatus") != null && !jsonObj.get("responseStatus").isJsonNull()) && !jsonObj.get("responseStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `responseStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseStatus").toString())); + } + if ((jsonObj.get("rwsetKey") != null && !jsonObj.get("rwsetKey").isJsonNull()) && !jsonObj.get("rwsetKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rwsetKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rwsetKey").toString())); + } + if ((jsonObj.get("rwsetWriteData") != null && !jsonObj.get("rwsetWriteData").isJsonNull()) && !jsonObj.get("rwsetWriteData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rwsetWriteData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rwsetWriteData").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransactionReceiptResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransactionReceiptResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetTransactionReceiptResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransactionReceiptResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransactionReceiptResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransactionReceiptResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransactionReceiptResponse + * @throws IOException if the JSON string is invalid with respect to GetTransactionReceiptResponse + */ + public static GetTransactionReceiptResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransactionReceiptResponse.class); + } + + /** + * Convert an instance of GetTransactionReceiptResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunDelegatedSignTransactionRequest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunDelegatedSignTransactionRequest.java new file mode 100644 index 00000000000..f0dec3c196b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunDelegatedSignTransactionRequest.java @@ -0,0 +1,596 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.FabricContractInvocationType; +import org.openapitools.client.model.RunTransactionResponseType; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunDelegatedSignTransactionRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunDelegatedSignTransactionRequest { + public static final String SERIALIZED_NAME_ENDORSING_PEERS = "endorsingPeers"; + @SerializedName(SERIALIZED_NAME_ENDORSING_PEERS) + private List endorsingPeers; + + public static final String SERIALIZED_NAME_ENDORSING_ORGS = "endorsingOrgs"; + @SerializedName(SERIALIZED_NAME_ENDORSING_ORGS) + private List endorsingOrgs; + + public static final String SERIALIZED_NAME_TRANSIENT_DATA = "transientData"; + @SerializedName(SERIALIZED_NAME_TRANSIENT_DATA) + private Object transientData; + + public static final String SERIALIZED_NAME_SIGNER_CERTIFICATE = "signerCertificate"; + @SerializedName(SERIALIZED_NAME_SIGNER_CERTIFICATE) + private String signerCertificate; + + public static final String SERIALIZED_NAME_SIGNER_MSP_I_D = "signerMspID"; + @SerializedName(SERIALIZED_NAME_SIGNER_MSP_I_D) + private String signerMspID; + + public static final String SERIALIZED_NAME_UNIQUE_TRANSACTION_DATA = "uniqueTransactionData"; + @SerializedName(SERIALIZED_NAME_UNIQUE_TRANSACTION_DATA) + private Object uniqueTransactionData = null; + + public static final String SERIALIZED_NAME_CHANNEL_NAME = "channelName"; + @SerializedName(SERIALIZED_NAME_CHANNEL_NAME) + private String channelName; + + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private FabricContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_RESPONSE_TYPE = "responseType"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPE) + private RunTransactionResponseType responseType; + + public RunDelegatedSignTransactionRequest() { + } + + public RunDelegatedSignTransactionRequest endorsingPeers(List endorsingPeers) { + + this.endorsingPeers = endorsingPeers; + return this; + } + + public RunDelegatedSignTransactionRequest addEndorsingPeersItem(String endorsingPeersItem) { + if (this.endorsingPeers == null) { + this.endorsingPeers = new ArrayList<>(); + } + this.endorsingPeers.add(endorsingPeersItem); + return this; + } + + /** + * An array of endorsing peers (name or url) for the transaction. + * @return endorsingPeers + **/ + @javax.annotation.Nullable + public List getEndorsingPeers() { + return endorsingPeers; + } + + + public void setEndorsingPeers(List endorsingPeers) { + this.endorsingPeers = endorsingPeers; + } + + + public RunDelegatedSignTransactionRequest endorsingOrgs(List endorsingOrgs) { + + this.endorsingOrgs = endorsingOrgs; + return this; + } + + public RunDelegatedSignTransactionRequest addEndorsingOrgsItem(String endorsingOrgsItem) { + if (this.endorsingOrgs == null) { + this.endorsingOrgs = new ArrayList<>(); + } + this.endorsingOrgs.add(endorsingOrgsItem); + return this; + } + + /** + * An array of endorsing organizations (by mspID or issuer org name on certificate) for the transaction. + * @return endorsingOrgs + **/ + @javax.annotation.Nullable + public List getEndorsingOrgs() { + return endorsingOrgs; + } + + + public void setEndorsingOrgs(List endorsingOrgs) { + this.endorsingOrgs = endorsingOrgs; + } + + + public RunDelegatedSignTransactionRequest transientData(Object transientData) { + + this.transientData = transientData; + return this; + } + + /** + * Get transientData + * @return transientData + **/ + @javax.annotation.Nullable + public Object getTransientData() { + return transientData; + } + + + public void setTransientData(Object transientData) { + this.transientData = transientData; + } + + + public RunDelegatedSignTransactionRequest signerCertificate(String signerCertificate) { + + this.signerCertificate = signerCertificate; + return this; + } + + /** + * Get signerCertificate + * @return signerCertificate + **/ + @javax.annotation.Nonnull + public String getSignerCertificate() { + return signerCertificate; + } + + + public void setSignerCertificate(String signerCertificate) { + this.signerCertificate = signerCertificate; + } + + + public RunDelegatedSignTransactionRequest signerMspID(String signerMspID) { + + this.signerMspID = signerMspID; + return this; + } + + /** + * Get signerMspID + * @return signerMspID + **/ + @javax.annotation.Nonnull + public String getSignerMspID() { + return signerMspID; + } + + + public void setSignerMspID(String signerMspID) { + this.signerMspID = signerMspID; + } + + + public RunDelegatedSignTransactionRequest uniqueTransactionData(Object uniqueTransactionData) { + + this.uniqueTransactionData = uniqueTransactionData; + return this; + } + + /** + * Can be used to uniquely identify and authorize signing request + * @return uniqueTransactionData + **/ + @javax.annotation.Nullable + public Object getUniqueTransactionData() { + return uniqueTransactionData; + } + + + public void setUniqueTransactionData(Object uniqueTransactionData) { + this.uniqueTransactionData = uniqueTransactionData; + } + + + public RunDelegatedSignTransactionRequest channelName(String channelName) { + + this.channelName = channelName; + return this; + } + + /** + * Get channelName + * @return channelName + **/ + @javax.annotation.Nonnull + public String getChannelName() { + return channelName; + } + + + public void setChannelName(String channelName) { + this.channelName = channelName; + } + + + public RunDelegatedSignTransactionRequest contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public RunDelegatedSignTransactionRequest invocationType(FabricContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public FabricContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(FabricContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public RunDelegatedSignTransactionRequest methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * Get methodName + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public RunDelegatedSignTransactionRequest params(List params) { + + this.params = params; + return this; + } + + public RunDelegatedSignTransactionRequest addParamsItem(String paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * Get params + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public RunDelegatedSignTransactionRequest responseType(RunTransactionResponseType responseType) { + + this.responseType = responseType; + return this; + } + + /** + * Get responseType + * @return responseType + **/ + @javax.annotation.Nullable + public RunTransactionResponseType getResponseType() { + return responseType; + } + + + public void setResponseType(RunTransactionResponseType responseType) { + this.responseType = responseType; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunDelegatedSignTransactionRequest runDelegatedSignTransactionRequest = (RunDelegatedSignTransactionRequest) o; + return Objects.equals(this.endorsingPeers, runDelegatedSignTransactionRequest.endorsingPeers) && + Objects.equals(this.endorsingOrgs, runDelegatedSignTransactionRequest.endorsingOrgs) && + Objects.equals(this.transientData, runDelegatedSignTransactionRequest.transientData) && + Objects.equals(this.signerCertificate, runDelegatedSignTransactionRequest.signerCertificate) && + Objects.equals(this.signerMspID, runDelegatedSignTransactionRequest.signerMspID) && + Objects.equals(this.uniqueTransactionData, runDelegatedSignTransactionRequest.uniqueTransactionData) && + Objects.equals(this.channelName, runDelegatedSignTransactionRequest.channelName) && + Objects.equals(this.contractName, runDelegatedSignTransactionRequest.contractName) && + Objects.equals(this.invocationType, runDelegatedSignTransactionRequest.invocationType) && + Objects.equals(this.methodName, runDelegatedSignTransactionRequest.methodName) && + Objects.equals(this.params, runDelegatedSignTransactionRequest.params) && + Objects.equals(this.responseType, runDelegatedSignTransactionRequest.responseType); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(endorsingPeers, endorsingOrgs, transientData, signerCertificate, signerMspID, uniqueTransactionData, channelName, contractName, invocationType, methodName, params, responseType); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunDelegatedSignTransactionRequest {\n"); + sb.append(" endorsingPeers: ").append(toIndentedString(endorsingPeers)).append("\n"); + sb.append(" endorsingOrgs: ").append(toIndentedString(endorsingOrgs)).append("\n"); + sb.append(" transientData: ").append(toIndentedString(transientData)).append("\n"); + sb.append(" signerCertificate: ").append(toIndentedString(signerCertificate)).append("\n"); + sb.append(" signerMspID: ").append(toIndentedString(signerMspID)).append("\n"); + sb.append(" uniqueTransactionData: ").append(toIndentedString(uniqueTransactionData)).append("\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" responseType: ").append(toIndentedString(responseType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("endorsingPeers"); + openapiFields.add("endorsingOrgs"); + openapiFields.add("transientData"); + openapiFields.add("signerCertificate"); + openapiFields.add("signerMspID"); + openapiFields.add("uniqueTransactionData"); + openapiFields.add("channelName"); + openapiFields.add("contractName"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("responseType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("signerCertificate"); + openapiRequiredFields.add("signerMspID"); + openapiRequiredFields.add("channelName"); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunDelegatedSignTransactionRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunDelegatedSignTransactionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunDelegatedSignTransactionRequest is not found in the empty JSON string", RunDelegatedSignTransactionRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunDelegatedSignTransactionRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunDelegatedSignTransactionRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunDelegatedSignTransactionRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("endorsingPeers") != null && !jsonObj.get("endorsingPeers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `endorsingPeers` to be an array in the JSON string but got `%s`", jsonObj.get("endorsingPeers").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("endorsingOrgs") != null && !jsonObj.get("endorsingOrgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `endorsingOrgs` to be an array in the JSON string but got `%s`", jsonObj.get("endorsingOrgs").toString())); + } + if (!jsonObj.get("signerCertificate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signerCertificate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signerCertificate").toString())); + } + if (!jsonObj.get("signerMspID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signerMspID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signerMspID").toString())); + } + if (!jsonObj.get("channelName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `channelName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("channelName").toString())); + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunDelegatedSignTransactionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunDelegatedSignTransactionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunDelegatedSignTransactionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunDelegatedSignTransactionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunDelegatedSignTransactionRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunDelegatedSignTransactionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunDelegatedSignTransactionRequest + * @throws IOException if the JSON string is invalid with respect to RunDelegatedSignTransactionRequest + */ + public static RunDelegatedSignTransactionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunDelegatedSignTransactionRequest.class); + } + + /** + * Convert an instance of RunDelegatedSignTransactionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java new file mode 100644 index 00000000000..eb3213093a6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java @@ -0,0 +1,569 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.FabricContractInvocationType; +import org.openapitools.client.model.FabricSigningCredential; +import org.openapitools.client.model.GatewayOptions; +import org.openapitools.client.model.RunTransactionResponseType; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionRequest { + public static final String SERIALIZED_NAME_ENDORSING_PEERS = "endorsingPeers"; + @SerializedName(SERIALIZED_NAME_ENDORSING_PEERS) + private List endorsingPeers; + + public static final String SERIALIZED_NAME_ENDORSING_ORGS = "endorsingOrgs"; + @SerializedName(SERIALIZED_NAME_ENDORSING_ORGS) + private List endorsingOrgs; + + public static final String SERIALIZED_NAME_TRANSIENT_DATA = "transientData"; + @SerializedName(SERIALIZED_NAME_TRANSIENT_DATA) + private Object transientData; + + public static final String SERIALIZED_NAME_GATEWAY_OPTIONS = "gatewayOptions"; + @SerializedName(SERIALIZED_NAME_GATEWAY_OPTIONS) + private GatewayOptions gatewayOptions; + + public static final String SERIALIZED_NAME_SIGNING_CREDENTIAL = "signingCredential"; + @SerializedName(SERIALIZED_NAME_SIGNING_CREDENTIAL) + private FabricSigningCredential signingCredential; + + public static final String SERIALIZED_NAME_CHANNEL_NAME = "channelName"; + @SerializedName(SERIALIZED_NAME_CHANNEL_NAME) + private String channelName; + + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private FabricContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_RESPONSE_TYPE = "responseType"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPE) + private RunTransactionResponseType responseType; + + public RunTransactionRequest() { + } + + public RunTransactionRequest endorsingPeers(List endorsingPeers) { + + this.endorsingPeers = endorsingPeers; + return this; + } + + public RunTransactionRequest addEndorsingPeersItem(String endorsingPeersItem) { + if (this.endorsingPeers == null) { + this.endorsingPeers = new ArrayList<>(); + } + this.endorsingPeers.add(endorsingPeersItem); + return this; + } + + /** + * An array of endorsing peers (name or url) for the transaction. + * @return endorsingPeers + **/ + @javax.annotation.Nullable + public List getEndorsingPeers() { + return endorsingPeers; + } + + + public void setEndorsingPeers(List endorsingPeers) { + this.endorsingPeers = endorsingPeers; + } + + + public RunTransactionRequest endorsingOrgs(List endorsingOrgs) { + + this.endorsingOrgs = endorsingOrgs; + return this; + } + + public RunTransactionRequest addEndorsingOrgsItem(String endorsingOrgsItem) { + if (this.endorsingOrgs == null) { + this.endorsingOrgs = new ArrayList<>(); + } + this.endorsingOrgs.add(endorsingOrgsItem); + return this; + } + + /** + * An array of endorsing organizations (by mspID or issuer org name on certificate) for the transaction. + * @return endorsingOrgs + **/ + @javax.annotation.Nullable + public List getEndorsingOrgs() { + return endorsingOrgs; + } + + + public void setEndorsingOrgs(List endorsingOrgs) { + this.endorsingOrgs = endorsingOrgs; + } + + + public RunTransactionRequest transientData(Object transientData) { + + this.transientData = transientData; + return this; + } + + /** + * Get transientData + * @return transientData + **/ + @javax.annotation.Nullable + public Object getTransientData() { + return transientData; + } + + + public void setTransientData(Object transientData) { + this.transientData = transientData; + } + + + public RunTransactionRequest gatewayOptions(GatewayOptions gatewayOptions) { + + this.gatewayOptions = gatewayOptions; + return this; + } + + /** + * Get gatewayOptions + * @return gatewayOptions + **/ + @javax.annotation.Nullable + public GatewayOptions getGatewayOptions() { + return gatewayOptions; + } + + + public void setGatewayOptions(GatewayOptions gatewayOptions) { + this.gatewayOptions = gatewayOptions; + } + + + public RunTransactionRequest signingCredential(FabricSigningCredential signingCredential) { + + this.signingCredential = signingCredential; + return this; + } + + /** + * Get signingCredential + * @return signingCredential + **/ + @javax.annotation.Nonnull + public FabricSigningCredential getSigningCredential() { + return signingCredential; + } + + + public void setSigningCredential(FabricSigningCredential signingCredential) { + this.signingCredential = signingCredential; + } + + + public RunTransactionRequest channelName(String channelName) { + + this.channelName = channelName; + return this; + } + + /** + * Get channelName + * @return channelName + **/ + @javax.annotation.Nonnull + public String getChannelName() { + return channelName; + } + + + public void setChannelName(String channelName) { + this.channelName = channelName; + } + + + public RunTransactionRequest contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public RunTransactionRequest invocationType(FabricContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public FabricContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(FabricContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public RunTransactionRequest methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * Get methodName + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public RunTransactionRequest params(List params) { + + this.params = params; + return this; + } + + public RunTransactionRequest addParamsItem(String paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * Get params + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public RunTransactionRequest responseType(RunTransactionResponseType responseType) { + + this.responseType = responseType; + return this; + } + + /** + * Get responseType + * @return responseType + **/ + @javax.annotation.Nullable + public RunTransactionResponseType getResponseType() { + return responseType; + } + + + public void setResponseType(RunTransactionResponseType responseType) { + this.responseType = responseType; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionRequest runTransactionRequest = (RunTransactionRequest) o; + return Objects.equals(this.endorsingPeers, runTransactionRequest.endorsingPeers) && + Objects.equals(this.endorsingOrgs, runTransactionRequest.endorsingOrgs) && + Objects.equals(this.transientData, runTransactionRequest.transientData) && + Objects.equals(this.gatewayOptions, runTransactionRequest.gatewayOptions) && + Objects.equals(this.signingCredential, runTransactionRequest.signingCredential) && + Objects.equals(this.channelName, runTransactionRequest.channelName) && + Objects.equals(this.contractName, runTransactionRequest.contractName) && + Objects.equals(this.invocationType, runTransactionRequest.invocationType) && + Objects.equals(this.methodName, runTransactionRequest.methodName) && + Objects.equals(this.params, runTransactionRequest.params) && + Objects.equals(this.responseType, runTransactionRequest.responseType); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(endorsingPeers, endorsingOrgs, transientData, gatewayOptions, signingCredential, channelName, contractName, invocationType, methodName, params, responseType); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionRequest {\n"); + sb.append(" endorsingPeers: ").append(toIndentedString(endorsingPeers)).append("\n"); + sb.append(" endorsingOrgs: ").append(toIndentedString(endorsingOrgs)).append("\n"); + sb.append(" transientData: ").append(toIndentedString(transientData)).append("\n"); + sb.append(" gatewayOptions: ").append(toIndentedString(gatewayOptions)).append("\n"); + sb.append(" signingCredential: ").append(toIndentedString(signingCredential)).append("\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" responseType: ").append(toIndentedString(responseType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("endorsingPeers"); + openapiFields.add("endorsingOrgs"); + openapiFields.add("transientData"); + openapiFields.add("gatewayOptions"); + openapiFields.add("signingCredential"); + openapiFields.add("channelName"); + openapiFields.add("contractName"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("responseType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("signingCredential"); + openapiRequiredFields.add("channelName"); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionRequest is not found in the empty JSON string", RunTransactionRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("endorsingPeers") != null && !jsonObj.get("endorsingPeers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `endorsingPeers` to be an array in the JSON string but got `%s`", jsonObj.get("endorsingPeers").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("endorsingOrgs") != null && !jsonObj.get("endorsingOrgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `endorsingOrgs` to be an array in the JSON string but got `%s`", jsonObj.get("endorsingOrgs").toString())); + } + // validate the optional field `gatewayOptions` + if (jsonObj.get("gatewayOptions") != null && !jsonObj.get("gatewayOptions").isJsonNull()) { + GatewayOptions.validateJsonObject(jsonObj.getAsJsonObject("gatewayOptions")); + } + // validate the required field `signingCredential` + FabricSigningCredential.validateJsonObject(jsonObj.getAsJsonObject("signingCredential")); + if (!jsonObj.get("channelName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `channelName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("channelName").toString())); + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionRequest + * @throws IOException if the JSON string is invalid with respect to RunTransactionRequest + */ + public static RunTransactionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionRequest.class); + } + + /** + * Convert an instance of RunTransactionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java new file mode 100644 index 00000000000..f498ceb6702 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionResponse { + public static final String SERIALIZED_NAME_FUNCTION_OUTPUT = "functionOutput"; + @SerializedName(SERIALIZED_NAME_FUNCTION_OUTPUT) + private String functionOutput; + + public static final String SERIALIZED_NAME_TRANSACTION_ID = "transactionId"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_ID) + private String transactionId; + + public RunTransactionResponse() { + } + + public RunTransactionResponse functionOutput(String functionOutput) { + + this.functionOutput = functionOutput; + return this; + } + + /** + * Get functionOutput + * @return functionOutput + **/ + @javax.annotation.Nonnull + public String getFunctionOutput() { + return functionOutput; + } + + + public void setFunctionOutput(String functionOutput) { + this.functionOutput = functionOutput; + } + + + public RunTransactionResponse transactionId(String transactionId) { + + this.transactionId = transactionId; + return this; + } + + /** + * Get transactionId + * @return transactionId + **/ + @javax.annotation.Nonnull + public String getTransactionId() { + return transactionId; + } + + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionResponse runTransactionResponse = (RunTransactionResponse) o; + return Objects.equals(this.functionOutput, runTransactionResponse.functionOutput) && + Objects.equals(this.transactionId, runTransactionResponse.transactionId); + } + + @Override + public int hashCode() { + return Objects.hash(functionOutput, transactionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionResponse {\n"); + sb.append(" functionOutput: ").append(toIndentedString(functionOutput)).append("\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("functionOutput"); + openapiFields.add("transactionId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("functionOutput"); + openapiRequiredFields.add("transactionId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionResponse is not found in the empty JSON string", RunTransactionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("functionOutput").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `functionOutput` to be a primitive type in the JSON string but got `%s`", jsonObj.get("functionOutput").toString())); + } + if (!jsonObj.get("transactionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionResponse + * @throws IOException if the JSON string is invalid with respect to RunTransactionResponse + */ + public static RunTransactionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionResponse.class); + } + + /** + * Convert an instance of RunTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponseType.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponseType.java new file mode 100644 index 00000000000..104fe3becd0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponseType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Response format from transaction / query execution + */ +@JsonAdapter(RunTransactionResponseType.Adapter.class) +public enum RunTransactionResponseType { + + JSON("org.hyperledger.cacti.api.hlfabric.RunTransactionResponseType.JSON"), + + UTF8("org.hyperledger.cacti.api.hlfabric.RunTransactionResponseType.UTF8"); + + private String value; + + RunTransactionResponseType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RunTransactionResponseType fromValue(String value) { + for (RunTransactionResponseType b : RunTransactionResponseType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RunTransactionResponseType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RunTransactionResponseType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RunTransactionResponseType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SSHExecCommandResponse.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SSHExecCommandResponse.java new file mode 100644 index 00000000000..889849439af --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SSHExecCommandResponse.java @@ -0,0 +1,309 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SSHExecCommandResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SSHExecCommandResponse { + public static final String SERIALIZED_NAME_STDOUT = "stdout"; + @SerializedName(SERIALIZED_NAME_STDOUT) + private String stdout; + + public static final String SERIALIZED_NAME_STDERR = "stderr"; + @SerializedName(SERIALIZED_NAME_STDERR) + private String stderr; + + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private Integer code; + + public static final String SERIALIZED_NAME_SIGNAL = "signal"; + @SerializedName(SERIALIZED_NAME_SIGNAL) + private String signal; + + public SSHExecCommandResponse() { + } + + public SSHExecCommandResponse stdout(String stdout) { + + this.stdout = stdout; + return this; + } + + /** + * Get stdout + * @return stdout + **/ + @javax.annotation.Nonnull + public String getStdout() { + return stdout; + } + + + public void setStdout(String stdout) { + this.stdout = stdout; + } + + + public SSHExecCommandResponse stderr(String stderr) { + + this.stderr = stderr; + return this; + } + + /** + * Get stderr + * @return stderr + **/ + @javax.annotation.Nonnull + public String getStderr() { + return stderr; + } + + + public void setStderr(String stderr) { + this.stderr = stderr; + } + + + public SSHExecCommandResponse code(Integer code) { + + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @javax.annotation.Nullable + public Integer getCode() { + return code; + } + + + public void setCode(Integer code) { + this.code = code; + } + + + public SSHExecCommandResponse signal(String signal) { + + this.signal = signal; + return this; + } + + /** + * Get signal + * @return signal + **/ + @javax.annotation.Nullable + public String getSignal() { + return signal; + } + + + public void setSignal(String signal) { + this.signal = signal; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SSHExecCommandResponse ssHExecCommandResponse = (SSHExecCommandResponse) o; + return Objects.equals(this.stdout, ssHExecCommandResponse.stdout) && + Objects.equals(this.stderr, ssHExecCommandResponse.stderr) && + Objects.equals(this.code, ssHExecCommandResponse.code) && + Objects.equals(this.signal, ssHExecCommandResponse.signal); + } + + @Override + public int hashCode() { + return Objects.hash(stdout, stderr, code, signal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SSHExecCommandResponse {\n"); + sb.append(" stdout: ").append(toIndentedString(stdout)).append("\n"); + sb.append(" stderr: ").append(toIndentedString(stderr)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" signal: ").append(toIndentedString(signal)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stdout"); + openapiFields.add("stderr"); + openapiFields.add("code"); + openapiFields.add("signal"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("stdout"); + openapiRequiredFields.add("stderr"); + openapiRequiredFields.add("code"); + openapiRequiredFields.add("signal"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SSHExecCommandResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SSHExecCommandResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SSHExecCommandResponse is not found in the empty JSON string", SSHExecCommandResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SSHExecCommandResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SSHExecCommandResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SSHExecCommandResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("stdout").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stdout` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stdout").toString())); + } + if (!jsonObj.get("stderr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stderr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stderr").toString())); + } + if (!jsonObj.get("signal").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signal` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signal").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SSHExecCommandResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SSHExecCommandResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SSHExecCommandResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SSHExecCommandResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SSHExecCommandResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SSHExecCommandResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SSHExecCommandResponse + * @throws IOException if the JSON string is invalid with respect to SSHExecCommandResponse + */ + public static SSHExecCommandResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SSHExecCommandResponse.class); + } + + /** + * Convert an instance of SSHExecCommandResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptBlockMetaData.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptBlockMetaData.java new file mode 100644 index 00000000000..2288e514171 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptBlockMetaData.java @@ -0,0 +1,270 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TransactReceiptBlockMetaData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransactReceiptBlockMetaData { + public static final String SERIALIZED_NAME_MSPID = "mspid"; + @SerializedName(SERIALIZED_NAME_MSPID) + private String mspid; + + public static final String SERIALIZED_NAME_BLOCK_CREATOR_I_D = "blockCreatorID"; + @SerializedName(SERIALIZED_NAME_BLOCK_CREATOR_I_D) + private String blockCreatorID; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public TransactReceiptBlockMetaData() { + } + + public TransactReceiptBlockMetaData mspid(String mspid) { + + this.mspid = mspid; + return this; + } + + /** + * Get mspid + * @return mspid + **/ + @javax.annotation.Nullable + public String getMspid() { + return mspid; + } + + + public void setMspid(String mspid) { + this.mspid = mspid; + } + + + public TransactReceiptBlockMetaData blockCreatorID(String blockCreatorID) { + + this.blockCreatorID = blockCreatorID; + return this; + } + + /** + * Get blockCreatorID + * @return blockCreatorID + **/ + @javax.annotation.Nullable + public String getBlockCreatorID() { + return blockCreatorID; + } + + + public void setBlockCreatorID(String blockCreatorID) { + this.blockCreatorID = blockCreatorID; + } + + + public TransactReceiptBlockMetaData signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nullable + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactReceiptBlockMetaData transactReceiptBlockMetaData = (TransactReceiptBlockMetaData) o; + return Objects.equals(this.mspid, transactReceiptBlockMetaData.mspid) && + Objects.equals(this.blockCreatorID, transactReceiptBlockMetaData.blockCreatorID) && + Objects.equals(this.signature, transactReceiptBlockMetaData.signature); + } + + @Override + public int hashCode() { + return Objects.hash(mspid, blockCreatorID, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactReceiptBlockMetaData {\n"); + sb.append(" mspid: ").append(toIndentedString(mspid)).append("\n"); + sb.append(" blockCreatorID: ").append(toIndentedString(blockCreatorID)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("mspid"); + openapiFields.add("blockCreatorID"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransactReceiptBlockMetaData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransactReceiptBlockMetaData.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransactReceiptBlockMetaData is not found in the empty JSON string", TransactReceiptBlockMetaData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransactReceiptBlockMetaData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactReceiptBlockMetaData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("mspid") != null && !jsonObj.get("mspid").isJsonNull()) && !jsonObj.get("mspid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mspid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mspid").toString())); + } + if ((jsonObj.get("blockCreatorID") != null && !jsonObj.get("blockCreatorID").isJsonNull()) && !jsonObj.get("blockCreatorID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockCreatorID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockCreatorID").toString())); + } + if ((jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactReceiptBlockMetaData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactReceiptBlockMetaData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactReceiptBlockMetaData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactReceiptBlockMetaData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactReceiptBlockMetaData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactReceiptBlockMetaData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactReceiptBlockMetaData + * @throws IOException if the JSON string is invalid with respect to TransactReceiptBlockMetaData + */ + public static TransactReceiptBlockMetaData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactReceiptBlockMetaData.class); + } + + /** + * Convert an instance of TransactReceiptBlockMetaData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptTransactionCreator.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptTransactionCreator.java new file mode 100644 index 00000000000..c77bcce334a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptTransactionCreator.java @@ -0,0 +1,239 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TransactReceiptTransactionCreator + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransactReceiptTransactionCreator { + public static final String SERIALIZED_NAME_MSPID = "mspid"; + @SerializedName(SERIALIZED_NAME_MSPID) + private String mspid; + + public static final String SERIALIZED_NAME_CREATOR_I_D = "creatorID"; + @SerializedName(SERIALIZED_NAME_CREATOR_I_D) + private String creatorID; + + public TransactReceiptTransactionCreator() { + } + + public TransactReceiptTransactionCreator mspid(String mspid) { + + this.mspid = mspid; + return this; + } + + /** + * Get mspid + * @return mspid + **/ + @javax.annotation.Nullable + public String getMspid() { + return mspid; + } + + + public void setMspid(String mspid) { + this.mspid = mspid; + } + + + public TransactReceiptTransactionCreator creatorID(String creatorID) { + + this.creatorID = creatorID; + return this; + } + + /** + * Get creatorID + * @return creatorID + **/ + @javax.annotation.Nullable + public String getCreatorID() { + return creatorID; + } + + + public void setCreatorID(String creatorID) { + this.creatorID = creatorID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactReceiptTransactionCreator transactReceiptTransactionCreator = (TransactReceiptTransactionCreator) o; + return Objects.equals(this.mspid, transactReceiptTransactionCreator.mspid) && + Objects.equals(this.creatorID, transactReceiptTransactionCreator.creatorID); + } + + @Override + public int hashCode() { + return Objects.hash(mspid, creatorID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactReceiptTransactionCreator {\n"); + sb.append(" mspid: ").append(toIndentedString(mspid)).append("\n"); + sb.append(" creatorID: ").append(toIndentedString(creatorID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("mspid"); + openapiFields.add("creatorID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransactReceiptTransactionCreator + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransactReceiptTransactionCreator.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransactReceiptTransactionCreator is not found in the empty JSON string", TransactReceiptTransactionCreator.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransactReceiptTransactionCreator.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactReceiptTransactionCreator` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("mspid") != null && !jsonObj.get("mspid").isJsonNull()) && !jsonObj.get("mspid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mspid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mspid").toString())); + } + if ((jsonObj.get("creatorID") != null && !jsonObj.get("creatorID").isJsonNull()) && !jsonObj.get("creatorID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `creatorID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactReceiptTransactionCreator.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactReceiptTransactionCreator' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactReceiptTransactionCreator.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactReceiptTransactionCreator value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactReceiptTransactionCreator read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactReceiptTransactionCreator given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactReceiptTransactionCreator + * @throws IOException if the JSON string is invalid with respect to TransactReceiptTransactionCreator + */ + public static TransactReceiptTransactionCreator fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactReceiptTransactionCreator.class); + } + + /** + * Convert an instance of TransactReceiptTransactionCreator to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptTransactionEndorsement.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptTransactionEndorsement.java new file mode 100644 index 00000000000..20209562906 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactReceiptTransactionEndorsement.java @@ -0,0 +1,270 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TransactReceiptTransactionEndorsement + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransactReceiptTransactionEndorsement { + public static final String SERIALIZED_NAME_MSPID = "mspid"; + @SerializedName(SERIALIZED_NAME_MSPID) + private String mspid; + + public static final String SERIALIZED_NAME_ENDORSER_I_D = "endorserID"; + @SerializedName(SERIALIZED_NAME_ENDORSER_I_D) + private String endorserID; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public TransactReceiptTransactionEndorsement() { + } + + public TransactReceiptTransactionEndorsement mspid(String mspid) { + + this.mspid = mspid; + return this; + } + + /** + * Get mspid + * @return mspid + **/ + @javax.annotation.Nullable + public String getMspid() { + return mspid; + } + + + public void setMspid(String mspid) { + this.mspid = mspid; + } + + + public TransactReceiptTransactionEndorsement endorserID(String endorserID) { + + this.endorserID = endorserID; + return this; + } + + /** + * Get endorserID + * @return endorserID + **/ + @javax.annotation.Nullable + public String getEndorserID() { + return endorserID; + } + + + public void setEndorserID(String endorserID) { + this.endorserID = endorserID; + } + + + public TransactReceiptTransactionEndorsement signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nullable + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactReceiptTransactionEndorsement transactReceiptTransactionEndorsement = (TransactReceiptTransactionEndorsement) o; + return Objects.equals(this.mspid, transactReceiptTransactionEndorsement.mspid) && + Objects.equals(this.endorserID, transactReceiptTransactionEndorsement.endorserID) && + Objects.equals(this.signature, transactReceiptTransactionEndorsement.signature); + } + + @Override + public int hashCode() { + return Objects.hash(mspid, endorserID, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactReceiptTransactionEndorsement {\n"); + sb.append(" mspid: ").append(toIndentedString(mspid)).append("\n"); + sb.append(" endorserID: ").append(toIndentedString(endorserID)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("mspid"); + openapiFields.add("endorserID"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransactReceiptTransactionEndorsement + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransactReceiptTransactionEndorsement.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransactReceiptTransactionEndorsement is not found in the empty JSON string", TransactReceiptTransactionEndorsement.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransactReceiptTransactionEndorsement.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactReceiptTransactionEndorsement` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("mspid") != null && !jsonObj.get("mspid").isJsonNull()) && !jsonObj.get("mspid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mspid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mspid").toString())); + } + if ((jsonObj.get("endorserID") != null && !jsonObj.get("endorserID").isJsonNull()) && !jsonObj.get("endorserID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `endorserID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endorserID").toString())); + } + if ((jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactReceiptTransactionEndorsement.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactReceiptTransactionEndorsement' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactReceiptTransactionEndorsement.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactReceiptTransactionEndorsement value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactReceiptTransactionEndorsement read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactReceiptTransactionEndorsement given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactReceiptTransactionEndorsement + * @throws IOException if the JSON string is invalid with respect to TransactReceiptTransactionEndorsement + */ + public static TransactReceiptTransactionEndorsement fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactReceiptTransactionEndorsement.class); + } + + /** + * Convert an instance of TransactReceiptTransactionEndorsement to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/VaultTransitKey.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/VaultTransitKey.java new file mode 100644 index 00000000000..aedda10fa80 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/VaultTransitKey.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * vault key details for signing fabric message with private key stored with transit engine. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class VaultTransitKey { + public static final String SERIALIZED_NAME_KEY_NAME = "keyName"; + @SerializedName(SERIALIZED_NAME_KEY_NAME) + private String keyName; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + private String token; + + public VaultTransitKey() { + } + + public VaultTransitKey keyName(String keyName) { + + this.keyName = keyName; + return this; + } + + /** + * label of private key + * @return keyName + **/ + @javax.annotation.Nonnull + public String getKeyName() { + return keyName; + } + + + public void setKeyName(String keyName) { + this.keyName = keyName; + } + + + public VaultTransitKey token(String token) { + + this.token = token; + return this; + } + + /** + * token for accessing private key + * @return token + **/ + @javax.annotation.Nonnull + public String getToken() { + return token; + } + + + public void setToken(String token) { + this.token = token; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VaultTransitKey vaultTransitKey = (VaultTransitKey) o; + return Objects.equals(this.keyName, vaultTransitKey.keyName) && + Objects.equals(this.token, vaultTransitKey.token); + } + + @Override + public int hashCode() { + return Objects.hash(keyName, token); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VaultTransitKey {\n"); + sb.append(" keyName: ").append(toIndentedString(keyName)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("keyName"); + openapiFields.add("token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("keyName"); + openapiRequiredFields.add("token"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to VaultTransitKey + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!VaultTransitKey.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in VaultTransitKey is not found in the empty JSON string", VaultTransitKey.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!VaultTransitKey.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VaultTransitKey` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : VaultTransitKey.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("keyName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keyName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keyName").toString())); + } + if (!jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VaultTransitKey.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VaultTransitKey' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VaultTransitKey.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, VaultTransitKey value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VaultTransitKey read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VaultTransitKey given an JSON string + * + * @param jsonString JSON string + * @return An instance of VaultTransitKey + * @throws IOException if the JSON string is invalid with respect to VaultTransitKey + */ + public static VaultTransitKey fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VaultTransitKey.class); + } + + /** + * Convert an instance of VaultTransitKey to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1.java new file mode 100644 index 00000000000..189f2d092ea --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1.java @@ -0,0 +1,246 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Error response from WatchBlocks operation. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksCactusErrorResponseV1 { + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private BigDecimal code; + + public static final String SERIALIZED_NAME_ERROR_MESSAGE = "errorMessage"; + @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) + private String errorMessage; + + public WatchBlocksCactusErrorResponseV1() { + } + + public WatchBlocksCactusErrorResponseV1 code(BigDecimal code) { + + this.code = code; + return this; + } + + /** + * Error code. + * @return code + **/ + @javax.annotation.Nonnull + public BigDecimal getCode() { + return code; + } + + + public void setCode(BigDecimal code) { + this.code = code; + } + + + public WatchBlocksCactusErrorResponseV1 errorMessage(String errorMessage) { + + this.errorMessage = errorMessage; + return this; + } + + /** + * Description of the error. + * @return errorMessage + **/ + @javax.annotation.Nonnull + public String getErrorMessage() { + return errorMessage; + } + + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksCactusErrorResponseV1 watchBlocksCactusErrorResponseV1 = (WatchBlocksCactusErrorResponseV1) o; + return Objects.equals(this.code, watchBlocksCactusErrorResponseV1.code) && + Objects.equals(this.errorMessage, watchBlocksCactusErrorResponseV1.errorMessage); + } + + @Override + public int hashCode() { + return Objects.hash(code, errorMessage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksCactusErrorResponseV1 {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("errorMessage"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("code"); + openapiRequiredFields.add("errorMessage"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksCactusErrorResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksCactusErrorResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksCactusErrorResponseV1 is not found in the empty JSON string", WatchBlocksCactusErrorResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksCactusErrorResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksCactusErrorResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksCactusErrorResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("errorMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorMessage").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksCactusErrorResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksCactusErrorResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksCactusErrorResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksCactusErrorResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksCactusErrorResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksCactusErrorResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksCactusErrorResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksCactusErrorResponseV1 + */ + public static WatchBlocksCactusErrorResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksCactusErrorResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksCactusErrorResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1.java new file mode 100644 index 00000000000..e7c53400c27 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1.java @@ -0,0 +1,325 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Transaction summary from commited block. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksCactusTransactionsEventV1 { + public static final String SERIALIZED_NAME_CHAINCODE_ID = "chaincodeId"; + @SerializedName(SERIALIZED_NAME_CHAINCODE_ID) + private String chaincodeId; + + public static final String SERIALIZED_NAME_TRANSACTION_ID = "transactionId"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_ID) + private String transactionId; + + public static final String SERIALIZED_NAME_FUNCTION_NAME = "functionName"; + @SerializedName(SERIALIZED_NAME_FUNCTION_NAME) + private String functionName; + + public static final String SERIALIZED_NAME_FUNCTION_ARGS = "functionArgs"; + @SerializedName(SERIALIZED_NAME_FUNCTION_ARGS) + private List functionArgs = new ArrayList<>(); + + public WatchBlocksCactusTransactionsEventV1() { + } + + public WatchBlocksCactusTransactionsEventV1 chaincodeId(String chaincodeId) { + + this.chaincodeId = chaincodeId; + return this; + } + + /** + * ChainCode containing function that was executed. + * @return chaincodeId + **/ + @javax.annotation.Nonnull + public String getChaincodeId() { + return chaincodeId; + } + + + public void setChaincodeId(String chaincodeId) { + this.chaincodeId = chaincodeId; + } + + + public WatchBlocksCactusTransactionsEventV1 transactionId(String transactionId) { + + this.transactionId = transactionId; + return this; + } + + /** + * Transaction identifier. + * @return transactionId + **/ + @javax.annotation.Nonnull + public String getTransactionId() { + return transactionId; + } + + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + + public WatchBlocksCactusTransactionsEventV1 functionName(String functionName) { + + this.functionName = functionName; + return this; + } + + /** + * Function name that was executed. + * @return functionName + **/ + @javax.annotation.Nonnull + public String getFunctionName() { + return functionName; + } + + + public void setFunctionName(String functionName) { + this.functionName = functionName; + } + + + public WatchBlocksCactusTransactionsEventV1 functionArgs(List functionArgs) { + + this.functionArgs = functionArgs; + return this; + } + + public WatchBlocksCactusTransactionsEventV1 addFunctionArgsItem(String functionArgsItem) { + if (this.functionArgs == null) { + this.functionArgs = new ArrayList<>(); + } + this.functionArgs.add(functionArgsItem); + return this; + } + + /** + * List of function arguments. + * @return functionArgs + **/ + @javax.annotation.Nonnull + public List getFunctionArgs() { + return functionArgs; + } + + + public void setFunctionArgs(List functionArgs) { + this.functionArgs = functionArgs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksCactusTransactionsEventV1 watchBlocksCactusTransactionsEventV1 = (WatchBlocksCactusTransactionsEventV1) o; + return Objects.equals(this.chaincodeId, watchBlocksCactusTransactionsEventV1.chaincodeId) && + Objects.equals(this.transactionId, watchBlocksCactusTransactionsEventV1.transactionId) && + Objects.equals(this.functionName, watchBlocksCactusTransactionsEventV1.functionName) && + Objects.equals(this.functionArgs, watchBlocksCactusTransactionsEventV1.functionArgs); + } + + @Override + public int hashCode() { + return Objects.hash(chaincodeId, transactionId, functionName, functionArgs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksCactusTransactionsEventV1 {\n"); + sb.append(" chaincodeId: ").append(toIndentedString(chaincodeId)).append("\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); + sb.append(" functionArgs: ").append(toIndentedString(functionArgs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("chaincodeId"); + openapiFields.add("transactionId"); + openapiFields.add("functionName"); + openapiFields.add("functionArgs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("chaincodeId"); + openapiRequiredFields.add("transactionId"); + openapiRequiredFields.add("functionName"); + openapiRequiredFields.add("functionArgs"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksCactusTransactionsEventV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksCactusTransactionsEventV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksCactusTransactionsEventV1 is not found in the empty JSON string", WatchBlocksCactusTransactionsEventV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksCactusTransactionsEventV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksCactusTransactionsEventV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksCactusTransactionsEventV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("chaincodeId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `chaincodeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chaincodeId").toString())); + } + if (!jsonObj.get("transactionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionId").toString())); + } + if (!jsonObj.get("functionName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `functionName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("functionName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("functionArgs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("functionArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `functionArgs` to be an array in the JSON string but got `%s`", jsonObj.get("functionArgs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksCactusTransactionsEventV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksCactusTransactionsEventV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksCactusTransactionsEventV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksCactusTransactionsEventV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksCactusTransactionsEventV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksCactusTransactionsEventV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksCactusTransactionsEventV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksCactusTransactionsEventV1 + */ + public static WatchBlocksCactusTransactionsEventV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksCactusTransactionsEventV1.class); + } + + /** + * Convert an instance of WatchBlocksCactusTransactionsEventV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1.java new file mode 100644 index 00000000000..1f5f56a102e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1.java @@ -0,0 +1,234 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.WatchBlocksCactusTransactionsEventV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Custom response containing block transactions summary. Compatible with legacy fabric-socketio connector monitoring. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksCactusTransactionsResponseV1 { + public static final String SERIALIZED_NAME_CACTUS_TRANSACTIONS_EVENTS = "cactusTransactionsEvents"; + @SerializedName(SERIALIZED_NAME_CACTUS_TRANSACTIONS_EVENTS) + private List cactusTransactionsEvents = new ArrayList<>(); + + public WatchBlocksCactusTransactionsResponseV1() { + } + + public WatchBlocksCactusTransactionsResponseV1 cactusTransactionsEvents(List cactusTransactionsEvents) { + + this.cactusTransactionsEvents = cactusTransactionsEvents; + return this; + } + + public WatchBlocksCactusTransactionsResponseV1 addCactusTransactionsEventsItem(WatchBlocksCactusTransactionsEventV1 cactusTransactionsEventsItem) { + if (this.cactusTransactionsEvents == null) { + this.cactusTransactionsEvents = new ArrayList<>(); + } + this.cactusTransactionsEvents.add(cactusTransactionsEventsItem); + return this; + } + + /** + * List of transactions summary + * @return cactusTransactionsEvents + **/ + @javax.annotation.Nonnull + public List getCactusTransactionsEvents() { + return cactusTransactionsEvents; + } + + + public void setCactusTransactionsEvents(List cactusTransactionsEvents) { + this.cactusTransactionsEvents = cactusTransactionsEvents; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksCactusTransactionsResponseV1 watchBlocksCactusTransactionsResponseV1 = (WatchBlocksCactusTransactionsResponseV1) o; + return Objects.equals(this.cactusTransactionsEvents, watchBlocksCactusTransactionsResponseV1.cactusTransactionsEvents); + } + + @Override + public int hashCode() { + return Objects.hash(cactusTransactionsEvents); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksCactusTransactionsResponseV1 {\n"); + sb.append(" cactusTransactionsEvents: ").append(toIndentedString(cactusTransactionsEvents)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cactusTransactionsEvents"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("cactusTransactionsEvents"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksCactusTransactionsResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksCactusTransactionsResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksCactusTransactionsResponseV1 is not found in the empty JSON string", WatchBlocksCactusTransactionsResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksCactusTransactionsResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksCactusTransactionsResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksCactusTransactionsResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("cactusTransactionsEvents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `cactusTransactionsEvents` to be an array in the JSON string but got `%s`", jsonObj.get("cactusTransactionsEvents").toString())); + } + + JsonArray jsonArraycactusTransactionsEvents = jsonObj.getAsJsonArray("cactusTransactionsEvents"); + // validate the required field `cactusTransactionsEvents` (array) + for (int i = 0; i < jsonArraycactusTransactionsEvents.size(); i++) { + WatchBlocksCactusTransactionsEventV1.validateJsonObject(jsonArraycactusTransactionsEvents.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksCactusTransactionsResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksCactusTransactionsResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksCactusTransactionsResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksCactusTransactionsResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksCactusTransactionsResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksCactusTransactionsResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksCactusTransactionsResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksCactusTransactionsResponseV1 + */ + public static WatchBlocksCactusTransactionsResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksCactusTransactionsResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksCactusTransactionsResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksDelegatedSignOptionsV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksDelegatedSignOptionsV1.java new file mode 100644 index 00000000000..f7078e89557 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksDelegatedSignOptionsV1.java @@ -0,0 +1,381 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.WatchBlocksListenerTypeV1; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Options passed when subscribing to block monitoring with delegated signing. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksDelegatedSignOptionsV1 { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private WatchBlocksListenerTypeV1 type; + + public static final String SERIALIZED_NAME_START_BLOCK = "startBlock"; + @SerializedName(SERIALIZED_NAME_START_BLOCK) + private String startBlock; + + public static final String SERIALIZED_NAME_CHANNEL_NAME = "channelName"; + @SerializedName(SERIALIZED_NAME_CHANNEL_NAME) + private String channelName; + + public static final String SERIALIZED_NAME_SIGNER_CERTIFICATE = "signerCertificate"; + @SerializedName(SERIALIZED_NAME_SIGNER_CERTIFICATE) + private String signerCertificate; + + public static final String SERIALIZED_NAME_SIGNER_MSP_I_D = "signerMspID"; + @SerializedName(SERIALIZED_NAME_SIGNER_MSP_I_D) + private String signerMspID; + + public static final String SERIALIZED_NAME_UNIQUE_TRANSACTION_DATA = "uniqueTransactionData"; + @SerializedName(SERIALIZED_NAME_UNIQUE_TRANSACTION_DATA) + private Object uniqueTransactionData = null; + + public WatchBlocksDelegatedSignOptionsV1() { + } + + public WatchBlocksDelegatedSignOptionsV1 type(WatchBlocksListenerTypeV1 type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public WatchBlocksListenerTypeV1 getType() { + return type; + } + + + public void setType(WatchBlocksListenerTypeV1 type) { + this.type = type; + } + + + public WatchBlocksDelegatedSignOptionsV1 startBlock(String startBlock) { + + this.startBlock = startBlock; + return this; + } + + /** + * From which block start monitoring. Defaults to latest. + * @return startBlock + **/ + @javax.annotation.Nullable + public String getStartBlock() { + return startBlock; + } + + + public void setStartBlock(String startBlock) { + this.startBlock = startBlock; + } + + + public WatchBlocksDelegatedSignOptionsV1 channelName(String channelName) { + + this.channelName = channelName; + return this; + } + + /** + * Get channelName + * @return channelName + **/ + @javax.annotation.Nonnull + public String getChannelName() { + return channelName; + } + + + public void setChannelName(String channelName) { + this.channelName = channelName; + } + + + public WatchBlocksDelegatedSignOptionsV1 signerCertificate(String signerCertificate) { + + this.signerCertificate = signerCertificate; + return this; + } + + /** + * Get signerCertificate + * @return signerCertificate + **/ + @javax.annotation.Nonnull + public String getSignerCertificate() { + return signerCertificate; + } + + + public void setSignerCertificate(String signerCertificate) { + this.signerCertificate = signerCertificate; + } + + + public WatchBlocksDelegatedSignOptionsV1 signerMspID(String signerMspID) { + + this.signerMspID = signerMspID; + return this; + } + + /** + * Get signerMspID + * @return signerMspID + **/ + @javax.annotation.Nonnull + public String getSignerMspID() { + return signerMspID; + } + + + public void setSignerMspID(String signerMspID) { + this.signerMspID = signerMspID; + } + + + public WatchBlocksDelegatedSignOptionsV1 uniqueTransactionData(Object uniqueTransactionData) { + + this.uniqueTransactionData = uniqueTransactionData; + return this; + } + + /** + * Can be used to uniquely identify and authorize signing request + * @return uniqueTransactionData + **/ + @javax.annotation.Nullable + public Object getUniqueTransactionData() { + return uniqueTransactionData; + } + + + public void setUniqueTransactionData(Object uniqueTransactionData) { + this.uniqueTransactionData = uniqueTransactionData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksDelegatedSignOptionsV1 watchBlocksDelegatedSignOptionsV1 = (WatchBlocksDelegatedSignOptionsV1) o; + return Objects.equals(this.type, watchBlocksDelegatedSignOptionsV1.type) && + Objects.equals(this.startBlock, watchBlocksDelegatedSignOptionsV1.startBlock) && + Objects.equals(this.channelName, watchBlocksDelegatedSignOptionsV1.channelName) && + Objects.equals(this.signerCertificate, watchBlocksDelegatedSignOptionsV1.signerCertificate) && + Objects.equals(this.signerMspID, watchBlocksDelegatedSignOptionsV1.signerMspID) && + Objects.equals(this.uniqueTransactionData, watchBlocksDelegatedSignOptionsV1.uniqueTransactionData); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(type, startBlock, channelName, signerCertificate, signerMspID, uniqueTransactionData); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksDelegatedSignOptionsV1 {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" startBlock: ").append(toIndentedString(startBlock)).append("\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" signerCertificate: ").append(toIndentedString(signerCertificate)).append("\n"); + sb.append(" signerMspID: ").append(toIndentedString(signerMspID)).append("\n"); + sb.append(" uniqueTransactionData: ").append(toIndentedString(uniqueTransactionData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("startBlock"); + openapiFields.add("channelName"); + openapiFields.add("signerCertificate"); + openapiFields.add("signerMspID"); + openapiFields.add("uniqueTransactionData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("channelName"); + openapiRequiredFields.add("signerCertificate"); + openapiRequiredFields.add("signerMspID"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksDelegatedSignOptionsV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksDelegatedSignOptionsV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksDelegatedSignOptionsV1 is not found in the empty JSON string", WatchBlocksDelegatedSignOptionsV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksDelegatedSignOptionsV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksDelegatedSignOptionsV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksDelegatedSignOptionsV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("startBlock") != null && !jsonObj.get("startBlock").isJsonNull()) && !jsonObj.get("startBlock").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `startBlock` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startBlock").toString())); + } + if (!jsonObj.get("channelName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `channelName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("channelName").toString())); + } + if (!jsonObj.get("signerCertificate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signerCertificate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signerCertificate").toString())); + } + if (!jsonObj.get("signerMspID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signerMspID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signerMspID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksDelegatedSignOptionsV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksDelegatedSignOptionsV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksDelegatedSignOptionsV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksDelegatedSignOptionsV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksDelegatedSignOptionsV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksDelegatedSignOptionsV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksDelegatedSignOptionsV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksDelegatedSignOptionsV1 + */ + public static WatchBlocksDelegatedSignOptionsV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksDelegatedSignOptionsV1.class); + } + + /** + * Convert an instance of WatchBlocksDelegatedSignOptionsV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1.java new file mode 100644 index 00000000000..d01ecc42150 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Response that corresponds to Fabric SDK 'filtered' EventType. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksFilteredResponseV1 { + public static final String SERIALIZED_NAME_FILTERED_BLOCK = "filteredBlock"; + @SerializedName(SERIALIZED_NAME_FILTERED_BLOCK) + private Object filteredBlock = null; + + public WatchBlocksFilteredResponseV1() { + } + + public WatchBlocksFilteredResponseV1 filteredBlock(Object filteredBlock) { + + this.filteredBlock = filteredBlock; + return this; + } + + /** + * Filtered commited block. + * @return filteredBlock + **/ + @javax.annotation.Nullable + public Object getFilteredBlock() { + return filteredBlock; + } + + + public void setFilteredBlock(Object filteredBlock) { + this.filteredBlock = filteredBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksFilteredResponseV1 watchBlocksFilteredResponseV1 = (WatchBlocksFilteredResponseV1) o; + return Objects.equals(this.filteredBlock, watchBlocksFilteredResponseV1.filteredBlock); + } + + @Override + public int hashCode() { + return Objects.hash(filteredBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksFilteredResponseV1 {\n"); + sb.append(" filteredBlock: ").append(toIndentedString(filteredBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("filteredBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("filteredBlock"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksFilteredResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksFilteredResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksFilteredResponseV1 is not found in the empty JSON string", WatchBlocksFilteredResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksFilteredResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksFilteredResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksFilteredResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksFilteredResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksFilteredResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksFilteredResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksFilteredResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksFilteredResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksFilteredResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksFilteredResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksFilteredResponseV1 + */ + public static WatchBlocksFilteredResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksFilteredResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksFilteredResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksFullResponseV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksFullResponseV1.java new file mode 100644 index 00000000000..c590a038e97 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksFullResponseV1.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Response that corresponds to Fabric SDK 'full' EventType. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksFullResponseV1 { + public static final String SERIALIZED_NAME_FULL_BLOCK = "fullBlock"; + @SerializedName(SERIALIZED_NAME_FULL_BLOCK) + private Object fullBlock = null; + + public WatchBlocksFullResponseV1() { + } + + public WatchBlocksFullResponseV1 fullBlock(Object fullBlock) { + + this.fullBlock = fullBlock; + return this; + } + + /** + * Full commited block. + * @return fullBlock + **/ + @javax.annotation.Nullable + public Object getFullBlock() { + return fullBlock; + } + + + public void setFullBlock(Object fullBlock) { + this.fullBlock = fullBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksFullResponseV1 watchBlocksFullResponseV1 = (WatchBlocksFullResponseV1) o; + return Objects.equals(this.fullBlock, watchBlocksFullResponseV1.fullBlock); + } + + @Override + public int hashCode() { + return Objects.hash(fullBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksFullResponseV1 {\n"); + sb.append(" fullBlock: ").append(toIndentedString(fullBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("fullBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("fullBlock"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksFullResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksFullResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksFullResponseV1 is not found in the empty JSON string", WatchBlocksFullResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksFullResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksFullResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksFullResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksFullResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksFullResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksFullResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksFullResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksFullResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksFullResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksFullResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksFullResponseV1 + */ + public static WatchBlocksFullResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksFullResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksFullResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksListenerTypeV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksListenerTypeV1.java new file mode 100644 index 00000000000..5f6167cfb01 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksListenerTypeV1.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Response type from WatchBlocks. 'Cactus*' are custom views, others correspond to fabric SDK call. + */ +@JsonAdapter(WatchBlocksListenerTypeV1.Adapter.class) +public enum WatchBlocksListenerTypeV1 { + + Filtered("filtered"), + + Full("full"), + + Private("private"), + + CactusTransactions("cactus:transactions"); + + private String value; + + WatchBlocksListenerTypeV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchBlocksListenerTypeV1 fromValue(String value) { + for (WatchBlocksListenerTypeV1 b : WatchBlocksListenerTypeV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchBlocksListenerTypeV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchBlocksListenerTypeV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchBlocksListenerTypeV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java new file mode 100644 index 00000000000..26f87f4f2ed --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java @@ -0,0 +1,309 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GatewayOptions; +import org.openapitools.client.model.WatchBlocksListenerTypeV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Options passed when subscribing to block monitoring. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksOptionsV1 { + public static final String SERIALIZED_NAME_CHANNEL_NAME = "channelName"; + @SerializedName(SERIALIZED_NAME_CHANNEL_NAME) + private String channelName; + + public static final String SERIALIZED_NAME_GATEWAY_OPTIONS = "gatewayOptions"; + @SerializedName(SERIALIZED_NAME_GATEWAY_OPTIONS) + private GatewayOptions gatewayOptions; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private WatchBlocksListenerTypeV1 type; + + public static final String SERIALIZED_NAME_START_BLOCK = "startBlock"; + @SerializedName(SERIALIZED_NAME_START_BLOCK) + private String startBlock; + + public WatchBlocksOptionsV1() { + } + + public WatchBlocksOptionsV1 channelName(String channelName) { + + this.channelName = channelName; + return this; + } + + /** + * Hyperledger Fabric channel to connect to. + * @return channelName + **/ + @javax.annotation.Nonnull + public String getChannelName() { + return channelName; + } + + + public void setChannelName(String channelName) { + this.channelName = channelName; + } + + + public WatchBlocksOptionsV1 gatewayOptions(GatewayOptions gatewayOptions) { + + this.gatewayOptions = gatewayOptions; + return this; + } + + /** + * Get gatewayOptions + * @return gatewayOptions + **/ + @javax.annotation.Nonnull + public GatewayOptions getGatewayOptions() { + return gatewayOptions; + } + + + public void setGatewayOptions(GatewayOptions gatewayOptions) { + this.gatewayOptions = gatewayOptions; + } + + + public WatchBlocksOptionsV1 type(WatchBlocksListenerTypeV1 type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public WatchBlocksListenerTypeV1 getType() { + return type; + } + + + public void setType(WatchBlocksListenerTypeV1 type) { + this.type = type; + } + + + public WatchBlocksOptionsV1 startBlock(String startBlock) { + + this.startBlock = startBlock; + return this; + } + + /** + * From which block start monitoring. Defaults to latest. + * @return startBlock + **/ + @javax.annotation.Nullable + public String getStartBlock() { + return startBlock; + } + + + public void setStartBlock(String startBlock) { + this.startBlock = startBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksOptionsV1 watchBlocksOptionsV1 = (WatchBlocksOptionsV1) o; + return Objects.equals(this.channelName, watchBlocksOptionsV1.channelName) && + Objects.equals(this.gatewayOptions, watchBlocksOptionsV1.gatewayOptions) && + Objects.equals(this.type, watchBlocksOptionsV1.type) && + Objects.equals(this.startBlock, watchBlocksOptionsV1.startBlock); + } + + @Override + public int hashCode() { + return Objects.hash(channelName, gatewayOptions, type, startBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksOptionsV1 {\n"); + sb.append(" channelName: ").append(toIndentedString(channelName)).append("\n"); + sb.append(" gatewayOptions: ").append(toIndentedString(gatewayOptions)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" startBlock: ").append(toIndentedString(startBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("channelName"); + openapiFields.add("gatewayOptions"); + openapiFields.add("type"); + openapiFields.add("startBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("channelName"); + openapiRequiredFields.add("gatewayOptions"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksOptionsV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksOptionsV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksOptionsV1 is not found in the empty JSON string", WatchBlocksOptionsV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksOptionsV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksOptionsV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksOptionsV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("channelName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `channelName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("channelName").toString())); + } + // validate the required field `gatewayOptions` + GatewayOptions.validateJsonObject(jsonObj.getAsJsonObject("gatewayOptions")); + if ((jsonObj.get("startBlock") != null && !jsonObj.get("startBlock").isJsonNull()) && !jsonObj.get("startBlock").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `startBlock` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startBlock").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksOptionsV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksOptionsV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksOptionsV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksOptionsV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksOptionsV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksOptionsV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksOptionsV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksOptionsV1 + */ + public static WatchBlocksOptionsV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksOptionsV1.class); + } + + /** + * Convert an instance of WatchBlocksOptionsV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1.java new file mode 100644 index 00000000000..700fad26649 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Response that corresponds to Fabric SDK 'private' EventType. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksPrivateResponseV1 { + public static final String SERIALIZED_NAME_PRIVATE_BLOCK = "privateBlock"; + @SerializedName(SERIALIZED_NAME_PRIVATE_BLOCK) + private Object privateBlock = null; + + public WatchBlocksPrivateResponseV1() { + } + + public WatchBlocksPrivateResponseV1 privateBlock(Object privateBlock) { + + this.privateBlock = privateBlock; + return this; + } + + /** + * Private commited block. + * @return privateBlock + **/ + @javax.annotation.Nullable + public Object getPrivateBlock() { + return privateBlock; + } + + + public void setPrivateBlock(Object privateBlock) { + this.privateBlock = privateBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksPrivateResponseV1 watchBlocksPrivateResponseV1 = (WatchBlocksPrivateResponseV1) o; + return Objects.equals(this.privateBlock, watchBlocksPrivateResponseV1.privateBlock); + } + + @Override + public int hashCode() { + return Objects.hash(privateBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksPrivateResponseV1 {\n"); + sb.append(" privateBlock: ").append(toIndentedString(privateBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("privateBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("privateBlock"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksPrivateResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksPrivateResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksPrivateResponseV1 is not found in the empty JSON string", WatchBlocksPrivateResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksPrivateResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksPrivateResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksPrivateResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksPrivateResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksPrivateResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksPrivateResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksPrivateResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksPrivateResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksPrivateResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksPrivateResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksPrivateResponseV1 + */ + public static WatchBlocksPrivateResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksPrivateResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksPrivateResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java new file mode 100644 index 00000000000..481015921f5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java @@ -0,0 +1,447 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.WatchBlocksCactusErrorResponseV1; +import org.openapitools.client.model.WatchBlocksCactusTransactionsEventV1; +import org.openapitools.client.model.WatchBlocksCactusTransactionsResponseV1; +import org.openapitools.client.model.WatchBlocksFilteredResponseV1; +import org.openapitools.client.model.WatchBlocksFullResponseV1; +import org.openapitools.client.model.WatchBlocksPrivateResponseV1; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksResponseV1 extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(WatchBlocksResponseV1.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWatchBlocksCactusErrorResponseV1 = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksCactusErrorResponseV1.class)); + final TypeAdapter adapterWatchBlocksCactusTransactionsResponseV1 = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksCactusTransactionsResponseV1.class)); + final TypeAdapter adapterWatchBlocksFilteredResponseV1 = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksFilteredResponseV1.class)); + final TypeAdapter adapterWatchBlocksFullResponseV1 = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksFullResponseV1.class)); + final TypeAdapter adapterWatchBlocksPrivateResponseV1 = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksPrivateResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksResponseV1 value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `WatchBlocksCactusErrorResponseV1` + if (value.getActualInstance() instanceof WatchBlocksCactusErrorResponseV1) { + JsonObject obj = adapterWatchBlocksCactusErrorResponseV1.toJsonTree((WatchBlocksCactusErrorResponseV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `WatchBlocksCactusTransactionsResponseV1` + if (value.getActualInstance() instanceof WatchBlocksCactusTransactionsResponseV1) { + JsonObject obj = adapterWatchBlocksCactusTransactionsResponseV1.toJsonTree((WatchBlocksCactusTransactionsResponseV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `WatchBlocksFilteredResponseV1` + if (value.getActualInstance() instanceof WatchBlocksFilteredResponseV1) { + JsonObject obj = adapterWatchBlocksFilteredResponseV1.toJsonTree((WatchBlocksFilteredResponseV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `WatchBlocksFullResponseV1` + if (value.getActualInstance() instanceof WatchBlocksFullResponseV1) { + JsonObject obj = adapterWatchBlocksFullResponseV1.toJsonTree((WatchBlocksFullResponseV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `WatchBlocksPrivateResponseV1` + if (value.getActualInstance() instanceof WatchBlocksPrivateResponseV1) { + JsonObject obj = adapterWatchBlocksPrivateResponseV1.toJsonTree((WatchBlocksPrivateResponseV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: WatchBlocksCactusErrorResponseV1, WatchBlocksCactusTransactionsResponseV1, WatchBlocksFilteredResponseV1, WatchBlocksFullResponseV1, WatchBlocksPrivateResponseV1"); + } + + @Override + public WatchBlocksResponseV1 read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize WatchBlocksCactusErrorResponseV1 + try { + // validate the JSON object to see if any exception is thrown + WatchBlocksCactusErrorResponseV1.validateJsonObject(jsonObject); + actualAdapter = adapterWatchBlocksCactusErrorResponseV1; + match++; + log.log(Level.FINER, "Input data matches schema 'WatchBlocksCactusErrorResponseV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for WatchBlocksCactusErrorResponseV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'WatchBlocksCactusErrorResponseV1'", e); + } + + // deserialize WatchBlocksCactusTransactionsResponseV1 + try { + // validate the JSON object to see if any exception is thrown + WatchBlocksCactusTransactionsResponseV1.validateJsonObject(jsonObject); + actualAdapter = adapterWatchBlocksCactusTransactionsResponseV1; + match++; + log.log(Level.FINER, "Input data matches schema 'WatchBlocksCactusTransactionsResponseV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for WatchBlocksCactusTransactionsResponseV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'WatchBlocksCactusTransactionsResponseV1'", e); + } + + // deserialize WatchBlocksFilteredResponseV1 + try { + // validate the JSON object to see if any exception is thrown + WatchBlocksFilteredResponseV1.validateJsonObject(jsonObject); + actualAdapter = adapterWatchBlocksFilteredResponseV1; + match++; + log.log(Level.FINER, "Input data matches schema 'WatchBlocksFilteredResponseV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for WatchBlocksFilteredResponseV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'WatchBlocksFilteredResponseV1'", e); + } + + // deserialize WatchBlocksFullResponseV1 + try { + // validate the JSON object to see if any exception is thrown + WatchBlocksFullResponseV1.validateJsonObject(jsonObject); + actualAdapter = adapterWatchBlocksFullResponseV1; + match++; + log.log(Level.FINER, "Input data matches schema 'WatchBlocksFullResponseV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for WatchBlocksFullResponseV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'WatchBlocksFullResponseV1'", e); + } + + // deserialize WatchBlocksPrivateResponseV1 + try { + // validate the JSON object to see if any exception is thrown + WatchBlocksPrivateResponseV1.validateJsonObject(jsonObject); + actualAdapter = adapterWatchBlocksPrivateResponseV1; + match++; + log.log(Level.FINER, "Input data matches schema 'WatchBlocksPrivateResponseV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for WatchBlocksPrivateResponseV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'WatchBlocksPrivateResponseV1'", e); + } + + if (match == 1) { + WatchBlocksResponseV1 ret = new WatchBlocksResponseV1(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for WatchBlocksResponseV1: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public WatchBlocksResponseV1() { + super("oneOf", Boolean.FALSE); + } + + public WatchBlocksResponseV1(WatchBlocksCactusErrorResponseV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public WatchBlocksResponseV1(WatchBlocksCactusTransactionsResponseV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public WatchBlocksResponseV1(WatchBlocksFilteredResponseV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public WatchBlocksResponseV1(WatchBlocksFullResponseV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public WatchBlocksResponseV1(WatchBlocksPrivateResponseV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("WatchBlocksCactusErrorResponseV1", new GenericType() { + }); + schemas.put("WatchBlocksCactusTransactionsResponseV1", new GenericType() { + }); + schemas.put("WatchBlocksFilteredResponseV1", new GenericType() { + }); + schemas.put("WatchBlocksFullResponseV1", new GenericType() { + }); + schemas.put("WatchBlocksPrivateResponseV1", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return WatchBlocksResponseV1.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * WatchBlocksCactusErrorResponseV1, WatchBlocksCactusTransactionsResponseV1, WatchBlocksFilteredResponseV1, WatchBlocksFullResponseV1, WatchBlocksPrivateResponseV1 + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof WatchBlocksCactusErrorResponseV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof WatchBlocksCactusTransactionsResponseV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof WatchBlocksFilteredResponseV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof WatchBlocksFullResponseV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof WatchBlocksPrivateResponseV1) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be WatchBlocksCactusErrorResponseV1, WatchBlocksCactusTransactionsResponseV1, WatchBlocksFilteredResponseV1, WatchBlocksFullResponseV1, WatchBlocksPrivateResponseV1"); + } + + /** + * Get the actual instance, which can be the following: + * WatchBlocksCactusErrorResponseV1, WatchBlocksCactusTransactionsResponseV1, WatchBlocksFilteredResponseV1, WatchBlocksFullResponseV1, WatchBlocksPrivateResponseV1 + * + * @return The actual instance (WatchBlocksCactusErrorResponseV1, WatchBlocksCactusTransactionsResponseV1, WatchBlocksFilteredResponseV1, WatchBlocksFullResponseV1, WatchBlocksPrivateResponseV1) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `WatchBlocksCactusErrorResponseV1`. If the actual instance is not `WatchBlocksCactusErrorResponseV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `WatchBlocksCactusErrorResponseV1` + * @throws ClassCastException if the instance is not `WatchBlocksCactusErrorResponseV1` + */ + public WatchBlocksCactusErrorResponseV1 getWatchBlocksCactusErrorResponseV1() throws ClassCastException { + return (WatchBlocksCactusErrorResponseV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `WatchBlocksCactusTransactionsResponseV1`. If the actual instance is not `WatchBlocksCactusTransactionsResponseV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `WatchBlocksCactusTransactionsResponseV1` + * @throws ClassCastException if the instance is not `WatchBlocksCactusTransactionsResponseV1` + */ + public WatchBlocksCactusTransactionsResponseV1 getWatchBlocksCactusTransactionsResponseV1() throws ClassCastException { + return (WatchBlocksCactusTransactionsResponseV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `WatchBlocksFilteredResponseV1`. If the actual instance is not `WatchBlocksFilteredResponseV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `WatchBlocksFilteredResponseV1` + * @throws ClassCastException if the instance is not `WatchBlocksFilteredResponseV1` + */ + public WatchBlocksFilteredResponseV1 getWatchBlocksFilteredResponseV1() throws ClassCastException { + return (WatchBlocksFilteredResponseV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `WatchBlocksFullResponseV1`. If the actual instance is not `WatchBlocksFullResponseV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `WatchBlocksFullResponseV1` + * @throws ClassCastException if the instance is not `WatchBlocksFullResponseV1` + */ + public WatchBlocksFullResponseV1 getWatchBlocksFullResponseV1() throws ClassCastException { + return (WatchBlocksFullResponseV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `WatchBlocksPrivateResponseV1`. If the actual instance is not `WatchBlocksPrivateResponseV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `WatchBlocksPrivateResponseV1` + * @throws ClassCastException if the instance is not `WatchBlocksPrivateResponseV1` + */ + public WatchBlocksPrivateResponseV1 getWatchBlocksPrivateResponseV1() throws ClassCastException { + return (WatchBlocksPrivateResponseV1)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with WatchBlocksCactusErrorResponseV1 + try { + WatchBlocksCactusErrorResponseV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for WatchBlocksCactusErrorResponseV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with WatchBlocksCactusTransactionsResponseV1 + try { + WatchBlocksCactusTransactionsResponseV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for WatchBlocksCactusTransactionsResponseV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with WatchBlocksFilteredResponseV1 + try { + WatchBlocksFilteredResponseV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for WatchBlocksFilteredResponseV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with WatchBlocksFullResponseV1 + try { + WatchBlocksFullResponseV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for WatchBlocksFullResponseV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with WatchBlocksPrivateResponseV1 + try { + WatchBlocksPrivateResponseV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for WatchBlocksPrivateResponseV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for WatchBlocksResponseV1 with oneOf schemas: WatchBlocksCactusErrorResponseV1, WatchBlocksCactusTransactionsResponseV1, WatchBlocksFilteredResponseV1, WatchBlocksFullResponseV1, WatchBlocksPrivateResponseV1. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of WatchBlocksResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksResponseV1 + */ + public static WatchBlocksResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java new file mode 100644 index 00000000000..e96d67acfbd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java @@ -0,0 +1,81 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Websocket requests for monitoring new blocks. + */ +@JsonAdapter(WatchBlocksV1.Adapter.class) +public enum WatchBlocksV1 { + + Subscribe("org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Subscribe"), + + SubscribeDelegatedSign("org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.SubscribeDelegatedSign"), + + Next("org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Next"), + + Unsubscribe("org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Unsubscribe"), + + Error("org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Error"), + + Complete("org.hyperledger.cactus.api.async.hlfabric.WatchBlocksV1.Complete"); + + private String value; + + WatchBlocksV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchBlocksV1 fromValue(String value) { + for (WatchBlocksV1 b : WatchBlocksV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchBlocksV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchBlocksV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchBlocksV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WebSocketKey.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WebSocketKey.java new file mode 100644 index 00000000000..771c94ef134 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WebSocketKey.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * web-socket key details for signing fabric message with private key stored with external client + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WebSocketKey { + public static final String SERIALIZED_NAME_SESSION_ID = "sessionId"; + @SerializedName(SERIALIZED_NAME_SESSION_ID) + private String sessionId; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public WebSocketKey() { + } + + public WebSocketKey sessionId(String sessionId) { + + this.sessionId = sessionId; + return this; + } + + /** + * session Id to access client + * @return sessionId + **/ + @javax.annotation.Nonnull + public String getSessionId() { + return sessionId; + } + + + public void setSessionId(String sessionId) { + this.sessionId = sessionId; + } + + + public WebSocketKey signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * signature of the session ID + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebSocketKey webSocketKey = (WebSocketKey) o; + return Objects.equals(this.sessionId, webSocketKey.sessionId) && + Objects.equals(this.signature, webSocketKey.signature); + } + + @Override + public int hashCode() { + return Objects.hash(sessionId, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebSocketKey {\n"); + sb.append(" sessionId: ").append(toIndentedString(sessionId)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionId"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionId"); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WebSocketKey + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WebSocketKey.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebSocketKey is not found in the empty JSON string", WebSocketKey.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WebSocketKey.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebSocketKey` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebSocketKey.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionId").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WebSocketKey.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebSocketKey' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebSocketKey.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WebSocketKey value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WebSocketKey read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebSocketKey given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebSocketKey + * @throws IOException if the JSON string is invalid with respect to WebSocketKey + */ + public static WebSocketKey fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebSocketKey.class); + } + + /** + * Convert an instance of WebSocketKey to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..0fe0c94885d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,134 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeployContractGoSourceV1501Response; +import org.openapitools.client.model.DeployContractGoSourceV1Request; +import org.openapitools.client.model.DeployContractGoSourceV1Response; +import org.openapitools.client.model.DeployContractV1Request; +import org.openapitools.client.model.DeployContractV1Response; +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.GetBlockRequestV1; +import org.openapitools.client.model.GetBlockResponseV1; +import org.openapitools.client.model.GetTransactionReceiptResponse; +import org.openapitools.client.model.RunDelegatedSignTransactionRequest; +import org.openapitools.client.model.RunTransactionRequest; +import org.openapitools.client.model.RunTransactionResponse; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deploys a chaincode contract in the form of a go sources. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractGoSourceV1Test() throws ApiException { + DeployContractGoSourceV1Request deployContractGoSourceV1Request = null; + DeployContractGoSourceV1Response response = api.deployContractGoSourceV1(deployContractGoSourceV1Request); + // TODO: test validations + } + + /** + * Deploys a chaincode contract from a set of source files. Note: This endpoint only supports Fabric 2.x. The 'v1' suffix in the method name refers to the Cactus API version, not the supported Fabric ledger version. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractV1Test() throws ApiException { + DeployContractV1Request deployContractV1Request = null; + DeployContractV1Response response = api.deployContractV1(deployContractV1Request); + // TODO: test validations + } + + /** + * Get block from the channel using one of selectors from the input. Works only on Fabric 2.x. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getBlockV1Test() throws ApiException { + GetBlockRequestV1 getBlockRequestV1 = null; + GetBlockResponseV1 response = api.getBlockV1(getBlockRequestV1); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * get a transaction receipt by tx id on a Fabric ledger. + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void getTransactionReceiptByTxIDV1Test() throws ApiException { + RunTransactionRequest runTransactionRequest = null; + GetTransactionReceiptResponse response = api.getTransactionReceiptByTxIDV1(runTransactionRequest); + // TODO: test validations + } + + /** + * Runs a transaction on a Fabric ledger using user-provided signing callback. + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void runDelegatedSignTransactionV1Test() throws ApiException { + RunDelegatedSignTransactionRequest runDelegatedSignTransactionRequest = null; + RunTransactionResponse response = api.runDelegatedSignTransactionV1(runDelegatedSignTransactionRequest); + // TODO: test validations + } + + /** + * Runs a transaction on a Fabric ledger. + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void runTransactionV1Test() throws ApiException { + RunTransactionRequest runTransactionRequest = null; + RunTransactionResponse response = api.runTransactionV1(runTransactionRequest); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeLanguageRuntimeTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeLanguageRuntimeTest.java new file mode 100644 index 00000000000..1c0c6969191 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeLanguageRuntimeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ChainCodeLanguageRuntime + */ +public class ChainCodeLanguageRuntimeTest { + /** + * Model tests for ChainCodeLanguageRuntime + */ + @Test + public void testChainCodeLanguageRuntime() { + // TODO: test ChainCodeLanguageRuntime + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponsesTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponsesTest.java new file mode 100644 index 00000000000..19f5908aad4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeLifeCycleCommandResponsesTest.java @@ -0,0 +1,99 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.SSHExecCommandResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ChainCodeLifeCycleCommandResponses + */ +public class ChainCodeLifeCycleCommandResponsesTest { + private final ChainCodeLifeCycleCommandResponses model = new ChainCodeLifeCycleCommandResponses(); + + /** + * Model tests for ChainCodeLifeCycleCommandResponses + */ + @Test + public void testChainCodeLifeCycleCommandResponses() { + // TODO: test ChainCodeLifeCycleCommandResponses + } + + /** + * Test the property 'packaging' + */ + @Test + public void packagingTest() { + // TODO: test packaging + } + + /** + * Test the property 'installList' + */ + @Test + public void installListTest() { + // TODO: test installList + } + + /** + * Test the property 'queryInstalledList' + */ + @Test + public void queryInstalledListTest() { + // TODO: test queryInstalledList + } + + /** + * Test the property 'approveForMyOrgList' + */ + @Test + public void approveForMyOrgListTest() { + // TODO: test approveForMyOrgList + } + + /** + * Test the property 'commit' + */ + @Test + public void commitTest() { + // TODO: test commit + } + + /** + * Test the property 'queryCommitted' + */ + @Test + public void queryCommittedTest() { + // TODO: test queryCommitted + } + + /** + * Test the property 'init' + */ + @Test + public void initTest() { + // TODO: test init + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeProgrammingLanguageTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeProgrammingLanguageTest.java new file mode 100644 index 00000000000..f9c3934f364 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ChainCodeProgrammingLanguageTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ChainCodeProgrammingLanguage + */ +public class ChainCodeProgrammingLanguageTest { + /** + * Model tests for ChainCodeProgrammingLanguage + */ + @Test + public void testChainCodeProgrammingLanguage() { + // TODO: test ChainCodeProgrammingLanguage + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConnectionProfileClientTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConnectionProfileClientTest.java new file mode 100644 index 00000000000..6d08ed9fb12 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConnectionProfileClientTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConnectionProfileClient + */ +public class ConnectionProfileClientTest { + private final ConnectionProfileClient model = new ConnectionProfileClient(); + + /** + * Model tests for ConnectionProfileClient + */ + @Test + public void testConnectionProfileClient() { + // TODO: test ConnectionProfileClient + } + + /** + * Test the property 'organization' + */ + @Test + public void organizationTest() { + // TODO: test organization + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConnectionProfileTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConnectionProfileTest.java new file mode 100644 index 00000000000..f5b21fd042b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConnectionProfileTest.java @@ -0,0 +1,123 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.HashMap; +import java.util.Map; +import org.openapitools.client.model.ConnectionProfileClient; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConnectionProfile + */ +public class ConnectionProfileTest { + private final ConnectionProfile model = new ConnectionProfile(); + + /** + * Model tests for ConnectionProfile + */ + @Test + public void testConnectionProfile() { + // TODO: test ConnectionProfile + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'xType' + */ + @Test + public void xTypeTest() { + // TODO: test xType + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property 'client' + */ + @Test + public void clientTest() { + // TODO: test client + } + + /** + * Test the property 'channels' + */ + @Test + public void channelsTest() { + // TODO: test channels + } + + /** + * Test the property 'organizations' + */ + @Test + public void organizationsTest() { + // TODO: test organizations + } + + /** + * Test the property 'orderers' + */ + @Test + public void orderersTest() { + // TODO: test orderers + } + + /** + * Test the property 'peers' + */ + @Test + public void peersTest() { + // TODO: test peers + } + + /** + * Test the property 'certificateAuthorities' + */ + @Test + public void certificateAuthoritiesTest() { + // TODO: test certificateAuthorities + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DefaultEventHandlerStrategyTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DefaultEventHandlerStrategyTest.java new file mode 100644 index 00000000000..444d13b2a83 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DefaultEventHandlerStrategyTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DefaultEventHandlerStrategy + */ +public class DefaultEventHandlerStrategyTest { + /** + * Model tests for DefaultEventHandlerStrategy + */ + @Test + public void testDefaultEventHandlerStrategy() { + // TODO: test DefaultEventHandlerStrategy + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1501ResponseTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1501ResponseTest.java new file mode 100644 index 00000000000..ea5c637cb97 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1501ResponseTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractGoSourceV1501Response + */ +public class DeployContractGoSourceV1501ResponseTest { + private final DeployContractGoSourceV1501Response model = new DeployContractGoSourceV1501Response(); + + /** + * Model tests for DeployContractGoSourceV1501Response + */ + @Test + public void testDeployContractGoSourceV1501Response() { + // TODO: test DeployContractGoSourceV1501Response + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgsTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgsTest.java new file mode 100644 index 00000000000..72b22db6642 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1RequestConstructorArgsTest.java @@ -0,0 +1,50 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractGoSourceV1RequestConstructorArgs + */ +public class DeployContractGoSourceV1RequestConstructorArgsTest { + private final DeployContractGoSourceV1RequestConstructorArgs model = new DeployContractGoSourceV1RequestConstructorArgs(); + + /** + * Model tests for DeployContractGoSourceV1RequestConstructorArgs + */ + @Test + public void testDeployContractGoSourceV1RequestConstructorArgs() { + // TODO: test DeployContractGoSourceV1RequestConstructorArgs + } + + /** + * Test the property 'args' + */ + @Test + public void argsTest() { + // TODO: test args + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1RequestTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1RequestTest.java new file mode 100644 index 00000000000..673b3d1ae5a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1RequestTest.java @@ -0,0 +1,142 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.DeployContractGoSourceV1RequestConstructorArgs; +import org.openapitools.client.model.DeploymentTargetOrganization; +import org.openapitools.client.model.FileBase64; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractGoSourceV1Request + */ +public class DeployContractGoSourceV1RequestTest { + private final DeployContractGoSourceV1Request model = new DeployContractGoSourceV1Request(); + + /** + * Model tests for DeployContractGoSourceV1Request + */ + @Test + public void testDeployContractGoSourceV1Request() { + // TODO: test DeployContractGoSourceV1Request + } + + /** + * Test the property 'policyDslSource' + */ + @Test + public void policyDslSourceTest() { + // TODO: test policyDslSource + } + + /** + * Test the property 'tlsRootCertFiles' + */ + @Test + public void tlsRootCertFilesTest() { + // TODO: test tlsRootCertFiles + } + + /** + * Test the property 'channelId' + */ + @Test + public void channelIdTest() { + // TODO: test channelId + } + + /** + * Test the property 'targetOrganizations' + */ + @Test + public void targetOrganizationsTest() { + // TODO: test targetOrganizations + } + + /** + * Test the property 'targetPeerAddresses' + */ + @Test + public void targetPeerAddressesTest() { + // TODO: test targetPeerAddresses + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'chainCodeVersion' + */ + @Test + public void chainCodeVersionTest() { + // TODO: test chainCodeVersion + } + + /** + * Test the property 'goSource' + */ + @Test + public void goSourceTest() { + // TODO: test goSource + } + + /** + * Test the property 'goMod' + */ + @Test + public void goModTest() { + // TODO: test goMod + } + + /** + * Test the property 'moduleName' + */ + @Test + public void moduleNameTest() { + // TODO: test moduleName + } + + /** + * Test the property 'pinnedDeps' + */ + @Test + public void pinnedDepsTest() { + // TODO: test pinnedDeps + } + + /** + * Test the property 'modTidyOnly' + */ + @Test + public void modTidyOnlyTest() { + // TODO: test modTidyOnly + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1ResponseTest.java new file mode 100644 index 00000000000..606134ad787 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractGoSourceV1ResponseTest.java @@ -0,0 +1,67 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.SSHExecCommandResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractGoSourceV1Response + */ +public class DeployContractGoSourceV1ResponseTest { + private final DeployContractGoSourceV1Response model = new DeployContractGoSourceV1Response(); + + /** + * Model tests for DeployContractGoSourceV1Response + */ + @Test + public void testDeployContractGoSourceV1Response() { + // TODO: test DeployContractGoSourceV1Response + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'installationCommandResponses' + */ + @Test + public void installationCommandResponsesTest() { + // TODO: test installationCommandResponses + } + + /** + * Test the property 'instantiationCommandResponse' + */ + @Test + public void instantiationCommandResponseTest() { + // TODO: test instantiationCommandResponse + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java new file mode 100644 index 00000000000..12504e1e357 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java @@ -0,0 +1,167 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ChainCodeProgrammingLanguage; +import org.openapitools.client.model.DeployContractGoSourceV1RequestConstructorArgs; +import org.openapitools.client.model.DeploymentTargetOrganization; +import org.openapitools.client.model.FileBase64; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractV1Request + */ +public class DeployContractV1RequestTest { + private final DeployContractV1Request model = new DeployContractV1Request(); + + /** + * Model tests for DeployContractV1Request + */ + @Test + public void testDeployContractV1Request() { + // TODO: test DeployContractV1Request + } + + /** + * Test the property 'ccLang' + */ + @Test + public void ccLangTest() { + // TODO: test ccLang + } + + /** + * Test the property 'caFile' + */ + @Test + public void caFileTest() { + // TODO: test caFile + } + + /** + * Test the property 'orderer' + */ + @Test + public void ordererTest() { + // TODO: test orderer + } + + /** + * Test the property 'ordererTLSHostnameOverride' + */ + @Test + public void ordererTLSHostnameOverrideTest() { + // TODO: test ordererTLSHostnameOverride + } + + /** + * Test the property 'connTimeout' + */ + @Test + public void connTimeoutTest() { + // TODO: test connTimeout + } + + /** + * Test the property 'signaturePolicy' + */ + @Test + public void signaturePolicyTest() { + // TODO: test signaturePolicy + } + + /** + * Test the property 'collectionsConfigFile' + */ + @Test + public void collectionsConfigFileTest() { + // TODO: test collectionsConfigFile + } + + /** + * Test the property 'channelId' + */ + @Test + public void channelIdTest() { + // TODO: test channelId + } + + /** + * Test the property 'targetOrganizations' + */ + @Test + public void targetOrganizationsTest() { + // TODO: test targetOrganizations + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'ccSequence' + */ + @Test + public void ccSequenceTest() { + // TODO: test ccSequence + } + + /** + * Test the property 'ccVersion' + */ + @Test + public void ccVersionTest() { + // TODO: test ccVersion + } + + /** + * Test the property 'ccName' + */ + @Test + public void ccNameTest() { + // TODO: test ccName + } + + /** + * Test the property 'ccLabel' + */ + @Test + public void ccLabelTest() { + // TODO: test ccLabel + } + + /** + * Test the property 'sourceFiles' + */ + @Test + public void sourceFilesTest() { + // TODO: test sourceFiles + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1ResponseTest.java new file mode 100644 index 00000000000..0ec368f9713 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1ResponseTest.java @@ -0,0 +1,67 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.ChainCodeLifeCycleCommandResponses; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractV1Response + */ +public class DeployContractV1ResponseTest { + private final DeployContractV1Response model = new DeployContractV1Response(); + + /** + * Model tests for DeployContractV1Response + */ + @Test + public void testDeployContractV1Response() { + // TODO: test DeployContractV1Response + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'packageIds' + */ + @Test + public void packageIdsTest() { + // TODO: test packageIds + } + + /** + * Test the property 'lifecycle' + */ + @Test + public void lifecycleTest() { + // TODO: test lifecycle + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeploymentTargetOrgFabric2xTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeploymentTargetOrgFabric2xTest.java new file mode 100644 index 00000000000..6da424f23c6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeploymentTargetOrgFabric2xTest.java @@ -0,0 +1,88 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeploymentTargetOrgFabric2x + */ +public class DeploymentTargetOrgFabric2xTest { + private final DeploymentTargetOrgFabric2x model = new DeploymentTargetOrgFabric2x(); + + /** + * Model tests for DeploymentTargetOrgFabric2x + */ + @Test + public void testDeploymentTargetOrgFabric2x() { + // TODO: test DeploymentTargetOrgFabric2x + } + + /** + * Test the property '_transient' + */ + @Test + public void _transientTest() { + // TODO: test _transient + } + + /** + * Test the property 'CORE_PEER_LOCALMSPID' + */ + @Test + public void CORE_PEER_LOCALMSPIDTest() { + // TODO: test CORE_PEER_LOCALMSPID + } + + /** + * Test the property 'CORE_PEER_ADDRESS' + */ + @Test + public void CORE_PEER_ADDRESSTest() { + // TODO: test CORE_PEER_ADDRESS + } + + /** + * Test the property 'CORE_PEER_MSPCONFIGPATH' + */ + @Test + public void CORE_PEER_MSPCONFIGPATHTest() { + // TODO: test CORE_PEER_MSPCONFIGPATH + } + + /** + * Test the property 'CORE_PEER_TLS_ROOTCERT_FILE' + */ + @Test + public void CORE_PEER_TLS_ROOTCERT_FILETest() { + // TODO: test CORE_PEER_TLS_ROOTCERT_FILE + } + + /** + * Test the property 'ORDERER_TLS_ROOTCERT_FILE' + */ + @Test + public void ORDERER_TLS_ROOTCERT_FILETest() { + // TODO: test ORDERER_TLS_ROOTCERT_FILE + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeploymentTargetOrganizationTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeploymentTargetOrganizationTest.java new file mode 100644 index 00000000000..0497c527bea --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeploymentTargetOrganizationTest.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeploymentTargetOrganization + */ +public class DeploymentTargetOrganizationTest { + private final DeploymentTargetOrganization model = new DeploymentTargetOrganization(); + + /** + * Model tests for DeploymentTargetOrganization + */ + @Test + public void testDeploymentTargetOrganization() { + // TODO: test DeploymentTargetOrganization + } + + /** + * Test the property 'CORE_PEER_LOCALMSPID' + */ + @Test + public void CORE_PEER_LOCALMSPIDTest() { + // TODO: test CORE_PEER_LOCALMSPID + } + + /** + * Test the property 'CORE_PEER_ADDRESS' + */ + @Test + public void CORE_PEER_ADDRESSTest() { + // TODO: test CORE_PEER_ADDRESS + } + + /** + * Test the property 'CORE_PEER_MSPCONFIGPATH' + */ + @Test + public void CORE_PEER_MSPCONFIGPATHTest() { + // TODO: test CORE_PEER_MSPCONFIGPATH + } + + /** + * Test the property 'CORE_PEER_TLS_ROOTCERT_FILE' + */ + @Test + public void CORE_PEER_TLS_ROOTCERT_FILETest() { + // TODO: test CORE_PEER_TLS_ROOTCERT_FILE + } + + /** + * Test the property 'ORDERER_TLS_ROOTCERT_FILE' + */ + @Test + public void ORDERER_TLS_ROOTCERT_FILETest() { + // TODO: test ORDERER_TLS_ROOTCERT_FILE + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java new file mode 100644 index 00000000000..1cde1e6335f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ErrorExceptionResponseV1 + */ +public class ErrorExceptionResponseV1Test { + private final ErrorExceptionResponseV1 model = new ErrorExceptionResponseV1(); + + /** + * Model tests for ErrorExceptionResponseV1 + */ + @Test + public void testErrorExceptionResponseV1() { + // TODO: test ErrorExceptionResponseV1 + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricContractInvocationTypeTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricContractInvocationTypeTest.java new file mode 100644 index 00000000000..17d0a7696f8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricContractInvocationTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FabricContractInvocationType + */ +public class FabricContractInvocationTypeTest { + /** + * Model tests for FabricContractInvocationType + */ + @Test + public void testFabricContractInvocationType() { + // TODO: test FabricContractInvocationType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricSigningCredentialTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricSigningCredentialTest.java new file mode 100644 index 00000000000..bbfb5740d25 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricSigningCredentialTest.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.FabricSigningCredentialType; +import org.openapitools.client.model.VaultTransitKey; +import org.openapitools.client.model.WebSocketKey; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FabricSigningCredential + */ +public class FabricSigningCredentialTest { + private final FabricSigningCredential model = new FabricSigningCredential(); + + /** + * Model tests for FabricSigningCredential + */ + @Test + public void testFabricSigningCredential() { + // TODO: test FabricSigningCredential + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'keychainRef' + */ + @Test + public void keychainRefTest() { + // TODO: test keychainRef + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'vaultTransitKey' + */ + @Test + public void vaultTransitKeyTest() { + // TODO: test vaultTransitKey + } + + /** + * Test the property 'webSocketKey' + */ + @Test + public void webSocketKeyTest() { + // TODO: test webSocketKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricSigningCredentialTypeTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricSigningCredentialTypeTest.java new file mode 100644 index 00000000000..b75b097ab48 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FabricSigningCredentialTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FabricSigningCredentialType + */ +public class FabricSigningCredentialTypeTest { + /** + * Model tests for FabricSigningCredentialType + */ + @Test + public void testFabricSigningCredentialType() { + // TODO: test FabricSigningCredentialType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FileBase64Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FileBase64Test.java new file mode 100644 index 00000000000..ea93811785b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/FileBase64Test.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FileBase64 + */ +public class FileBase64Test { + private final FileBase64 model = new FileBase64(); + + /** + * Model tests for FileBase64 + */ + @Test + public void testFileBase64() { + // TODO: test FileBase64 + } + + /** + * Test the property 'body' + */ + @Test + public void bodyTest() { + // TODO: test body + } + + /** + * Test the property 'filename' + */ + @Test + public void filenameTest() { + // TODO: test filename + } + + /** + * Test the property 'filepath' + */ + @Test + public void filepathTest() { + // TODO: test filepath + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayDiscoveryOptionsTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayDiscoveryOptionsTest.java new file mode 100644 index 00000000000..5d83d1c535a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayDiscoveryOptionsTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GatewayDiscoveryOptions + */ +public class GatewayDiscoveryOptionsTest { + private final GatewayDiscoveryOptions model = new GatewayDiscoveryOptions(); + + /** + * Model tests for GatewayDiscoveryOptions + */ + @Test + public void testGatewayDiscoveryOptions() { + // TODO: test GatewayDiscoveryOptions + } + + /** + * Test the property 'asLocalhost' + */ + @Test + public void asLocalhostTest() { + // TODO: test asLocalhost + } + + /** + * Test the property 'enabled' + */ + @Test + public void enabledTest() { + // TODO: test enabled + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayEventHandlerOptionsTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayEventHandlerOptionsTest.java new file mode 100644 index 00000000000..35c3d10a7b7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayEventHandlerOptionsTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.client.model.DefaultEventHandlerStrategy; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GatewayEventHandlerOptions + */ +public class GatewayEventHandlerOptionsTest { + private final GatewayEventHandlerOptions model = new GatewayEventHandlerOptions(); + + /** + * Model tests for GatewayEventHandlerOptions + */ + @Test + public void testGatewayEventHandlerOptions() { + // TODO: test GatewayEventHandlerOptions + } + + /** + * Test the property 'commitTimeout' + */ + @Test + public void commitTimeoutTest() { + // TODO: test commitTimeout + } + + /** + * Test the property 'endorseTimeout' + */ + @Test + public void endorseTimeoutTest() { + // TODO: test endorseTimeout + } + + /** + * Test the property 'strategy' + */ + @Test + public void strategyTest() { + // TODO: test strategy + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayOptionsTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayOptionsTest.java new file mode 100644 index 00000000000..6205899f504 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayOptionsTest.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.ConnectionProfile; +import org.openapitools.client.model.GatewayDiscoveryOptions; +import org.openapitools.client.model.GatewayEventHandlerOptions; +import org.openapitools.client.model.GatewayOptionsWallet; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GatewayOptions + */ +public class GatewayOptionsTest { + private final GatewayOptions model = new GatewayOptions(); + + /** + * Model tests for GatewayOptions + */ + @Test + public void testGatewayOptions() { + // TODO: test GatewayOptions + } + + /** + * Test the property 'connectionProfile' + */ + @Test + public void connectionProfileTest() { + // TODO: test connectionProfile + } + + /** + * Test the property 'discovery' + */ + @Test + public void discoveryTest() { + // TODO: test discovery + } + + /** + * Test the property 'eventHandlerOptions' + */ + @Test + public void eventHandlerOptionsTest() { + // TODO: test eventHandlerOptions + } + + /** + * Test the property 'identity' + */ + @Test + public void identityTest() { + // TODO: test identity + } + + /** + * Test the property 'wallet' + */ + @Test + public void walletTest() { + // TODO: test wallet + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayOptionsWalletTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayOptionsWalletTest.java new file mode 100644 index 00000000000..016b3994a44 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GatewayOptionsWalletTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.FabricSigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GatewayOptionsWallet + */ +public class GatewayOptionsWalletTest { + private final GatewayOptionsWallet model = new GatewayOptionsWallet(); + + /** + * Model tests for GatewayOptionsWallet + */ + @Test + public void testGatewayOptionsWallet() { + // TODO: test GatewayOptionsWallet + } + + /** + * Test the property 'keychain' + */ + @Test + public void keychainTest() { + // TODO: test keychain + } + + /** + * Test the property 'json' + */ + @Test + public void jsonTest() { + // TODO: test json + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHashTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHashTest.java new file mode 100644 index 00000000000..0eb43b03ac4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1QueryBlockHashTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockRequestV1QueryBlockHash + */ +public class GetBlockRequestV1QueryBlockHashTest { + private final GetBlockRequestV1QueryBlockHash model = new GetBlockRequestV1QueryBlockHash(); + + /** + * Model tests for GetBlockRequestV1QueryBlockHash + */ + @Test + public void testGetBlockRequestV1QueryBlockHash() { + // TODO: test GetBlockRequestV1QueryBlockHash + } + + /** + * Test the property 'encoding' + */ + @Test + public void encodingTest() { + // TODO: test encoding + } + + /** + * Test the property 'buffer' + */ + @Test + public void bufferTest() { + // TODO: test buffer + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1QueryTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1QueryTest.java new file mode 100644 index 00000000000..88d298bf536 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1QueryTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.GetBlockRequestV1QueryBlockHash; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockRequestV1Query + */ +public class GetBlockRequestV1QueryTest { + private final GetBlockRequestV1Query model = new GetBlockRequestV1Query(); + + /** + * Model tests for GetBlockRequestV1Query + */ + @Test + public void testGetBlockRequestV1Query() { + // TODO: test GetBlockRequestV1Query + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'transactionId' + */ + @Test + public void transactionIdTest() { + // TODO: test transactionId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1Test.java new file mode 100644 index 00000000000..8356fe899c8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestV1Test.java @@ -0,0 +1,82 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.GatewayOptions; +import org.openapitools.client.model.GetBlockRequestV1Query; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockRequestV1 + */ +public class GetBlockRequestV1Test { + private final GetBlockRequestV1 model = new GetBlockRequestV1(); + + /** + * Model tests for GetBlockRequestV1 + */ + @Test + public void testGetBlockRequestV1() { + // TODO: test GetBlockRequestV1 + } + + /** + * Test the property 'channelName' + */ + @Test + public void channelNameTest() { + // TODO: test channelName + } + + /** + * Test the property 'connectionChannelName' + */ + @Test + public void connectionChannelNameTest() { + // TODO: test connectionChannelName + } + + /** + * Test the property 'gatewayOptions' + */ + @Test + public void gatewayOptionsTest() { + // TODO: test gatewayOptions + } + + /** + * Test the property 'query' + */ + @Test + public void queryTest() { + // TODO: test query + } + + /** + * Test the property 'skipDecode' + */ + @Test + public void skipDecodeTest() { + // TODO: test skipDecode + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseDecodedV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseDecodedV1Test.java new file mode 100644 index 00000000000..7b6f7b80886 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseDecodedV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockResponseDecodedV1 + */ +public class GetBlockResponseDecodedV1Test { + private final GetBlockResponseDecodedV1 model = new GetBlockResponseDecodedV1(); + + /** + * Model tests for GetBlockResponseDecodedV1 + */ + @Test + public void testGetBlockResponseDecodedV1() { + // TODO: test GetBlockResponseDecodedV1 + } + + /** + * Test the property 'decodedBlock' + */ + @Test + public void decodedBlockTest() { + // TODO: test decodedBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseEncodedV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseEncodedV1Test.java new file mode 100644 index 00000000000..5dd745f8153 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseEncodedV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockResponseEncodedV1 + */ +public class GetBlockResponseEncodedV1Test { + private final GetBlockResponseEncodedV1 model = new GetBlockResponseEncodedV1(); + + /** + * Model tests for GetBlockResponseEncodedV1 + */ + @Test + public void testGetBlockResponseEncodedV1() { + // TODO: test GetBlockResponseEncodedV1 + } + + /** + * Test the property 'encodedBlock' + */ + @Test + public void encodedBlockTest() { + // TODO: test encodedBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseV1Test.java new file mode 100644 index 00000000000..a1c71dc126a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockResponseV1Test.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.GetBlockResponseDecodedV1; +import org.openapitools.client.model.GetBlockResponseEncodedV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockResponseV1 + */ +public class GetBlockResponseV1Test { + private final GetBlockResponseV1 model = new GetBlockResponseV1(); + + /** + * Model tests for GetBlockResponseV1 + */ + @Test + public void testGetBlockResponseV1() { + // TODO: test GetBlockResponseV1 + } + + /** + * Test the property 'decodedBlock' + */ + @Test + public void decodedBlockTest() { + // TODO: test decodedBlock + } + + /** + * Test the property 'encodedBlock' + */ + @Test + public void encodedBlockTest() { + // TODO: test encodedBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionReceiptResponseTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionReceiptResponseTest.java new file mode 100644 index 00000000000..d6aaeb2bf1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionReceiptResponseTest.java @@ -0,0 +1,125 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.TransactReceiptBlockMetaData; +import org.openapitools.client.model.TransactReceiptTransactionCreator; +import org.openapitools.client.model.TransactReceiptTransactionEndorsement; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetTransactionReceiptResponse + */ +public class GetTransactionReceiptResponseTest { + private final GetTransactionReceiptResponse model = new GetTransactionReceiptResponse(); + + /** + * Model tests for GetTransactionReceiptResponse + */ + @Test + public void testGetTransactionReceiptResponse() { + // TODO: test GetTransactionReceiptResponse + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'channelID' + */ + @Test + public void channelIDTest() { + // TODO: test channelID + } + + /** + * Test the property 'transactionCreator' + */ + @Test + public void transactionCreatorTest() { + // TODO: test transactionCreator + } + + /** + * Test the property 'transactionEndorsement' + */ + @Test + public void transactionEndorsementTest() { + // TODO: test transactionEndorsement + } + + /** + * Test the property 'blockMetaData' + */ + @Test + public void blockMetaDataTest() { + // TODO: test blockMetaData + } + + /** + * Test the property 'chainCodeName' + */ + @Test + public void chainCodeNameTest() { + // TODO: test chainCodeName + } + + /** + * Test the property 'chainCodeVersion' + */ + @Test + public void chainCodeVersionTest() { + // TODO: test chainCodeVersion + } + + /** + * Test the property 'responseStatus' + */ + @Test + public void responseStatusTest() { + // TODO: test responseStatus + } + + /** + * Test the property 'rwsetKey' + */ + @Test + public void rwsetKeyTest() { + // TODO: test rwsetKey + } + + /** + * Test the property 'rwsetWriteData' + */ + @Test + public void rwsetWriteDataTest() { + // TODO: test rwsetWriteData + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunDelegatedSignTransactionRequestTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunDelegatedSignTransactionRequestTest.java new file mode 100644 index 00000000000..50e965299fd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunDelegatedSignTransactionRequestTest.java @@ -0,0 +1,141 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.FabricContractInvocationType; +import org.openapitools.client.model.RunTransactionResponseType; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunDelegatedSignTransactionRequest + */ +public class RunDelegatedSignTransactionRequestTest { + private final RunDelegatedSignTransactionRequest model = new RunDelegatedSignTransactionRequest(); + + /** + * Model tests for RunDelegatedSignTransactionRequest + */ + @Test + public void testRunDelegatedSignTransactionRequest() { + // TODO: test RunDelegatedSignTransactionRequest + } + + /** + * Test the property 'endorsingPeers' + */ + @Test + public void endorsingPeersTest() { + // TODO: test endorsingPeers + } + + /** + * Test the property 'endorsingOrgs' + */ + @Test + public void endorsingOrgsTest() { + // TODO: test endorsingOrgs + } + + /** + * Test the property 'transientData' + */ + @Test + public void transientDataTest() { + // TODO: test transientData + } + + /** + * Test the property 'signerCertificate' + */ + @Test + public void signerCertificateTest() { + // TODO: test signerCertificate + } + + /** + * Test the property 'signerMspID' + */ + @Test + public void signerMspIDTest() { + // TODO: test signerMspID + } + + /** + * Test the property 'uniqueTransactionData' + */ + @Test + public void uniqueTransactionDataTest() { + // TODO: test uniqueTransactionData + } + + /** + * Test the property 'channelName' + */ + @Test + public void channelNameTest() { + // TODO: test channelName + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'responseType' + */ + @Test + public void responseTypeTest() { + // TODO: test responseType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java new file mode 100644 index 00000000000..a179874b4f4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java @@ -0,0 +1,135 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.FabricContractInvocationType; +import org.openapitools.client.model.FabricSigningCredential; +import org.openapitools.client.model.GatewayOptions; +import org.openapitools.client.model.RunTransactionResponseType; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionRequest + */ +public class RunTransactionRequestTest { + private final RunTransactionRequest model = new RunTransactionRequest(); + + /** + * Model tests for RunTransactionRequest + */ + @Test + public void testRunTransactionRequest() { + // TODO: test RunTransactionRequest + } + + /** + * Test the property 'endorsingPeers' + */ + @Test + public void endorsingPeersTest() { + // TODO: test endorsingPeers + } + + /** + * Test the property 'endorsingOrgs' + */ + @Test + public void endorsingOrgsTest() { + // TODO: test endorsingOrgs + } + + /** + * Test the property 'transientData' + */ + @Test + public void transientDataTest() { + // TODO: test transientData + } + + /** + * Test the property 'gatewayOptions' + */ + @Test + public void gatewayOptionsTest() { + // TODO: test gatewayOptions + } + + /** + * Test the property 'signingCredential' + */ + @Test + public void signingCredentialTest() { + // TODO: test signingCredential + } + + /** + * Test the property 'channelName' + */ + @Test + public void channelNameTest() { + // TODO: test channelName + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'responseType' + */ + @Test + public void responseTypeTest() { + // TODO: test responseType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java new file mode 100644 index 00000000000..da025399f72 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionResponse + */ +public class RunTransactionResponseTest { + private final RunTransactionResponse model = new RunTransactionResponse(); + + /** + * Model tests for RunTransactionResponse + */ + @Test + public void testRunTransactionResponse() { + // TODO: test RunTransactionResponse + } + + /** + * Test the property 'functionOutput' + */ + @Test + public void functionOutputTest() { + // TODO: test functionOutput + } + + /** + * Test the property 'transactionId' + */ + @Test + public void transactionIdTest() { + // TODO: test transactionId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTypeTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTypeTest.java new file mode 100644 index 00000000000..46ea4c2c258 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionResponseType + */ +public class RunTransactionResponseTypeTest { + /** + * Model tests for RunTransactionResponseType + */ + @Test + public void testRunTransactionResponseType() { + // TODO: test RunTransactionResponseType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SSHExecCommandResponseTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SSHExecCommandResponseTest.java new file mode 100644 index 00000000000..b55c94eff49 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SSHExecCommandResponseTest.java @@ -0,0 +1,72 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SSHExecCommandResponse + */ +public class SSHExecCommandResponseTest { + private final SSHExecCommandResponse model = new SSHExecCommandResponse(); + + /** + * Model tests for SSHExecCommandResponse + */ + @Test + public void testSSHExecCommandResponse() { + // TODO: test SSHExecCommandResponse + } + + /** + * Test the property 'stdout' + */ + @Test + public void stdoutTest() { + // TODO: test stdout + } + + /** + * Test the property 'stderr' + */ + @Test + public void stderrTest() { + // TODO: test stderr + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'signal' + */ + @Test + public void signalTest() { + // TODO: test signal + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptBlockMetaDataTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptBlockMetaDataTest.java new file mode 100644 index 00000000000..cfee773d56e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptBlockMetaDataTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransactReceiptBlockMetaData + */ +public class TransactReceiptBlockMetaDataTest { + private final TransactReceiptBlockMetaData model = new TransactReceiptBlockMetaData(); + + /** + * Model tests for TransactReceiptBlockMetaData + */ + @Test + public void testTransactReceiptBlockMetaData() { + // TODO: test TransactReceiptBlockMetaData + } + + /** + * Test the property 'mspid' + */ + @Test + public void mspidTest() { + // TODO: test mspid + } + + /** + * Test the property 'blockCreatorID' + */ + @Test + public void blockCreatorIDTest() { + // TODO: test blockCreatorID + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptTransactionCreatorTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptTransactionCreatorTest.java new file mode 100644 index 00000000000..3081f88b0a6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptTransactionCreatorTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransactReceiptTransactionCreator + */ +public class TransactReceiptTransactionCreatorTest { + private final TransactReceiptTransactionCreator model = new TransactReceiptTransactionCreator(); + + /** + * Model tests for TransactReceiptTransactionCreator + */ + @Test + public void testTransactReceiptTransactionCreator() { + // TODO: test TransactReceiptTransactionCreator + } + + /** + * Test the property 'mspid' + */ + @Test + public void mspidTest() { + // TODO: test mspid + } + + /** + * Test the property 'creatorID' + */ + @Test + public void creatorIDTest() { + // TODO: test creatorID + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptTransactionEndorsementTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptTransactionEndorsementTest.java new file mode 100644 index 00000000000..532477d045a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactReceiptTransactionEndorsementTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransactReceiptTransactionEndorsement + */ +public class TransactReceiptTransactionEndorsementTest { + private final TransactReceiptTransactionEndorsement model = new TransactReceiptTransactionEndorsement(); + + /** + * Model tests for TransactReceiptTransactionEndorsement + */ + @Test + public void testTransactReceiptTransactionEndorsement() { + // TODO: test TransactReceiptTransactionEndorsement + } + + /** + * Test the property 'mspid' + */ + @Test + public void mspidTest() { + // TODO: test mspid + } + + /** + * Test the property 'endorserID' + */ + @Test + public void endorserIDTest() { + // TODO: test endorserID + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/VaultTransitKeyTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/VaultTransitKeyTest.java new file mode 100644 index 00000000000..291c8a0978f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/VaultTransitKeyTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for VaultTransitKey + */ +public class VaultTransitKeyTest { + private final VaultTransitKey model = new VaultTransitKey(); + + /** + * Model tests for VaultTransitKey + */ + @Test + public void testVaultTransitKey() { + // TODO: test VaultTransitKey + } + + /** + * Test the property 'keyName' + */ + @Test + public void keyNameTest() { + // TODO: test keyName + } + + /** + * Test the property 'token' + */ + @Test + public void tokenTest() { + // TODO: test token + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1Test.java new file mode 100644 index 00000000000..748ce128290 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusErrorResponseV1Test.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksCactusErrorResponseV1 + */ +public class WatchBlocksCactusErrorResponseV1Test { + private final WatchBlocksCactusErrorResponseV1 model = new WatchBlocksCactusErrorResponseV1(); + + /** + * Model tests for WatchBlocksCactusErrorResponseV1 + */ + @Test + public void testWatchBlocksCactusErrorResponseV1() { + // TODO: test WatchBlocksCactusErrorResponseV1 + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'errorMessage' + */ + @Test + public void errorMessageTest() { + // TODO: test errorMessage + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1Test.java new file mode 100644 index 00000000000..c02915f41e1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusTransactionsEventV1Test.java @@ -0,0 +1,74 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksCactusTransactionsEventV1 + */ +public class WatchBlocksCactusTransactionsEventV1Test { + private final WatchBlocksCactusTransactionsEventV1 model = new WatchBlocksCactusTransactionsEventV1(); + + /** + * Model tests for WatchBlocksCactusTransactionsEventV1 + */ + @Test + public void testWatchBlocksCactusTransactionsEventV1() { + // TODO: test WatchBlocksCactusTransactionsEventV1 + } + + /** + * Test the property 'chaincodeId' + */ + @Test + public void chaincodeIdTest() { + // TODO: test chaincodeId + } + + /** + * Test the property 'transactionId' + */ + @Test + public void transactionIdTest() { + // TODO: test transactionId + } + + /** + * Test the property 'functionName' + */ + @Test + public void functionNameTest() { + // TODO: test functionName + } + + /** + * Test the property 'functionArgs' + */ + @Test + public void functionArgsTest() { + // TODO: test functionArgs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1Test.java new file mode 100644 index 00000000000..6f43f88f443 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksCactusTransactionsResponseV1Test.java @@ -0,0 +1,51 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.WatchBlocksCactusTransactionsEventV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksCactusTransactionsResponseV1 + */ +public class WatchBlocksCactusTransactionsResponseV1Test { + private final WatchBlocksCactusTransactionsResponseV1 model = new WatchBlocksCactusTransactionsResponseV1(); + + /** + * Model tests for WatchBlocksCactusTransactionsResponseV1 + */ + @Test + public void testWatchBlocksCactusTransactionsResponseV1() { + // TODO: test WatchBlocksCactusTransactionsResponseV1 + } + + /** + * Test the property 'cactusTransactionsEvents' + */ + @Test + public void cactusTransactionsEventsTest() { + // TODO: test cactusTransactionsEvents + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksDelegatedSignOptionsV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksDelegatedSignOptionsV1Test.java new file mode 100644 index 00000000000..00b9849f8f7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksDelegatedSignOptionsV1Test.java @@ -0,0 +1,90 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.WatchBlocksListenerTypeV1; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksDelegatedSignOptionsV1 + */ +public class WatchBlocksDelegatedSignOptionsV1Test { + private final WatchBlocksDelegatedSignOptionsV1 model = new WatchBlocksDelegatedSignOptionsV1(); + + /** + * Model tests for WatchBlocksDelegatedSignOptionsV1 + */ + @Test + public void testWatchBlocksDelegatedSignOptionsV1() { + // TODO: test WatchBlocksDelegatedSignOptionsV1 + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'startBlock' + */ + @Test + public void startBlockTest() { + // TODO: test startBlock + } + + /** + * Test the property 'channelName' + */ + @Test + public void channelNameTest() { + // TODO: test channelName + } + + /** + * Test the property 'signerCertificate' + */ + @Test + public void signerCertificateTest() { + // TODO: test signerCertificate + } + + /** + * Test the property 'signerMspID' + */ + @Test + public void signerMspIDTest() { + // TODO: test signerMspID + } + + /** + * Test the property 'uniqueTransactionData' + */ + @Test + public void uniqueTransactionDataTest() { + // TODO: test uniqueTransactionData + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1Test.java new file mode 100644 index 00000000000..7fc32f627af --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksFilteredResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksFilteredResponseV1 + */ +public class WatchBlocksFilteredResponseV1Test { + private final WatchBlocksFilteredResponseV1 model = new WatchBlocksFilteredResponseV1(); + + /** + * Model tests for WatchBlocksFilteredResponseV1 + */ + @Test + public void testWatchBlocksFilteredResponseV1() { + // TODO: test WatchBlocksFilteredResponseV1 + } + + /** + * Test the property 'filteredBlock' + */ + @Test + public void filteredBlockTest() { + // TODO: test filteredBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksFullResponseV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksFullResponseV1Test.java new file mode 100644 index 00000000000..ea886e19efc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksFullResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksFullResponseV1 + */ +public class WatchBlocksFullResponseV1Test { + private final WatchBlocksFullResponseV1 model = new WatchBlocksFullResponseV1(); + + /** + * Model tests for WatchBlocksFullResponseV1 + */ + @Test + public void testWatchBlocksFullResponseV1() { + // TODO: test WatchBlocksFullResponseV1 + } + + /** + * Test the property 'fullBlock' + */ + @Test + public void fullBlockTest() { + // TODO: test fullBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksListenerTypeV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksListenerTypeV1Test.java new file mode 100644 index 00000000000..f56a101d6a7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksListenerTypeV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksListenerTypeV1 + */ +public class WatchBlocksListenerTypeV1Test { + /** + * Model tests for WatchBlocksListenerTypeV1 + */ + @Test + public void testWatchBlocksListenerTypeV1() { + // TODO: test WatchBlocksListenerTypeV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksOptionsV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksOptionsV1Test.java new file mode 100644 index 00000000000..ae42895a7df --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksOptionsV1Test.java @@ -0,0 +1,74 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.GatewayOptions; +import org.openapitools.client.model.WatchBlocksListenerTypeV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksOptionsV1 + */ +public class WatchBlocksOptionsV1Test { + private final WatchBlocksOptionsV1 model = new WatchBlocksOptionsV1(); + + /** + * Model tests for WatchBlocksOptionsV1 + */ + @Test + public void testWatchBlocksOptionsV1() { + // TODO: test WatchBlocksOptionsV1 + } + + /** + * Test the property 'channelName' + */ + @Test + public void channelNameTest() { + // TODO: test channelName + } + + /** + * Test the property 'gatewayOptions' + */ + @Test + public void gatewayOptionsTest() { + // TODO: test gatewayOptions + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'startBlock' + */ + @Test + public void startBlockTest() { + // TODO: test startBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1Test.java new file mode 100644 index 00000000000..f9cb59f4015 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksPrivateResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksPrivateResponseV1 + */ +public class WatchBlocksPrivateResponseV1Test { + private final WatchBlocksPrivateResponseV1 model = new WatchBlocksPrivateResponseV1(); + + /** + * Model tests for WatchBlocksPrivateResponseV1 + */ + @Test + public void testWatchBlocksPrivateResponseV1() { + // TODO: test WatchBlocksPrivateResponseV1 + } + + /** + * Test the property 'privateBlock' + */ + @Test + public void privateBlockTest() { + // TODO: test privateBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksResponseV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksResponseV1Test.java new file mode 100644 index 00000000000..22e5ebaf5ed --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksResponseV1Test.java @@ -0,0 +1,97 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.WatchBlocksCactusErrorResponseV1; +import org.openapitools.client.model.WatchBlocksCactusTransactionsEventV1; +import org.openapitools.client.model.WatchBlocksCactusTransactionsResponseV1; +import org.openapitools.client.model.WatchBlocksFilteredResponseV1; +import org.openapitools.client.model.WatchBlocksFullResponseV1; +import org.openapitools.client.model.WatchBlocksPrivateResponseV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksResponseV1 + */ +public class WatchBlocksResponseV1Test { + private final WatchBlocksResponseV1 model = new WatchBlocksResponseV1(); + + /** + * Model tests for WatchBlocksResponseV1 + */ + @Test + public void testWatchBlocksResponseV1() { + // TODO: test WatchBlocksResponseV1 + } + + /** + * Test the property 'cactusTransactionsEvents' + */ + @Test + public void cactusTransactionsEventsTest() { + // TODO: test cactusTransactionsEvents + } + + /** + * Test the property 'fullBlock' + */ + @Test + public void fullBlockTest() { + // TODO: test fullBlock + } + + /** + * Test the property 'filteredBlock' + */ + @Test + public void filteredBlockTest() { + // TODO: test filteredBlock + } + + /** + * Test the property 'privateBlock' + */ + @Test + public void privateBlockTest() { + // TODO: test privateBlock + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'errorMessage' + */ + @Test + public void errorMessageTest() { + // TODO: test errorMessage + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java new file mode 100644 index 00000000000..33e615ccb32 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1 + */ +public class WatchBlocksV1Test { + /** + * Model tests for WatchBlocksV1 + */ + @Test + public void testWatchBlocksV1() { + // TODO: test WatchBlocksV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WebSocketKeyTest.java b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WebSocketKeyTest.java new file mode 100644 index 00000000000..e3ac8725ef3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WebSocketKeyTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Fabric + * Can perform basic tasks on a fabric ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WebSocketKey + */ +public class WebSocketKeyTest { + private final WebSocketKey model = new WebSocketKey(); + + /** + * Model tests for WebSocketKey + */ + @Test + public void testWebSocketKey() { + // TODO: test WebSocketKey + } + + /** + * Test the property 'sessionId' + */ + @Test + public void sessionIdTest() { + // TODO: test sessionId + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/package.json b/packages/cactus-plugin-ledger-connector-iroha/package.json index 565451d3e22..f180ad27ff2 100644 --- a/packages/cactus-plugin-ledger-connector-iroha/package.json +++ b/packages/cactus-plugin-ledger-connector-iroha/package.json @@ -48,6 +48,8 @@ "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..1f979dbd09c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,59 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_add_asset_quantity_request_parameters.go +model_add_peer_request_parameters.go +model_add_signatory_request_parameters.go +model_append_role_request_parameters.go +model_call_engine_request_parameters.go +model_compare_and_set_account_detail_request_parameters.go +model_create_account_request_parameters.go +model_create_asset_request_parameters.go +model_create_domain_request_parameters.go +model_create_role_request_parameters.go +model_detach_role_request_parameters.go +model_error_exception_json_response_v1.go +model_error_exception_response_v1.go +model_generate_transaction_request_v1.go +model_get_account_asset_transactions_request_parameters.go +model_get_account_assets_request_parameters.go +model_get_account_detail_request_parameters.go +model_get_account_request_parameters.go +model_get_account_transactions_request_parameters.go +model_get_asset_info_request_parameters.go +model_get_block_request_parameters.go +model_get_engine_receipts_request_parameters.go +model_get_pending_transactions_request_parameters.go +model_get_role_permissions_request_parameters.go +model_get_signatories_request_parameters.go +model_get_transactions_request_parameters.go +model_grant_permission_request_parameters.go +model_iroha_base_config.go +model_iroha_block_progress.go +model_iroha_block_response.go +model_iroha_block_response_payload.go +model_iroha_command.go +model_iroha_query.go +model_iroha_socket_io_transact_v1.go +model_key_pair.go +model_remove_peer_request_parameters.go +model_remove_signatory_request_parameters.go +model_revoke_permission_request_parameters.go +model_run_transaction_request_v1.go +model_run_transaction_request_v1_body.go +model_run_transaction_request_v1_params.go +model_run_transaction_response.go +model_run_transaction_signed_request_v1.go +model_set_account_detail_request_parameters.go +model_set_account_quorum_request_parameters.go +model_subtract_asset_quantity_request_parameters.go +model_transfer_asset_request_parameters.go +model_watch_blocks_v1.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..bc904229cd4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,161 @@ +# Go API client for cactus-plugin-ledger-connector-iroha + +Can perform basic tasks on a Iroha ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-iroha "github.com/hyperledger/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-iroha.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-iroha.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-iroha.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-iroha.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GenerateTransactionV1**](docs/DefaultApi.md#generatetransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/generate-transaction | Generate transaction that can be signed locally. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**RunTransactionV1**](docs/DefaultApi.md#runtransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/run-transaction | Executes a transaction on a Iroha ledger + + +## Documentation For Models + + - [AddAssetQuantityRequestParameters](docs/AddAssetQuantityRequestParameters.md) + - [AddPeerRequestParameters](docs/AddPeerRequestParameters.md) + - [AddSignatoryRequestParameters](docs/AddSignatoryRequestParameters.md) + - [AppendRoleRequestParameters](docs/AppendRoleRequestParameters.md) + - [CallEngineRequestParameters](docs/CallEngineRequestParameters.md) + - [CompareAndSetAccountDetailRequestParameters](docs/CompareAndSetAccountDetailRequestParameters.md) + - [CreateAccountRequestParameters](docs/CreateAccountRequestParameters.md) + - [CreateAssetRequestParameters](docs/CreateAssetRequestParameters.md) + - [CreateDomainRequestParameters](docs/CreateDomainRequestParameters.md) + - [CreateRoleRequestParameters](docs/CreateRoleRequestParameters.md) + - [DetachRoleRequestParameters](docs/DetachRoleRequestParameters.md) + - [ErrorExceptionJsonResponseV1](docs/ErrorExceptionJsonResponseV1.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [GenerateTransactionRequestV1](docs/GenerateTransactionRequestV1.md) + - [GetAccountAssetTransactionsRequestParameters](docs/GetAccountAssetTransactionsRequestParameters.md) + - [GetAccountAssetsRequestParameters](docs/GetAccountAssetsRequestParameters.md) + - [GetAccountDetailRequestParameters](docs/GetAccountDetailRequestParameters.md) + - [GetAccountRequestParameters](docs/GetAccountRequestParameters.md) + - [GetAccountTransactionsRequestParameters](docs/GetAccountTransactionsRequestParameters.md) + - [GetAssetInfoRequestParameters](docs/GetAssetInfoRequestParameters.md) + - [GetBlockRequestParameters](docs/GetBlockRequestParameters.md) + - [GetEngineReceiptsRequestParameters](docs/GetEngineReceiptsRequestParameters.md) + - [GetPendingTransactionsRequestParameters](docs/GetPendingTransactionsRequestParameters.md) + - [GetRolePermissionsRequestParameters](docs/GetRolePermissionsRequestParameters.md) + - [GetSignatoriesRequestParameters](docs/GetSignatoriesRequestParameters.md) + - [GetTransactionsRequestParameters](docs/GetTransactionsRequestParameters.md) + - [GrantPermissionRequestParameters](docs/GrantPermissionRequestParameters.md) + - [IrohaBaseConfig](docs/IrohaBaseConfig.md) + - [IrohaBlockProgress](docs/IrohaBlockProgress.md) + - [IrohaBlockResponse](docs/IrohaBlockResponse.md) + - [IrohaBlockResponsePayload](docs/IrohaBlockResponsePayload.md) + - [IrohaCommand](docs/IrohaCommand.md) + - [IrohaQuery](docs/IrohaQuery.md) + - [IrohaSocketIOTransactV1](docs/IrohaSocketIOTransactV1.md) + - [KeyPair](docs/KeyPair.md) + - [RemovePeerRequestParameters](docs/RemovePeerRequestParameters.md) + - [RemoveSignatoryRequestParameters](docs/RemoveSignatoryRequestParameters.md) + - [RevokePermissionRequestParameters](docs/RevokePermissionRequestParameters.md) + - [RunTransactionRequestV1](docs/RunTransactionRequestV1.md) + - [RunTransactionRequestV1Body](docs/RunTransactionRequestV1Body.md) + - [RunTransactionRequestV1Params](docs/RunTransactionRequestV1Params.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [RunTransactionSignedRequestV1](docs/RunTransactionSignedRequestV1.md) + - [SetAccountDetailRequestParameters](docs/SetAccountDetailRequestParameters.md) + - [SetAccountQuorumRequestParameters](docs/SetAccountQuorumRequestParameters.md) + - [SubtractAssetQuantityRequestParameters](docs/SubtractAssetQuantityRequestParameters.md) + - [TransferAssetRequestParameters](docs/TransferAssetRequestParameters.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..648ae5e2016 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,897 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Iroha ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Iroha + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequestV1Body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionJsonResponseV1' + description: Bad Request error. + "405": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionJsonResponseV1' + description: Method Not Allowed error. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionJsonResponseV1' + description: Internal Server Error. + summary: Executes a transaction on a Iroha ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/run-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/generate-transaction: + post: + operationId: generateTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateTransactionRequestV1' + responses: + "200": + content: + application/octet-stream: + schema: + type: string + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Bad Request Error + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Generate transaction that can be signed locally. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/generate-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/get-prometheus-exporter-metrics +components: + schemas: + IrohaCommand: + enum: + - createAccount + - setAccountDetail + - setAccountQuorum + - compareAndSetAccountDetail + - createAsset + - addAssetQuantity + - subtractAssetQuantity + - transferAsset + - createDomain + - createRole + - detachRole + - appendRole + - addSignatory + - removeSignatory + - grantPermission + - revokePermission + - addPeer + - removePeer + - setSettingValue + - callEngine + type: string + x-enum-descriptions: + - "Make entity in the system, capable of sending transactions or queries, storing\ + \ signatories, personal data and identifiers." + - Set key-value information for a given account. + - "Set the number of signatories required to confirm the identity of a user,\ + \ who creates the transaction." + - Set key-value information for a given account if the old value matches the + value passed. + - "Create a new type of asset, unique in a domain. An asset is a countable representation\ + \ of a commodity." + - Increase the quantity of an asset on account of transaction creator. + - Decrease the number of assets on account of transaction creator. + - "Share assets within the account in peer network: in the way that source account\ + \ transfers assets to the target account." + - "Make new domain in Iroha network, which is a group of accounts." + - Create a new role in the system from the set of permissions. + - Detach a role from the set of roles of an account. + - "Promote an account to some created role in the system, where a role is a\ + \ set of permissions account has to perform an action (command or query)." + - Add an identifier to the account. Such identifier is a public key of another + device or a public key of another user. + - "Remove a public key, associated with an identity, from an account" + - Give another account rights to perform actions on the account of transaction + sender (give someone right to do something with my account). + - Revoke or dismiss given granted permission from another account in the network. + - Write into ledger the fact of peer addition into the peer network. + - Write into ledger the fact of peer removal from the network. + - "This command is not available for use, it was added for backward compatibility\ + \ with Iroha." + - This command is not availalbe for use because it is related to smart contract. + x-enum-varnames: + - CreateAccount + - SetAccountDetail + - SetAccountQuorum + - CompareAndSetAccountDetail + - CreateAsset + - AddAssetQuantity + - SubtractAssetQuantity + - TransferAsset + - CreateDomain + - CreateRole + - DetachRole + - AppendRole + - AddSignatory + - RemoveSignatory + - GrantPermission + - RevokePermission + - AddPeer + - RemovePeer + - SetSettingValue + - CallEngine + IrohaQuery: + enum: + - getAccount + - getAccountDetail + - getAssetInfo + - getAccountAssets + - getTransactions + - getPendingTransactions + - getAccountTransactions + - getAccountAssetTransactions + - getRoles + - getSignatories + - getRolePermissions + - getBlock + - getEngineReceipts + - fetchCommits + - getPeers + type: string + x-enum-descriptions: + - To get the state of an account + - To get details of the account. + - To get information on the given asset (as for now - its precision). + - To get the state of all assets in an account (a balance). + - "To retrieve information about transactions, based on their hashes." + - To retrieve a list of pending (not fully signed) multisignature transactions + or batches of transactions issued by account of query creator. + - To retrieve a list of transactions per account. + - To retrieve all transactions associated with given account and asset. + - To get existing roles in the system. + - "To get signatories, which act as an identity of the account." + - To get available permissions per role in the system. + - "To get a specific block, using its height as an identifier." + - To retrieve a receipt of a CallEngine command. Allows to access the event + log created during computations inside the EVM. + - "To get new blocks as soon as they are committed, a user can invoke FetchCommits\ + \ RPC call to Iroha network." + - A query that returns a list of peers in Iroha network. + x-enum-varnames: + - GetAccount + - GetAccountDetail + - GetAssetInfo + - GetAccountAssets + - GetTransactions + - GetPendingTransactions + - GetAccountTransactions + - GetAccountAssetTransactions + - GetRoles + - GetSignatories + - GetRolePermissions + - GetBlock + - GetEngineReceipts + - FetchCommits + - GetPeers + KeyPair: + properties: + publicKey: + description: SHA-3 ed25519 public keys of length 64 are recommended. + example: 313a07e6384776ed95447710d15e59148473ccfc052a681317a72a69f2a49910 + nullable: false + type: string + privateKey: + description: SHA-3 ed25519 private keys of length 64 are recommended. + example: f101537e319568c765b2cc89698325604991dca57b9716b58016b253506cab70 + nullable: false + type: string + required: + - privateKey + - publicKey + type: object + RunTransactionRequestV1Params: + oneOf: + - items: {} + type: array + - $ref: '#/components/schemas/AddAssetQuantityRequestParameters' + - $ref: '#/components/schemas/AddPeerRequestParameters' + - $ref: '#/components/schemas/AddSignatoryRequestParameters' + - $ref: '#/components/schemas/AppendRoleRequestParameters' + - $ref: '#/components/schemas/CallEngineRequestParameters' + - $ref: '#/components/schemas/CreateAccountRequestParameters' + - $ref: '#/components/schemas/CreateAssetRequestParameters' + - $ref: '#/components/schemas/CreateDomainRequestParameters' + - $ref: '#/components/schemas/CreateRoleRequestParameters' + - $ref: '#/components/schemas/DetachRoleRequestParameters' + - $ref: '#/components/schemas/GrantPermissionRequestParameters' + - $ref: '#/components/schemas/RemovePeerRequestParameters' + - $ref: '#/components/schemas/RemoveSignatoryRequestParameters' + - $ref: '#/components/schemas/RevokePermissionRequestParameters' + - $ref: '#/components/schemas/SetAccountDetailRequestParameters' + - $ref: '#/components/schemas/SetAccountQuorumRequestParameters' + - $ref: '#/components/schemas/SubtractAssetQuantityRequestParameters' + - $ref: '#/components/schemas/TransferAssetRequestParameters' + - $ref: '#/components/schemas/CompareAndSetAccountDetailRequestParameters' + - $ref: '#/components/schemas/GetAccountRequestParameters' + - $ref: '#/components/schemas/GetBlockRequestParameters' + - $ref: '#/components/schemas/GetSignatoriesRequestParameters' + - $ref: '#/components/schemas/GetTransactionsRequestParameters' + - $ref: '#/components/schemas/GetPendingTransactionsRequestParameters' + - $ref: '#/components/schemas/GetAccountTransactionsRequestParameters' + - $ref: '#/components/schemas/GetAccountAssetTransactionsRequestParameters' + - $ref: '#/components/schemas/GetAccountAssetsRequestParameters' + - $ref: '#/components/schemas/GetAccountDetailRequestParameters' + - $ref: '#/components/schemas/GetAssetInfoRequestParameters' + - $ref: '#/components/schemas/GetRolePermissionsRequestParameters' + - $ref: '#/components/schemas/GetEngineReceiptsRequestParameters' + RunTransactionRequestV1Body: + oneOf: + - $ref: '#/components/schemas/RunTransactionRequestV1' + - $ref: '#/components/schemas/RunTransactionSignedRequestV1' + RunTransactionRequestV1: + additionalProperties: false + properties: + commandName: + nullable: false + type: string + baseConfig: + $ref: '#/components/schemas/IrohaBaseConfig' + params: + $ref: '#/components/schemas/RunTransactionRequestV1Params' + required: + - baseConfig + - commandName + - params + type: object + AddAssetQuantityRequestParameters: + description: The list of arguments to pass in to the transaction request to + Add Asset Quantity. + properties: + assetId: + type: string + amount: + type: number + required: + - amount + - assetId + type: object + AddPeerRequestParameters: + description: The list of arguments to pass in to the transaction request to + Add Peer. + properties: + address: + type: string + peerKey: + type: string + tlsCertificate: + type: string + syncingPeer: + type: boolean + required: + - address + - peerKey + type: object + AddSignatoryRequestParameters: + description: The list of arguments to pass in to the transaction request to + Add Signatory. + properties: + accountId: + type: string + publicKey: + type: string + required: + - accountId + - publicKey + type: object + AppendRoleRequestParameters: + description: The list of arguments to pass in to the transaction request to + Append Role. + properties: + accountId: + type: string + roleName: + type: string + required: + - accountId + - roleName + type: object + CallEngineRequestParameters: + description: The list of arguments to pass in to the transaction request to + Call Engine. + properties: + caller: + type: string + callee: + type: string + input: + type: string + required: + - callee + - caller + - input + type: object + CreateAccountRequestParameters: + description: The list of arguments to pass in to the transaction request to + Create Account. + properties: + accountName: + type: string + domainId: + type: string + publicKey: + type: string + required: + - accountName + - domainId + - publicKey + type: object + CreateAssetRequestParameters: + description: The list of arguments to pass in to the transaction request to + Create Asset. + properties: + assetName: + type: string + domainId: + type: string + precision: + type: integer + required: + - assetName + - domainId + - precision + type: object + CreateDomainRequestParameters: + description: The list of arguments to pass in to the transaction request to + Create Domain. + properties: + domainId: + type: string + defaultRole: + type: string + required: + - defaultRole + - domainId + type: object + CreateRoleRequestParameters: + description: The list of arguments to pass in to the transaction request to + Create Role. + properties: + roleName: + type: string + permissionsList: + items: + type: number + type: array + required: + - permissionsList + - roleName + type: object + DetachRoleRequestParameters: + description: The list of arguments to pass in to the transaction request to + Detach Role. + properties: + accountId: + type: string + roleName: + type: string + required: + - accountId + - roleName + type: object + GrantPermissionRequestParameters: + description: The list of arguments to pass in to the transaction request to + Grant Permission. + properties: + accountId: + type: string + permission: + type: string + required: + - accountId + - permission + type: object + RemovePeerRequestParameters: + description: The list of arguments to pass in to the transaction request to + Remove Peer. + properties: + publicKey: + type: string + required: + - publicKey + type: object + RemoveSignatoryRequestParameters: + description: The list of arguments to pass in to the transaction request to + Remove Signatory. + properties: + accountId: + type: string + publicKey: + type: string + required: + - accountId + - publicKey + type: object + RevokePermissionRequestParameters: + description: The list of arguments to pass in to the transaction request to + Revoke Permission. + properties: + accountId: + type: string + permission: + type: number + required: + - accountId + - permission + type: object + SetAccountDetailRequestParameters: + description: The list of arguments to pass in to the transaction request to + Set Account Detail. + properties: + accountId: + type: string + key: + type: string + value: + type: string + required: + - accountId + - key + - value + type: object + SetAccountQuorumRequestParameters: + description: The list of arguments to pass in to the transaction request to + Set Account Quorum. + properties: + accountId: + type: string + quorum: + type: integer + required: + - accountId + - quorum + type: object + SubtractAssetQuantityRequestParameters: + description: The list of arguments to pass in to the transaction request to + Subtract Asset Quantity. + properties: + assetId: + type: string + amount: + type: number + required: + - amount + - assetId + type: object + TransferAssetRequestParameters: + description: The list of arguments to pass in to the transaction request to + Transfer Asset. + properties: + srcAccountId: + type: string + destAccountId: + type: string + assetId: + type: string + description: + type: string + amount: + type: number + required: + - amount + - assetId + - description + - destAccountId + - srcAccountId + type: object + CompareAndSetAccountDetailRequestParameters: + description: The list of arguments to pass in to the transaction request to + Compare And Set Account Detail. + properties: + accountId: + type: string + key: + type: string + value: + type: string + oldValue: + type: string + check_empty: + type: boolean + required: + - accountId + - check_empty + - key + - value + type: object + GetAccountRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account. + properties: + accountId: + type: string + required: + - accountId + type: object + GetBlockRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Block. + properties: + height: + type: integer + required: + - height + type: object + GetSignatoriesRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Signatories. + properties: + accountId: + type: string + required: + - accountId + type: object + GetTransactionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Transactions. + properties: + txHashesList: + items: + type: string + type: array + required: + - txHashesList + type: object + GetPendingTransactionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Pending Transactions. + properties: + pageSize: + type: integer + firstTxHash: + type: string + firstTxTime: + type: object + lastTxTime: + type: object + required: + - pageSize + type: object + GetAccountTransactionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account Transactions. + properties: + accountId: + type: string + pageSize: + type: integer + firstTxHash: + type: string + firstTxTime: + type: object + lastTxTime: + type: object + firstTxHeight: + type: integer + lastTxHeight: + type: integer + required: + - accountId + - firstTxHash + - pageSize + type: object + GetAccountAssetTransactionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account Asset Transactions. + properties: + accountId: + type: string + assetId: + type: string + pageSize: + type: integer + firstTxHash: + type: string + required: + - accountId + - assetId + - firstTxHash + - pageSize + type: object + GetAccountAssetsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account Assets. + properties: + accountId: + type: string + pageSize: + type: number + firstAssetId: + type: string + required: + - accountId + - pageSize + type: object + GetAccountDetailRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account Detail. + properties: + accountId: + type: string + key: + type: string + writer: + type: string + pageSize: + type: integer + paginationKey: + type: string + paginationWriter: + type: string + required: + - pageSize + - paginationKey + - paginationWriter + type: object + GetAssetInfoRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Asset Info. + properties: + assetId: + type: string + required: + - assetId + type: object + GetRolePermissionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Role Permissions. + properties: + roleId: + type: string + required: + - roleId + type: object + GetEngineReceiptsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Engine Receipts. + properties: + txHash: + type: string + required: + - txHash + type: object + RunTransactionSignedRequestV1: + properties: + signedTransaction: + description: Signed transaction binary data received from generate-transaction + endpoint. + type: string + baseConfig: + $ref: '#/components/schemas/IrohaBaseConfig' + required: + - signedTransaction + type: object + GenerateTransactionRequestV1: + additionalProperties: false + example: + creatorAccountId: creatorAccountId + commandName: "" + commandParams: "{}" + quorum: 0.8008281904610115 + properties: + commandName: + description: Iroha command name. + nullable: false + type: IrohaCommand + commandParams: + description: Parameters for iroha command specified in commandName + type: object + creatorAccountId: + description: Sender account id + nullable: false + type: string + quorum: + default: 1 + description: Requested transaction quorum + nullable: false + type: number + required: + - commandName + - commandParams + - creatorAccountId + type: object + IrohaBaseConfig: + additionalProperties: true + properties: + irohaHost: + nullable: false + type: string + irohaPort: + nullable: false + type: number + creatorAccountId: + nullable: false + type: string + privKey: + default: [] + items: {} + nullable: false + type: array + quorum: + nullable: false + type: number + timeoutLimit: + nullable: false + type: number + tls: + description: Can only be set to false for an insecure grpc connection. + nullable: false + type: boolean + monitorMode: + description: Flag used for monitoring. It changes default beahviour of transaction + wrapper so it return error to caller instead of throwing RuntimeError + straight away. + nullable: true + type: boolean + type: object + RunTransactionResponse: + example: + transactionReceipt: "" + properties: + transactionReceipt: {} + required: + - transactionReceipt + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + ErrorExceptionJsonResponseV1: + properties: + message: + nullable: false + type: string + name: + nullable: false + type: string + error: + nullable: false + type: string + stack: + nullable: false + type: string + cause: + nullable: false + type: string + required: + - message + type: object + ErrorExceptionResponseV1: + properties: + message: + nullable: false + type: string + error: + nullable: false + type: string + required: + - error + - message + type: object + WatchBlocksV1: + enum: + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + - SendAsyncRequest + - SendSyncRequest + IrohaSocketIOTransactV1: + enum: + - org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendAsyncRequest + - org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendSyncRequest + type: string + x-enum-varnames: + - SendAsyncRequest + - SendSyncRequest + IrohaBlockResponse: + properties: + payload: + $ref: '#/components/schemas/IrohaBlockResponse_payload' + signaturesList: + items: {} + type: array + required: + - payload + - signaturesList + type: object + IrohaBlockProgress: + properties: + transactionReceipt: + $ref: '#/components/schemas/IrohaBlockResponse' + required: + - transactionReceipt + type: object + IrohaBlockResponse_payload: + properties: + transactionsList: + items: {} + type: array + txNumber: + type: number + height: + type: number + prevBlockHash: + type: string + createdTime: + type: number + rejectedTransactionsHashesList: + items: {} + type: array + required: + - createdTime + - height + - prevBlockHash + - rejectedTransactionsHashesList + - transactionsList + - txNumber + type: object diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..743044ea896 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,383 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGenerateTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + generateTransactionRequestV1 *GenerateTransactionRequestV1 +} + +func (r ApiGenerateTransactionV1Request) GenerateTransactionRequestV1(generateTransactionRequestV1 GenerateTransactionRequestV1) ApiGenerateTransactionV1Request { + r.generateTransactionRequestV1 = &generateTransactionRequestV1 + return r +} + +func (r ApiGenerateTransactionV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GenerateTransactionV1Execute(r) +} + +/* +GenerateTransactionV1 Generate transaction that can be signed locally. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGenerateTransactionV1Request +*/ +func (a *DefaultApiService) GenerateTransactionV1(ctx context.Context) ApiGenerateTransactionV1Request { + return ApiGenerateTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GenerateTransactionV1Execute(r ApiGenerateTransactionV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GenerateTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/generate-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/octet-stream", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.generateTransactionRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRunTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + runTransactionRequestV1Body *RunTransactionRequestV1Body +} + +func (r ApiRunTransactionV1Request) RunTransactionRequestV1Body(runTransactionRequestV1Body RunTransactionRequestV1Body) ApiRunTransactionV1Request { + r.runTransactionRequestV1Body = &runTransactionRequestV1Body + return r +} + +func (r ApiRunTransactionV1Request) Execute() (*RunTransactionResponse, *http.Response, error) { + return r.ApiService.RunTransactionV1Execute(r) +} + +/* +RunTransactionV1 Executes a transaction on a Iroha ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRunTransactionV1Request +*/ +func (a *DefaultApiService) RunTransactionV1(ctx context.Context) ApiRunTransactionV1Request { + return ApiRunTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionResponse +func (a *DefaultApiService) RunTransactionV1Execute(r ApiRunTransactionV1Request) (*RunTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RunTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/run-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.runTransactionRequestV1Body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorExceptionJsonResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 405 { + var v ErrorExceptionJsonResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionJsonResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..6ded5d14772 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Connector Iroha API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..b57ec163ee2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..42d289bb66a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_asset_quantity_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_asset_quantity_request_parameters.go new file mode 100644 index 00000000000..b46372487c8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_asset_quantity_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the AddAssetQuantityRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddAssetQuantityRequestParameters{} + +// AddAssetQuantityRequestParameters The list of arguments to pass in to the transaction request to Add Asset Quantity. +type AddAssetQuantityRequestParameters struct { + AssetId string `json:"assetId"` + Amount float32 `json:"amount"` +} + +// NewAddAssetQuantityRequestParameters instantiates a new AddAssetQuantityRequestParameters 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 +// will change when the set of required properties is changed +func NewAddAssetQuantityRequestParameters(assetId string, amount float32) *AddAssetQuantityRequestParameters { + this := AddAssetQuantityRequestParameters{} + this.AssetId = assetId + this.Amount = amount + return &this +} + +// NewAddAssetQuantityRequestParametersWithDefaults instantiates a new AddAssetQuantityRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddAssetQuantityRequestParametersWithDefaults() *AddAssetQuantityRequestParameters { + this := AddAssetQuantityRequestParameters{} + return &this +} + +// GetAssetId returns the AssetId field value +func (o *AddAssetQuantityRequestParameters) GetAssetId() string { + if o == nil { + var ret string + return ret + } + + return o.AssetId +} + +// GetAssetIdOk returns a tuple with the AssetId field value +// and a boolean to check if the value has been set. +func (o *AddAssetQuantityRequestParameters) GetAssetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssetId, true +} + +// SetAssetId sets field value +func (o *AddAssetQuantityRequestParameters) SetAssetId(v string) { + o.AssetId = v +} + +// GetAmount returns the Amount field value +func (o *AddAssetQuantityRequestParameters) GetAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *AddAssetQuantityRequestParameters) GetAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *AddAssetQuantityRequestParameters) SetAmount(v float32) { + o.Amount = v +} + +func (o AddAssetQuantityRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddAssetQuantityRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["assetId"] = o.AssetId + toSerialize["amount"] = o.Amount + return toSerialize, nil +} + +type NullableAddAssetQuantityRequestParameters struct { + value *AddAssetQuantityRequestParameters + isSet bool +} + +func (v NullableAddAssetQuantityRequestParameters) Get() *AddAssetQuantityRequestParameters { + return v.value +} + +func (v *NullableAddAssetQuantityRequestParameters) Set(val *AddAssetQuantityRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableAddAssetQuantityRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableAddAssetQuantityRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddAssetQuantityRequestParameters(val *AddAssetQuantityRequestParameters) *NullableAddAssetQuantityRequestParameters { + return &NullableAddAssetQuantityRequestParameters{value: val, isSet: true} +} + +func (v NullableAddAssetQuantityRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddAssetQuantityRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_peer_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_peer_request_parameters.go new file mode 100644 index 00000000000..0c3d2629e18 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_peer_request_parameters.go @@ -0,0 +1,216 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the AddPeerRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddPeerRequestParameters{} + +// AddPeerRequestParameters The list of arguments to pass in to the transaction request to Add Peer. +type AddPeerRequestParameters struct { + Address string `json:"address"` + PeerKey string `json:"peerKey"` + TlsCertificate *string `json:"tlsCertificate,omitempty"` + SyncingPeer *bool `json:"syncingPeer,omitempty"` +} + +// NewAddPeerRequestParameters instantiates a new AddPeerRequestParameters 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 +// will change when the set of required properties is changed +func NewAddPeerRequestParameters(address string, peerKey string) *AddPeerRequestParameters { + this := AddPeerRequestParameters{} + this.Address = address + this.PeerKey = peerKey + return &this +} + +// NewAddPeerRequestParametersWithDefaults instantiates a new AddPeerRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddPeerRequestParametersWithDefaults() *AddPeerRequestParameters { + this := AddPeerRequestParameters{} + return &this +} + +// GetAddress returns the Address field value +func (o *AddPeerRequestParameters) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *AddPeerRequestParameters) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *AddPeerRequestParameters) SetAddress(v string) { + o.Address = v +} + +// GetPeerKey returns the PeerKey field value +func (o *AddPeerRequestParameters) GetPeerKey() string { + if o == nil { + var ret string + return ret + } + + return o.PeerKey +} + +// GetPeerKeyOk returns a tuple with the PeerKey field value +// and a boolean to check if the value has been set. +func (o *AddPeerRequestParameters) GetPeerKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PeerKey, true +} + +// SetPeerKey sets field value +func (o *AddPeerRequestParameters) SetPeerKey(v string) { + o.PeerKey = v +} + +// GetTlsCertificate returns the TlsCertificate field value if set, zero value otherwise. +func (o *AddPeerRequestParameters) GetTlsCertificate() string { + if o == nil || IsNil(o.TlsCertificate) { + var ret string + return ret + } + return *o.TlsCertificate +} + +// GetTlsCertificateOk returns a tuple with the TlsCertificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddPeerRequestParameters) GetTlsCertificateOk() (*string, bool) { + if o == nil || IsNil(o.TlsCertificate) { + return nil, false + } + return o.TlsCertificate, true +} + +// HasTlsCertificate returns a boolean if a field has been set. +func (o *AddPeerRequestParameters) HasTlsCertificate() bool { + if o != nil && !IsNil(o.TlsCertificate) { + return true + } + + return false +} + +// SetTlsCertificate gets a reference to the given string and assigns it to the TlsCertificate field. +func (o *AddPeerRequestParameters) SetTlsCertificate(v string) { + o.TlsCertificate = &v +} + +// GetSyncingPeer returns the SyncingPeer field value if set, zero value otherwise. +func (o *AddPeerRequestParameters) GetSyncingPeer() bool { + if o == nil || IsNil(o.SyncingPeer) { + var ret bool + return ret + } + return *o.SyncingPeer +} + +// GetSyncingPeerOk returns a tuple with the SyncingPeer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddPeerRequestParameters) GetSyncingPeerOk() (*bool, bool) { + if o == nil || IsNil(o.SyncingPeer) { + return nil, false + } + return o.SyncingPeer, true +} + +// HasSyncingPeer returns a boolean if a field has been set. +func (o *AddPeerRequestParameters) HasSyncingPeer() bool { + if o != nil && !IsNil(o.SyncingPeer) { + return true + } + + return false +} + +// SetSyncingPeer gets a reference to the given bool and assigns it to the SyncingPeer field. +func (o *AddPeerRequestParameters) SetSyncingPeer(v bool) { + o.SyncingPeer = &v +} + +func (o AddPeerRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddPeerRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address"] = o.Address + toSerialize["peerKey"] = o.PeerKey + if !IsNil(o.TlsCertificate) { + toSerialize["tlsCertificate"] = o.TlsCertificate + } + if !IsNil(o.SyncingPeer) { + toSerialize["syncingPeer"] = o.SyncingPeer + } + return toSerialize, nil +} + +type NullableAddPeerRequestParameters struct { + value *AddPeerRequestParameters + isSet bool +} + +func (v NullableAddPeerRequestParameters) Get() *AddPeerRequestParameters { + return v.value +} + +func (v *NullableAddPeerRequestParameters) Set(val *AddPeerRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableAddPeerRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableAddPeerRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddPeerRequestParameters(val *AddPeerRequestParameters) *NullableAddPeerRequestParameters { + return &NullableAddPeerRequestParameters{value: val, isSet: true} +} + +func (v NullableAddPeerRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddPeerRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_signatory_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_signatory_request_parameters.go new file mode 100644 index 00000000000..48079c0c38f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_add_signatory_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the AddSignatoryRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddSignatoryRequestParameters{} + +// AddSignatoryRequestParameters The list of arguments to pass in to the transaction request to Add Signatory. +type AddSignatoryRequestParameters struct { + AccountId string `json:"accountId"` + PublicKey string `json:"publicKey"` +} + +// NewAddSignatoryRequestParameters instantiates a new AddSignatoryRequestParameters 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 +// will change when the set of required properties is changed +func NewAddSignatoryRequestParameters(accountId string, publicKey string) *AddSignatoryRequestParameters { + this := AddSignatoryRequestParameters{} + this.AccountId = accountId + this.PublicKey = publicKey + return &this +} + +// NewAddSignatoryRequestParametersWithDefaults instantiates a new AddSignatoryRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddSignatoryRequestParametersWithDefaults() *AddSignatoryRequestParameters { + this := AddSignatoryRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *AddSignatoryRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *AddSignatoryRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *AddSignatoryRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetPublicKey returns the PublicKey field value +func (o *AddSignatoryRequestParameters) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *AddSignatoryRequestParameters) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *AddSignatoryRequestParameters) SetPublicKey(v string) { + o.PublicKey = v +} + +func (o AddSignatoryRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddSignatoryRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["publicKey"] = o.PublicKey + return toSerialize, nil +} + +type NullableAddSignatoryRequestParameters struct { + value *AddSignatoryRequestParameters + isSet bool +} + +func (v NullableAddSignatoryRequestParameters) Get() *AddSignatoryRequestParameters { + return v.value +} + +func (v *NullableAddSignatoryRequestParameters) Set(val *AddSignatoryRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableAddSignatoryRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableAddSignatoryRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddSignatoryRequestParameters(val *AddSignatoryRequestParameters) *NullableAddSignatoryRequestParameters { + return &NullableAddSignatoryRequestParameters{value: val, isSet: true} +} + +func (v NullableAddSignatoryRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddSignatoryRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_append_role_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_append_role_request_parameters.go new file mode 100644 index 00000000000..d9a7cd8324a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_append_role_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the AppendRoleRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AppendRoleRequestParameters{} + +// AppendRoleRequestParameters The list of arguments to pass in to the transaction request to Append Role. +type AppendRoleRequestParameters struct { + AccountId string `json:"accountId"` + RoleName string `json:"roleName"` +} + +// NewAppendRoleRequestParameters instantiates a new AppendRoleRequestParameters 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 +// will change when the set of required properties is changed +func NewAppendRoleRequestParameters(accountId string, roleName string) *AppendRoleRequestParameters { + this := AppendRoleRequestParameters{} + this.AccountId = accountId + this.RoleName = roleName + return &this +} + +// NewAppendRoleRequestParametersWithDefaults instantiates a new AppendRoleRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAppendRoleRequestParametersWithDefaults() *AppendRoleRequestParameters { + this := AppendRoleRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *AppendRoleRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *AppendRoleRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *AppendRoleRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetRoleName returns the RoleName field value +func (o *AppendRoleRequestParameters) GetRoleName() string { + if o == nil { + var ret string + return ret + } + + return o.RoleName +} + +// GetRoleNameOk returns a tuple with the RoleName field value +// and a boolean to check if the value has been set. +func (o *AppendRoleRequestParameters) GetRoleNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RoleName, true +} + +// SetRoleName sets field value +func (o *AppendRoleRequestParameters) SetRoleName(v string) { + o.RoleName = v +} + +func (o AppendRoleRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AppendRoleRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["roleName"] = o.RoleName + return toSerialize, nil +} + +type NullableAppendRoleRequestParameters struct { + value *AppendRoleRequestParameters + isSet bool +} + +func (v NullableAppendRoleRequestParameters) Get() *AppendRoleRequestParameters { + return v.value +} + +func (v *NullableAppendRoleRequestParameters) Set(val *AppendRoleRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableAppendRoleRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableAppendRoleRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAppendRoleRequestParameters(val *AppendRoleRequestParameters) *NullableAppendRoleRequestParameters { + return &NullableAppendRoleRequestParameters{value: val, isSet: true} +} + +func (v NullableAppendRoleRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAppendRoleRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_call_engine_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_call_engine_request_parameters.go new file mode 100644 index 00000000000..9059a1038b7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_call_engine_request_parameters.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the CallEngineRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CallEngineRequestParameters{} + +// CallEngineRequestParameters The list of arguments to pass in to the transaction request to Call Engine. +type CallEngineRequestParameters struct { + Caller string `json:"caller"` + Callee string `json:"callee"` + Input string `json:"input"` +} + +// NewCallEngineRequestParameters instantiates a new CallEngineRequestParameters 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 +// will change when the set of required properties is changed +func NewCallEngineRequestParameters(caller string, callee string, input string) *CallEngineRequestParameters { + this := CallEngineRequestParameters{} + this.Caller = caller + this.Callee = callee + this.Input = input + return &this +} + +// NewCallEngineRequestParametersWithDefaults instantiates a new CallEngineRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCallEngineRequestParametersWithDefaults() *CallEngineRequestParameters { + this := CallEngineRequestParameters{} + return &this +} + +// GetCaller returns the Caller field value +func (o *CallEngineRequestParameters) GetCaller() string { + if o == nil { + var ret string + return ret + } + + return o.Caller +} + +// GetCallerOk returns a tuple with the Caller field value +// and a boolean to check if the value has been set. +func (o *CallEngineRequestParameters) GetCallerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Caller, true +} + +// SetCaller sets field value +func (o *CallEngineRequestParameters) SetCaller(v string) { + o.Caller = v +} + +// GetCallee returns the Callee field value +func (o *CallEngineRequestParameters) GetCallee() string { + if o == nil { + var ret string + return ret + } + + return o.Callee +} + +// GetCalleeOk returns a tuple with the Callee field value +// and a boolean to check if the value has been set. +func (o *CallEngineRequestParameters) GetCalleeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Callee, true +} + +// SetCallee sets field value +func (o *CallEngineRequestParameters) SetCallee(v string) { + o.Callee = v +} + +// GetInput returns the Input field value +func (o *CallEngineRequestParameters) GetInput() string { + if o == nil { + var ret string + return ret + } + + return o.Input +} + +// GetInputOk returns a tuple with the Input field value +// and a boolean to check if the value has been set. +func (o *CallEngineRequestParameters) GetInputOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Input, true +} + +// SetInput sets field value +func (o *CallEngineRequestParameters) SetInput(v string) { + o.Input = v +} + +func (o CallEngineRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CallEngineRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["caller"] = o.Caller + toSerialize["callee"] = o.Callee + toSerialize["input"] = o.Input + return toSerialize, nil +} + +type NullableCallEngineRequestParameters struct { + value *CallEngineRequestParameters + isSet bool +} + +func (v NullableCallEngineRequestParameters) Get() *CallEngineRequestParameters { + return v.value +} + +func (v *NullableCallEngineRequestParameters) Set(val *CallEngineRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableCallEngineRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableCallEngineRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCallEngineRequestParameters(val *CallEngineRequestParameters) *NullableCallEngineRequestParameters { + return &NullableCallEngineRequestParameters{value: val, isSet: true} +} + +func (v NullableCallEngineRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCallEngineRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_compare_and_set_account_detail_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_compare_and_set_account_detail_request_parameters.go new file mode 100644 index 00000000000..e870b84340b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_compare_and_set_account_detail_request_parameters.go @@ -0,0 +1,234 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the CompareAndSetAccountDetailRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CompareAndSetAccountDetailRequestParameters{} + +// CompareAndSetAccountDetailRequestParameters The list of arguments to pass in to the transaction request to Compare And Set Account Detail. +type CompareAndSetAccountDetailRequestParameters struct { + AccountId string `json:"accountId"` + Key string `json:"key"` + Value string `json:"value"` + OldValue *string `json:"oldValue,omitempty"` + CheckEmpty bool `json:"check_empty"` +} + +// NewCompareAndSetAccountDetailRequestParameters instantiates a new CompareAndSetAccountDetailRequestParameters 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 +// will change when the set of required properties is changed +func NewCompareAndSetAccountDetailRequestParameters(accountId string, key string, value string, checkEmpty bool) *CompareAndSetAccountDetailRequestParameters { + this := CompareAndSetAccountDetailRequestParameters{} + this.AccountId = accountId + this.Key = key + this.Value = value + this.CheckEmpty = checkEmpty + return &this +} + +// NewCompareAndSetAccountDetailRequestParametersWithDefaults instantiates a new CompareAndSetAccountDetailRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCompareAndSetAccountDetailRequestParametersWithDefaults() *CompareAndSetAccountDetailRequestParameters { + this := CompareAndSetAccountDetailRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *CompareAndSetAccountDetailRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *CompareAndSetAccountDetailRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *CompareAndSetAccountDetailRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetKey returns the Key field value +func (o *CompareAndSetAccountDetailRequestParameters) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *CompareAndSetAccountDetailRequestParameters) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *CompareAndSetAccountDetailRequestParameters) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *CompareAndSetAccountDetailRequestParameters) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *CompareAndSetAccountDetailRequestParameters) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *CompareAndSetAccountDetailRequestParameters) SetValue(v string) { + o.Value = v +} + +// GetOldValue returns the OldValue field value if set, zero value otherwise. +func (o *CompareAndSetAccountDetailRequestParameters) GetOldValue() string { + if o == nil || IsNil(o.OldValue) { + var ret string + return ret + } + return *o.OldValue +} + +// GetOldValueOk returns a tuple with the OldValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CompareAndSetAccountDetailRequestParameters) GetOldValueOk() (*string, bool) { + if o == nil || IsNil(o.OldValue) { + return nil, false + } + return o.OldValue, true +} + +// HasOldValue returns a boolean if a field has been set. +func (o *CompareAndSetAccountDetailRequestParameters) HasOldValue() bool { + if o != nil && !IsNil(o.OldValue) { + return true + } + + return false +} + +// SetOldValue gets a reference to the given string and assigns it to the OldValue field. +func (o *CompareAndSetAccountDetailRequestParameters) SetOldValue(v string) { + o.OldValue = &v +} + +// GetCheckEmpty returns the CheckEmpty field value +func (o *CompareAndSetAccountDetailRequestParameters) GetCheckEmpty() bool { + if o == nil { + var ret bool + return ret + } + + return o.CheckEmpty +} + +// GetCheckEmptyOk returns a tuple with the CheckEmpty field value +// and a boolean to check if the value has been set. +func (o *CompareAndSetAccountDetailRequestParameters) GetCheckEmptyOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.CheckEmpty, true +} + +// SetCheckEmpty sets field value +func (o *CompareAndSetAccountDetailRequestParameters) SetCheckEmpty(v bool) { + o.CheckEmpty = v +} + +func (o CompareAndSetAccountDetailRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CompareAndSetAccountDetailRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + if !IsNil(o.OldValue) { + toSerialize["oldValue"] = o.OldValue + } + toSerialize["check_empty"] = o.CheckEmpty + return toSerialize, nil +} + +type NullableCompareAndSetAccountDetailRequestParameters struct { + value *CompareAndSetAccountDetailRequestParameters + isSet bool +} + +func (v NullableCompareAndSetAccountDetailRequestParameters) Get() *CompareAndSetAccountDetailRequestParameters { + return v.value +} + +func (v *NullableCompareAndSetAccountDetailRequestParameters) Set(val *CompareAndSetAccountDetailRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableCompareAndSetAccountDetailRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableCompareAndSetAccountDetailRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCompareAndSetAccountDetailRequestParameters(val *CompareAndSetAccountDetailRequestParameters) *NullableCompareAndSetAccountDetailRequestParameters { + return &NullableCompareAndSetAccountDetailRequestParameters{value: val, isSet: true} +} + +func (v NullableCompareAndSetAccountDetailRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCompareAndSetAccountDetailRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_account_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_account_request_parameters.go new file mode 100644 index 00000000000..ab7f545591c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_account_request_parameters.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the CreateAccountRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateAccountRequestParameters{} + +// CreateAccountRequestParameters The list of arguments to pass in to the transaction request to Create Account. +type CreateAccountRequestParameters struct { + AccountName string `json:"accountName"` + DomainId string `json:"domainId"` + PublicKey string `json:"publicKey"` +} + +// NewCreateAccountRequestParameters instantiates a new CreateAccountRequestParameters 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 +// will change when the set of required properties is changed +func NewCreateAccountRequestParameters(accountName string, domainId string, publicKey string) *CreateAccountRequestParameters { + this := CreateAccountRequestParameters{} + this.AccountName = accountName + this.DomainId = domainId + this.PublicKey = publicKey + return &this +} + +// NewCreateAccountRequestParametersWithDefaults instantiates a new CreateAccountRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateAccountRequestParametersWithDefaults() *CreateAccountRequestParameters { + this := CreateAccountRequestParameters{} + return &this +} + +// GetAccountName returns the AccountName field value +func (o *CreateAccountRequestParameters) GetAccountName() string { + if o == nil { + var ret string + return ret + } + + return o.AccountName +} + +// GetAccountNameOk returns a tuple with the AccountName field value +// and a boolean to check if the value has been set. +func (o *CreateAccountRequestParameters) GetAccountNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountName, true +} + +// SetAccountName sets field value +func (o *CreateAccountRequestParameters) SetAccountName(v string) { + o.AccountName = v +} + +// GetDomainId returns the DomainId field value +func (o *CreateAccountRequestParameters) GetDomainId() string { + if o == nil { + var ret string + return ret + } + + return o.DomainId +} + +// GetDomainIdOk returns a tuple with the DomainId field value +// and a boolean to check if the value has been set. +func (o *CreateAccountRequestParameters) GetDomainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DomainId, true +} + +// SetDomainId sets field value +func (o *CreateAccountRequestParameters) SetDomainId(v string) { + o.DomainId = v +} + +// GetPublicKey returns the PublicKey field value +func (o *CreateAccountRequestParameters) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *CreateAccountRequestParameters) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *CreateAccountRequestParameters) SetPublicKey(v string) { + o.PublicKey = v +} + +func (o CreateAccountRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateAccountRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountName"] = o.AccountName + toSerialize["domainId"] = o.DomainId + toSerialize["publicKey"] = o.PublicKey + return toSerialize, nil +} + +type NullableCreateAccountRequestParameters struct { + value *CreateAccountRequestParameters + isSet bool +} + +func (v NullableCreateAccountRequestParameters) Get() *CreateAccountRequestParameters { + return v.value +} + +func (v *NullableCreateAccountRequestParameters) Set(val *CreateAccountRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableCreateAccountRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateAccountRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateAccountRequestParameters(val *CreateAccountRequestParameters) *NullableCreateAccountRequestParameters { + return &NullableCreateAccountRequestParameters{value: val, isSet: true} +} + +func (v NullableCreateAccountRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateAccountRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_asset_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_asset_request_parameters.go new file mode 100644 index 00000000000..9ea93b702ea --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_asset_request_parameters.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the CreateAssetRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateAssetRequestParameters{} + +// CreateAssetRequestParameters The list of arguments to pass in to the transaction request to Create Asset. +type CreateAssetRequestParameters struct { + AssetName string `json:"assetName"` + DomainId string `json:"domainId"` + Precision int32 `json:"precision"` +} + +// NewCreateAssetRequestParameters instantiates a new CreateAssetRequestParameters 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 +// will change when the set of required properties is changed +func NewCreateAssetRequestParameters(assetName string, domainId string, precision int32) *CreateAssetRequestParameters { + this := CreateAssetRequestParameters{} + this.AssetName = assetName + this.DomainId = domainId + this.Precision = precision + return &this +} + +// NewCreateAssetRequestParametersWithDefaults instantiates a new CreateAssetRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateAssetRequestParametersWithDefaults() *CreateAssetRequestParameters { + this := CreateAssetRequestParameters{} + return &this +} + +// GetAssetName returns the AssetName field value +func (o *CreateAssetRequestParameters) GetAssetName() string { + if o == nil { + var ret string + return ret + } + + return o.AssetName +} + +// GetAssetNameOk returns a tuple with the AssetName field value +// and a boolean to check if the value has been set. +func (o *CreateAssetRequestParameters) GetAssetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssetName, true +} + +// SetAssetName sets field value +func (o *CreateAssetRequestParameters) SetAssetName(v string) { + o.AssetName = v +} + +// GetDomainId returns the DomainId field value +func (o *CreateAssetRequestParameters) GetDomainId() string { + if o == nil { + var ret string + return ret + } + + return o.DomainId +} + +// GetDomainIdOk returns a tuple with the DomainId field value +// and a boolean to check if the value has been set. +func (o *CreateAssetRequestParameters) GetDomainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DomainId, true +} + +// SetDomainId sets field value +func (o *CreateAssetRequestParameters) SetDomainId(v string) { + o.DomainId = v +} + +// GetPrecision returns the Precision field value +func (o *CreateAssetRequestParameters) GetPrecision() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Precision +} + +// GetPrecisionOk returns a tuple with the Precision field value +// and a boolean to check if the value has been set. +func (o *CreateAssetRequestParameters) GetPrecisionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Precision, true +} + +// SetPrecision sets field value +func (o *CreateAssetRequestParameters) SetPrecision(v int32) { + o.Precision = v +} + +func (o CreateAssetRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateAssetRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["assetName"] = o.AssetName + toSerialize["domainId"] = o.DomainId + toSerialize["precision"] = o.Precision + return toSerialize, nil +} + +type NullableCreateAssetRequestParameters struct { + value *CreateAssetRequestParameters + isSet bool +} + +func (v NullableCreateAssetRequestParameters) Get() *CreateAssetRequestParameters { + return v.value +} + +func (v *NullableCreateAssetRequestParameters) Set(val *CreateAssetRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableCreateAssetRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateAssetRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateAssetRequestParameters(val *CreateAssetRequestParameters) *NullableCreateAssetRequestParameters { + return &NullableCreateAssetRequestParameters{value: val, isSet: true} +} + +func (v NullableCreateAssetRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateAssetRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_domain_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_domain_request_parameters.go new file mode 100644 index 00000000000..37023403c17 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_domain_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the CreateDomainRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDomainRequestParameters{} + +// CreateDomainRequestParameters The list of arguments to pass in to the transaction request to Create Domain. +type CreateDomainRequestParameters struct { + DomainId string `json:"domainId"` + DefaultRole string `json:"defaultRole"` +} + +// NewCreateDomainRequestParameters instantiates a new CreateDomainRequestParameters 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 +// will change when the set of required properties is changed +func NewCreateDomainRequestParameters(domainId string, defaultRole string) *CreateDomainRequestParameters { + this := CreateDomainRequestParameters{} + this.DomainId = domainId + this.DefaultRole = defaultRole + return &this +} + +// NewCreateDomainRequestParametersWithDefaults instantiates a new CreateDomainRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateDomainRequestParametersWithDefaults() *CreateDomainRequestParameters { + this := CreateDomainRequestParameters{} + return &this +} + +// GetDomainId returns the DomainId field value +func (o *CreateDomainRequestParameters) GetDomainId() string { + if o == nil { + var ret string + return ret + } + + return o.DomainId +} + +// GetDomainIdOk returns a tuple with the DomainId field value +// and a boolean to check if the value has been set. +func (o *CreateDomainRequestParameters) GetDomainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DomainId, true +} + +// SetDomainId sets field value +func (o *CreateDomainRequestParameters) SetDomainId(v string) { + o.DomainId = v +} + +// GetDefaultRole returns the DefaultRole field value +func (o *CreateDomainRequestParameters) GetDefaultRole() string { + if o == nil { + var ret string + return ret + } + + return o.DefaultRole +} + +// GetDefaultRoleOk returns a tuple with the DefaultRole field value +// and a boolean to check if the value has been set. +func (o *CreateDomainRequestParameters) GetDefaultRoleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DefaultRole, true +} + +// SetDefaultRole sets field value +func (o *CreateDomainRequestParameters) SetDefaultRole(v string) { + o.DefaultRole = v +} + +func (o CreateDomainRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateDomainRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["domainId"] = o.DomainId + toSerialize["defaultRole"] = o.DefaultRole + return toSerialize, nil +} + +type NullableCreateDomainRequestParameters struct { + value *CreateDomainRequestParameters + isSet bool +} + +func (v NullableCreateDomainRequestParameters) Get() *CreateDomainRequestParameters { + return v.value +} + +func (v *NullableCreateDomainRequestParameters) Set(val *CreateDomainRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDomainRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDomainRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDomainRequestParameters(val *CreateDomainRequestParameters) *NullableCreateDomainRequestParameters { + return &NullableCreateDomainRequestParameters{value: val, isSet: true} +} + +func (v NullableCreateDomainRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDomainRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_role_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_role_request_parameters.go new file mode 100644 index 00000000000..c5da347b71d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_create_role_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the CreateRoleRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateRoleRequestParameters{} + +// CreateRoleRequestParameters The list of arguments to pass in to the transaction request to Create Role. +type CreateRoleRequestParameters struct { + RoleName string `json:"roleName"` + PermissionsList []float32 `json:"permissionsList"` +} + +// NewCreateRoleRequestParameters instantiates a new CreateRoleRequestParameters 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 +// will change when the set of required properties is changed +func NewCreateRoleRequestParameters(roleName string, permissionsList []float32) *CreateRoleRequestParameters { + this := CreateRoleRequestParameters{} + this.RoleName = roleName + this.PermissionsList = permissionsList + return &this +} + +// NewCreateRoleRequestParametersWithDefaults instantiates a new CreateRoleRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateRoleRequestParametersWithDefaults() *CreateRoleRequestParameters { + this := CreateRoleRequestParameters{} + return &this +} + +// GetRoleName returns the RoleName field value +func (o *CreateRoleRequestParameters) GetRoleName() string { + if o == nil { + var ret string + return ret + } + + return o.RoleName +} + +// GetRoleNameOk returns a tuple with the RoleName field value +// and a boolean to check if the value has been set. +func (o *CreateRoleRequestParameters) GetRoleNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RoleName, true +} + +// SetRoleName sets field value +func (o *CreateRoleRequestParameters) SetRoleName(v string) { + o.RoleName = v +} + +// GetPermissionsList returns the PermissionsList field value +func (o *CreateRoleRequestParameters) GetPermissionsList() []float32 { + if o == nil { + var ret []float32 + return ret + } + + return o.PermissionsList +} + +// GetPermissionsListOk returns a tuple with the PermissionsList field value +// and a boolean to check if the value has been set. +func (o *CreateRoleRequestParameters) GetPermissionsListOk() ([]float32, bool) { + if o == nil { + return nil, false + } + return o.PermissionsList, true +} + +// SetPermissionsList sets field value +func (o *CreateRoleRequestParameters) SetPermissionsList(v []float32) { + o.PermissionsList = v +} + +func (o CreateRoleRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateRoleRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["roleName"] = o.RoleName + toSerialize["permissionsList"] = o.PermissionsList + return toSerialize, nil +} + +type NullableCreateRoleRequestParameters struct { + value *CreateRoleRequestParameters + isSet bool +} + +func (v NullableCreateRoleRequestParameters) Get() *CreateRoleRequestParameters { + return v.value +} + +func (v *NullableCreateRoleRequestParameters) Set(val *CreateRoleRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableCreateRoleRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateRoleRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateRoleRequestParameters(val *CreateRoleRequestParameters) *NullableCreateRoleRequestParameters { + return &NullableCreateRoleRequestParameters{value: val, isSet: true} +} + +func (v NullableCreateRoleRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateRoleRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_detach_role_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_detach_role_request_parameters.go new file mode 100644 index 00000000000..b29234c3df8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_detach_role_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the DetachRoleRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DetachRoleRequestParameters{} + +// DetachRoleRequestParameters The list of arguments to pass in to the transaction request to Detach Role. +type DetachRoleRequestParameters struct { + AccountId string `json:"accountId"` + RoleName string `json:"roleName"` +} + +// NewDetachRoleRequestParameters instantiates a new DetachRoleRequestParameters 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 +// will change when the set of required properties is changed +func NewDetachRoleRequestParameters(accountId string, roleName string) *DetachRoleRequestParameters { + this := DetachRoleRequestParameters{} + this.AccountId = accountId + this.RoleName = roleName + return &this +} + +// NewDetachRoleRequestParametersWithDefaults instantiates a new DetachRoleRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDetachRoleRequestParametersWithDefaults() *DetachRoleRequestParameters { + this := DetachRoleRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *DetachRoleRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *DetachRoleRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *DetachRoleRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetRoleName returns the RoleName field value +func (o *DetachRoleRequestParameters) GetRoleName() string { + if o == nil { + var ret string + return ret + } + + return o.RoleName +} + +// GetRoleNameOk returns a tuple with the RoleName field value +// and a boolean to check if the value has been set. +func (o *DetachRoleRequestParameters) GetRoleNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RoleName, true +} + +// SetRoleName sets field value +func (o *DetachRoleRequestParameters) SetRoleName(v string) { + o.RoleName = v +} + +func (o DetachRoleRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DetachRoleRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["roleName"] = o.RoleName + return toSerialize, nil +} + +type NullableDetachRoleRequestParameters struct { + value *DetachRoleRequestParameters + isSet bool +} + +func (v NullableDetachRoleRequestParameters) Get() *DetachRoleRequestParameters { + return v.value +} + +func (v *NullableDetachRoleRequestParameters) Set(val *DetachRoleRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableDetachRoleRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableDetachRoleRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDetachRoleRequestParameters(val *DetachRoleRequestParameters) *NullableDetachRoleRequestParameters { + return &NullableDetachRoleRequestParameters{value: val, isSet: true} +} + +func (v NullableDetachRoleRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDetachRoleRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_error_exception_json_response_v1.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_error_exception_json_response_v1.go new file mode 100644 index 00000000000..8a7c9fc42e3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_error_exception_json_response_v1.go @@ -0,0 +1,261 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the ErrorExceptionJsonResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorExceptionJsonResponseV1{} + +// ErrorExceptionJsonResponseV1 struct for ErrorExceptionJsonResponseV1 +type ErrorExceptionJsonResponseV1 struct { + Message string `json:"message"` + Name *string `json:"name,omitempty"` + Error *string `json:"error,omitempty"` + Stack *string `json:"stack,omitempty"` + Cause *string `json:"cause,omitempty"` +} + +// NewErrorExceptionJsonResponseV1 instantiates a new ErrorExceptionJsonResponseV1 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 +// will change when the set of required properties is changed +func NewErrorExceptionJsonResponseV1(message string) *ErrorExceptionJsonResponseV1 { + this := ErrorExceptionJsonResponseV1{} + this.Message = message + return &this +} + +// NewErrorExceptionJsonResponseV1WithDefaults instantiates a new ErrorExceptionJsonResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorExceptionJsonResponseV1WithDefaults() *ErrorExceptionJsonResponseV1 { + this := ErrorExceptionJsonResponseV1{} + return &this +} + +// GetMessage returns the Message field value +func (o *ErrorExceptionJsonResponseV1) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionJsonResponseV1) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ErrorExceptionJsonResponseV1) SetMessage(v string) { + o.Message = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ErrorExceptionJsonResponseV1) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorExceptionJsonResponseV1) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ErrorExceptionJsonResponseV1) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ErrorExceptionJsonResponseV1) SetName(v string) { + o.Name = &v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *ErrorExceptionJsonResponseV1) GetError() string { + if o == nil || IsNil(o.Error) { + var ret string + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorExceptionJsonResponseV1) GetErrorOk() (*string, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *ErrorExceptionJsonResponseV1) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *ErrorExceptionJsonResponseV1) SetError(v string) { + o.Error = &v +} + +// GetStack returns the Stack field value if set, zero value otherwise. +func (o *ErrorExceptionJsonResponseV1) GetStack() string { + if o == nil || IsNil(o.Stack) { + var ret string + return ret + } + return *o.Stack +} + +// GetStackOk returns a tuple with the Stack field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorExceptionJsonResponseV1) GetStackOk() (*string, bool) { + if o == nil || IsNil(o.Stack) { + return nil, false + } + return o.Stack, true +} + +// HasStack returns a boolean if a field has been set. +func (o *ErrorExceptionJsonResponseV1) HasStack() bool { + if o != nil && !IsNil(o.Stack) { + return true + } + + return false +} + +// SetStack gets a reference to the given string and assigns it to the Stack field. +func (o *ErrorExceptionJsonResponseV1) SetStack(v string) { + o.Stack = &v +} + +// GetCause returns the Cause field value if set, zero value otherwise. +func (o *ErrorExceptionJsonResponseV1) GetCause() string { + if o == nil || IsNil(o.Cause) { + var ret string + return ret + } + return *o.Cause +} + +// GetCauseOk returns a tuple with the Cause field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorExceptionJsonResponseV1) GetCauseOk() (*string, bool) { + if o == nil || IsNil(o.Cause) { + return nil, false + } + return o.Cause, true +} + +// HasCause returns a boolean if a field has been set. +func (o *ErrorExceptionJsonResponseV1) HasCause() bool { + if o != nil && !IsNil(o.Cause) { + return true + } + + return false +} + +// SetCause gets a reference to the given string and assigns it to the Cause field. +func (o *ErrorExceptionJsonResponseV1) SetCause(v string) { + o.Cause = &v +} + +func (o ErrorExceptionJsonResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorExceptionJsonResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + if !IsNil(o.Stack) { + toSerialize["stack"] = o.Stack + } + if !IsNil(o.Cause) { + toSerialize["cause"] = o.Cause + } + return toSerialize, nil +} + +type NullableErrorExceptionJsonResponseV1 struct { + value *ErrorExceptionJsonResponseV1 + isSet bool +} + +func (v NullableErrorExceptionJsonResponseV1) Get() *ErrorExceptionJsonResponseV1 { + return v.value +} + +func (v *NullableErrorExceptionJsonResponseV1) Set(val *ErrorExceptionJsonResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableErrorExceptionJsonResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorExceptionJsonResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorExceptionJsonResponseV1(val *ErrorExceptionJsonResponseV1) *NullableErrorExceptionJsonResponseV1 { + return &NullableErrorExceptionJsonResponseV1{value: val, isSet: true} +} + +func (v NullableErrorExceptionJsonResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorExceptionJsonResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go new file mode 100644 index 00000000000..b1991f27e8d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the ErrorExceptionResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorExceptionResponseV1{} + +// ErrorExceptionResponseV1 struct for ErrorExceptionResponseV1 +type ErrorExceptionResponseV1 struct { + Message string `json:"message"` + Error string `json:"error"` +} + +// NewErrorExceptionResponseV1 instantiates a new ErrorExceptionResponseV1 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 +// will change when the set of required properties is changed +func NewErrorExceptionResponseV1(message string, error_ string) *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + this.Message = message + this.Error = error_ + return &this +} + +// NewErrorExceptionResponseV1WithDefaults instantiates a new ErrorExceptionResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorExceptionResponseV1WithDefaults() *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + return &this +} + +// GetMessage returns the Message field value +func (o *ErrorExceptionResponseV1) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ErrorExceptionResponseV1) SetMessage(v string) { + o.Message = v +} + +// GetError returns the Error field value +func (o *ErrorExceptionResponseV1) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *ErrorExceptionResponseV1) SetError(v string) { + o.Error = v +} + +func (o ErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorExceptionResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + toSerialize["error"] = o.Error + return toSerialize, nil +} + +type NullableErrorExceptionResponseV1 struct { + value *ErrorExceptionResponseV1 + isSet bool +} + +func (v NullableErrorExceptionResponseV1) Get() *ErrorExceptionResponseV1 { + return v.value +} + +func (v *NullableErrorExceptionResponseV1) Set(val *ErrorExceptionResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableErrorExceptionResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorExceptionResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorExceptionResponseV1(val *ErrorExceptionResponseV1) *NullableErrorExceptionResponseV1 { + return &NullableErrorExceptionResponseV1{value: val, isSet: true} +} + +func (v NullableErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorExceptionResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1.go new file mode 100644 index 00000000000..991e0825fa5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GenerateTransactionRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GenerateTransactionRequestV1{} + +// GenerateTransactionRequestV1 struct for GenerateTransactionRequestV1 +type GenerateTransactionRequestV1 struct { + // Iroha command name. + CommandName IrohaCommand `json:"commandName"` + // Parameters for iroha command specified in commandName + CommandParams map[string]interface{} `json:"commandParams"` + // Sender account id + CreatorAccountId string `json:"creatorAccountId"` + // Requested transaction quorum + Quorum *float32 `json:"quorum,omitempty"` +} + +// NewGenerateTransactionRequestV1 instantiates a new GenerateTransactionRequestV1 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 +// will change when the set of required properties is changed +func NewGenerateTransactionRequestV1(commandName IrohaCommand, commandParams map[string]interface{}, creatorAccountId string) *GenerateTransactionRequestV1 { + this := GenerateTransactionRequestV1{} + this.CommandName = commandName + this.CommandParams = commandParams + this.CreatorAccountId = creatorAccountId + var quorum float32 = 1 + this.Quorum = &quorum + return &this +} + +// NewGenerateTransactionRequestV1WithDefaults instantiates a new GenerateTransactionRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGenerateTransactionRequestV1WithDefaults() *GenerateTransactionRequestV1 { + this := GenerateTransactionRequestV1{} + var quorum float32 = 1 + this.Quorum = &quorum + return &this +} + +// GetCommandName returns the CommandName field value +func (o *GenerateTransactionRequestV1) GetCommandName() IrohaCommand { + if o == nil { + var ret IrohaCommand + return ret + } + + return o.CommandName +} + +// GetCommandNameOk returns a tuple with the CommandName field value +// and a boolean to check if the value has been set. +func (o *GenerateTransactionRequestV1) GetCommandNameOk() (*IrohaCommand, bool) { + if o == nil { + return nil, false + } + return &o.CommandName, true +} + +// SetCommandName sets field value +func (o *GenerateTransactionRequestV1) SetCommandName(v IrohaCommand) { + o.CommandName = v +} + +// GetCommandParams returns the CommandParams field value +func (o *GenerateTransactionRequestV1) GetCommandParams() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.CommandParams +} + +// GetCommandParamsOk returns a tuple with the CommandParams field value +// and a boolean to check if the value has been set. +func (o *GenerateTransactionRequestV1) GetCommandParamsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.CommandParams, true +} + +// SetCommandParams sets field value +func (o *GenerateTransactionRequestV1) SetCommandParams(v map[string]interface{}) { + o.CommandParams = v +} + +// GetCreatorAccountId returns the CreatorAccountId field value +func (o *GenerateTransactionRequestV1) GetCreatorAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.CreatorAccountId +} + +// GetCreatorAccountIdOk returns a tuple with the CreatorAccountId field value +// and a boolean to check if the value has been set. +func (o *GenerateTransactionRequestV1) GetCreatorAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CreatorAccountId, true +} + +// SetCreatorAccountId sets field value +func (o *GenerateTransactionRequestV1) SetCreatorAccountId(v string) { + o.CreatorAccountId = v +} + +// GetQuorum returns the Quorum field value if set, zero value otherwise. +func (o *GenerateTransactionRequestV1) GetQuorum() float32 { + if o == nil || IsNil(o.Quorum) { + var ret float32 + return ret + } + return *o.Quorum +} + +// GetQuorumOk returns a tuple with the Quorum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenerateTransactionRequestV1) GetQuorumOk() (*float32, bool) { + if o == nil || IsNil(o.Quorum) { + return nil, false + } + return o.Quorum, true +} + +// HasQuorum returns a boolean if a field has been set. +func (o *GenerateTransactionRequestV1) HasQuorum() bool { + if o != nil && !IsNil(o.Quorum) { + return true + } + + return false +} + +// SetQuorum gets a reference to the given float32 and assigns it to the Quorum field. +func (o *GenerateTransactionRequestV1) SetQuorum(v float32) { + o.Quorum = &v +} + +func (o GenerateTransactionRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GenerateTransactionRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["commandName"] = o.CommandName + toSerialize["commandParams"] = o.CommandParams + toSerialize["creatorAccountId"] = o.CreatorAccountId + if !IsNil(o.Quorum) { + toSerialize["quorum"] = o.Quorum + } + return toSerialize, nil +} + +type NullableGenerateTransactionRequestV1 struct { + value *GenerateTransactionRequestV1 + isSet bool +} + +func (v NullableGenerateTransactionRequestV1) Get() *GenerateTransactionRequestV1 { + return v.value +} + +func (v *NullableGenerateTransactionRequestV1) Set(val *GenerateTransactionRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGenerateTransactionRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGenerateTransactionRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenerateTransactionRequestV1(val *GenerateTransactionRequestV1) *NullableGenerateTransactionRequestV1 { + return &NullableGenerateTransactionRequestV1{value: val, isSet: true} +} + +func (v NullableGenerateTransactionRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenerateTransactionRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_asset_transactions_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_asset_transactions_request_parameters.go new file mode 100644 index 00000000000..7a068ae4a03 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_asset_transactions_request_parameters.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetAccountAssetTransactionsRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetAccountAssetTransactionsRequestParameters{} + +// GetAccountAssetTransactionsRequestParameters The list of arguments to pass in to the transaction request to Get Account Asset Transactions. +type GetAccountAssetTransactionsRequestParameters struct { + AccountId string `json:"accountId"` + AssetId string `json:"assetId"` + PageSize int32 `json:"pageSize"` + FirstTxHash string `json:"firstTxHash"` +} + +// NewGetAccountAssetTransactionsRequestParameters instantiates a new GetAccountAssetTransactionsRequestParameters 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 +// will change when the set of required properties is changed +func NewGetAccountAssetTransactionsRequestParameters(accountId string, assetId string, pageSize int32, firstTxHash string) *GetAccountAssetTransactionsRequestParameters { + this := GetAccountAssetTransactionsRequestParameters{} + this.AccountId = accountId + this.AssetId = assetId + this.PageSize = pageSize + this.FirstTxHash = firstTxHash + return &this +} + +// NewGetAccountAssetTransactionsRequestParametersWithDefaults instantiates a new GetAccountAssetTransactionsRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetAccountAssetTransactionsRequestParametersWithDefaults() *GetAccountAssetTransactionsRequestParameters { + this := GetAccountAssetTransactionsRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *GetAccountAssetTransactionsRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *GetAccountAssetTransactionsRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *GetAccountAssetTransactionsRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetAssetId returns the AssetId field value +func (o *GetAccountAssetTransactionsRequestParameters) GetAssetId() string { + if o == nil { + var ret string + return ret + } + + return o.AssetId +} + +// GetAssetIdOk returns a tuple with the AssetId field value +// and a boolean to check if the value has been set. +func (o *GetAccountAssetTransactionsRequestParameters) GetAssetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssetId, true +} + +// SetAssetId sets field value +func (o *GetAccountAssetTransactionsRequestParameters) SetAssetId(v string) { + o.AssetId = v +} + +// GetPageSize returns the PageSize field value +func (o *GetAccountAssetTransactionsRequestParameters) GetPageSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PageSize +} + +// GetPageSizeOk returns a tuple with the PageSize field value +// and a boolean to check if the value has been set. +func (o *GetAccountAssetTransactionsRequestParameters) GetPageSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PageSize, true +} + +// SetPageSize sets field value +func (o *GetAccountAssetTransactionsRequestParameters) SetPageSize(v int32) { + o.PageSize = v +} + +// GetFirstTxHash returns the FirstTxHash field value +func (o *GetAccountAssetTransactionsRequestParameters) GetFirstTxHash() string { + if o == nil { + var ret string + return ret + } + + return o.FirstTxHash +} + +// GetFirstTxHashOk returns a tuple with the FirstTxHash field value +// and a boolean to check if the value has been set. +func (o *GetAccountAssetTransactionsRequestParameters) GetFirstTxHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FirstTxHash, true +} + +// SetFirstTxHash sets field value +func (o *GetAccountAssetTransactionsRequestParameters) SetFirstTxHash(v string) { + o.FirstTxHash = v +} + +func (o GetAccountAssetTransactionsRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAccountAssetTransactionsRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["assetId"] = o.AssetId + toSerialize["pageSize"] = o.PageSize + toSerialize["firstTxHash"] = o.FirstTxHash + return toSerialize, nil +} + +type NullableGetAccountAssetTransactionsRequestParameters struct { + value *GetAccountAssetTransactionsRequestParameters + isSet bool +} + +func (v NullableGetAccountAssetTransactionsRequestParameters) Get() *GetAccountAssetTransactionsRequestParameters { + return v.value +} + +func (v *NullableGetAccountAssetTransactionsRequestParameters) Set(val *GetAccountAssetTransactionsRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetAccountAssetTransactionsRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAccountAssetTransactionsRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAccountAssetTransactionsRequestParameters(val *GetAccountAssetTransactionsRequestParameters) *NullableGetAccountAssetTransactionsRequestParameters { + return &NullableGetAccountAssetTransactionsRequestParameters{value: val, isSet: true} +} + +func (v NullableGetAccountAssetTransactionsRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAccountAssetTransactionsRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_assets_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_assets_request_parameters.go new file mode 100644 index 00000000000..45c9bf330a3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_assets_request_parameters.go @@ -0,0 +1,180 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetAccountAssetsRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetAccountAssetsRequestParameters{} + +// GetAccountAssetsRequestParameters The list of arguments to pass in to the transaction request to Get Account Assets. +type GetAccountAssetsRequestParameters struct { + AccountId string `json:"accountId"` + PageSize float32 `json:"pageSize"` + FirstAssetId *string `json:"firstAssetId,omitempty"` +} + +// NewGetAccountAssetsRequestParameters instantiates a new GetAccountAssetsRequestParameters 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 +// will change when the set of required properties is changed +func NewGetAccountAssetsRequestParameters(accountId string, pageSize float32) *GetAccountAssetsRequestParameters { + this := GetAccountAssetsRequestParameters{} + this.AccountId = accountId + this.PageSize = pageSize + return &this +} + +// NewGetAccountAssetsRequestParametersWithDefaults instantiates a new GetAccountAssetsRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetAccountAssetsRequestParametersWithDefaults() *GetAccountAssetsRequestParameters { + this := GetAccountAssetsRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *GetAccountAssetsRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *GetAccountAssetsRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *GetAccountAssetsRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetPageSize returns the PageSize field value +func (o *GetAccountAssetsRequestParameters) GetPageSize() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.PageSize +} + +// GetPageSizeOk returns a tuple with the PageSize field value +// and a boolean to check if the value has been set. +func (o *GetAccountAssetsRequestParameters) GetPageSizeOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.PageSize, true +} + +// SetPageSize sets field value +func (o *GetAccountAssetsRequestParameters) SetPageSize(v float32) { + o.PageSize = v +} + +// GetFirstAssetId returns the FirstAssetId field value if set, zero value otherwise. +func (o *GetAccountAssetsRequestParameters) GetFirstAssetId() string { + if o == nil || IsNil(o.FirstAssetId) { + var ret string + return ret + } + return *o.FirstAssetId +} + +// GetFirstAssetIdOk returns a tuple with the FirstAssetId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAccountAssetsRequestParameters) GetFirstAssetIdOk() (*string, bool) { + if o == nil || IsNil(o.FirstAssetId) { + return nil, false + } + return o.FirstAssetId, true +} + +// HasFirstAssetId returns a boolean if a field has been set. +func (o *GetAccountAssetsRequestParameters) HasFirstAssetId() bool { + if o != nil && !IsNil(o.FirstAssetId) { + return true + } + + return false +} + +// SetFirstAssetId gets a reference to the given string and assigns it to the FirstAssetId field. +func (o *GetAccountAssetsRequestParameters) SetFirstAssetId(v string) { + o.FirstAssetId = &v +} + +func (o GetAccountAssetsRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAccountAssetsRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["pageSize"] = o.PageSize + if !IsNil(o.FirstAssetId) { + toSerialize["firstAssetId"] = o.FirstAssetId + } + return toSerialize, nil +} + +type NullableGetAccountAssetsRequestParameters struct { + value *GetAccountAssetsRequestParameters + isSet bool +} + +func (v NullableGetAccountAssetsRequestParameters) Get() *GetAccountAssetsRequestParameters { + return v.value +} + +func (v *NullableGetAccountAssetsRequestParameters) Set(val *GetAccountAssetsRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetAccountAssetsRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAccountAssetsRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAccountAssetsRequestParameters(val *GetAccountAssetsRequestParameters) *NullableGetAccountAssetsRequestParameters { + return &NullableGetAccountAssetsRequestParameters{value: val, isSet: true} +} + +func (v NullableGetAccountAssetsRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAccountAssetsRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_detail_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_detail_request_parameters.go new file mode 100644 index 00000000000..3c291605112 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_detail_request_parameters.go @@ -0,0 +1,279 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetAccountDetailRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetAccountDetailRequestParameters{} + +// GetAccountDetailRequestParameters The list of arguments to pass in to the transaction request to Get Account Detail. +type GetAccountDetailRequestParameters struct { + AccountId *string `json:"accountId,omitempty"` + Key *string `json:"key,omitempty"` + Writer *string `json:"writer,omitempty"` + PageSize int32 `json:"pageSize"` + PaginationKey string `json:"paginationKey"` + PaginationWriter string `json:"paginationWriter"` +} + +// NewGetAccountDetailRequestParameters instantiates a new GetAccountDetailRequestParameters 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 +// will change when the set of required properties is changed +func NewGetAccountDetailRequestParameters(pageSize int32, paginationKey string, paginationWriter string) *GetAccountDetailRequestParameters { + this := GetAccountDetailRequestParameters{} + this.PageSize = pageSize + this.PaginationKey = paginationKey + this.PaginationWriter = paginationWriter + return &this +} + +// NewGetAccountDetailRequestParametersWithDefaults instantiates a new GetAccountDetailRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetAccountDetailRequestParametersWithDefaults() *GetAccountDetailRequestParameters { + this := GetAccountDetailRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value if set, zero value otherwise. +func (o *GetAccountDetailRequestParameters) GetAccountId() string { + if o == nil || IsNil(o.AccountId) { + var ret string + return ret + } + return *o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAccountDetailRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil || IsNil(o.AccountId) { + return nil, false + } + return o.AccountId, true +} + +// HasAccountId returns a boolean if a field has been set. +func (o *GetAccountDetailRequestParameters) HasAccountId() bool { + if o != nil && !IsNil(o.AccountId) { + return true + } + + return false +} + +// SetAccountId gets a reference to the given string and assigns it to the AccountId field. +func (o *GetAccountDetailRequestParameters) SetAccountId(v string) { + o.AccountId = &v +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *GetAccountDetailRequestParameters) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAccountDetailRequestParameters) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *GetAccountDetailRequestParameters) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *GetAccountDetailRequestParameters) SetKey(v string) { + o.Key = &v +} + +// GetWriter returns the Writer field value if set, zero value otherwise. +func (o *GetAccountDetailRequestParameters) GetWriter() string { + if o == nil || IsNil(o.Writer) { + var ret string + return ret + } + return *o.Writer +} + +// GetWriterOk returns a tuple with the Writer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAccountDetailRequestParameters) GetWriterOk() (*string, bool) { + if o == nil || IsNil(o.Writer) { + return nil, false + } + return o.Writer, true +} + +// HasWriter returns a boolean if a field has been set. +func (o *GetAccountDetailRequestParameters) HasWriter() bool { + if o != nil && !IsNil(o.Writer) { + return true + } + + return false +} + +// SetWriter gets a reference to the given string and assigns it to the Writer field. +func (o *GetAccountDetailRequestParameters) SetWriter(v string) { + o.Writer = &v +} + +// GetPageSize returns the PageSize field value +func (o *GetAccountDetailRequestParameters) GetPageSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PageSize +} + +// GetPageSizeOk returns a tuple with the PageSize field value +// and a boolean to check if the value has been set. +func (o *GetAccountDetailRequestParameters) GetPageSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PageSize, true +} + +// SetPageSize sets field value +func (o *GetAccountDetailRequestParameters) SetPageSize(v int32) { + o.PageSize = v +} + +// GetPaginationKey returns the PaginationKey field value +func (o *GetAccountDetailRequestParameters) GetPaginationKey() string { + if o == nil { + var ret string + return ret + } + + return o.PaginationKey +} + +// GetPaginationKeyOk returns a tuple with the PaginationKey field value +// and a boolean to check if the value has been set. +func (o *GetAccountDetailRequestParameters) GetPaginationKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PaginationKey, true +} + +// SetPaginationKey sets field value +func (o *GetAccountDetailRequestParameters) SetPaginationKey(v string) { + o.PaginationKey = v +} + +// GetPaginationWriter returns the PaginationWriter field value +func (o *GetAccountDetailRequestParameters) GetPaginationWriter() string { + if o == nil { + var ret string + return ret + } + + return o.PaginationWriter +} + +// GetPaginationWriterOk returns a tuple with the PaginationWriter field value +// and a boolean to check if the value has been set. +func (o *GetAccountDetailRequestParameters) GetPaginationWriterOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PaginationWriter, true +} + +// SetPaginationWriter sets field value +func (o *GetAccountDetailRequestParameters) SetPaginationWriter(v string) { + o.PaginationWriter = v +} + +func (o GetAccountDetailRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAccountDetailRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AccountId) { + toSerialize["accountId"] = o.AccountId + } + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.Writer) { + toSerialize["writer"] = o.Writer + } + toSerialize["pageSize"] = o.PageSize + toSerialize["paginationKey"] = o.PaginationKey + toSerialize["paginationWriter"] = o.PaginationWriter + return toSerialize, nil +} + +type NullableGetAccountDetailRequestParameters struct { + value *GetAccountDetailRequestParameters + isSet bool +} + +func (v NullableGetAccountDetailRequestParameters) Get() *GetAccountDetailRequestParameters { + return v.value +} + +func (v *NullableGetAccountDetailRequestParameters) Set(val *GetAccountDetailRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetAccountDetailRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAccountDetailRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAccountDetailRequestParameters(val *GetAccountDetailRequestParameters) *NullableGetAccountDetailRequestParameters { + return &NullableGetAccountDetailRequestParameters{value: val, isSet: true} +} + +func (v NullableGetAccountDetailRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAccountDetailRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_request_parameters.go new file mode 100644 index 00000000000..48afa17d1cf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_request_parameters.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetAccountRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetAccountRequestParameters{} + +// GetAccountRequestParameters The list of arguments to pass in to the transaction request to Get Account. +type GetAccountRequestParameters struct { + AccountId string `json:"accountId"` +} + +// NewGetAccountRequestParameters instantiates a new GetAccountRequestParameters 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 +// will change when the set of required properties is changed +func NewGetAccountRequestParameters(accountId string) *GetAccountRequestParameters { + this := GetAccountRequestParameters{} + this.AccountId = accountId + return &this +} + +// NewGetAccountRequestParametersWithDefaults instantiates a new GetAccountRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetAccountRequestParametersWithDefaults() *GetAccountRequestParameters { + this := GetAccountRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *GetAccountRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *GetAccountRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *GetAccountRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +func (o GetAccountRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAccountRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + return toSerialize, nil +} + +type NullableGetAccountRequestParameters struct { + value *GetAccountRequestParameters + isSet bool +} + +func (v NullableGetAccountRequestParameters) Get() *GetAccountRequestParameters { + return v.value +} + +func (v *NullableGetAccountRequestParameters) Set(val *GetAccountRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetAccountRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAccountRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAccountRequestParameters(val *GetAccountRequestParameters) *NullableGetAccountRequestParameters { + return &NullableGetAccountRequestParameters{value: val, isSet: true} +} + +func (v NullableGetAccountRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAccountRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_transactions_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_transactions_request_parameters.go new file mode 100644 index 00000000000..df6c2c5c88b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_account_transactions_request_parameters.go @@ -0,0 +1,315 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetAccountTransactionsRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetAccountTransactionsRequestParameters{} + +// GetAccountTransactionsRequestParameters The list of arguments to pass in to the transaction request to Get Account Transactions. +type GetAccountTransactionsRequestParameters struct { + AccountId string `json:"accountId"` + PageSize int32 `json:"pageSize"` + FirstTxHash string `json:"firstTxHash"` + FirstTxTime map[string]interface{} `json:"firstTxTime,omitempty"` + LastTxTime map[string]interface{} `json:"lastTxTime,omitempty"` + FirstTxHeight *int32 `json:"firstTxHeight,omitempty"` + LastTxHeight *int32 `json:"lastTxHeight,omitempty"` +} + +// NewGetAccountTransactionsRequestParameters instantiates a new GetAccountTransactionsRequestParameters 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 +// will change when the set of required properties is changed +func NewGetAccountTransactionsRequestParameters(accountId string, pageSize int32, firstTxHash string) *GetAccountTransactionsRequestParameters { + this := GetAccountTransactionsRequestParameters{} + this.AccountId = accountId + this.PageSize = pageSize + this.FirstTxHash = firstTxHash + return &this +} + +// NewGetAccountTransactionsRequestParametersWithDefaults instantiates a new GetAccountTransactionsRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetAccountTransactionsRequestParametersWithDefaults() *GetAccountTransactionsRequestParameters { + this := GetAccountTransactionsRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *GetAccountTransactionsRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *GetAccountTransactionsRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *GetAccountTransactionsRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetPageSize returns the PageSize field value +func (o *GetAccountTransactionsRequestParameters) GetPageSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PageSize +} + +// GetPageSizeOk returns a tuple with the PageSize field value +// and a boolean to check if the value has been set. +func (o *GetAccountTransactionsRequestParameters) GetPageSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PageSize, true +} + +// SetPageSize sets field value +func (o *GetAccountTransactionsRequestParameters) SetPageSize(v int32) { + o.PageSize = v +} + +// GetFirstTxHash returns the FirstTxHash field value +func (o *GetAccountTransactionsRequestParameters) GetFirstTxHash() string { + if o == nil { + var ret string + return ret + } + + return o.FirstTxHash +} + +// GetFirstTxHashOk returns a tuple with the FirstTxHash field value +// and a boolean to check if the value has been set. +func (o *GetAccountTransactionsRequestParameters) GetFirstTxHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FirstTxHash, true +} + +// SetFirstTxHash sets field value +func (o *GetAccountTransactionsRequestParameters) SetFirstTxHash(v string) { + o.FirstTxHash = v +} + +// GetFirstTxTime returns the FirstTxTime field value if set, zero value otherwise. +func (o *GetAccountTransactionsRequestParameters) GetFirstTxTime() map[string]interface{} { + if o == nil || IsNil(o.FirstTxTime) { + var ret map[string]interface{} + return ret + } + return o.FirstTxTime +} + +// GetFirstTxTimeOk returns a tuple with the FirstTxTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAccountTransactionsRequestParameters) GetFirstTxTimeOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FirstTxTime) { + return map[string]interface{}{}, false + } + return o.FirstTxTime, true +} + +// HasFirstTxTime returns a boolean if a field has been set. +func (o *GetAccountTransactionsRequestParameters) HasFirstTxTime() bool { + if o != nil && !IsNil(o.FirstTxTime) { + return true + } + + return false +} + +// SetFirstTxTime gets a reference to the given map[string]interface{} and assigns it to the FirstTxTime field. +func (o *GetAccountTransactionsRequestParameters) SetFirstTxTime(v map[string]interface{}) { + o.FirstTxTime = v +} + +// GetLastTxTime returns the LastTxTime field value if set, zero value otherwise. +func (o *GetAccountTransactionsRequestParameters) GetLastTxTime() map[string]interface{} { + if o == nil || IsNil(o.LastTxTime) { + var ret map[string]interface{} + return ret + } + return o.LastTxTime +} + +// GetLastTxTimeOk returns a tuple with the LastTxTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAccountTransactionsRequestParameters) GetLastTxTimeOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.LastTxTime) { + return map[string]interface{}{}, false + } + return o.LastTxTime, true +} + +// HasLastTxTime returns a boolean if a field has been set. +func (o *GetAccountTransactionsRequestParameters) HasLastTxTime() bool { + if o != nil && !IsNil(o.LastTxTime) { + return true + } + + return false +} + +// SetLastTxTime gets a reference to the given map[string]interface{} and assigns it to the LastTxTime field. +func (o *GetAccountTransactionsRequestParameters) SetLastTxTime(v map[string]interface{}) { + o.LastTxTime = v +} + +// GetFirstTxHeight returns the FirstTxHeight field value if set, zero value otherwise. +func (o *GetAccountTransactionsRequestParameters) GetFirstTxHeight() int32 { + if o == nil || IsNil(o.FirstTxHeight) { + var ret int32 + return ret + } + return *o.FirstTxHeight +} + +// GetFirstTxHeightOk returns a tuple with the FirstTxHeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAccountTransactionsRequestParameters) GetFirstTxHeightOk() (*int32, bool) { + if o == nil || IsNil(o.FirstTxHeight) { + return nil, false + } + return o.FirstTxHeight, true +} + +// HasFirstTxHeight returns a boolean if a field has been set. +func (o *GetAccountTransactionsRequestParameters) HasFirstTxHeight() bool { + if o != nil && !IsNil(o.FirstTxHeight) { + return true + } + + return false +} + +// SetFirstTxHeight gets a reference to the given int32 and assigns it to the FirstTxHeight field. +func (o *GetAccountTransactionsRequestParameters) SetFirstTxHeight(v int32) { + o.FirstTxHeight = &v +} + +// GetLastTxHeight returns the LastTxHeight field value if set, zero value otherwise. +func (o *GetAccountTransactionsRequestParameters) GetLastTxHeight() int32 { + if o == nil || IsNil(o.LastTxHeight) { + var ret int32 + return ret + } + return *o.LastTxHeight +} + +// GetLastTxHeightOk returns a tuple with the LastTxHeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAccountTransactionsRequestParameters) GetLastTxHeightOk() (*int32, bool) { + if o == nil || IsNil(o.LastTxHeight) { + return nil, false + } + return o.LastTxHeight, true +} + +// HasLastTxHeight returns a boolean if a field has been set. +func (o *GetAccountTransactionsRequestParameters) HasLastTxHeight() bool { + if o != nil && !IsNil(o.LastTxHeight) { + return true + } + + return false +} + +// SetLastTxHeight gets a reference to the given int32 and assigns it to the LastTxHeight field. +func (o *GetAccountTransactionsRequestParameters) SetLastTxHeight(v int32) { + o.LastTxHeight = &v +} + +func (o GetAccountTransactionsRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAccountTransactionsRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["pageSize"] = o.PageSize + toSerialize["firstTxHash"] = o.FirstTxHash + if !IsNil(o.FirstTxTime) { + toSerialize["firstTxTime"] = o.FirstTxTime + } + if !IsNil(o.LastTxTime) { + toSerialize["lastTxTime"] = o.LastTxTime + } + if !IsNil(o.FirstTxHeight) { + toSerialize["firstTxHeight"] = o.FirstTxHeight + } + if !IsNil(o.LastTxHeight) { + toSerialize["lastTxHeight"] = o.LastTxHeight + } + return toSerialize, nil +} + +type NullableGetAccountTransactionsRequestParameters struct { + value *GetAccountTransactionsRequestParameters + isSet bool +} + +func (v NullableGetAccountTransactionsRequestParameters) Get() *GetAccountTransactionsRequestParameters { + return v.value +} + +func (v *NullableGetAccountTransactionsRequestParameters) Set(val *GetAccountTransactionsRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetAccountTransactionsRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAccountTransactionsRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAccountTransactionsRequestParameters(val *GetAccountTransactionsRequestParameters) *NullableGetAccountTransactionsRequestParameters { + return &NullableGetAccountTransactionsRequestParameters{value: val, isSet: true} +} + +func (v NullableGetAccountTransactionsRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAccountTransactionsRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_asset_info_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_asset_info_request_parameters.go new file mode 100644 index 00000000000..ac3db713b8d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_asset_info_request_parameters.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetAssetInfoRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetAssetInfoRequestParameters{} + +// GetAssetInfoRequestParameters The list of arguments to pass in to the transaction request to Get Asset Info. +type GetAssetInfoRequestParameters struct { + AssetId string `json:"assetId"` +} + +// NewGetAssetInfoRequestParameters instantiates a new GetAssetInfoRequestParameters 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 +// will change when the set of required properties is changed +func NewGetAssetInfoRequestParameters(assetId string) *GetAssetInfoRequestParameters { + this := GetAssetInfoRequestParameters{} + this.AssetId = assetId + return &this +} + +// NewGetAssetInfoRequestParametersWithDefaults instantiates a new GetAssetInfoRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetAssetInfoRequestParametersWithDefaults() *GetAssetInfoRequestParameters { + this := GetAssetInfoRequestParameters{} + return &this +} + +// GetAssetId returns the AssetId field value +func (o *GetAssetInfoRequestParameters) GetAssetId() string { + if o == nil { + var ret string + return ret + } + + return o.AssetId +} + +// GetAssetIdOk returns a tuple with the AssetId field value +// and a boolean to check if the value has been set. +func (o *GetAssetInfoRequestParameters) GetAssetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssetId, true +} + +// SetAssetId sets field value +func (o *GetAssetInfoRequestParameters) SetAssetId(v string) { + o.AssetId = v +} + +func (o GetAssetInfoRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAssetInfoRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["assetId"] = o.AssetId + return toSerialize, nil +} + +type NullableGetAssetInfoRequestParameters struct { + value *GetAssetInfoRequestParameters + isSet bool +} + +func (v NullableGetAssetInfoRequestParameters) Get() *GetAssetInfoRequestParameters { + return v.value +} + +func (v *NullableGetAssetInfoRequestParameters) Set(val *GetAssetInfoRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetAssetInfoRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAssetInfoRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAssetInfoRequestParameters(val *GetAssetInfoRequestParameters) *NullableGetAssetInfoRequestParameters { + return &NullableGetAssetInfoRequestParameters{value: val, isSet: true} +} + +func (v NullableGetAssetInfoRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAssetInfoRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_block_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_block_request_parameters.go new file mode 100644 index 00000000000..be4141faee3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_block_request_parameters.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetBlockRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBlockRequestParameters{} + +// GetBlockRequestParameters The list of arguments to pass in to the transaction request to Get Block. +type GetBlockRequestParameters struct { + Height int32 `json:"height"` +} + +// NewGetBlockRequestParameters instantiates a new GetBlockRequestParameters 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 +// will change when the set of required properties is changed +func NewGetBlockRequestParameters(height int32) *GetBlockRequestParameters { + this := GetBlockRequestParameters{} + this.Height = height + return &this +} + +// NewGetBlockRequestParametersWithDefaults instantiates a new GetBlockRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBlockRequestParametersWithDefaults() *GetBlockRequestParameters { + this := GetBlockRequestParameters{} + return &this +} + +// GetHeight returns the Height field value +func (o *GetBlockRequestParameters) GetHeight() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Height +} + +// GetHeightOk returns a tuple with the Height field value +// and a boolean to check if the value has been set. +func (o *GetBlockRequestParameters) GetHeightOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Height, true +} + +// SetHeight sets field value +func (o *GetBlockRequestParameters) SetHeight(v int32) { + o.Height = v +} + +func (o GetBlockRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBlockRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["height"] = o.Height + return toSerialize, nil +} + +type NullableGetBlockRequestParameters struct { + value *GetBlockRequestParameters + isSet bool +} + +func (v NullableGetBlockRequestParameters) Get() *GetBlockRequestParameters { + return v.value +} + +func (v *NullableGetBlockRequestParameters) Set(val *GetBlockRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockRequestParameters(val *GetBlockRequestParameters) *NullableGetBlockRequestParameters { + return &NullableGetBlockRequestParameters{value: val, isSet: true} +} + +func (v NullableGetBlockRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_engine_receipts_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_engine_receipts_request_parameters.go new file mode 100644 index 00000000000..96d1d008d17 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_engine_receipts_request_parameters.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetEngineReceiptsRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetEngineReceiptsRequestParameters{} + +// GetEngineReceiptsRequestParameters The list of arguments to pass in to the transaction request to Get Engine Receipts. +type GetEngineReceiptsRequestParameters struct { + TxHash string `json:"txHash"` +} + +// NewGetEngineReceiptsRequestParameters instantiates a new GetEngineReceiptsRequestParameters 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 +// will change when the set of required properties is changed +func NewGetEngineReceiptsRequestParameters(txHash string) *GetEngineReceiptsRequestParameters { + this := GetEngineReceiptsRequestParameters{} + this.TxHash = txHash + return &this +} + +// NewGetEngineReceiptsRequestParametersWithDefaults instantiates a new GetEngineReceiptsRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetEngineReceiptsRequestParametersWithDefaults() *GetEngineReceiptsRequestParameters { + this := GetEngineReceiptsRequestParameters{} + return &this +} + +// GetTxHash returns the TxHash field value +func (o *GetEngineReceiptsRequestParameters) GetTxHash() string { + if o == nil { + var ret string + return ret + } + + return o.TxHash +} + +// GetTxHashOk returns a tuple with the TxHash field value +// and a boolean to check if the value has been set. +func (o *GetEngineReceiptsRequestParameters) GetTxHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TxHash, true +} + +// SetTxHash sets field value +func (o *GetEngineReceiptsRequestParameters) SetTxHash(v string) { + o.TxHash = v +} + +func (o GetEngineReceiptsRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetEngineReceiptsRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["txHash"] = o.TxHash + return toSerialize, nil +} + +type NullableGetEngineReceiptsRequestParameters struct { + value *GetEngineReceiptsRequestParameters + isSet bool +} + +func (v NullableGetEngineReceiptsRequestParameters) Get() *GetEngineReceiptsRequestParameters { + return v.value +} + +func (v *NullableGetEngineReceiptsRequestParameters) Set(val *GetEngineReceiptsRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetEngineReceiptsRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetEngineReceiptsRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetEngineReceiptsRequestParameters(val *GetEngineReceiptsRequestParameters) *NullableGetEngineReceiptsRequestParameters { + return &NullableGetEngineReceiptsRequestParameters{value: val, isSet: true} +} + +func (v NullableGetEngineReceiptsRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetEngineReceiptsRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_pending_transactions_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_pending_transactions_request_parameters.go new file mode 100644 index 00000000000..79bda3fc20f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_pending_transactions_request_parameters.go @@ -0,0 +1,225 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetPendingTransactionsRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetPendingTransactionsRequestParameters{} + +// GetPendingTransactionsRequestParameters The list of arguments to pass in to the transaction request to Get Pending Transactions. +type GetPendingTransactionsRequestParameters struct { + PageSize int32 `json:"pageSize"` + FirstTxHash *string `json:"firstTxHash,omitempty"` + FirstTxTime map[string]interface{} `json:"firstTxTime,omitempty"` + LastTxTime map[string]interface{} `json:"lastTxTime,omitempty"` +} + +// NewGetPendingTransactionsRequestParameters instantiates a new GetPendingTransactionsRequestParameters 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 +// will change when the set of required properties is changed +func NewGetPendingTransactionsRequestParameters(pageSize int32) *GetPendingTransactionsRequestParameters { + this := GetPendingTransactionsRequestParameters{} + this.PageSize = pageSize + return &this +} + +// NewGetPendingTransactionsRequestParametersWithDefaults instantiates a new GetPendingTransactionsRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetPendingTransactionsRequestParametersWithDefaults() *GetPendingTransactionsRequestParameters { + this := GetPendingTransactionsRequestParameters{} + return &this +} + +// GetPageSize returns the PageSize field value +func (o *GetPendingTransactionsRequestParameters) GetPageSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PageSize +} + +// GetPageSizeOk returns a tuple with the PageSize field value +// and a boolean to check if the value has been set. +func (o *GetPendingTransactionsRequestParameters) GetPageSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PageSize, true +} + +// SetPageSize sets field value +func (o *GetPendingTransactionsRequestParameters) SetPageSize(v int32) { + o.PageSize = v +} + +// GetFirstTxHash returns the FirstTxHash field value if set, zero value otherwise. +func (o *GetPendingTransactionsRequestParameters) GetFirstTxHash() string { + if o == nil || IsNil(o.FirstTxHash) { + var ret string + return ret + } + return *o.FirstTxHash +} + +// GetFirstTxHashOk returns a tuple with the FirstTxHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetPendingTransactionsRequestParameters) GetFirstTxHashOk() (*string, bool) { + if o == nil || IsNil(o.FirstTxHash) { + return nil, false + } + return o.FirstTxHash, true +} + +// HasFirstTxHash returns a boolean if a field has been set. +func (o *GetPendingTransactionsRequestParameters) HasFirstTxHash() bool { + if o != nil && !IsNil(o.FirstTxHash) { + return true + } + + return false +} + +// SetFirstTxHash gets a reference to the given string and assigns it to the FirstTxHash field. +func (o *GetPendingTransactionsRequestParameters) SetFirstTxHash(v string) { + o.FirstTxHash = &v +} + +// GetFirstTxTime returns the FirstTxTime field value if set, zero value otherwise. +func (o *GetPendingTransactionsRequestParameters) GetFirstTxTime() map[string]interface{} { + if o == nil || IsNil(o.FirstTxTime) { + var ret map[string]interface{} + return ret + } + return o.FirstTxTime +} + +// GetFirstTxTimeOk returns a tuple with the FirstTxTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetPendingTransactionsRequestParameters) GetFirstTxTimeOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FirstTxTime) { + return map[string]interface{}{}, false + } + return o.FirstTxTime, true +} + +// HasFirstTxTime returns a boolean if a field has been set. +func (o *GetPendingTransactionsRequestParameters) HasFirstTxTime() bool { + if o != nil && !IsNil(o.FirstTxTime) { + return true + } + + return false +} + +// SetFirstTxTime gets a reference to the given map[string]interface{} and assigns it to the FirstTxTime field. +func (o *GetPendingTransactionsRequestParameters) SetFirstTxTime(v map[string]interface{}) { + o.FirstTxTime = v +} + +// GetLastTxTime returns the LastTxTime field value if set, zero value otherwise. +func (o *GetPendingTransactionsRequestParameters) GetLastTxTime() map[string]interface{} { + if o == nil || IsNil(o.LastTxTime) { + var ret map[string]interface{} + return ret + } + return o.LastTxTime +} + +// GetLastTxTimeOk returns a tuple with the LastTxTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetPendingTransactionsRequestParameters) GetLastTxTimeOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.LastTxTime) { + return map[string]interface{}{}, false + } + return o.LastTxTime, true +} + +// HasLastTxTime returns a boolean if a field has been set. +func (o *GetPendingTransactionsRequestParameters) HasLastTxTime() bool { + if o != nil && !IsNil(o.LastTxTime) { + return true + } + + return false +} + +// SetLastTxTime gets a reference to the given map[string]interface{} and assigns it to the LastTxTime field. +func (o *GetPendingTransactionsRequestParameters) SetLastTxTime(v map[string]interface{}) { + o.LastTxTime = v +} + +func (o GetPendingTransactionsRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetPendingTransactionsRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pageSize"] = o.PageSize + if !IsNil(o.FirstTxHash) { + toSerialize["firstTxHash"] = o.FirstTxHash + } + if !IsNil(o.FirstTxTime) { + toSerialize["firstTxTime"] = o.FirstTxTime + } + if !IsNil(o.LastTxTime) { + toSerialize["lastTxTime"] = o.LastTxTime + } + return toSerialize, nil +} + +type NullableGetPendingTransactionsRequestParameters struct { + value *GetPendingTransactionsRequestParameters + isSet bool +} + +func (v NullableGetPendingTransactionsRequestParameters) Get() *GetPendingTransactionsRequestParameters { + return v.value +} + +func (v *NullableGetPendingTransactionsRequestParameters) Set(val *GetPendingTransactionsRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetPendingTransactionsRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetPendingTransactionsRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetPendingTransactionsRequestParameters(val *GetPendingTransactionsRequestParameters) *NullableGetPendingTransactionsRequestParameters { + return &NullableGetPendingTransactionsRequestParameters{value: val, isSet: true} +} + +func (v NullableGetPendingTransactionsRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetPendingTransactionsRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_role_permissions_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_role_permissions_request_parameters.go new file mode 100644 index 00000000000..00e9c3cd0e8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_role_permissions_request_parameters.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetRolePermissionsRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetRolePermissionsRequestParameters{} + +// GetRolePermissionsRequestParameters The list of arguments to pass in to the transaction request to Get Role Permissions. +type GetRolePermissionsRequestParameters struct { + RoleId string `json:"roleId"` +} + +// NewGetRolePermissionsRequestParameters instantiates a new GetRolePermissionsRequestParameters 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 +// will change when the set of required properties is changed +func NewGetRolePermissionsRequestParameters(roleId string) *GetRolePermissionsRequestParameters { + this := GetRolePermissionsRequestParameters{} + this.RoleId = roleId + return &this +} + +// NewGetRolePermissionsRequestParametersWithDefaults instantiates a new GetRolePermissionsRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetRolePermissionsRequestParametersWithDefaults() *GetRolePermissionsRequestParameters { + this := GetRolePermissionsRequestParameters{} + return &this +} + +// GetRoleId returns the RoleId field value +func (o *GetRolePermissionsRequestParameters) GetRoleId() string { + if o == nil { + var ret string + return ret + } + + return o.RoleId +} + +// GetRoleIdOk returns a tuple with the RoleId field value +// and a boolean to check if the value has been set. +func (o *GetRolePermissionsRequestParameters) GetRoleIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RoleId, true +} + +// SetRoleId sets field value +func (o *GetRolePermissionsRequestParameters) SetRoleId(v string) { + o.RoleId = v +} + +func (o GetRolePermissionsRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetRolePermissionsRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["roleId"] = o.RoleId + return toSerialize, nil +} + +type NullableGetRolePermissionsRequestParameters struct { + value *GetRolePermissionsRequestParameters + isSet bool +} + +func (v NullableGetRolePermissionsRequestParameters) Get() *GetRolePermissionsRequestParameters { + return v.value +} + +func (v *NullableGetRolePermissionsRequestParameters) Set(val *GetRolePermissionsRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetRolePermissionsRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetRolePermissionsRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetRolePermissionsRequestParameters(val *GetRolePermissionsRequestParameters) *NullableGetRolePermissionsRequestParameters { + return &NullableGetRolePermissionsRequestParameters{value: val, isSet: true} +} + +func (v NullableGetRolePermissionsRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetRolePermissionsRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_signatories_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_signatories_request_parameters.go new file mode 100644 index 00000000000..ab5e2f282ca --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_signatories_request_parameters.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetSignatoriesRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetSignatoriesRequestParameters{} + +// GetSignatoriesRequestParameters The list of arguments to pass in to the transaction request to Get Signatories. +type GetSignatoriesRequestParameters struct { + AccountId string `json:"accountId"` +} + +// NewGetSignatoriesRequestParameters instantiates a new GetSignatoriesRequestParameters 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 +// will change when the set of required properties is changed +func NewGetSignatoriesRequestParameters(accountId string) *GetSignatoriesRequestParameters { + this := GetSignatoriesRequestParameters{} + this.AccountId = accountId + return &this +} + +// NewGetSignatoriesRequestParametersWithDefaults instantiates a new GetSignatoriesRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetSignatoriesRequestParametersWithDefaults() *GetSignatoriesRequestParameters { + this := GetSignatoriesRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *GetSignatoriesRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *GetSignatoriesRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *GetSignatoriesRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +func (o GetSignatoriesRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetSignatoriesRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + return toSerialize, nil +} + +type NullableGetSignatoriesRequestParameters struct { + value *GetSignatoriesRequestParameters + isSet bool +} + +func (v NullableGetSignatoriesRequestParameters) Get() *GetSignatoriesRequestParameters { + return v.value +} + +func (v *NullableGetSignatoriesRequestParameters) Set(val *GetSignatoriesRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetSignatoriesRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetSignatoriesRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetSignatoriesRequestParameters(val *GetSignatoriesRequestParameters) *NullableGetSignatoriesRequestParameters { + return &NullableGetSignatoriesRequestParameters{value: val, isSet: true} +} + +func (v NullableGetSignatoriesRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetSignatoriesRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_transactions_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_transactions_request_parameters.go new file mode 100644 index 00000000000..42e985ed525 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_get_transactions_request_parameters.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GetTransactionsRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetTransactionsRequestParameters{} + +// GetTransactionsRequestParameters The list of arguments to pass in to the transaction request to Get Transactions. +type GetTransactionsRequestParameters struct { + TxHashesList []string `json:"txHashesList"` +} + +// NewGetTransactionsRequestParameters instantiates a new GetTransactionsRequestParameters 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 +// will change when the set of required properties is changed +func NewGetTransactionsRequestParameters(txHashesList []string) *GetTransactionsRequestParameters { + this := GetTransactionsRequestParameters{} + this.TxHashesList = txHashesList + return &this +} + +// NewGetTransactionsRequestParametersWithDefaults instantiates a new GetTransactionsRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetTransactionsRequestParametersWithDefaults() *GetTransactionsRequestParameters { + this := GetTransactionsRequestParameters{} + return &this +} + +// GetTxHashesList returns the TxHashesList field value +func (o *GetTransactionsRequestParameters) GetTxHashesList() []string { + if o == nil { + var ret []string + return ret + } + + return o.TxHashesList +} + +// GetTxHashesListOk returns a tuple with the TxHashesList field value +// and a boolean to check if the value has been set. +func (o *GetTransactionsRequestParameters) GetTxHashesListOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.TxHashesList, true +} + +// SetTxHashesList sets field value +func (o *GetTransactionsRequestParameters) SetTxHashesList(v []string) { + o.TxHashesList = v +} + +func (o GetTransactionsRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetTransactionsRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["txHashesList"] = o.TxHashesList + return toSerialize, nil +} + +type NullableGetTransactionsRequestParameters struct { + value *GetTransactionsRequestParameters + isSet bool +} + +func (v NullableGetTransactionsRequestParameters) Get() *GetTransactionsRequestParameters { + return v.value +} + +func (v *NullableGetTransactionsRequestParameters) Set(val *GetTransactionsRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGetTransactionsRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGetTransactionsRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetTransactionsRequestParameters(val *GetTransactionsRequestParameters) *NullableGetTransactionsRequestParameters { + return &NullableGetTransactionsRequestParameters{value: val, isSet: true} +} + +func (v NullableGetTransactionsRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetTransactionsRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_grant_permission_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_grant_permission_request_parameters.go new file mode 100644 index 00000000000..d932ffbdfa7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_grant_permission_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the GrantPermissionRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GrantPermissionRequestParameters{} + +// GrantPermissionRequestParameters The list of arguments to pass in to the transaction request to Grant Permission. +type GrantPermissionRequestParameters struct { + AccountId string `json:"accountId"` + Permission string `json:"permission"` +} + +// NewGrantPermissionRequestParameters instantiates a new GrantPermissionRequestParameters 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 +// will change when the set of required properties is changed +func NewGrantPermissionRequestParameters(accountId string, permission string) *GrantPermissionRequestParameters { + this := GrantPermissionRequestParameters{} + this.AccountId = accountId + this.Permission = permission + return &this +} + +// NewGrantPermissionRequestParametersWithDefaults instantiates a new GrantPermissionRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGrantPermissionRequestParametersWithDefaults() *GrantPermissionRequestParameters { + this := GrantPermissionRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *GrantPermissionRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *GrantPermissionRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *GrantPermissionRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetPermission returns the Permission field value +func (o *GrantPermissionRequestParameters) GetPermission() string { + if o == nil { + var ret string + return ret + } + + return o.Permission +} + +// GetPermissionOk returns a tuple with the Permission field value +// and a boolean to check if the value has been set. +func (o *GrantPermissionRequestParameters) GetPermissionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Permission, true +} + +// SetPermission sets field value +func (o *GrantPermissionRequestParameters) SetPermission(v string) { + o.Permission = v +} + +func (o GrantPermissionRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GrantPermissionRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["permission"] = o.Permission + return toSerialize, nil +} + +type NullableGrantPermissionRequestParameters struct { + value *GrantPermissionRequestParameters + isSet bool +} + +func (v NullableGrantPermissionRequestParameters) Get() *GrantPermissionRequestParameters { + return v.value +} + +func (v *NullableGrantPermissionRequestParameters) Set(val *GrantPermissionRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableGrantPermissionRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableGrantPermissionRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGrantPermissionRequestParameters(val *GrantPermissionRequestParameters) *NullableGrantPermissionRequestParameters { + return &NullableGrantPermissionRequestParameters{value: val, isSet: true} +} + +func (v NullableGrantPermissionRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGrantPermissionRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_base_config.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_base_config.go new file mode 100644 index 00000000000..1b6d1d1c356 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_base_config.go @@ -0,0 +1,422 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the IrohaBaseConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaBaseConfig{} + +// IrohaBaseConfig struct for IrohaBaseConfig +type IrohaBaseConfig struct { + IrohaHost *string `json:"irohaHost,omitempty"` + IrohaPort *float32 `json:"irohaPort,omitempty"` + CreatorAccountId *string `json:"creatorAccountId,omitempty"` + PrivKey []interface{} `json:"privKey,omitempty"` + Quorum *float32 `json:"quorum,omitempty"` + TimeoutLimit *float32 `json:"timeoutLimit,omitempty"` + // Can only be set to false for an insecure grpc connection. + Tls *bool `json:"tls,omitempty"` + // Flag used for monitoring. It changes default beahviour of transaction wrapper so it return error to caller instead of throwing RuntimeError straight away. + MonitorMode NullableBool `json:"monitorMode,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IrohaBaseConfig IrohaBaseConfig + +// NewIrohaBaseConfig instantiates a new IrohaBaseConfig 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 +// will change when the set of required properties is changed +func NewIrohaBaseConfig() *IrohaBaseConfig { + this := IrohaBaseConfig{} + return &this +} + +// NewIrohaBaseConfigWithDefaults instantiates a new IrohaBaseConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaBaseConfigWithDefaults() *IrohaBaseConfig { + this := IrohaBaseConfig{} + return &this +} + +// GetIrohaHost returns the IrohaHost field value if set, zero value otherwise. +func (o *IrohaBaseConfig) GetIrohaHost() string { + if o == nil || IsNil(o.IrohaHost) { + var ret string + return ret + } + return *o.IrohaHost +} + +// GetIrohaHostOk returns a tuple with the IrohaHost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaBaseConfig) GetIrohaHostOk() (*string, bool) { + if o == nil || IsNil(o.IrohaHost) { + return nil, false + } + return o.IrohaHost, true +} + +// HasIrohaHost returns a boolean if a field has been set. +func (o *IrohaBaseConfig) HasIrohaHost() bool { + if o != nil && !IsNil(o.IrohaHost) { + return true + } + + return false +} + +// SetIrohaHost gets a reference to the given string and assigns it to the IrohaHost field. +func (o *IrohaBaseConfig) SetIrohaHost(v string) { + o.IrohaHost = &v +} + +// GetIrohaPort returns the IrohaPort field value if set, zero value otherwise. +func (o *IrohaBaseConfig) GetIrohaPort() float32 { + if o == nil || IsNil(o.IrohaPort) { + var ret float32 + return ret + } + return *o.IrohaPort +} + +// GetIrohaPortOk returns a tuple with the IrohaPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaBaseConfig) GetIrohaPortOk() (*float32, bool) { + if o == nil || IsNil(o.IrohaPort) { + return nil, false + } + return o.IrohaPort, true +} + +// HasIrohaPort returns a boolean if a field has been set. +func (o *IrohaBaseConfig) HasIrohaPort() bool { + if o != nil && !IsNil(o.IrohaPort) { + return true + } + + return false +} + +// SetIrohaPort gets a reference to the given float32 and assigns it to the IrohaPort field. +func (o *IrohaBaseConfig) SetIrohaPort(v float32) { + o.IrohaPort = &v +} + +// GetCreatorAccountId returns the CreatorAccountId field value if set, zero value otherwise. +func (o *IrohaBaseConfig) GetCreatorAccountId() string { + if o == nil || IsNil(o.CreatorAccountId) { + var ret string + return ret + } + return *o.CreatorAccountId +} + +// GetCreatorAccountIdOk returns a tuple with the CreatorAccountId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaBaseConfig) GetCreatorAccountIdOk() (*string, bool) { + if o == nil || IsNil(o.CreatorAccountId) { + return nil, false + } + return o.CreatorAccountId, true +} + +// HasCreatorAccountId returns a boolean if a field has been set. +func (o *IrohaBaseConfig) HasCreatorAccountId() bool { + if o != nil && !IsNil(o.CreatorAccountId) { + return true + } + + return false +} + +// SetCreatorAccountId gets a reference to the given string and assigns it to the CreatorAccountId field. +func (o *IrohaBaseConfig) SetCreatorAccountId(v string) { + o.CreatorAccountId = &v +} + +// GetPrivKey returns the PrivKey field value if set, zero value otherwise. +func (o *IrohaBaseConfig) GetPrivKey() []interface{} { + if o == nil || IsNil(o.PrivKey) { + var ret []interface{} + return ret + } + return o.PrivKey +} + +// GetPrivKeyOk returns a tuple with the PrivKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaBaseConfig) GetPrivKeyOk() ([]interface{}, bool) { + if o == nil || IsNil(o.PrivKey) { + return nil, false + } + return o.PrivKey, true +} + +// HasPrivKey returns a boolean if a field has been set. +func (o *IrohaBaseConfig) HasPrivKey() bool { + if o != nil && !IsNil(o.PrivKey) { + return true + } + + return false +} + +// SetPrivKey gets a reference to the given []interface{} and assigns it to the PrivKey field. +func (o *IrohaBaseConfig) SetPrivKey(v []interface{}) { + o.PrivKey = v +} + +// GetQuorum returns the Quorum field value if set, zero value otherwise. +func (o *IrohaBaseConfig) GetQuorum() float32 { + if o == nil || IsNil(o.Quorum) { + var ret float32 + return ret + } + return *o.Quorum +} + +// GetQuorumOk returns a tuple with the Quorum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaBaseConfig) GetQuorumOk() (*float32, bool) { + if o == nil || IsNil(o.Quorum) { + return nil, false + } + return o.Quorum, true +} + +// HasQuorum returns a boolean if a field has been set. +func (o *IrohaBaseConfig) HasQuorum() bool { + if o != nil && !IsNil(o.Quorum) { + return true + } + + return false +} + +// SetQuorum gets a reference to the given float32 and assigns it to the Quorum field. +func (o *IrohaBaseConfig) SetQuorum(v float32) { + o.Quorum = &v +} + +// GetTimeoutLimit returns the TimeoutLimit field value if set, zero value otherwise. +func (o *IrohaBaseConfig) GetTimeoutLimit() float32 { + if o == nil || IsNil(o.TimeoutLimit) { + var ret float32 + return ret + } + return *o.TimeoutLimit +} + +// GetTimeoutLimitOk returns a tuple with the TimeoutLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaBaseConfig) GetTimeoutLimitOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutLimit) { + return nil, false + } + return o.TimeoutLimit, true +} + +// HasTimeoutLimit returns a boolean if a field has been set. +func (o *IrohaBaseConfig) HasTimeoutLimit() bool { + if o != nil && !IsNil(o.TimeoutLimit) { + return true + } + + return false +} + +// SetTimeoutLimit gets a reference to the given float32 and assigns it to the TimeoutLimit field. +func (o *IrohaBaseConfig) SetTimeoutLimit(v float32) { + o.TimeoutLimit = &v +} + +// GetTls returns the Tls field value if set, zero value otherwise. +func (o *IrohaBaseConfig) GetTls() bool { + if o == nil || IsNil(o.Tls) { + var ret bool + return ret + } + return *o.Tls +} + +// GetTlsOk returns a tuple with the Tls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaBaseConfig) GetTlsOk() (*bool, bool) { + if o == nil || IsNil(o.Tls) { + return nil, false + } + return o.Tls, true +} + +// HasTls returns a boolean if a field has been set. +func (o *IrohaBaseConfig) HasTls() bool { + if o != nil && !IsNil(o.Tls) { + return true + } + + return false +} + +// SetTls gets a reference to the given bool and assigns it to the Tls field. +func (o *IrohaBaseConfig) SetTls(v bool) { + o.Tls = &v +} + +// GetMonitorMode returns the MonitorMode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IrohaBaseConfig) GetMonitorMode() bool { + if o == nil || IsNil(o.MonitorMode.Get()) { + var ret bool + return ret + } + return *o.MonitorMode.Get() +} + +// GetMonitorModeOk returns a tuple with the MonitorMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IrohaBaseConfig) GetMonitorModeOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.MonitorMode.Get(), o.MonitorMode.IsSet() +} + +// HasMonitorMode returns a boolean if a field has been set. +func (o *IrohaBaseConfig) HasMonitorMode() bool { + if o != nil && o.MonitorMode.IsSet() { + return true + } + + return false +} + +// SetMonitorMode gets a reference to the given NullableBool and assigns it to the MonitorMode field. +func (o *IrohaBaseConfig) SetMonitorMode(v bool) { + o.MonitorMode.Set(&v) +} +// SetMonitorModeNil sets the value for MonitorMode to be an explicit nil +func (o *IrohaBaseConfig) SetMonitorModeNil() { + o.MonitorMode.Set(nil) +} + +// UnsetMonitorMode ensures that no value is present for MonitorMode, not even an explicit nil +func (o *IrohaBaseConfig) UnsetMonitorMode() { + o.MonitorMode.Unset() +} + +func (o IrohaBaseConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaBaseConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.IrohaHost) { + toSerialize["irohaHost"] = o.IrohaHost + } + if !IsNil(o.IrohaPort) { + toSerialize["irohaPort"] = o.IrohaPort + } + if !IsNil(o.CreatorAccountId) { + toSerialize["creatorAccountId"] = o.CreatorAccountId + } + if !IsNil(o.PrivKey) { + toSerialize["privKey"] = o.PrivKey + } + if !IsNil(o.Quorum) { + toSerialize["quorum"] = o.Quorum + } + if !IsNil(o.TimeoutLimit) { + toSerialize["timeoutLimit"] = o.TimeoutLimit + } + if !IsNil(o.Tls) { + toSerialize["tls"] = o.Tls + } + if o.MonitorMode.IsSet() { + toSerialize["monitorMode"] = o.MonitorMode.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IrohaBaseConfig) UnmarshalJSON(bytes []byte) (err error) { + varIrohaBaseConfig := _IrohaBaseConfig{} + + if err = json.Unmarshal(bytes, &varIrohaBaseConfig); err == nil { + *o = IrohaBaseConfig(varIrohaBaseConfig) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "irohaHost") + delete(additionalProperties, "irohaPort") + delete(additionalProperties, "creatorAccountId") + delete(additionalProperties, "privKey") + delete(additionalProperties, "quorum") + delete(additionalProperties, "timeoutLimit") + delete(additionalProperties, "tls") + delete(additionalProperties, "monitorMode") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIrohaBaseConfig struct { + value *IrohaBaseConfig + isSet bool +} + +func (v NullableIrohaBaseConfig) Get() *IrohaBaseConfig { + return v.value +} + +func (v *NullableIrohaBaseConfig) Set(val *IrohaBaseConfig) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaBaseConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaBaseConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaBaseConfig(val *IrohaBaseConfig) *NullableIrohaBaseConfig { + return &NullableIrohaBaseConfig{value: val, isSet: true} +} + +func (v NullableIrohaBaseConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaBaseConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_progress.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_progress.go new file mode 100644 index 00000000000..fe53c867476 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_progress.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the IrohaBlockProgress type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaBlockProgress{} + +// IrohaBlockProgress struct for IrohaBlockProgress +type IrohaBlockProgress struct { + TransactionReceipt IrohaBlockResponse `json:"transactionReceipt"` +} + +// NewIrohaBlockProgress instantiates a new IrohaBlockProgress 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 +// will change when the set of required properties is changed +func NewIrohaBlockProgress(transactionReceipt IrohaBlockResponse) *IrohaBlockProgress { + this := IrohaBlockProgress{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewIrohaBlockProgressWithDefaults instantiates a new IrohaBlockProgress object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaBlockProgressWithDefaults() *IrohaBlockProgress { + this := IrohaBlockProgress{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *IrohaBlockProgress) GetTransactionReceipt() IrohaBlockResponse { + if o == nil { + var ret IrohaBlockResponse + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockProgress) GetTransactionReceiptOk() (*IrohaBlockResponse, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *IrohaBlockProgress) SetTransactionReceipt(v IrohaBlockResponse) { + o.TransactionReceipt = v +} + +func (o IrohaBlockProgress) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaBlockProgress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableIrohaBlockProgress struct { + value *IrohaBlockProgress + isSet bool +} + +func (v NullableIrohaBlockProgress) Get() *IrohaBlockProgress { + return v.value +} + +func (v *NullableIrohaBlockProgress) Set(val *IrohaBlockProgress) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaBlockProgress) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaBlockProgress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaBlockProgress(val *IrohaBlockProgress) *NullableIrohaBlockProgress { + return &NullableIrohaBlockProgress{value: val, isSet: true} +} + +func (v NullableIrohaBlockProgress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaBlockProgress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_response.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_response.go new file mode 100644 index 00000000000..3dbfe80be19 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_response.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the IrohaBlockResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaBlockResponse{} + +// IrohaBlockResponse struct for IrohaBlockResponse +type IrohaBlockResponse struct { + Payload IrohaBlockResponsePayload `json:"payload"` + SignaturesList []interface{} `json:"signaturesList"` +} + +// NewIrohaBlockResponse instantiates a new IrohaBlockResponse 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 +// will change when the set of required properties is changed +func NewIrohaBlockResponse(payload IrohaBlockResponsePayload, signaturesList []interface{}) *IrohaBlockResponse { + this := IrohaBlockResponse{} + this.Payload = payload + this.SignaturesList = signaturesList + return &this +} + +// NewIrohaBlockResponseWithDefaults instantiates a new IrohaBlockResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaBlockResponseWithDefaults() *IrohaBlockResponse { + this := IrohaBlockResponse{} + return &this +} + +// GetPayload returns the Payload field value +func (o *IrohaBlockResponse) GetPayload() IrohaBlockResponsePayload { + if o == nil { + var ret IrohaBlockResponsePayload + return ret + } + + return o.Payload +} + +// GetPayloadOk returns a tuple with the Payload field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockResponse) GetPayloadOk() (*IrohaBlockResponsePayload, bool) { + if o == nil { + return nil, false + } + return &o.Payload, true +} + +// SetPayload sets field value +func (o *IrohaBlockResponse) SetPayload(v IrohaBlockResponsePayload) { + o.Payload = v +} + +// GetSignaturesList returns the SignaturesList field value +func (o *IrohaBlockResponse) GetSignaturesList() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.SignaturesList +} + +// GetSignaturesListOk returns a tuple with the SignaturesList field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockResponse) GetSignaturesListOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.SignaturesList, true +} + +// SetSignaturesList sets field value +func (o *IrohaBlockResponse) SetSignaturesList(v []interface{}) { + o.SignaturesList = v +} + +func (o IrohaBlockResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaBlockResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["payload"] = o.Payload + toSerialize["signaturesList"] = o.SignaturesList + return toSerialize, nil +} + +type NullableIrohaBlockResponse struct { + value *IrohaBlockResponse + isSet bool +} + +func (v NullableIrohaBlockResponse) Get() *IrohaBlockResponse { + return v.value +} + +func (v *NullableIrohaBlockResponse) Set(val *IrohaBlockResponse) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaBlockResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaBlockResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaBlockResponse(val *IrohaBlockResponse) *NullableIrohaBlockResponse { + return &NullableIrohaBlockResponse{value: val, isSet: true} +} + +func (v NullableIrohaBlockResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaBlockResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_response_payload.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_response_payload.go new file mode 100644 index 00000000000..ab08c640591 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_block_response_payload.go @@ -0,0 +1,252 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the IrohaBlockResponsePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaBlockResponsePayload{} + +// IrohaBlockResponsePayload struct for IrohaBlockResponsePayload +type IrohaBlockResponsePayload struct { + TransactionsList []interface{} `json:"transactionsList"` + TxNumber float32 `json:"txNumber"` + Height float32 `json:"height"` + PrevBlockHash string `json:"prevBlockHash"` + CreatedTime float32 `json:"createdTime"` + RejectedTransactionsHashesList []interface{} `json:"rejectedTransactionsHashesList"` +} + +// NewIrohaBlockResponsePayload instantiates a new IrohaBlockResponsePayload 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 +// will change when the set of required properties is changed +func NewIrohaBlockResponsePayload(transactionsList []interface{}, txNumber float32, height float32, prevBlockHash string, createdTime float32, rejectedTransactionsHashesList []interface{}) *IrohaBlockResponsePayload { + this := IrohaBlockResponsePayload{} + this.TransactionsList = transactionsList + this.TxNumber = txNumber + this.Height = height + this.PrevBlockHash = prevBlockHash + this.CreatedTime = createdTime + this.RejectedTransactionsHashesList = rejectedTransactionsHashesList + return &this +} + +// NewIrohaBlockResponsePayloadWithDefaults instantiates a new IrohaBlockResponsePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaBlockResponsePayloadWithDefaults() *IrohaBlockResponsePayload { + this := IrohaBlockResponsePayload{} + return &this +} + +// GetTransactionsList returns the TransactionsList field value +func (o *IrohaBlockResponsePayload) GetTransactionsList() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.TransactionsList +} + +// GetTransactionsListOk returns a tuple with the TransactionsList field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockResponsePayload) GetTransactionsListOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.TransactionsList, true +} + +// SetTransactionsList sets field value +func (o *IrohaBlockResponsePayload) SetTransactionsList(v []interface{}) { + o.TransactionsList = v +} + +// GetTxNumber returns the TxNumber field value +func (o *IrohaBlockResponsePayload) GetTxNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TxNumber +} + +// GetTxNumberOk returns a tuple with the TxNumber field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockResponsePayload) GetTxNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TxNumber, true +} + +// SetTxNumber sets field value +func (o *IrohaBlockResponsePayload) SetTxNumber(v float32) { + o.TxNumber = v +} + +// GetHeight returns the Height field value +func (o *IrohaBlockResponsePayload) GetHeight() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Height +} + +// GetHeightOk returns a tuple with the Height field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockResponsePayload) GetHeightOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Height, true +} + +// SetHeight sets field value +func (o *IrohaBlockResponsePayload) SetHeight(v float32) { + o.Height = v +} + +// GetPrevBlockHash returns the PrevBlockHash field value +func (o *IrohaBlockResponsePayload) GetPrevBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.PrevBlockHash +} + +// GetPrevBlockHashOk returns a tuple with the PrevBlockHash field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockResponsePayload) GetPrevBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PrevBlockHash, true +} + +// SetPrevBlockHash sets field value +func (o *IrohaBlockResponsePayload) SetPrevBlockHash(v string) { + o.PrevBlockHash = v +} + +// GetCreatedTime returns the CreatedTime field value +func (o *IrohaBlockResponsePayload) GetCreatedTime() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.CreatedTime +} + +// GetCreatedTimeOk returns a tuple with the CreatedTime field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockResponsePayload) GetCreatedTimeOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.CreatedTime, true +} + +// SetCreatedTime sets field value +func (o *IrohaBlockResponsePayload) SetCreatedTime(v float32) { + o.CreatedTime = v +} + +// GetRejectedTransactionsHashesList returns the RejectedTransactionsHashesList field value +func (o *IrohaBlockResponsePayload) GetRejectedTransactionsHashesList() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.RejectedTransactionsHashesList +} + +// GetRejectedTransactionsHashesListOk returns a tuple with the RejectedTransactionsHashesList field value +// and a boolean to check if the value has been set. +func (o *IrohaBlockResponsePayload) GetRejectedTransactionsHashesListOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.RejectedTransactionsHashesList, true +} + +// SetRejectedTransactionsHashesList sets field value +func (o *IrohaBlockResponsePayload) SetRejectedTransactionsHashesList(v []interface{}) { + o.RejectedTransactionsHashesList = v +} + +func (o IrohaBlockResponsePayload) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaBlockResponsePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionsList"] = o.TransactionsList + toSerialize["txNumber"] = o.TxNumber + toSerialize["height"] = o.Height + toSerialize["prevBlockHash"] = o.PrevBlockHash + toSerialize["createdTime"] = o.CreatedTime + toSerialize["rejectedTransactionsHashesList"] = o.RejectedTransactionsHashesList + return toSerialize, nil +} + +type NullableIrohaBlockResponsePayload struct { + value *IrohaBlockResponsePayload + isSet bool +} + +func (v NullableIrohaBlockResponsePayload) Get() *IrohaBlockResponsePayload { + return v.value +} + +func (v *NullableIrohaBlockResponsePayload) Set(val *IrohaBlockResponsePayload) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaBlockResponsePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaBlockResponsePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaBlockResponsePayload(val *IrohaBlockResponsePayload) *NullableIrohaBlockResponsePayload { + return &NullableIrohaBlockResponsePayload{value: val, isSet: true} +} + +func (v NullableIrohaBlockResponsePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaBlockResponsePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_command.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_command.go new file mode 100644 index 00000000000..550fd949301 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_command.go @@ -0,0 +1,147 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" + "fmt" +) + +// IrohaCommand the model 'IrohaCommand' +type IrohaCommand string + +// List of IrohaCommand +const ( + CreateAccount IrohaCommand = "createAccount" + SetAccountDetail IrohaCommand = "setAccountDetail" + SetAccountQuorum IrohaCommand = "setAccountQuorum" + CompareAndSetAccountDetail IrohaCommand = "compareAndSetAccountDetail" + CreateAsset IrohaCommand = "createAsset" + AddAssetQuantity IrohaCommand = "addAssetQuantity" + SubtractAssetQuantity IrohaCommand = "subtractAssetQuantity" + TransferAsset IrohaCommand = "transferAsset" + CreateDomain IrohaCommand = "createDomain" + CreateRole IrohaCommand = "createRole" + DetachRole IrohaCommand = "detachRole" + AppendRole IrohaCommand = "appendRole" + AddSignatory IrohaCommand = "addSignatory" + RemoveSignatory IrohaCommand = "removeSignatory" + GrantPermission IrohaCommand = "grantPermission" + RevokePermission IrohaCommand = "revokePermission" + AddPeer IrohaCommand = "addPeer" + RemovePeer IrohaCommand = "removePeer" + SetSettingValue IrohaCommand = "setSettingValue" + CallEngine IrohaCommand = "callEngine" +) + +// All allowed values of IrohaCommand enum +var AllowedIrohaCommandEnumValues = []IrohaCommand{ + "createAccount", + "setAccountDetail", + "setAccountQuorum", + "compareAndSetAccountDetail", + "createAsset", + "addAssetQuantity", + "subtractAssetQuantity", + "transferAsset", + "createDomain", + "createRole", + "detachRole", + "appendRole", + "addSignatory", + "removeSignatory", + "grantPermission", + "revokePermission", + "addPeer", + "removePeer", + "setSettingValue", + "callEngine", +} + +func (v *IrohaCommand) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IrohaCommand(value) + for _, existing := range AllowedIrohaCommandEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IrohaCommand", value) +} + +// NewIrohaCommandFromValue returns a pointer to a valid IrohaCommand +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIrohaCommandFromValue(v string) (*IrohaCommand, error) { + ev := IrohaCommand(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IrohaCommand: valid values are %v", v, AllowedIrohaCommandEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IrohaCommand) IsValid() bool { + for _, existing := range AllowedIrohaCommandEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IrohaCommand value +func (v IrohaCommand) Ptr() *IrohaCommand { + return &v +} + +type NullableIrohaCommand struct { + value *IrohaCommand + isSet bool +} + +func (v NullableIrohaCommand) Get() *IrohaCommand { + return v.value +} + +func (v *NullableIrohaCommand) Set(val *IrohaCommand) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaCommand) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaCommand) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaCommand(val *IrohaCommand) *NullableIrohaCommand { + return &NullableIrohaCommand{value: val, isSet: true} +} + +func (v NullableIrohaCommand) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaCommand) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_query.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_query.go new file mode 100644 index 00000000000..11791126635 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_query.go @@ -0,0 +1,137 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" + "fmt" +) + +// IrohaQuery the model 'IrohaQuery' +type IrohaQuery string + +// List of IrohaQuery +const ( + GetAccount IrohaQuery = "getAccount" + GetAccountDetail IrohaQuery = "getAccountDetail" + GetAssetInfo IrohaQuery = "getAssetInfo" + GetAccountAssets IrohaQuery = "getAccountAssets" + GetTransactions IrohaQuery = "getTransactions" + GetPendingTransactions IrohaQuery = "getPendingTransactions" + GetAccountTransactions IrohaQuery = "getAccountTransactions" + GetAccountAssetTransactions IrohaQuery = "getAccountAssetTransactions" + GetRoles IrohaQuery = "getRoles" + GetSignatories IrohaQuery = "getSignatories" + GetRolePermissions IrohaQuery = "getRolePermissions" + GetBlock IrohaQuery = "getBlock" + GetEngineReceipts IrohaQuery = "getEngineReceipts" + FetchCommits IrohaQuery = "fetchCommits" + GetPeers IrohaQuery = "getPeers" +) + +// All allowed values of IrohaQuery enum +var AllowedIrohaQueryEnumValues = []IrohaQuery{ + "getAccount", + "getAccountDetail", + "getAssetInfo", + "getAccountAssets", + "getTransactions", + "getPendingTransactions", + "getAccountTransactions", + "getAccountAssetTransactions", + "getRoles", + "getSignatories", + "getRolePermissions", + "getBlock", + "getEngineReceipts", + "fetchCommits", + "getPeers", +} + +func (v *IrohaQuery) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IrohaQuery(value) + for _, existing := range AllowedIrohaQueryEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IrohaQuery", value) +} + +// NewIrohaQueryFromValue returns a pointer to a valid IrohaQuery +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIrohaQueryFromValue(v string) (*IrohaQuery, error) { + ev := IrohaQuery(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IrohaQuery: valid values are %v", v, AllowedIrohaQueryEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IrohaQuery) IsValid() bool { + for _, existing := range AllowedIrohaQueryEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IrohaQuery value +func (v IrohaQuery) Ptr() *IrohaQuery { + return &v +} + +type NullableIrohaQuery struct { + value *IrohaQuery + isSet bool +} + +func (v NullableIrohaQuery) Get() *IrohaQuery { + return v.value +} + +func (v *NullableIrohaQuery) Set(val *IrohaQuery) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaQuery) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaQuery) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaQuery(val *IrohaQuery) *NullableIrohaQuery { + return &NullableIrohaQuery{value: val, isSet: true} +} + +func (v NullableIrohaQuery) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaQuery) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_socket_io_transact_v1.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_socket_io_transact_v1.go new file mode 100644 index 00000000000..47478e09917 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_iroha_socket_io_transact_v1.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" + "fmt" +) + +// IrohaSocketIOTransactV1 the model 'IrohaSocketIOTransactV1' +type IrohaSocketIOTransactV1 string + +// List of IrohaSocketIOTransactV1 +const ( + SendAsyncRequest IrohaSocketIOTransactV1 = "org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendAsyncRequest" + SendSyncRequest IrohaSocketIOTransactV1 = "org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendSyncRequest" +) + +// All allowed values of IrohaSocketIOTransactV1 enum +var AllowedIrohaSocketIOTransactV1EnumValues = []IrohaSocketIOTransactV1{ + "org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendAsyncRequest", + "org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendSyncRequest", +} + +func (v *IrohaSocketIOTransactV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IrohaSocketIOTransactV1(value) + for _, existing := range AllowedIrohaSocketIOTransactV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IrohaSocketIOTransactV1", value) +} + +// NewIrohaSocketIOTransactV1FromValue returns a pointer to a valid IrohaSocketIOTransactV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIrohaSocketIOTransactV1FromValue(v string) (*IrohaSocketIOTransactV1, error) { + ev := IrohaSocketIOTransactV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IrohaSocketIOTransactV1: valid values are %v", v, AllowedIrohaSocketIOTransactV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IrohaSocketIOTransactV1) IsValid() bool { + for _, existing := range AllowedIrohaSocketIOTransactV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IrohaSocketIOTransactV1 value +func (v IrohaSocketIOTransactV1) Ptr() *IrohaSocketIOTransactV1 { + return &v +} + +type NullableIrohaSocketIOTransactV1 struct { + value *IrohaSocketIOTransactV1 + isSet bool +} + +func (v NullableIrohaSocketIOTransactV1) Get() *IrohaSocketIOTransactV1 { + return v.value +} + +func (v *NullableIrohaSocketIOTransactV1) Set(val *IrohaSocketIOTransactV1) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaSocketIOTransactV1) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaSocketIOTransactV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaSocketIOTransactV1(val *IrohaSocketIOTransactV1) *NullableIrohaSocketIOTransactV1 { + return &NullableIrohaSocketIOTransactV1{value: val, isSet: true} +} + +func (v NullableIrohaSocketIOTransactV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaSocketIOTransactV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_key_pair.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_key_pair.go new file mode 100644 index 00000000000..b756f8c05dd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_key_pair.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the KeyPair type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeyPair{} + +// KeyPair struct for KeyPair +type KeyPair struct { + // SHA-3 ed25519 public keys of length 64 are recommended. + PublicKey string `json:"publicKey"` + // SHA-3 ed25519 private keys of length 64 are recommended. + PrivateKey string `json:"privateKey"` +} + +// NewKeyPair instantiates a new KeyPair 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 +// will change when the set of required properties is changed +func NewKeyPair(publicKey string, privateKey string) *KeyPair { + this := KeyPair{} + this.PublicKey = publicKey + this.PrivateKey = privateKey + return &this +} + +// NewKeyPairWithDefaults instantiates a new KeyPair object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKeyPairWithDefaults() *KeyPair { + this := KeyPair{} + return &this +} + +// GetPublicKey returns the PublicKey field value +func (o *KeyPair) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *KeyPair) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *KeyPair) SetPublicKey(v string) { + o.PublicKey = v +} + +// GetPrivateKey returns the PrivateKey field value +func (o *KeyPair) GetPrivateKey() string { + if o == nil { + var ret string + return ret + } + + return o.PrivateKey +} + +// GetPrivateKeyOk returns a tuple with the PrivateKey field value +// and a boolean to check if the value has been set. +func (o *KeyPair) GetPrivateKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PrivateKey, true +} + +// SetPrivateKey sets field value +func (o *KeyPair) SetPrivateKey(v string) { + o.PrivateKey = v +} + +func (o KeyPair) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeyPair) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["publicKey"] = o.PublicKey + toSerialize["privateKey"] = o.PrivateKey + return toSerialize, nil +} + +type NullableKeyPair struct { + value *KeyPair + isSet bool +} + +func (v NullableKeyPair) Get() *KeyPair { + return v.value +} + +func (v *NullableKeyPair) Set(val *KeyPair) { + v.value = val + v.isSet = true +} + +func (v NullableKeyPair) IsSet() bool { + return v.isSet +} + +func (v *NullableKeyPair) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeyPair(val *KeyPair) *NullableKeyPair { + return &NullableKeyPair{value: val, isSet: true} +} + +func (v NullableKeyPair) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeyPair) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_remove_peer_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_remove_peer_request_parameters.go new file mode 100644 index 00000000000..939ebfa64ea --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_remove_peer_request_parameters.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the RemovePeerRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RemovePeerRequestParameters{} + +// RemovePeerRequestParameters The list of arguments to pass in to the transaction request to Remove Peer. +type RemovePeerRequestParameters struct { + PublicKey string `json:"publicKey"` +} + +// NewRemovePeerRequestParameters instantiates a new RemovePeerRequestParameters 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 +// will change when the set of required properties is changed +func NewRemovePeerRequestParameters(publicKey string) *RemovePeerRequestParameters { + this := RemovePeerRequestParameters{} + this.PublicKey = publicKey + return &this +} + +// NewRemovePeerRequestParametersWithDefaults instantiates a new RemovePeerRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRemovePeerRequestParametersWithDefaults() *RemovePeerRequestParameters { + this := RemovePeerRequestParameters{} + return &this +} + +// GetPublicKey returns the PublicKey field value +func (o *RemovePeerRequestParameters) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *RemovePeerRequestParameters) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *RemovePeerRequestParameters) SetPublicKey(v string) { + o.PublicKey = v +} + +func (o RemovePeerRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RemovePeerRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["publicKey"] = o.PublicKey + return toSerialize, nil +} + +type NullableRemovePeerRequestParameters struct { + value *RemovePeerRequestParameters + isSet bool +} + +func (v NullableRemovePeerRequestParameters) Get() *RemovePeerRequestParameters { + return v.value +} + +func (v *NullableRemovePeerRequestParameters) Set(val *RemovePeerRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableRemovePeerRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableRemovePeerRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRemovePeerRequestParameters(val *RemovePeerRequestParameters) *NullableRemovePeerRequestParameters { + return &NullableRemovePeerRequestParameters{value: val, isSet: true} +} + +func (v NullableRemovePeerRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRemovePeerRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_remove_signatory_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_remove_signatory_request_parameters.go new file mode 100644 index 00000000000..456e887ed93 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_remove_signatory_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the RemoveSignatoryRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RemoveSignatoryRequestParameters{} + +// RemoveSignatoryRequestParameters The list of arguments to pass in to the transaction request to Remove Signatory. +type RemoveSignatoryRequestParameters struct { + AccountId string `json:"accountId"` + PublicKey string `json:"publicKey"` +} + +// NewRemoveSignatoryRequestParameters instantiates a new RemoveSignatoryRequestParameters 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 +// will change when the set of required properties is changed +func NewRemoveSignatoryRequestParameters(accountId string, publicKey string) *RemoveSignatoryRequestParameters { + this := RemoveSignatoryRequestParameters{} + this.AccountId = accountId + this.PublicKey = publicKey + return &this +} + +// NewRemoveSignatoryRequestParametersWithDefaults instantiates a new RemoveSignatoryRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRemoveSignatoryRequestParametersWithDefaults() *RemoveSignatoryRequestParameters { + this := RemoveSignatoryRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *RemoveSignatoryRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *RemoveSignatoryRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *RemoveSignatoryRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetPublicKey returns the PublicKey field value +func (o *RemoveSignatoryRequestParameters) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *RemoveSignatoryRequestParameters) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *RemoveSignatoryRequestParameters) SetPublicKey(v string) { + o.PublicKey = v +} + +func (o RemoveSignatoryRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RemoveSignatoryRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["publicKey"] = o.PublicKey + return toSerialize, nil +} + +type NullableRemoveSignatoryRequestParameters struct { + value *RemoveSignatoryRequestParameters + isSet bool +} + +func (v NullableRemoveSignatoryRequestParameters) Get() *RemoveSignatoryRequestParameters { + return v.value +} + +func (v *NullableRemoveSignatoryRequestParameters) Set(val *RemoveSignatoryRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableRemoveSignatoryRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableRemoveSignatoryRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRemoveSignatoryRequestParameters(val *RemoveSignatoryRequestParameters) *NullableRemoveSignatoryRequestParameters { + return &NullableRemoveSignatoryRequestParameters{value: val, isSet: true} +} + +func (v NullableRemoveSignatoryRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRemoveSignatoryRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_revoke_permission_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_revoke_permission_request_parameters.go new file mode 100644 index 00000000000..c5a6ef2ebac --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_revoke_permission_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the RevokePermissionRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RevokePermissionRequestParameters{} + +// RevokePermissionRequestParameters The list of arguments to pass in to the transaction request to Revoke Permission. +type RevokePermissionRequestParameters struct { + AccountId string `json:"accountId"` + Permission float32 `json:"permission"` +} + +// NewRevokePermissionRequestParameters instantiates a new RevokePermissionRequestParameters 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 +// will change when the set of required properties is changed +func NewRevokePermissionRequestParameters(accountId string, permission float32) *RevokePermissionRequestParameters { + this := RevokePermissionRequestParameters{} + this.AccountId = accountId + this.Permission = permission + return &this +} + +// NewRevokePermissionRequestParametersWithDefaults instantiates a new RevokePermissionRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRevokePermissionRequestParametersWithDefaults() *RevokePermissionRequestParameters { + this := RevokePermissionRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *RevokePermissionRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *RevokePermissionRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *RevokePermissionRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetPermission returns the Permission field value +func (o *RevokePermissionRequestParameters) GetPermission() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Permission +} + +// GetPermissionOk returns a tuple with the Permission field value +// and a boolean to check if the value has been set. +func (o *RevokePermissionRequestParameters) GetPermissionOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Permission, true +} + +// SetPermission sets field value +func (o *RevokePermissionRequestParameters) SetPermission(v float32) { + o.Permission = v +} + +func (o RevokePermissionRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RevokePermissionRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["permission"] = o.Permission + return toSerialize, nil +} + +type NullableRevokePermissionRequestParameters struct { + value *RevokePermissionRequestParameters + isSet bool +} + +func (v NullableRevokePermissionRequestParameters) Get() *RevokePermissionRequestParameters { + return v.value +} + +func (v *NullableRevokePermissionRequestParameters) Set(val *RevokePermissionRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableRevokePermissionRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableRevokePermissionRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRevokePermissionRequestParameters(val *RevokePermissionRequestParameters) *NullableRevokePermissionRequestParameters { + return &NullableRevokePermissionRequestParameters{value: val, isSet: true} +} + +func (v NullableRevokePermissionRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRevokePermissionRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1.go new file mode 100644 index 00000000000..3f416b0d6bb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the RunTransactionRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionRequestV1{} + +// RunTransactionRequestV1 struct for RunTransactionRequestV1 +type RunTransactionRequestV1 struct { + CommandName string `json:"commandName"` + BaseConfig IrohaBaseConfig `json:"baseConfig"` + Params RunTransactionRequestV1Params `json:"params"` +} + +// NewRunTransactionRequestV1 instantiates a new RunTransactionRequestV1 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 +// will change when the set of required properties is changed +func NewRunTransactionRequestV1(commandName string, baseConfig IrohaBaseConfig, params RunTransactionRequestV1Params) *RunTransactionRequestV1 { + this := RunTransactionRequestV1{} + this.CommandName = commandName + this.BaseConfig = baseConfig + this.Params = params + return &this +} + +// NewRunTransactionRequestV1WithDefaults instantiates a new RunTransactionRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionRequestV1WithDefaults() *RunTransactionRequestV1 { + this := RunTransactionRequestV1{} + return &this +} + +// GetCommandName returns the CommandName field value +func (o *RunTransactionRequestV1) GetCommandName() string { + if o == nil { + var ret string + return ret + } + + return o.CommandName +} + +// GetCommandNameOk returns a tuple with the CommandName field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequestV1) GetCommandNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CommandName, true +} + +// SetCommandName sets field value +func (o *RunTransactionRequestV1) SetCommandName(v string) { + o.CommandName = v +} + +// GetBaseConfig returns the BaseConfig field value +func (o *RunTransactionRequestV1) GetBaseConfig() IrohaBaseConfig { + if o == nil { + var ret IrohaBaseConfig + return ret + } + + return o.BaseConfig +} + +// GetBaseConfigOk returns a tuple with the BaseConfig field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequestV1) GetBaseConfigOk() (*IrohaBaseConfig, bool) { + if o == nil { + return nil, false + } + return &o.BaseConfig, true +} + +// SetBaseConfig sets field value +func (o *RunTransactionRequestV1) SetBaseConfig(v IrohaBaseConfig) { + o.BaseConfig = v +} + +// GetParams returns the Params field value +func (o *RunTransactionRequestV1) GetParams() RunTransactionRequestV1Params { + if o == nil { + var ret RunTransactionRequestV1Params + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequestV1) GetParamsOk() (*RunTransactionRequestV1Params, bool) { + if o == nil { + return nil, false + } + return &o.Params, true +} + +// SetParams sets field value +func (o *RunTransactionRequestV1) SetParams(v RunTransactionRequestV1Params) { + o.Params = v +} + +func (o RunTransactionRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["commandName"] = o.CommandName + toSerialize["baseConfig"] = o.BaseConfig + toSerialize["params"] = o.Params + return toSerialize, nil +} + +type NullableRunTransactionRequestV1 struct { + value *RunTransactionRequestV1 + isSet bool +} + +func (v NullableRunTransactionRequestV1) Get() *RunTransactionRequestV1 { + return v.value +} + +func (v *NullableRunTransactionRequestV1) Set(val *RunTransactionRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionRequestV1(val *RunTransactionRequestV1) *NullableRunTransactionRequestV1 { + return &NullableRunTransactionRequestV1{value: val, isSet: true} +} + +func (v NullableRunTransactionRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1_body.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1_body.go new file mode 100644 index 00000000000..a777d7d0191 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1_body.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" + "fmt" +) + +// RunTransactionRequestV1Body - struct for RunTransactionRequestV1Body +type RunTransactionRequestV1Body struct { + RunTransactionRequestV1 *RunTransactionRequestV1 + RunTransactionSignedRequestV1 *RunTransactionSignedRequestV1 +} + +// RunTransactionRequestV1AsRunTransactionRequestV1Body is a convenience function that returns RunTransactionRequestV1 wrapped in RunTransactionRequestV1Body +func RunTransactionRequestV1AsRunTransactionRequestV1Body(v *RunTransactionRequestV1) RunTransactionRequestV1Body { + return RunTransactionRequestV1Body{ + RunTransactionRequestV1: v, + } +} + +// RunTransactionSignedRequestV1AsRunTransactionRequestV1Body is a convenience function that returns RunTransactionSignedRequestV1 wrapped in RunTransactionRequestV1Body +func RunTransactionSignedRequestV1AsRunTransactionRequestV1Body(v *RunTransactionSignedRequestV1) RunTransactionRequestV1Body { + return RunTransactionRequestV1Body{ + RunTransactionSignedRequestV1: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *RunTransactionRequestV1Body) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into RunTransactionRequestV1 + err = newStrictDecoder(data).Decode(&dst.RunTransactionRequestV1) + if err == nil { + jsonRunTransactionRequestV1, _ := json.Marshal(dst.RunTransactionRequestV1) + if string(jsonRunTransactionRequestV1) == "{}" { // empty struct + dst.RunTransactionRequestV1 = nil + } else { + match++ + } + } else { + dst.RunTransactionRequestV1 = nil + } + + // try to unmarshal data into RunTransactionSignedRequestV1 + err = newStrictDecoder(data).Decode(&dst.RunTransactionSignedRequestV1) + if err == nil { + jsonRunTransactionSignedRequestV1, _ := json.Marshal(dst.RunTransactionSignedRequestV1) + if string(jsonRunTransactionSignedRequestV1) == "{}" { // empty struct + dst.RunTransactionSignedRequestV1 = nil + } else { + match++ + } + } else { + dst.RunTransactionSignedRequestV1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.RunTransactionRequestV1 = nil + dst.RunTransactionSignedRequestV1 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(RunTransactionRequestV1Body)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(RunTransactionRequestV1Body)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RunTransactionRequestV1Body) MarshalJSON() ([]byte, error) { + if src.RunTransactionRequestV1 != nil { + return json.Marshal(&src.RunTransactionRequestV1) + } + + if src.RunTransactionSignedRequestV1 != nil { + return json.Marshal(&src.RunTransactionSignedRequestV1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *RunTransactionRequestV1Body) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.RunTransactionRequestV1 != nil { + return obj.RunTransactionRequestV1 + } + + if obj.RunTransactionSignedRequestV1 != nil { + return obj.RunTransactionSignedRequestV1 + } + + // all schemas are nil + return nil +} + +type NullableRunTransactionRequestV1Body struct { + value *RunTransactionRequestV1Body + isSet bool +} + +func (v NullableRunTransactionRequestV1Body) Get() *RunTransactionRequestV1Body { + return v.value +} + +func (v *NullableRunTransactionRequestV1Body) Set(val *RunTransactionRequestV1Body) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionRequestV1Body) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionRequestV1Body) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionRequestV1Body(val *RunTransactionRequestV1Body) *NullableRunTransactionRequestV1Body { + return &NullableRunTransactionRequestV1Body{value: val, isSet: true} +} + +func (v NullableRunTransactionRequestV1Body) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionRequestV1Body) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1_params.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1_params.go new file mode 100644 index 00000000000..56c3d689915 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_request_v1_params.go @@ -0,0 +1,1048 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" + "fmt" +) + +// RunTransactionRequestV1Params - struct for RunTransactionRequestV1Params +type RunTransactionRequestV1Params struct { + AddAssetQuantityRequestParameters *AddAssetQuantityRequestParameters + AddPeerRequestParameters *AddPeerRequestParameters + AddSignatoryRequestParameters *AddSignatoryRequestParameters + AppendRoleRequestParameters *AppendRoleRequestParameters + CallEngineRequestParameters *CallEngineRequestParameters + CompareAndSetAccountDetailRequestParameters *CompareAndSetAccountDetailRequestParameters + CreateAccountRequestParameters *CreateAccountRequestParameters + CreateAssetRequestParameters *CreateAssetRequestParameters + CreateDomainRequestParameters *CreateDomainRequestParameters + CreateRoleRequestParameters *CreateRoleRequestParameters + DetachRoleRequestParameters *DetachRoleRequestParameters + GetAccountAssetTransactionsRequestParameters *GetAccountAssetTransactionsRequestParameters + GetAccountAssetsRequestParameters *GetAccountAssetsRequestParameters + GetAccountDetailRequestParameters *GetAccountDetailRequestParameters + GetAccountRequestParameters *GetAccountRequestParameters + GetAccountTransactionsRequestParameters *GetAccountTransactionsRequestParameters + GetAssetInfoRequestParameters *GetAssetInfoRequestParameters + GetBlockRequestParameters *GetBlockRequestParameters + GetEngineReceiptsRequestParameters *GetEngineReceiptsRequestParameters + GetPendingTransactionsRequestParameters *GetPendingTransactionsRequestParameters + GetRolePermissionsRequestParameters *GetRolePermissionsRequestParameters + GetSignatoriesRequestParameters *GetSignatoriesRequestParameters + GetTransactionsRequestParameters *GetTransactionsRequestParameters + GrantPermissionRequestParameters *GrantPermissionRequestParameters + RemovePeerRequestParameters *RemovePeerRequestParameters + RemoveSignatoryRequestParameters *RemoveSignatoryRequestParameters + RevokePermissionRequestParameters *RevokePermissionRequestParameters + SetAccountDetailRequestParameters *SetAccountDetailRequestParameters + SetAccountQuorumRequestParameters *SetAccountQuorumRequestParameters + SubtractAssetQuantityRequestParameters *SubtractAssetQuantityRequestParameters + TransferAssetRequestParameters *TransferAssetRequestParameters + ArrayOfInterface{} *[]interface{} +} + +// AddAssetQuantityRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns AddAssetQuantityRequestParameters wrapped in RunTransactionRequestV1Params +func AddAssetQuantityRequestParametersAsRunTransactionRequestV1Params(v *AddAssetQuantityRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + AddAssetQuantityRequestParameters: v, + } +} + +// AddPeerRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns AddPeerRequestParameters wrapped in RunTransactionRequestV1Params +func AddPeerRequestParametersAsRunTransactionRequestV1Params(v *AddPeerRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + AddPeerRequestParameters: v, + } +} + +// AddSignatoryRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns AddSignatoryRequestParameters wrapped in RunTransactionRequestV1Params +func AddSignatoryRequestParametersAsRunTransactionRequestV1Params(v *AddSignatoryRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + AddSignatoryRequestParameters: v, + } +} + +// AppendRoleRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns AppendRoleRequestParameters wrapped in RunTransactionRequestV1Params +func AppendRoleRequestParametersAsRunTransactionRequestV1Params(v *AppendRoleRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + AppendRoleRequestParameters: v, + } +} + +// CallEngineRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns CallEngineRequestParameters wrapped in RunTransactionRequestV1Params +func CallEngineRequestParametersAsRunTransactionRequestV1Params(v *CallEngineRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + CallEngineRequestParameters: v, + } +} + +// CompareAndSetAccountDetailRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns CompareAndSetAccountDetailRequestParameters wrapped in RunTransactionRequestV1Params +func CompareAndSetAccountDetailRequestParametersAsRunTransactionRequestV1Params(v *CompareAndSetAccountDetailRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + CompareAndSetAccountDetailRequestParameters: v, + } +} + +// CreateAccountRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns CreateAccountRequestParameters wrapped in RunTransactionRequestV1Params +func CreateAccountRequestParametersAsRunTransactionRequestV1Params(v *CreateAccountRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + CreateAccountRequestParameters: v, + } +} + +// CreateAssetRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns CreateAssetRequestParameters wrapped in RunTransactionRequestV1Params +func CreateAssetRequestParametersAsRunTransactionRequestV1Params(v *CreateAssetRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + CreateAssetRequestParameters: v, + } +} + +// CreateDomainRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns CreateDomainRequestParameters wrapped in RunTransactionRequestV1Params +func CreateDomainRequestParametersAsRunTransactionRequestV1Params(v *CreateDomainRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + CreateDomainRequestParameters: v, + } +} + +// CreateRoleRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns CreateRoleRequestParameters wrapped in RunTransactionRequestV1Params +func CreateRoleRequestParametersAsRunTransactionRequestV1Params(v *CreateRoleRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + CreateRoleRequestParameters: v, + } +} + +// DetachRoleRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns DetachRoleRequestParameters wrapped in RunTransactionRequestV1Params +func DetachRoleRequestParametersAsRunTransactionRequestV1Params(v *DetachRoleRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + DetachRoleRequestParameters: v, + } +} + +// GetAccountAssetTransactionsRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetAccountAssetTransactionsRequestParameters wrapped in RunTransactionRequestV1Params +func GetAccountAssetTransactionsRequestParametersAsRunTransactionRequestV1Params(v *GetAccountAssetTransactionsRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetAccountAssetTransactionsRequestParameters: v, + } +} + +// GetAccountAssetsRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetAccountAssetsRequestParameters wrapped in RunTransactionRequestV1Params +func GetAccountAssetsRequestParametersAsRunTransactionRequestV1Params(v *GetAccountAssetsRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetAccountAssetsRequestParameters: v, + } +} + +// GetAccountDetailRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetAccountDetailRequestParameters wrapped in RunTransactionRequestV1Params +func GetAccountDetailRequestParametersAsRunTransactionRequestV1Params(v *GetAccountDetailRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetAccountDetailRequestParameters: v, + } +} + +// GetAccountRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetAccountRequestParameters wrapped in RunTransactionRequestV1Params +func GetAccountRequestParametersAsRunTransactionRequestV1Params(v *GetAccountRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetAccountRequestParameters: v, + } +} + +// GetAccountTransactionsRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetAccountTransactionsRequestParameters wrapped in RunTransactionRequestV1Params +func GetAccountTransactionsRequestParametersAsRunTransactionRequestV1Params(v *GetAccountTransactionsRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetAccountTransactionsRequestParameters: v, + } +} + +// GetAssetInfoRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetAssetInfoRequestParameters wrapped in RunTransactionRequestV1Params +func GetAssetInfoRequestParametersAsRunTransactionRequestV1Params(v *GetAssetInfoRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetAssetInfoRequestParameters: v, + } +} + +// GetBlockRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetBlockRequestParameters wrapped in RunTransactionRequestV1Params +func GetBlockRequestParametersAsRunTransactionRequestV1Params(v *GetBlockRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetBlockRequestParameters: v, + } +} + +// GetEngineReceiptsRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetEngineReceiptsRequestParameters wrapped in RunTransactionRequestV1Params +func GetEngineReceiptsRequestParametersAsRunTransactionRequestV1Params(v *GetEngineReceiptsRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetEngineReceiptsRequestParameters: v, + } +} + +// GetPendingTransactionsRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetPendingTransactionsRequestParameters wrapped in RunTransactionRequestV1Params +func GetPendingTransactionsRequestParametersAsRunTransactionRequestV1Params(v *GetPendingTransactionsRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetPendingTransactionsRequestParameters: v, + } +} + +// GetRolePermissionsRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetRolePermissionsRequestParameters wrapped in RunTransactionRequestV1Params +func GetRolePermissionsRequestParametersAsRunTransactionRequestV1Params(v *GetRolePermissionsRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetRolePermissionsRequestParameters: v, + } +} + +// GetSignatoriesRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetSignatoriesRequestParameters wrapped in RunTransactionRequestV1Params +func GetSignatoriesRequestParametersAsRunTransactionRequestV1Params(v *GetSignatoriesRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetSignatoriesRequestParameters: v, + } +} + +// GetTransactionsRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GetTransactionsRequestParameters wrapped in RunTransactionRequestV1Params +func GetTransactionsRequestParametersAsRunTransactionRequestV1Params(v *GetTransactionsRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GetTransactionsRequestParameters: v, + } +} + +// GrantPermissionRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns GrantPermissionRequestParameters wrapped in RunTransactionRequestV1Params +func GrantPermissionRequestParametersAsRunTransactionRequestV1Params(v *GrantPermissionRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + GrantPermissionRequestParameters: v, + } +} + +// RemovePeerRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns RemovePeerRequestParameters wrapped in RunTransactionRequestV1Params +func RemovePeerRequestParametersAsRunTransactionRequestV1Params(v *RemovePeerRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + RemovePeerRequestParameters: v, + } +} + +// RemoveSignatoryRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns RemoveSignatoryRequestParameters wrapped in RunTransactionRequestV1Params +func RemoveSignatoryRequestParametersAsRunTransactionRequestV1Params(v *RemoveSignatoryRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + RemoveSignatoryRequestParameters: v, + } +} + +// RevokePermissionRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns RevokePermissionRequestParameters wrapped in RunTransactionRequestV1Params +func RevokePermissionRequestParametersAsRunTransactionRequestV1Params(v *RevokePermissionRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + RevokePermissionRequestParameters: v, + } +} + +// SetAccountDetailRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns SetAccountDetailRequestParameters wrapped in RunTransactionRequestV1Params +func SetAccountDetailRequestParametersAsRunTransactionRequestV1Params(v *SetAccountDetailRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + SetAccountDetailRequestParameters: v, + } +} + +// SetAccountQuorumRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns SetAccountQuorumRequestParameters wrapped in RunTransactionRequestV1Params +func SetAccountQuorumRequestParametersAsRunTransactionRequestV1Params(v *SetAccountQuorumRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + SetAccountQuorumRequestParameters: v, + } +} + +// SubtractAssetQuantityRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns SubtractAssetQuantityRequestParameters wrapped in RunTransactionRequestV1Params +func SubtractAssetQuantityRequestParametersAsRunTransactionRequestV1Params(v *SubtractAssetQuantityRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + SubtractAssetQuantityRequestParameters: v, + } +} + +// TransferAssetRequestParametersAsRunTransactionRequestV1Params is a convenience function that returns TransferAssetRequestParameters wrapped in RunTransactionRequestV1Params +func TransferAssetRequestParametersAsRunTransactionRequestV1Params(v *TransferAssetRequestParameters) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + TransferAssetRequestParameters: v, + } +} + +// []interface{}AsRunTransactionRequestV1Params is a convenience function that returns []interface{} wrapped in RunTransactionRequestV1Params +func ArrayOfInterface{}AsRunTransactionRequestV1Params(v *[]interface{}) RunTransactionRequestV1Params { + return RunTransactionRequestV1Params{ + ArrayOfInterface{}: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *RunTransactionRequestV1Params) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into AddAssetQuantityRequestParameters + err = newStrictDecoder(data).Decode(&dst.AddAssetQuantityRequestParameters) + if err == nil { + jsonAddAssetQuantityRequestParameters, _ := json.Marshal(dst.AddAssetQuantityRequestParameters) + if string(jsonAddAssetQuantityRequestParameters) == "{}" { // empty struct + dst.AddAssetQuantityRequestParameters = nil + } else { + match++ + } + } else { + dst.AddAssetQuantityRequestParameters = nil + } + + // try to unmarshal data into AddPeerRequestParameters + err = newStrictDecoder(data).Decode(&dst.AddPeerRequestParameters) + if err == nil { + jsonAddPeerRequestParameters, _ := json.Marshal(dst.AddPeerRequestParameters) + if string(jsonAddPeerRequestParameters) == "{}" { // empty struct + dst.AddPeerRequestParameters = nil + } else { + match++ + } + } else { + dst.AddPeerRequestParameters = nil + } + + // try to unmarshal data into AddSignatoryRequestParameters + err = newStrictDecoder(data).Decode(&dst.AddSignatoryRequestParameters) + if err == nil { + jsonAddSignatoryRequestParameters, _ := json.Marshal(dst.AddSignatoryRequestParameters) + if string(jsonAddSignatoryRequestParameters) == "{}" { // empty struct + dst.AddSignatoryRequestParameters = nil + } else { + match++ + } + } else { + dst.AddSignatoryRequestParameters = nil + } + + // try to unmarshal data into AppendRoleRequestParameters + err = newStrictDecoder(data).Decode(&dst.AppendRoleRequestParameters) + if err == nil { + jsonAppendRoleRequestParameters, _ := json.Marshal(dst.AppendRoleRequestParameters) + if string(jsonAppendRoleRequestParameters) == "{}" { // empty struct + dst.AppendRoleRequestParameters = nil + } else { + match++ + } + } else { + dst.AppendRoleRequestParameters = nil + } + + // try to unmarshal data into CallEngineRequestParameters + err = newStrictDecoder(data).Decode(&dst.CallEngineRequestParameters) + if err == nil { + jsonCallEngineRequestParameters, _ := json.Marshal(dst.CallEngineRequestParameters) + if string(jsonCallEngineRequestParameters) == "{}" { // empty struct + dst.CallEngineRequestParameters = nil + } else { + match++ + } + } else { + dst.CallEngineRequestParameters = nil + } + + // try to unmarshal data into CompareAndSetAccountDetailRequestParameters + err = newStrictDecoder(data).Decode(&dst.CompareAndSetAccountDetailRequestParameters) + if err == nil { + jsonCompareAndSetAccountDetailRequestParameters, _ := json.Marshal(dst.CompareAndSetAccountDetailRequestParameters) + if string(jsonCompareAndSetAccountDetailRequestParameters) == "{}" { // empty struct + dst.CompareAndSetAccountDetailRequestParameters = nil + } else { + match++ + } + } else { + dst.CompareAndSetAccountDetailRequestParameters = nil + } + + // try to unmarshal data into CreateAccountRequestParameters + err = newStrictDecoder(data).Decode(&dst.CreateAccountRequestParameters) + if err == nil { + jsonCreateAccountRequestParameters, _ := json.Marshal(dst.CreateAccountRequestParameters) + if string(jsonCreateAccountRequestParameters) == "{}" { // empty struct + dst.CreateAccountRequestParameters = nil + } else { + match++ + } + } else { + dst.CreateAccountRequestParameters = nil + } + + // try to unmarshal data into CreateAssetRequestParameters + err = newStrictDecoder(data).Decode(&dst.CreateAssetRequestParameters) + if err == nil { + jsonCreateAssetRequestParameters, _ := json.Marshal(dst.CreateAssetRequestParameters) + if string(jsonCreateAssetRequestParameters) == "{}" { // empty struct + dst.CreateAssetRequestParameters = nil + } else { + match++ + } + } else { + dst.CreateAssetRequestParameters = nil + } + + // try to unmarshal data into CreateDomainRequestParameters + err = newStrictDecoder(data).Decode(&dst.CreateDomainRequestParameters) + if err == nil { + jsonCreateDomainRequestParameters, _ := json.Marshal(dst.CreateDomainRequestParameters) + if string(jsonCreateDomainRequestParameters) == "{}" { // empty struct + dst.CreateDomainRequestParameters = nil + } else { + match++ + } + } else { + dst.CreateDomainRequestParameters = nil + } + + // try to unmarshal data into CreateRoleRequestParameters + err = newStrictDecoder(data).Decode(&dst.CreateRoleRequestParameters) + if err == nil { + jsonCreateRoleRequestParameters, _ := json.Marshal(dst.CreateRoleRequestParameters) + if string(jsonCreateRoleRequestParameters) == "{}" { // empty struct + dst.CreateRoleRequestParameters = nil + } else { + match++ + } + } else { + dst.CreateRoleRequestParameters = nil + } + + // try to unmarshal data into DetachRoleRequestParameters + err = newStrictDecoder(data).Decode(&dst.DetachRoleRequestParameters) + if err == nil { + jsonDetachRoleRequestParameters, _ := json.Marshal(dst.DetachRoleRequestParameters) + if string(jsonDetachRoleRequestParameters) == "{}" { // empty struct + dst.DetachRoleRequestParameters = nil + } else { + match++ + } + } else { + dst.DetachRoleRequestParameters = nil + } + + // try to unmarshal data into GetAccountAssetTransactionsRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetAccountAssetTransactionsRequestParameters) + if err == nil { + jsonGetAccountAssetTransactionsRequestParameters, _ := json.Marshal(dst.GetAccountAssetTransactionsRequestParameters) + if string(jsonGetAccountAssetTransactionsRequestParameters) == "{}" { // empty struct + dst.GetAccountAssetTransactionsRequestParameters = nil + } else { + match++ + } + } else { + dst.GetAccountAssetTransactionsRequestParameters = nil + } + + // try to unmarshal data into GetAccountAssetsRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetAccountAssetsRequestParameters) + if err == nil { + jsonGetAccountAssetsRequestParameters, _ := json.Marshal(dst.GetAccountAssetsRequestParameters) + if string(jsonGetAccountAssetsRequestParameters) == "{}" { // empty struct + dst.GetAccountAssetsRequestParameters = nil + } else { + match++ + } + } else { + dst.GetAccountAssetsRequestParameters = nil + } + + // try to unmarshal data into GetAccountDetailRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetAccountDetailRequestParameters) + if err == nil { + jsonGetAccountDetailRequestParameters, _ := json.Marshal(dst.GetAccountDetailRequestParameters) + if string(jsonGetAccountDetailRequestParameters) == "{}" { // empty struct + dst.GetAccountDetailRequestParameters = nil + } else { + match++ + } + } else { + dst.GetAccountDetailRequestParameters = nil + } + + // try to unmarshal data into GetAccountRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetAccountRequestParameters) + if err == nil { + jsonGetAccountRequestParameters, _ := json.Marshal(dst.GetAccountRequestParameters) + if string(jsonGetAccountRequestParameters) == "{}" { // empty struct + dst.GetAccountRequestParameters = nil + } else { + match++ + } + } else { + dst.GetAccountRequestParameters = nil + } + + // try to unmarshal data into GetAccountTransactionsRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetAccountTransactionsRequestParameters) + if err == nil { + jsonGetAccountTransactionsRequestParameters, _ := json.Marshal(dst.GetAccountTransactionsRequestParameters) + if string(jsonGetAccountTransactionsRequestParameters) == "{}" { // empty struct + dst.GetAccountTransactionsRequestParameters = nil + } else { + match++ + } + } else { + dst.GetAccountTransactionsRequestParameters = nil + } + + // try to unmarshal data into GetAssetInfoRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetAssetInfoRequestParameters) + if err == nil { + jsonGetAssetInfoRequestParameters, _ := json.Marshal(dst.GetAssetInfoRequestParameters) + if string(jsonGetAssetInfoRequestParameters) == "{}" { // empty struct + dst.GetAssetInfoRequestParameters = nil + } else { + match++ + } + } else { + dst.GetAssetInfoRequestParameters = nil + } + + // try to unmarshal data into GetBlockRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetBlockRequestParameters) + if err == nil { + jsonGetBlockRequestParameters, _ := json.Marshal(dst.GetBlockRequestParameters) + if string(jsonGetBlockRequestParameters) == "{}" { // empty struct + dst.GetBlockRequestParameters = nil + } else { + match++ + } + } else { + dst.GetBlockRequestParameters = nil + } + + // try to unmarshal data into GetEngineReceiptsRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetEngineReceiptsRequestParameters) + if err == nil { + jsonGetEngineReceiptsRequestParameters, _ := json.Marshal(dst.GetEngineReceiptsRequestParameters) + if string(jsonGetEngineReceiptsRequestParameters) == "{}" { // empty struct + dst.GetEngineReceiptsRequestParameters = nil + } else { + match++ + } + } else { + dst.GetEngineReceiptsRequestParameters = nil + } + + // try to unmarshal data into GetPendingTransactionsRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetPendingTransactionsRequestParameters) + if err == nil { + jsonGetPendingTransactionsRequestParameters, _ := json.Marshal(dst.GetPendingTransactionsRequestParameters) + if string(jsonGetPendingTransactionsRequestParameters) == "{}" { // empty struct + dst.GetPendingTransactionsRequestParameters = nil + } else { + match++ + } + } else { + dst.GetPendingTransactionsRequestParameters = nil + } + + // try to unmarshal data into GetRolePermissionsRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetRolePermissionsRequestParameters) + if err == nil { + jsonGetRolePermissionsRequestParameters, _ := json.Marshal(dst.GetRolePermissionsRequestParameters) + if string(jsonGetRolePermissionsRequestParameters) == "{}" { // empty struct + dst.GetRolePermissionsRequestParameters = nil + } else { + match++ + } + } else { + dst.GetRolePermissionsRequestParameters = nil + } + + // try to unmarshal data into GetSignatoriesRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetSignatoriesRequestParameters) + if err == nil { + jsonGetSignatoriesRequestParameters, _ := json.Marshal(dst.GetSignatoriesRequestParameters) + if string(jsonGetSignatoriesRequestParameters) == "{}" { // empty struct + dst.GetSignatoriesRequestParameters = nil + } else { + match++ + } + } else { + dst.GetSignatoriesRequestParameters = nil + } + + // try to unmarshal data into GetTransactionsRequestParameters + err = newStrictDecoder(data).Decode(&dst.GetTransactionsRequestParameters) + if err == nil { + jsonGetTransactionsRequestParameters, _ := json.Marshal(dst.GetTransactionsRequestParameters) + if string(jsonGetTransactionsRequestParameters) == "{}" { // empty struct + dst.GetTransactionsRequestParameters = nil + } else { + match++ + } + } else { + dst.GetTransactionsRequestParameters = nil + } + + // try to unmarshal data into GrantPermissionRequestParameters + err = newStrictDecoder(data).Decode(&dst.GrantPermissionRequestParameters) + if err == nil { + jsonGrantPermissionRequestParameters, _ := json.Marshal(dst.GrantPermissionRequestParameters) + if string(jsonGrantPermissionRequestParameters) == "{}" { // empty struct + dst.GrantPermissionRequestParameters = nil + } else { + match++ + } + } else { + dst.GrantPermissionRequestParameters = nil + } + + // try to unmarshal data into RemovePeerRequestParameters + err = newStrictDecoder(data).Decode(&dst.RemovePeerRequestParameters) + if err == nil { + jsonRemovePeerRequestParameters, _ := json.Marshal(dst.RemovePeerRequestParameters) + if string(jsonRemovePeerRequestParameters) == "{}" { // empty struct + dst.RemovePeerRequestParameters = nil + } else { + match++ + } + } else { + dst.RemovePeerRequestParameters = nil + } + + // try to unmarshal data into RemoveSignatoryRequestParameters + err = newStrictDecoder(data).Decode(&dst.RemoveSignatoryRequestParameters) + if err == nil { + jsonRemoveSignatoryRequestParameters, _ := json.Marshal(dst.RemoveSignatoryRequestParameters) + if string(jsonRemoveSignatoryRequestParameters) == "{}" { // empty struct + dst.RemoveSignatoryRequestParameters = nil + } else { + match++ + } + } else { + dst.RemoveSignatoryRequestParameters = nil + } + + // try to unmarshal data into RevokePermissionRequestParameters + err = newStrictDecoder(data).Decode(&dst.RevokePermissionRequestParameters) + if err == nil { + jsonRevokePermissionRequestParameters, _ := json.Marshal(dst.RevokePermissionRequestParameters) + if string(jsonRevokePermissionRequestParameters) == "{}" { // empty struct + dst.RevokePermissionRequestParameters = nil + } else { + match++ + } + } else { + dst.RevokePermissionRequestParameters = nil + } + + // try to unmarshal data into SetAccountDetailRequestParameters + err = newStrictDecoder(data).Decode(&dst.SetAccountDetailRequestParameters) + if err == nil { + jsonSetAccountDetailRequestParameters, _ := json.Marshal(dst.SetAccountDetailRequestParameters) + if string(jsonSetAccountDetailRequestParameters) == "{}" { // empty struct + dst.SetAccountDetailRequestParameters = nil + } else { + match++ + } + } else { + dst.SetAccountDetailRequestParameters = nil + } + + // try to unmarshal data into SetAccountQuorumRequestParameters + err = newStrictDecoder(data).Decode(&dst.SetAccountQuorumRequestParameters) + if err == nil { + jsonSetAccountQuorumRequestParameters, _ := json.Marshal(dst.SetAccountQuorumRequestParameters) + if string(jsonSetAccountQuorumRequestParameters) == "{}" { // empty struct + dst.SetAccountQuorumRequestParameters = nil + } else { + match++ + } + } else { + dst.SetAccountQuorumRequestParameters = nil + } + + // try to unmarshal data into SubtractAssetQuantityRequestParameters + err = newStrictDecoder(data).Decode(&dst.SubtractAssetQuantityRequestParameters) + if err == nil { + jsonSubtractAssetQuantityRequestParameters, _ := json.Marshal(dst.SubtractAssetQuantityRequestParameters) + if string(jsonSubtractAssetQuantityRequestParameters) == "{}" { // empty struct + dst.SubtractAssetQuantityRequestParameters = nil + } else { + match++ + } + } else { + dst.SubtractAssetQuantityRequestParameters = nil + } + + // try to unmarshal data into TransferAssetRequestParameters + err = newStrictDecoder(data).Decode(&dst.TransferAssetRequestParameters) + if err == nil { + jsonTransferAssetRequestParameters, _ := json.Marshal(dst.TransferAssetRequestParameters) + if string(jsonTransferAssetRequestParameters) == "{}" { // empty struct + dst.TransferAssetRequestParameters = nil + } else { + match++ + } + } else { + dst.TransferAssetRequestParameters = nil + } + + // try to unmarshal data into ArrayOfInterface{} + err = newStrictDecoder(data).Decode(&dst.ArrayOfInterface{}) + if err == nil { + jsonArrayOfInterface{}, _ := json.Marshal(dst.ArrayOfInterface{}) + if string(jsonArrayOfInterface{}) == "{}" { // empty struct + dst.ArrayOfInterface{} = nil + } else { + match++ + } + } else { + dst.ArrayOfInterface{} = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.AddAssetQuantityRequestParameters = nil + dst.AddPeerRequestParameters = nil + dst.AddSignatoryRequestParameters = nil + dst.AppendRoleRequestParameters = nil + dst.CallEngineRequestParameters = nil + dst.CompareAndSetAccountDetailRequestParameters = nil + dst.CreateAccountRequestParameters = nil + dst.CreateAssetRequestParameters = nil + dst.CreateDomainRequestParameters = nil + dst.CreateRoleRequestParameters = nil + dst.DetachRoleRequestParameters = nil + dst.GetAccountAssetTransactionsRequestParameters = nil + dst.GetAccountAssetsRequestParameters = nil + dst.GetAccountDetailRequestParameters = nil + dst.GetAccountRequestParameters = nil + dst.GetAccountTransactionsRequestParameters = nil + dst.GetAssetInfoRequestParameters = nil + dst.GetBlockRequestParameters = nil + dst.GetEngineReceiptsRequestParameters = nil + dst.GetPendingTransactionsRequestParameters = nil + dst.GetRolePermissionsRequestParameters = nil + dst.GetSignatoriesRequestParameters = nil + dst.GetTransactionsRequestParameters = nil + dst.GrantPermissionRequestParameters = nil + dst.RemovePeerRequestParameters = nil + dst.RemoveSignatoryRequestParameters = nil + dst.RevokePermissionRequestParameters = nil + dst.SetAccountDetailRequestParameters = nil + dst.SetAccountQuorumRequestParameters = nil + dst.SubtractAssetQuantityRequestParameters = nil + dst.TransferAssetRequestParameters = nil + dst.ArrayOfInterface{} = nil + + return fmt.Errorf("data matches more than one schema in oneOf(RunTransactionRequestV1Params)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(RunTransactionRequestV1Params)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RunTransactionRequestV1Params) MarshalJSON() ([]byte, error) { + if src.AddAssetQuantityRequestParameters != nil { + return json.Marshal(&src.AddAssetQuantityRequestParameters) + } + + if src.AddPeerRequestParameters != nil { + return json.Marshal(&src.AddPeerRequestParameters) + } + + if src.AddSignatoryRequestParameters != nil { + return json.Marshal(&src.AddSignatoryRequestParameters) + } + + if src.AppendRoleRequestParameters != nil { + return json.Marshal(&src.AppendRoleRequestParameters) + } + + if src.CallEngineRequestParameters != nil { + return json.Marshal(&src.CallEngineRequestParameters) + } + + if src.CompareAndSetAccountDetailRequestParameters != nil { + return json.Marshal(&src.CompareAndSetAccountDetailRequestParameters) + } + + if src.CreateAccountRequestParameters != nil { + return json.Marshal(&src.CreateAccountRequestParameters) + } + + if src.CreateAssetRequestParameters != nil { + return json.Marshal(&src.CreateAssetRequestParameters) + } + + if src.CreateDomainRequestParameters != nil { + return json.Marshal(&src.CreateDomainRequestParameters) + } + + if src.CreateRoleRequestParameters != nil { + return json.Marshal(&src.CreateRoleRequestParameters) + } + + if src.DetachRoleRequestParameters != nil { + return json.Marshal(&src.DetachRoleRequestParameters) + } + + if src.GetAccountAssetTransactionsRequestParameters != nil { + return json.Marshal(&src.GetAccountAssetTransactionsRequestParameters) + } + + if src.GetAccountAssetsRequestParameters != nil { + return json.Marshal(&src.GetAccountAssetsRequestParameters) + } + + if src.GetAccountDetailRequestParameters != nil { + return json.Marshal(&src.GetAccountDetailRequestParameters) + } + + if src.GetAccountRequestParameters != nil { + return json.Marshal(&src.GetAccountRequestParameters) + } + + if src.GetAccountTransactionsRequestParameters != nil { + return json.Marshal(&src.GetAccountTransactionsRequestParameters) + } + + if src.GetAssetInfoRequestParameters != nil { + return json.Marshal(&src.GetAssetInfoRequestParameters) + } + + if src.GetBlockRequestParameters != nil { + return json.Marshal(&src.GetBlockRequestParameters) + } + + if src.GetEngineReceiptsRequestParameters != nil { + return json.Marshal(&src.GetEngineReceiptsRequestParameters) + } + + if src.GetPendingTransactionsRequestParameters != nil { + return json.Marshal(&src.GetPendingTransactionsRequestParameters) + } + + if src.GetRolePermissionsRequestParameters != nil { + return json.Marshal(&src.GetRolePermissionsRequestParameters) + } + + if src.GetSignatoriesRequestParameters != nil { + return json.Marshal(&src.GetSignatoriesRequestParameters) + } + + if src.GetTransactionsRequestParameters != nil { + return json.Marshal(&src.GetTransactionsRequestParameters) + } + + if src.GrantPermissionRequestParameters != nil { + return json.Marshal(&src.GrantPermissionRequestParameters) + } + + if src.RemovePeerRequestParameters != nil { + return json.Marshal(&src.RemovePeerRequestParameters) + } + + if src.RemoveSignatoryRequestParameters != nil { + return json.Marshal(&src.RemoveSignatoryRequestParameters) + } + + if src.RevokePermissionRequestParameters != nil { + return json.Marshal(&src.RevokePermissionRequestParameters) + } + + if src.SetAccountDetailRequestParameters != nil { + return json.Marshal(&src.SetAccountDetailRequestParameters) + } + + if src.SetAccountQuorumRequestParameters != nil { + return json.Marshal(&src.SetAccountQuorumRequestParameters) + } + + if src.SubtractAssetQuantityRequestParameters != nil { + return json.Marshal(&src.SubtractAssetQuantityRequestParameters) + } + + if src.TransferAssetRequestParameters != nil { + return json.Marshal(&src.TransferAssetRequestParameters) + } + + if src.ArrayOfInterface{} != nil { + return json.Marshal(&src.ArrayOfInterface{}) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *RunTransactionRequestV1Params) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.AddAssetQuantityRequestParameters != nil { + return obj.AddAssetQuantityRequestParameters + } + + if obj.AddPeerRequestParameters != nil { + return obj.AddPeerRequestParameters + } + + if obj.AddSignatoryRequestParameters != nil { + return obj.AddSignatoryRequestParameters + } + + if obj.AppendRoleRequestParameters != nil { + return obj.AppendRoleRequestParameters + } + + if obj.CallEngineRequestParameters != nil { + return obj.CallEngineRequestParameters + } + + if obj.CompareAndSetAccountDetailRequestParameters != nil { + return obj.CompareAndSetAccountDetailRequestParameters + } + + if obj.CreateAccountRequestParameters != nil { + return obj.CreateAccountRequestParameters + } + + if obj.CreateAssetRequestParameters != nil { + return obj.CreateAssetRequestParameters + } + + if obj.CreateDomainRequestParameters != nil { + return obj.CreateDomainRequestParameters + } + + if obj.CreateRoleRequestParameters != nil { + return obj.CreateRoleRequestParameters + } + + if obj.DetachRoleRequestParameters != nil { + return obj.DetachRoleRequestParameters + } + + if obj.GetAccountAssetTransactionsRequestParameters != nil { + return obj.GetAccountAssetTransactionsRequestParameters + } + + if obj.GetAccountAssetsRequestParameters != nil { + return obj.GetAccountAssetsRequestParameters + } + + if obj.GetAccountDetailRequestParameters != nil { + return obj.GetAccountDetailRequestParameters + } + + if obj.GetAccountRequestParameters != nil { + return obj.GetAccountRequestParameters + } + + if obj.GetAccountTransactionsRequestParameters != nil { + return obj.GetAccountTransactionsRequestParameters + } + + if obj.GetAssetInfoRequestParameters != nil { + return obj.GetAssetInfoRequestParameters + } + + if obj.GetBlockRequestParameters != nil { + return obj.GetBlockRequestParameters + } + + if obj.GetEngineReceiptsRequestParameters != nil { + return obj.GetEngineReceiptsRequestParameters + } + + if obj.GetPendingTransactionsRequestParameters != nil { + return obj.GetPendingTransactionsRequestParameters + } + + if obj.GetRolePermissionsRequestParameters != nil { + return obj.GetRolePermissionsRequestParameters + } + + if obj.GetSignatoriesRequestParameters != nil { + return obj.GetSignatoriesRequestParameters + } + + if obj.GetTransactionsRequestParameters != nil { + return obj.GetTransactionsRequestParameters + } + + if obj.GrantPermissionRequestParameters != nil { + return obj.GrantPermissionRequestParameters + } + + if obj.RemovePeerRequestParameters != nil { + return obj.RemovePeerRequestParameters + } + + if obj.RemoveSignatoryRequestParameters != nil { + return obj.RemoveSignatoryRequestParameters + } + + if obj.RevokePermissionRequestParameters != nil { + return obj.RevokePermissionRequestParameters + } + + if obj.SetAccountDetailRequestParameters != nil { + return obj.SetAccountDetailRequestParameters + } + + if obj.SetAccountQuorumRequestParameters != nil { + return obj.SetAccountQuorumRequestParameters + } + + if obj.SubtractAssetQuantityRequestParameters != nil { + return obj.SubtractAssetQuantityRequestParameters + } + + if obj.TransferAssetRequestParameters != nil { + return obj.TransferAssetRequestParameters + } + + if obj.ArrayOfInterface{} != nil { + return obj.ArrayOfInterface{} + } + + // all schemas are nil + return nil +} + +type NullableRunTransactionRequestV1Params struct { + value *RunTransactionRequestV1Params + isSet bool +} + +func (v NullableRunTransactionRequestV1Params) Get() *RunTransactionRequestV1Params { + return v.value +} + +func (v *NullableRunTransactionRequestV1Params) Set(val *RunTransactionRequestV1Params) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionRequestV1Params) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionRequestV1Params) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionRequestV1Params(val *RunTransactionRequestV1Params) *NullableRunTransactionRequestV1Params { + return &NullableRunTransactionRequestV1Params{value: val, isSet: true} +} + +func (v NullableRunTransactionRequestV1Params) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionRequestV1Params) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_response.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_response.go new file mode 100644 index 00000000000..1259fd117c2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_response.go @@ -0,0 +1,121 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the RunTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionResponse{} + +// RunTransactionResponse struct for RunTransactionResponse +type RunTransactionResponse struct { + TransactionReceipt interface{} `json:"transactionReceipt"` +} + +// NewRunTransactionResponse instantiates a new RunTransactionResponse 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 +// will change when the set of required properties is changed +func NewRunTransactionResponse(transactionReceipt interface{}) *RunTransactionResponse { + this := RunTransactionResponse{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewRunTransactionResponseWithDefaults instantiates a new RunTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionResponseWithDefaults() *RunTransactionResponse { + this := RunTransactionResponse{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *RunTransactionResponse) GetTransactionReceipt() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RunTransactionResponse) GetTransactionReceiptOk() (*interface{}, bool) { + if o == nil || IsNil(o.TransactionReceipt) { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *RunTransactionResponse) SetTransactionReceipt(v interface{}) { + o.TransactionReceipt = v +} + +func (o RunTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.TransactionReceipt != nil { + toSerialize["transactionReceipt"] = o.TransactionReceipt + } + return toSerialize, nil +} + +type NullableRunTransactionResponse struct { + value *RunTransactionResponse + isSet bool +} + +func (v NullableRunTransactionResponse) Get() *RunTransactionResponse { + return v.value +} + +func (v *NullableRunTransactionResponse) Set(val *RunTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionResponse(val *RunTransactionResponse) *NullableRunTransactionResponse { + return &NullableRunTransactionResponse{value: val, isSet: true} +} + +func (v NullableRunTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_signed_request_v1.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_signed_request_v1.go new file mode 100644 index 00000000000..0f901e75b18 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_run_transaction_signed_request_v1.go @@ -0,0 +1,154 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the RunTransactionSignedRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionSignedRequestV1{} + +// RunTransactionSignedRequestV1 struct for RunTransactionSignedRequestV1 +type RunTransactionSignedRequestV1 struct { + // Signed transaction binary data received from generate-transaction endpoint. + SignedTransaction string `json:"signedTransaction"` + BaseConfig *IrohaBaseConfig `json:"baseConfig,omitempty"` +} + +// NewRunTransactionSignedRequestV1 instantiates a new RunTransactionSignedRequestV1 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 +// will change when the set of required properties is changed +func NewRunTransactionSignedRequestV1(signedTransaction string) *RunTransactionSignedRequestV1 { + this := RunTransactionSignedRequestV1{} + this.SignedTransaction = signedTransaction + return &this +} + +// NewRunTransactionSignedRequestV1WithDefaults instantiates a new RunTransactionSignedRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionSignedRequestV1WithDefaults() *RunTransactionSignedRequestV1 { + this := RunTransactionSignedRequestV1{} + return &this +} + +// GetSignedTransaction returns the SignedTransaction field value +func (o *RunTransactionSignedRequestV1) GetSignedTransaction() string { + if o == nil { + var ret string + return ret + } + + return o.SignedTransaction +} + +// GetSignedTransactionOk returns a tuple with the SignedTransaction field value +// and a boolean to check if the value has been set. +func (o *RunTransactionSignedRequestV1) GetSignedTransactionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SignedTransaction, true +} + +// SetSignedTransaction sets field value +func (o *RunTransactionSignedRequestV1) SetSignedTransaction(v string) { + o.SignedTransaction = v +} + +// GetBaseConfig returns the BaseConfig field value if set, zero value otherwise. +func (o *RunTransactionSignedRequestV1) GetBaseConfig() IrohaBaseConfig { + if o == nil || IsNil(o.BaseConfig) { + var ret IrohaBaseConfig + return ret + } + return *o.BaseConfig +} + +// GetBaseConfigOk returns a tuple with the BaseConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTransactionSignedRequestV1) GetBaseConfigOk() (*IrohaBaseConfig, bool) { + if o == nil || IsNil(o.BaseConfig) { + return nil, false + } + return o.BaseConfig, true +} + +// HasBaseConfig returns a boolean if a field has been set. +func (o *RunTransactionSignedRequestV1) HasBaseConfig() bool { + if o != nil && !IsNil(o.BaseConfig) { + return true + } + + return false +} + +// SetBaseConfig gets a reference to the given IrohaBaseConfig and assigns it to the BaseConfig field. +func (o *RunTransactionSignedRequestV1) SetBaseConfig(v IrohaBaseConfig) { + o.BaseConfig = &v +} + +func (o RunTransactionSignedRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionSignedRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["signedTransaction"] = o.SignedTransaction + if !IsNil(o.BaseConfig) { + toSerialize["baseConfig"] = o.BaseConfig + } + return toSerialize, nil +} + +type NullableRunTransactionSignedRequestV1 struct { + value *RunTransactionSignedRequestV1 + isSet bool +} + +func (v NullableRunTransactionSignedRequestV1) Get() *RunTransactionSignedRequestV1 { + return v.value +} + +func (v *NullableRunTransactionSignedRequestV1) Set(val *RunTransactionSignedRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionSignedRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionSignedRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionSignedRequestV1(val *RunTransactionSignedRequestV1) *NullableRunTransactionSignedRequestV1 { + return &NullableRunTransactionSignedRequestV1{value: val, isSet: true} +} + +func (v NullableRunTransactionSignedRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionSignedRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_set_account_detail_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_set_account_detail_request_parameters.go new file mode 100644 index 00000000000..4a0cd906289 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_set_account_detail_request_parameters.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the SetAccountDetailRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetAccountDetailRequestParameters{} + +// SetAccountDetailRequestParameters The list of arguments to pass in to the transaction request to Set Account Detail. +type SetAccountDetailRequestParameters struct { + AccountId string `json:"accountId"` + Key string `json:"key"` + Value string `json:"value"` +} + +// NewSetAccountDetailRequestParameters instantiates a new SetAccountDetailRequestParameters 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 +// will change when the set of required properties is changed +func NewSetAccountDetailRequestParameters(accountId string, key string, value string) *SetAccountDetailRequestParameters { + this := SetAccountDetailRequestParameters{} + this.AccountId = accountId + this.Key = key + this.Value = value + return &this +} + +// NewSetAccountDetailRequestParametersWithDefaults instantiates a new SetAccountDetailRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetAccountDetailRequestParametersWithDefaults() *SetAccountDetailRequestParameters { + this := SetAccountDetailRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *SetAccountDetailRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *SetAccountDetailRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *SetAccountDetailRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetKey returns the Key field value +func (o *SetAccountDetailRequestParameters) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *SetAccountDetailRequestParameters) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *SetAccountDetailRequestParameters) SetKey(v string) { + o.Key = v +} + +// GetValue returns the Value field value +func (o *SetAccountDetailRequestParameters) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *SetAccountDetailRequestParameters) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *SetAccountDetailRequestParameters) SetValue(v string) { + o.Value = v +} + +func (o SetAccountDetailRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetAccountDetailRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableSetAccountDetailRequestParameters struct { + value *SetAccountDetailRequestParameters + isSet bool +} + +func (v NullableSetAccountDetailRequestParameters) Get() *SetAccountDetailRequestParameters { + return v.value +} + +func (v *NullableSetAccountDetailRequestParameters) Set(val *SetAccountDetailRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableSetAccountDetailRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableSetAccountDetailRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetAccountDetailRequestParameters(val *SetAccountDetailRequestParameters) *NullableSetAccountDetailRequestParameters { + return &NullableSetAccountDetailRequestParameters{value: val, isSet: true} +} + +func (v NullableSetAccountDetailRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetAccountDetailRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_set_account_quorum_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_set_account_quorum_request_parameters.go new file mode 100644 index 00000000000..a0fc4af8e95 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_set_account_quorum_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the SetAccountQuorumRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetAccountQuorumRequestParameters{} + +// SetAccountQuorumRequestParameters The list of arguments to pass in to the transaction request to Set Account Quorum. +type SetAccountQuorumRequestParameters struct { + AccountId string `json:"accountId"` + Quorum int32 `json:"quorum"` +} + +// NewSetAccountQuorumRequestParameters instantiates a new SetAccountQuorumRequestParameters 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 +// will change when the set of required properties is changed +func NewSetAccountQuorumRequestParameters(accountId string, quorum int32) *SetAccountQuorumRequestParameters { + this := SetAccountQuorumRequestParameters{} + this.AccountId = accountId + this.Quorum = quorum + return &this +} + +// NewSetAccountQuorumRequestParametersWithDefaults instantiates a new SetAccountQuorumRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetAccountQuorumRequestParametersWithDefaults() *SetAccountQuorumRequestParameters { + this := SetAccountQuorumRequestParameters{} + return &this +} + +// GetAccountId returns the AccountId field value +func (o *SetAccountQuorumRequestParameters) GetAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value +// and a boolean to check if the value has been set. +func (o *SetAccountQuorumRequestParameters) GetAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountId, true +} + +// SetAccountId sets field value +func (o *SetAccountQuorumRequestParameters) SetAccountId(v string) { + o.AccountId = v +} + +// GetQuorum returns the Quorum field value +func (o *SetAccountQuorumRequestParameters) GetQuorum() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Quorum +} + +// GetQuorumOk returns a tuple with the Quorum field value +// and a boolean to check if the value has been set. +func (o *SetAccountQuorumRequestParameters) GetQuorumOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Quorum, true +} + +// SetQuorum sets field value +func (o *SetAccountQuorumRequestParameters) SetQuorum(v int32) { + o.Quorum = v +} + +func (o SetAccountQuorumRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetAccountQuorumRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountId"] = o.AccountId + toSerialize["quorum"] = o.Quorum + return toSerialize, nil +} + +type NullableSetAccountQuorumRequestParameters struct { + value *SetAccountQuorumRequestParameters + isSet bool +} + +func (v NullableSetAccountQuorumRequestParameters) Get() *SetAccountQuorumRequestParameters { + return v.value +} + +func (v *NullableSetAccountQuorumRequestParameters) Set(val *SetAccountQuorumRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableSetAccountQuorumRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableSetAccountQuorumRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetAccountQuorumRequestParameters(val *SetAccountQuorumRequestParameters) *NullableSetAccountQuorumRequestParameters { + return &NullableSetAccountQuorumRequestParameters{value: val, isSet: true} +} + +func (v NullableSetAccountQuorumRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetAccountQuorumRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_subtract_asset_quantity_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_subtract_asset_quantity_request_parameters.go new file mode 100644 index 00000000000..57bcdb046fb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_subtract_asset_quantity_request_parameters.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the SubtractAssetQuantityRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SubtractAssetQuantityRequestParameters{} + +// SubtractAssetQuantityRequestParameters The list of arguments to pass in to the transaction request to Subtract Asset Quantity. +type SubtractAssetQuantityRequestParameters struct { + AssetId string `json:"assetId"` + Amount float32 `json:"amount"` +} + +// NewSubtractAssetQuantityRequestParameters instantiates a new SubtractAssetQuantityRequestParameters 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 +// will change when the set of required properties is changed +func NewSubtractAssetQuantityRequestParameters(assetId string, amount float32) *SubtractAssetQuantityRequestParameters { + this := SubtractAssetQuantityRequestParameters{} + this.AssetId = assetId + this.Amount = amount + return &this +} + +// NewSubtractAssetQuantityRequestParametersWithDefaults instantiates a new SubtractAssetQuantityRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSubtractAssetQuantityRequestParametersWithDefaults() *SubtractAssetQuantityRequestParameters { + this := SubtractAssetQuantityRequestParameters{} + return &this +} + +// GetAssetId returns the AssetId field value +func (o *SubtractAssetQuantityRequestParameters) GetAssetId() string { + if o == nil { + var ret string + return ret + } + + return o.AssetId +} + +// GetAssetIdOk returns a tuple with the AssetId field value +// and a boolean to check if the value has been set. +func (o *SubtractAssetQuantityRequestParameters) GetAssetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssetId, true +} + +// SetAssetId sets field value +func (o *SubtractAssetQuantityRequestParameters) SetAssetId(v string) { + o.AssetId = v +} + +// GetAmount returns the Amount field value +func (o *SubtractAssetQuantityRequestParameters) GetAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *SubtractAssetQuantityRequestParameters) GetAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *SubtractAssetQuantityRequestParameters) SetAmount(v float32) { + o.Amount = v +} + +func (o SubtractAssetQuantityRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SubtractAssetQuantityRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["assetId"] = o.AssetId + toSerialize["amount"] = o.Amount + return toSerialize, nil +} + +type NullableSubtractAssetQuantityRequestParameters struct { + value *SubtractAssetQuantityRequestParameters + isSet bool +} + +func (v NullableSubtractAssetQuantityRequestParameters) Get() *SubtractAssetQuantityRequestParameters { + return v.value +} + +func (v *NullableSubtractAssetQuantityRequestParameters) Set(val *SubtractAssetQuantityRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableSubtractAssetQuantityRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableSubtractAssetQuantityRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSubtractAssetQuantityRequestParameters(val *SubtractAssetQuantityRequestParameters) *NullableSubtractAssetQuantityRequestParameters { + return &NullableSubtractAssetQuantityRequestParameters{value: val, isSet: true} +} + +func (v NullableSubtractAssetQuantityRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSubtractAssetQuantityRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_transfer_asset_request_parameters.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_transfer_asset_request_parameters.go new file mode 100644 index 00000000000..0b69a9e2dde --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_transfer_asset_request_parameters.go @@ -0,0 +1,225 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" +) + +// checks if the TransferAssetRequestParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransferAssetRequestParameters{} + +// TransferAssetRequestParameters The list of arguments to pass in to the transaction request to Transfer Asset. +type TransferAssetRequestParameters struct { + SrcAccountId string `json:"srcAccountId"` + DestAccountId string `json:"destAccountId"` + AssetId string `json:"assetId"` + Description string `json:"description"` + Amount float32 `json:"amount"` +} + +// NewTransferAssetRequestParameters instantiates a new TransferAssetRequestParameters 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 +// will change when the set of required properties is changed +func NewTransferAssetRequestParameters(srcAccountId string, destAccountId string, assetId string, description string, amount float32) *TransferAssetRequestParameters { + this := TransferAssetRequestParameters{} + this.SrcAccountId = srcAccountId + this.DestAccountId = destAccountId + this.AssetId = assetId + this.Description = description + this.Amount = amount + return &this +} + +// NewTransferAssetRequestParametersWithDefaults instantiates a new TransferAssetRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferAssetRequestParametersWithDefaults() *TransferAssetRequestParameters { + this := TransferAssetRequestParameters{} + return &this +} + +// GetSrcAccountId returns the SrcAccountId field value +func (o *TransferAssetRequestParameters) GetSrcAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.SrcAccountId +} + +// GetSrcAccountIdOk returns a tuple with the SrcAccountId field value +// and a boolean to check if the value has been set. +func (o *TransferAssetRequestParameters) GetSrcAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SrcAccountId, true +} + +// SetSrcAccountId sets field value +func (o *TransferAssetRequestParameters) SetSrcAccountId(v string) { + o.SrcAccountId = v +} + +// GetDestAccountId returns the DestAccountId field value +func (o *TransferAssetRequestParameters) GetDestAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.DestAccountId +} + +// GetDestAccountIdOk returns a tuple with the DestAccountId field value +// and a boolean to check if the value has been set. +func (o *TransferAssetRequestParameters) GetDestAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DestAccountId, true +} + +// SetDestAccountId sets field value +func (o *TransferAssetRequestParameters) SetDestAccountId(v string) { + o.DestAccountId = v +} + +// GetAssetId returns the AssetId field value +func (o *TransferAssetRequestParameters) GetAssetId() string { + if o == nil { + var ret string + return ret + } + + return o.AssetId +} + +// GetAssetIdOk returns a tuple with the AssetId field value +// and a boolean to check if the value has been set. +func (o *TransferAssetRequestParameters) GetAssetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssetId, true +} + +// SetAssetId sets field value +func (o *TransferAssetRequestParameters) SetAssetId(v string) { + o.AssetId = v +} + +// GetDescription returns the Description field value +func (o *TransferAssetRequestParameters) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *TransferAssetRequestParameters) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *TransferAssetRequestParameters) SetDescription(v string) { + o.Description = v +} + +// GetAmount returns the Amount field value +func (o *TransferAssetRequestParameters) GetAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *TransferAssetRequestParameters) GetAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *TransferAssetRequestParameters) SetAmount(v float32) { + o.Amount = v +} + +func (o TransferAssetRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferAssetRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["srcAccountId"] = o.SrcAccountId + toSerialize["destAccountId"] = o.DestAccountId + toSerialize["assetId"] = o.AssetId + toSerialize["description"] = o.Description + toSerialize["amount"] = o.Amount + return toSerialize, nil +} + +type NullableTransferAssetRequestParameters struct { + value *TransferAssetRequestParameters + isSet bool +} + +func (v NullableTransferAssetRequestParameters) Get() *TransferAssetRequestParameters { + return v.value +} + +func (v *NullableTransferAssetRequestParameters) Set(val *TransferAssetRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullableTransferAssetRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferAssetRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferAssetRequestParameters(val *TransferAssetRequestParameters) *NullableTransferAssetRequestParameters { + return &NullableTransferAssetRequestParameters{value: val, isSet: true} +} + +func (v NullableTransferAssetRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferAssetRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go new file mode 100644 index 00000000000..d368ebf4c56 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksV1 the model 'WatchBlocksV1' +type WatchBlocksV1 string + +// List of WatchBlocksV1 +const ( + Subscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Subscribe" + Next WatchBlocksV1 = "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Next" + Unsubscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Unsubscribe" + Error WatchBlocksV1 = "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Error" + Complete WatchBlocksV1 = "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Complete" +) + +// All allowed values of WatchBlocksV1 enum +var AllowedWatchBlocksV1EnumValues = []WatchBlocksV1{ + "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Subscribe", + "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Next", + "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Unsubscribe", + "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Error", + "org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Complete", +} + +func (v *WatchBlocksV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchBlocksV1(value) + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchBlocksV1", value) +} + +// NewWatchBlocksV1FromValue returns a pointer to a valid WatchBlocksV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchBlocksV1FromValue(v string) (*WatchBlocksV1, error) { + ev := WatchBlocksV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchBlocksV1: valid values are %v", v, AllowedWatchBlocksV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchBlocksV1) IsValid() bool { + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchBlocksV1 value +func (v WatchBlocksV1) Ptr() *WatchBlocksV1 { + return &v +} + +type NullableWatchBlocksV1 struct { + value *WatchBlocksV1 + isSet bool +} + +func (v NullableWatchBlocksV1) Get() *WatchBlocksV1 { + return v.value +} + +func (v *NullableWatchBlocksV1) Set(val *WatchBlocksV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1(val *WatchBlocksV1) *NullableWatchBlocksV1 { + return &NullableWatchBlocksV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..37268079d31 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..c9fe54eb503 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,61 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-ledger-connector-iroha + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-ledger-connector-iroha_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService GenerateTransactionV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GenerateTransactionV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPrometheusMetricsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPrometheusMetricsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RunTransactionV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.RunTransactionV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..6dff48e1b06 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha + +Can perform basic tasks on a Iroha ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..b3522e2c76e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - Connector Iroha + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..5595dbc6231 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,128 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/AddAssetQuantityRequestParameters.java +src/main/java/org/openapitools/client/model/AddPeerRequestParameters.java +src/main/java/org/openapitools/client/model/AddSignatoryRequestParameters.java +src/main/java/org/openapitools/client/model/AppendRoleRequestParameters.java +src/main/java/org/openapitools/client/model/CallEngineRequestParameters.java +src/main/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParameters.java +src/main/java/org/openapitools/client/model/CreateAccountRequestParameters.java +src/main/java/org/openapitools/client/model/CreateAssetRequestParameters.java +src/main/java/org/openapitools/client/model/CreateDomainRequestParameters.java +src/main/java/org/openapitools/client/model/CreateRoleRequestParameters.java +src/main/java/org/openapitools/client/model/DetachRoleRequestParameters.java +src/main/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1.java +src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java +src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java +src/main/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParameters.java +src/main/java/org/openapitools/client/model/GetAccountAssetsRequestParameters.java +src/main/java/org/openapitools/client/model/GetAccountDetailRequestParameters.java +src/main/java/org/openapitools/client/model/GetAccountRequestParameters.java +src/main/java/org/openapitools/client/model/GetAccountTransactionsRequestParameters.java +src/main/java/org/openapitools/client/model/GetAssetInfoRequestParameters.java +src/main/java/org/openapitools/client/model/GetBlockRequestParameters.java +src/main/java/org/openapitools/client/model/GetEngineReceiptsRequestParameters.java +src/main/java/org/openapitools/client/model/GetPendingTransactionsRequestParameters.java +src/main/java/org/openapitools/client/model/GetRolePermissionsRequestParameters.java +src/main/java/org/openapitools/client/model/GetSignatoriesRequestParameters.java +src/main/java/org/openapitools/client/model/GetTransactionsRequestParameters.java +src/main/java/org/openapitools/client/model/GrantPermissionRequestParameters.java +src/main/java/org/openapitools/client/model/IrohaBaseConfig.java +src/main/java/org/openapitools/client/model/IrohaBlockProgress.java +src/main/java/org/openapitools/client/model/IrohaBlockResponse.java +src/main/java/org/openapitools/client/model/IrohaBlockResponsePayload.java +src/main/java/org/openapitools/client/model/IrohaCommand.java +src/main/java/org/openapitools/client/model/IrohaQuery.java +src/main/java/org/openapitools/client/model/IrohaSocketIOTransactV1.java +src/main/java/org/openapitools/client/model/KeyPair.java +src/main/java/org/openapitools/client/model/RemovePeerRequestParameters.java +src/main/java/org/openapitools/client/model/RemoveSignatoryRequestParameters.java +src/main/java/org/openapitools/client/model/RevokePermissionRequestParameters.java +src/main/java/org/openapitools/client/model/RunTransactionRequestV1.java +src/main/java/org/openapitools/client/model/RunTransactionRequestV1Body.java +src/main/java/org/openapitools/client/model/RunTransactionRequestV1Params.java +src/main/java/org/openapitools/client/model/RunTransactionResponse.java +src/main/java/org/openapitools/client/model/RunTransactionSignedRequestV1.java +src/main/java/org/openapitools/client/model/SetAccountDetailRequestParameters.java +src/main/java/org/openapitools/client/model/SetAccountQuorumRequestParameters.java +src/main/java/org/openapitools/client/model/SubtractAssetQuantityRequestParameters.java +src/main/java/org/openapitools/client/model/TransferAssetRequestParameters.java +src/main/java/org/openapitools/client/model/WatchBlocksV1.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/AddAssetQuantityRequestParametersTest.java +src/test/java/org/openapitools/client/model/AddPeerRequestParametersTest.java +src/test/java/org/openapitools/client/model/AddSignatoryRequestParametersTest.java +src/test/java/org/openapitools/client/model/AppendRoleRequestParametersTest.java +src/test/java/org/openapitools/client/model/CallEngineRequestParametersTest.java +src/test/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParametersTest.java +src/test/java/org/openapitools/client/model/CreateAccountRequestParametersTest.java +src/test/java/org/openapitools/client/model/CreateAssetRequestParametersTest.java +src/test/java/org/openapitools/client/model/CreateDomainRequestParametersTest.java +src/test/java/org/openapitools/client/model/CreateRoleRequestParametersTest.java +src/test/java/org/openapitools/client/model/DetachRoleRequestParametersTest.java +src/test/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1Test.java +src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java +src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1Test.java +src/test/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParametersTest.java +src/test/java/org/openapitools/client/model/GetAccountAssetsRequestParametersTest.java +src/test/java/org/openapitools/client/model/GetAccountDetailRequestParametersTest.java +src/test/java/org/openapitools/client/model/GetAccountRequestParametersTest.java +src/test/java/org/openapitools/client/model/GetAccountTransactionsRequestParametersTest.java +src/test/java/org/openapitools/client/model/GetAssetInfoRequestParametersTest.java +src/test/java/org/openapitools/client/model/GetBlockRequestParametersTest.java +src/test/java/org/openapitools/client/model/GetEngineReceiptsRequestParametersTest.java +src/test/java/org/openapitools/client/model/GetPendingTransactionsRequestParametersTest.java +src/test/java/org/openapitools/client/model/GetRolePermissionsRequestParametersTest.java +src/test/java/org/openapitools/client/model/GetSignatoriesRequestParametersTest.java +src/test/java/org/openapitools/client/model/GetTransactionsRequestParametersTest.java +src/test/java/org/openapitools/client/model/GrantPermissionRequestParametersTest.java +src/test/java/org/openapitools/client/model/IrohaBaseConfigTest.java +src/test/java/org/openapitools/client/model/IrohaBlockProgressTest.java +src/test/java/org/openapitools/client/model/IrohaBlockResponsePayloadTest.java +src/test/java/org/openapitools/client/model/IrohaBlockResponseTest.java +src/test/java/org/openapitools/client/model/IrohaCommandTest.java +src/test/java/org/openapitools/client/model/IrohaQueryTest.java +src/test/java/org/openapitools/client/model/IrohaSocketIOTransactV1Test.java +src/test/java/org/openapitools/client/model/KeyPairTest.java +src/test/java/org/openapitools/client/model/RemovePeerRequestParametersTest.java +src/test/java/org/openapitools/client/model/RemoveSignatoryRequestParametersTest.java +src/test/java/org/openapitools/client/model/RevokePermissionRequestParametersTest.java +src/test/java/org/openapitools/client/model/RunTransactionRequestV1BodyTest.java +src/test/java/org/openapitools/client/model/RunTransactionRequestV1ParamsTest.java +src/test/java/org/openapitools/client/model/RunTransactionRequestV1Test.java +src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java +src/test/java/org/openapitools/client/model/RunTransactionSignedRequestV1Test.java +src/test/java/org/openapitools/client/model/SetAccountDetailRequestParametersTest.java +src/test/java/org/openapitools/client/model/SetAccountQuorumRequestParametersTest.java +src/test/java/org/openapitools/client/model/SubtractAssetQuantityRequestParametersTest.java +src/test/java/org/openapitools/client/model/TransferAssetRequestParametersTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..bc1824e2cce --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,186 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Connector Iroha +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a Iroha ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + GenerateTransactionRequestV1 generateTransactionRequestV1 = new GenerateTransactionRequestV1(); // GenerateTransactionRequestV1 | + try { + String result = apiInstance.generateTransactionV1(generateTransactionRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#generateTransactionV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**generateTransactionV1**](docs/DefaultApi.md#generateTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/generate-transaction | Generate transaction that can be signed locally. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**runTransactionV1**](docs/DefaultApi.md#runTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/run-transaction | Executes a transaction on a Iroha ledger + + +## Documentation for Models + + - [AddAssetQuantityRequestParameters](docs/AddAssetQuantityRequestParameters.md) + - [AddPeerRequestParameters](docs/AddPeerRequestParameters.md) + - [AddSignatoryRequestParameters](docs/AddSignatoryRequestParameters.md) + - [AppendRoleRequestParameters](docs/AppendRoleRequestParameters.md) + - [CallEngineRequestParameters](docs/CallEngineRequestParameters.md) + - [CompareAndSetAccountDetailRequestParameters](docs/CompareAndSetAccountDetailRequestParameters.md) + - [CreateAccountRequestParameters](docs/CreateAccountRequestParameters.md) + - [CreateAssetRequestParameters](docs/CreateAssetRequestParameters.md) + - [CreateDomainRequestParameters](docs/CreateDomainRequestParameters.md) + - [CreateRoleRequestParameters](docs/CreateRoleRequestParameters.md) + - [DetachRoleRequestParameters](docs/DetachRoleRequestParameters.md) + - [ErrorExceptionJsonResponseV1](docs/ErrorExceptionJsonResponseV1.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [GenerateTransactionRequestV1](docs/GenerateTransactionRequestV1.md) + - [GetAccountAssetTransactionsRequestParameters](docs/GetAccountAssetTransactionsRequestParameters.md) + - [GetAccountAssetsRequestParameters](docs/GetAccountAssetsRequestParameters.md) + - [GetAccountDetailRequestParameters](docs/GetAccountDetailRequestParameters.md) + - [GetAccountRequestParameters](docs/GetAccountRequestParameters.md) + - [GetAccountTransactionsRequestParameters](docs/GetAccountTransactionsRequestParameters.md) + - [GetAssetInfoRequestParameters](docs/GetAssetInfoRequestParameters.md) + - [GetBlockRequestParameters](docs/GetBlockRequestParameters.md) + - [GetEngineReceiptsRequestParameters](docs/GetEngineReceiptsRequestParameters.md) + - [GetPendingTransactionsRequestParameters](docs/GetPendingTransactionsRequestParameters.md) + - [GetRolePermissionsRequestParameters](docs/GetRolePermissionsRequestParameters.md) + - [GetSignatoriesRequestParameters](docs/GetSignatoriesRequestParameters.md) + - [GetTransactionsRequestParameters](docs/GetTransactionsRequestParameters.md) + - [GrantPermissionRequestParameters](docs/GrantPermissionRequestParameters.md) + - [IrohaBaseConfig](docs/IrohaBaseConfig.md) + - [IrohaBlockProgress](docs/IrohaBlockProgress.md) + - [IrohaBlockResponse](docs/IrohaBlockResponse.md) + - [IrohaBlockResponsePayload](docs/IrohaBlockResponsePayload.md) + - [IrohaCommand](docs/IrohaCommand.md) + - [IrohaQuery](docs/IrohaQuery.md) + - [IrohaSocketIOTransactV1](docs/IrohaSocketIOTransactV1.md) + - [KeyPair](docs/KeyPair.md) + - [RemovePeerRequestParameters](docs/RemovePeerRequestParameters.md) + - [RemoveSignatoryRequestParameters](docs/RemoveSignatoryRequestParameters.md) + - [RevokePermissionRequestParameters](docs/RevokePermissionRequestParameters.md) + - [RunTransactionRequestV1](docs/RunTransactionRequestV1.md) + - [RunTransactionRequestV1Body](docs/RunTransactionRequestV1Body.md) + - [RunTransactionRequestV1Params](docs/RunTransactionRequestV1Params.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [RunTransactionSignedRequestV1](docs/RunTransactionSignedRequestV1.md) + - [SetAccountDetailRequestParameters](docs/SetAccountDetailRequestParameters.md) + - [SetAccountQuorumRequestParameters](docs/SetAccountQuorumRequestParameters.md) + - [SubtractAssetQuantityRequestParameters](docs/SubtractAssetQuantityRequestParameters.md) + - [TransferAssetRequestParameters](docs/TransferAssetRequestParameters.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..f8ce82828b2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,903 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Iroha ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Iroha + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequestV1Body' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionJsonResponseV1' + description: Bad Request error. + "405": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionJsonResponseV1' + description: Method Not Allowed error. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionJsonResponseV1' + description: Internal Server Error. + summary: Executes a transaction on a Iroha ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/run-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/generate-transaction: + post: + operationId: generateTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateTransactionRequestV1' + responses: + "200": + content: + application/octet-stream: + schema: + type: string + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Bad Request Error + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Generate transaction that can be signed locally. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/generate-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/get-prometheus-exporter-metrics + x-accepts: text/plain +components: + schemas: + IrohaCommand: + enum: + - createAccount + - setAccountDetail + - setAccountQuorum + - compareAndSetAccountDetail + - createAsset + - addAssetQuantity + - subtractAssetQuantity + - transferAsset + - createDomain + - createRole + - detachRole + - appendRole + - addSignatory + - removeSignatory + - grantPermission + - revokePermission + - addPeer + - removePeer + - setSettingValue + - callEngine + type: string + x-enum-descriptions: + - "Make entity in the system, capable of sending transactions or queries, storing\ + \ signatories, personal data and identifiers." + - Set key-value information for a given account. + - "Set the number of signatories required to confirm the identity of a user,\ + \ who creates the transaction." + - Set key-value information for a given account if the old value matches the + value passed. + - "Create a new type of asset, unique in a domain. An asset is a countable representation\ + \ of a commodity." + - Increase the quantity of an asset on account of transaction creator. + - Decrease the number of assets on account of transaction creator. + - "Share assets within the account in peer network: in the way that source account\ + \ transfers assets to the target account." + - "Make new domain in Iroha network, which is a group of accounts." + - Create a new role in the system from the set of permissions. + - Detach a role from the set of roles of an account. + - "Promote an account to some created role in the system, where a role is a\ + \ set of permissions account has to perform an action (command or query)." + - Add an identifier to the account. Such identifier is a public key of another + device or a public key of another user. + - "Remove a public key, associated with an identity, from an account" + - Give another account rights to perform actions on the account of transaction + sender (give someone right to do something with my account). + - Revoke or dismiss given granted permission from another account in the network. + - Write into ledger the fact of peer addition into the peer network. + - Write into ledger the fact of peer removal from the network. + - "This command is not available for use, it was added for backward compatibility\ + \ with Iroha." + - This command is not availalbe for use because it is related to smart contract. + x-enum-varnames: + - CreateAccount + - SetAccountDetail + - SetAccountQuorum + - CompareAndSetAccountDetail + - CreateAsset + - AddAssetQuantity + - SubtractAssetQuantity + - TransferAsset + - CreateDomain + - CreateRole + - DetachRole + - AppendRole + - AddSignatory + - RemoveSignatory + - GrantPermission + - RevokePermission + - AddPeer + - RemovePeer + - SetSettingValue + - CallEngine + IrohaQuery: + enum: + - getAccount + - getAccountDetail + - getAssetInfo + - getAccountAssets + - getTransactions + - getPendingTransactions + - getAccountTransactions + - getAccountAssetTransactions + - getRoles + - getSignatories + - getRolePermissions + - getBlock + - getEngineReceipts + - fetchCommits + - getPeers + type: string + x-enum-descriptions: + - To get the state of an account + - To get details of the account. + - To get information on the given asset (as for now - its precision). + - To get the state of all assets in an account (a balance). + - "To retrieve information about transactions, based on their hashes." + - To retrieve a list of pending (not fully signed) multisignature transactions + or batches of transactions issued by account of query creator. + - To retrieve a list of transactions per account. + - To retrieve all transactions associated with given account and asset. + - To get existing roles in the system. + - "To get signatories, which act as an identity of the account." + - To get available permissions per role in the system. + - "To get a specific block, using its height as an identifier." + - To retrieve a receipt of a CallEngine command. Allows to access the event + log created during computations inside the EVM. + - "To get new blocks as soon as they are committed, a user can invoke FetchCommits\ + \ RPC call to Iroha network." + - A query that returns a list of peers in Iroha network. + x-enum-varnames: + - GetAccount + - GetAccountDetail + - GetAssetInfo + - GetAccountAssets + - GetTransactions + - GetPendingTransactions + - GetAccountTransactions + - GetAccountAssetTransactions + - GetRoles + - GetSignatories + - GetRolePermissions + - GetBlock + - GetEngineReceipts + - FetchCommits + - GetPeers + KeyPair: + properties: + publicKey: + description: SHA-3 ed25519 public keys of length 64 are recommended. + example: 313a07e6384776ed95447710d15e59148473ccfc052a681317a72a69f2a49910 + nullable: false + type: string + privateKey: + description: SHA-3 ed25519 private keys of length 64 are recommended. + example: f101537e319568c765b2cc89698325604991dca57b9716b58016b253506cab70 + nullable: false + type: string + required: + - privateKey + - publicKey + type: object + RunTransactionRequestV1Params: + oneOf: + - items: {} + type: array + - $ref: '#/components/schemas/AddAssetQuantityRequestParameters' + - $ref: '#/components/schemas/AddPeerRequestParameters' + - $ref: '#/components/schemas/AddSignatoryRequestParameters' + - $ref: '#/components/schemas/AppendRoleRequestParameters' + - $ref: '#/components/schemas/CallEngineRequestParameters' + - $ref: '#/components/schemas/CreateAccountRequestParameters' + - $ref: '#/components/schemas/CreateAssetRequestParameters' + - $ref: '#/components/schemas/CreateDomainRequestParameters' + - $ref: '#/components/schemas/CreateRoleRequestParameters' + - $ref: '#/components/schemas/DetachRoleRequestParameters' + - $ref: '#/components/schemas/GrantPermissionRequestParameters' + - $ref: '#/components/schemas/RemovePeerRequestParameters' + - $ref: '#/components/schemas/RemoveSignatoryRequestParameters' + - $ref: '#/components/schemas/RevokePermissionRequestParameters' + - $ref: '#/components/schemas/SetAccountDetailRequestParameters' + - $ref: '#/components/schemas/SetAccountQuorumRequestParameters' + - $ref: '#/components/schemas/SubtractAssetQuantityRequestParameters' + - $ref: '#/components/schemas/TransferAssetRequestParameters' + - $ref: '#/components/schemas/CompareAndSetAccountDetailRequestParameters' + - $ref: '#/components/schemas/GetAccountRequestParameters' + - $ref: '#/components/schemas/GetBlockRequestParameters' + - $ref: '#/components/schemas/GetSignatoriesRequestParameters' + - $ref: '#/components/schemas/GetTransactionsRequestParameters' + - $ref: '#/components/schemas/GetPendingTransactionsRequestParameters' + - $ref: '#/components/schemas/GetAccountTransactionsRequestParameters' + - $ref: '#/components/schemas/GetAccountAssetTransactionsRequestParameters' + - $ref: '#/components/schemas/GetAccountAssetsRequestParameters' + - $ref: '#/components/schemas/GetAccountDetailRequestParameters' + - $ref: '#/components/schemas/GetAssetInfoRequestParameters' + - $ref: '#/components/schemas/GetRolePermissionsRequestParameters' + - $ref: '#/components/schemas/GetEngineReceiptsRequestParameters' + RunTransactionRequestV1Body: + oneOf: + - $ref: '#/components/schemas/RunTransactionRequestV1' + - $ref: '#/components/schemas/RunTransactionSignedRequestV1' + RunTransactionRequestV1: + additionalProperties: false + properties: + commandName: + nullable: false + type: string + baseConfig: + $ref: '#/components/schemas/IrohaBaseConfig' + params: + $ref: '#/components/schemas/RunTransactionRequestV1Params' + required: + - baseConfig + - commandName + - params + type: object + AddAssetQuantityRequestParameters: + description: The list of arguments to pass in to the transaction request to + Add Asset Quantity. + properties: + assetId: + type: string + amount: + type: number + required: + - amount + - assetId + type: object + AddPeerRequestParameters: + description: The list of arguments to pass in to the transaction request to + Add Peer. + properties: + address: + type: string + peerKey: + type: string + tlsCertificate: + type: string + syncingPeer: + type: boolean + required: + - address + - peerKey + type: object + AddSignatoryRequestParameters: + description: The list of arguments to pass in to the transaction request to + Add Signatory. + properties: + accountId: + type: string + publicKey: + type: string + required: + - accountId + - publicKey + type: object + AppendRoleRequestParameters: + description: The list of arguments to pass in to the transaction request to + Append Role. + properties: + accountId: + type: string + roleName: + type: string + required: + - accountId + - roleName + type: object + CallEngineRequestParameters: + description: The list of arguments to pass in to the transaction request to + Call Engine. + properties: + caller: + type: string + callee: + type: string + input: + type: string + required: + - callee + - caller + - input + type: object + CreateAccountRequestParameters: + description: The list of arguments to pass in to the transaction request to + Create Account. + properties: + accountName: + type: string + domainId: + type: string + publicKey: + type: string + required: + - accountName + - domainId + - publicKey + type: object + CreateAssetRequestParameters: + description: The list of arguments to pass in to the transaction request to + Create Asset. + properties: + assetName: + type: string + domainId: + type: string + precision: + type: integer + required: + - assetName + - domainId + - precision + type: object + CreateDomainRequestParameters: + description: The list of arguments to pass in to the transaction request to + Create Domain. + properties: + domainId: + type: string + defaultRole: + type: string + required: + - defaultRole + - domainId + type: object + CreateRoleRequestParameters: + description: The list of arguments to pass in to the transaction request to + Create Role. + properties: + roleName: + type: string + permissionsList: + items: + type: number + type: array + required: + - permissionsList + - roleName + type: object + DetachRoleRequestParameters: + description: The list of arguments to pass in to the transaction request to + Detach Role. + properties: + accountId: + type: string + roleName: + type: string + required: + - accountId + - roleName + type: object + GrantPermissionRequestParameters: + description: The list of arguments to pass in to the transaction request to + Grant Permission. + properties: + accountId: + type: string + permission: + type: string + required: + - accountId + - permission + type: object + RemovePeerRequestParameters: + description: The list of arguments to pass in to the transaction request to + Remove Peer. + properties: + publicKey: + type: string + required: + - publicKey + type: object + RemoveSignatoryRequestParameters: + description: The list of arguments to pass in to the transaction request to + Remove Signatory. + properties: + accountId: + type: string + publicKey: + type: string + required: + - accountId + - publicKey + type: object + RevokePermissionRequestParameters: + description: The list of arguments to pass in to the transaction request to + Revoke Permission. + properties: + accountId: + type: string + permission: + type: number + required: + - accountId + - permission + type: object + SetAccountDetailRequestParameters: + description: The list of arguments to pass in to the transaction request to + Set Account Detail. + properties: + accountId: + type: string + key: + type: string + value: + type: string + required: + - accountId + - key + - value + type: object + SetAccountQuorumRequestParameters: + description: The list of arguments to pass in to the transaction request to + Set Account Quorum. + properties: + accountId: + type: string + quorum: + type: integer + required: + - accountId + - quorum + type: object + SubtractAssetQuantityRequestParameters: + description: The list of arguments to pass in to the transaction request to + Subtract Asset Quantity. + properties: + assetId: + type: string + amount: + type: number + required: + - amount + - assetId + type: object + TransferAssetRequestParameters: + description: The list of arguments to pass in to the transaction request to + Transfer Asset. + properties: + srcAccountId: + type: string + destAccountId: + type: string + assetId: + type: string + description: + type: string + amount: + type: number + required: + - amount + - assetId + - description + - destAccountId + - srcAccountId + type: object + CompareAndSetAccountDetailRequestParameters: + description: The list of arguments to pass in to the transaction request to + Compare And Set Account Detail. + properties: + accountId: + type: string + key: + type: string + value: + type: string + oldValue: + type: string + check_empty: + type: boolean + required: + - accountId + - check_empty + - key + - value + type: object + GetAccountRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account. + properties: + accountId: + type: string + required: + - accountId + type: object + GetBlockRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Block. + properties: + height: + type: integer + required: + - height + type: object + GetSignatoriesRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Signatories. + properties: + accountId: + type: string + required: + - accountId + type: object + GetTransactionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Transactions. + properties: + txHashesList: + items: + type: string + type: array + required: + - txHashesList + type: object + GetPendingTransactionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Pending Transactions. + properties: + pageSize: + type: integer + firstTxHash: + type: string + firstTxTime: + type: object + lastTxTime: + type: object + required: + - pageSize + type: object + GetAccountTransactionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account Transactions. + properties: + accountId: + type: string + pageSize: + type: integer + firstTxHash: + type: string + firstTxTime: + type: object + lastTxTime: + type: object + firstTxHeight: + type: integer + lastTxHeight: + type: integer + required: + - accountId + - firstTxHash + - pageSize + type: object + GetAccountAssetTransactionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account Asset Transactions. + properties: + accountId: + type: string + assetId: + type: string + pageSize: + type: integer + firstTxHash: + type: string + required: + - accountId + - assetId + - firstTxHash + - pageSize + type: object + GetAccountAssetsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account Assets. + properties: + accountId: + type: string + pageSize: + type: number + firstAssetId: + type: string + required: + - accountId + - pageSize + type: object + GetAccountDetailRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Account Detail. + properties: + accountId: + type: string + key: + type: string + writer: + type: string + pageSize: + type: integer + paginationKey: + type: string + paginationWriter: + type: string + required: + - pageSize + - paginationKey + - paginationWriter + type: object + GetAssetInfoRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Asset Info. + properties: + assetId: + type: string + required: + - assetId + type: object + GetRolePermissionsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Role Permissions. + properties: + roleId: + type: string + required: + - roleId + type: object + GetEngineReceiptsRequestParameters: + description: The list of arguments to pass in to the transaction request to + Get Engine Receipts. + properties: + txHash: + type: string + required: + - txHash + type: object + RunTransactionSignedRequestV1: + properties: + signedTransaction: + description: Signed transaction binary data received from generate-transaction + endpoint. + type: string + baseConfig: + $ref: '#/components/schemas/IrohaBaseConfig' + required: + - signedTransaction + type: object + GenerateTransactionRequestV1: + additionalProperties: false + example: + creatorAccountId: creatorAccountId + commandName: "" + commandParams: "{}" + quorum: 0.8008281904610115 + properties: + commandName: + description: Iroha command name. + nullable: false + type: IrohaCommand + commandParams: + description: Parameters for iroha command specified in commandName + type: object + creatorAccountId: + description: Sender account id + nullable: false + type: string + quorum: + default: 1 + description: Requested transaction quorum + nullable: false + type: number + required: + - commandName + - commandParams + - creatorAccountId + type: object + IrohaBaseConfig: + additionalProperties: true + properties: + irohaHost: + nullable: false + type: string + irohaPort: + nullable: false + type: number + creatorAccountId: + nullable: false + type: string + privKey: + default: [] + items: {} + nullable: false + type: array + quorum: + nullable: false + type: number + timeoutLimit: + nullable: false + type: number + tls: + description: Can only be set to false for an insecure grpc connection. + nullable: false + type: boolean + monitorMode: + description: Flag used for monitoring. It changes default beahviour of transaction + wrapper so it return error to caller instead of throwing RuntimeError + straight away. + nullable: true + type: boolean + type: object + RunTransactionResponse: + example: + transactionReceipt: "" + properties: + transactionReceipt: {} + required: + - transactionReceipt + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + ErrorExceptionJsonResponseV1: + properties: + message: + nullable: false + type: string + name: + nullable: false + type: string + error: + nullable: false + type: string + stack: + nullable: false + type: string + cause: + nullable: false + type: string + required: + - message + type: object + ErrorExceptionResponseV1: + properties: + message: + nullable: false + type: string + error: + nullable: false + type: string + required: + - error + - message + type: object + WatchBlocksV1: + enum: + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + - SendAsyncRequest + - SendSyncRequest + IrohaSocketIOTransactV1: + enum: + - org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendAsyncRequest + - org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendSyncRequest + type: string + x-enum-varnames: + - SendAsyncRequest + - SendSyncRequest + IrohaBlockResponse: + properties: + payload: + $ref: '#/components/schemas/IrohaBlockResponse_payload' + signaturesList: + items: {} + type: array + required: + - payload + - signaturesList + type: object + IrohaBlockProgress: + properties: + transactionReceipt: + $ref: '#/components/schemas/IrohaBlockResponse' + required: + - transactionReceipt + type: object + IrohaBlockResponse_payload: + properties: + transactionsList: + items: {} + type: array + txNumber: + type: number + height: + type: number + prevBlockHash: + type: string + createdTime: + type: number + rejectedTransactionsHashesList: + items: {} + type: array + required: + - createdTime + - height + - prevBlockHash + - rejectedTransactionsHashesList + - transactionsList + - txNumber + type: object + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..f7170e4302d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..a9d883bb7fb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..f096ad15550 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..4e5787fcff1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..ff07a638454 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..c9acbf1133b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..61917580d31 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,444 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.AddAssetQuantityRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.AddPeerRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.AddSignatoryRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.AppendRoleRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CallEngineRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CompareAndSetAccountDetailRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CreateAccountRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CreateAssetRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CreateDomainRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CreateRoleRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DetachRoleRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ErrorExceptionJsonResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ErrorExceptionResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GenerateTransactionRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetAccountAssetTransactionsRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetAccountAssetsRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetAccountDetailRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetAccountRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetAccountTransactionsRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetAssetInfoRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetBlockRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetEngineReceiptsRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetPendingTransactionsRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetRolePermissionsRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetSignatoriesRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GetTransactionsRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GrantPermissionRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaBaseConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaBlockProgress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaBlockResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaBlockResponsePayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.KeyPair.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RemovePeerRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RemoveSignatoryRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RevokePermissionRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionRequestV1Body.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionRequestV1Params.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionSignedRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetAccountDetailRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SetAccountQuorumRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SubtractAssetQuantityRequestParameters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransferAssetRequestParameters.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); + } + } + } + + /** + * 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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..1be3f99e703 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..9a65171239d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..0851213f2d5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..05a88a73e5d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..8aa7c9caf54 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,450 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.ErrorExceptionJsonResponseV1; +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.GenerateTransactionRequestV1; +import org.openapitools.client.model.RunTransactionRequestV1Body; +import org.openapitools.client.model.RunTransactionResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 generateTransactionV1 + * @param generateTransactionRequestV1 (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 + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request Error -
500 Internal Server Error -
+ */ + public okhttp3.Call generateTransactionV1Call(GenerateTransactionRequestV1 generateTransactionRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = generateTransactionRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/generate-transaction"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/octet-stream", + "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 generateTransactionV1ValidateBeforeCall(GenerateTransactionRequestV1 generateTransactionRequestV1, final ApiCallback _callback) throws ApiException { + return generateTransactionV1Call(generateTransactionRequestV1, _callback); + + } + + /** + * Generate transaction that can be signed locally. + * + * @param generateTransactionRequestV1 (optional) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request Error -
500 Internal Server Error -
+ */ + public String generateTransactionV1(GenerateTransactionRequestV1 generateTransactionRequestV1) throws ApiException { + ApiResponse localVarResp = generateTransactionV1WithHttpInfo(generateTransactionRequestV1); + return localVarResp.getData(); + } + + /** + * Generate transaction that can be signed locally. + * + * @param generateTransactionRequestV1 (optional) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request Error -
500 Internal Server Error -
+ */ + public ApiResponse generateTransactionV1WithHttpInfo(GenerateTransactionRequestV1 generateTransactionRequestV1) throws ApiException { + okhttp3.Call localVarCall = generateTransactionV1ValidateBeforeCall(generateTransactionRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Generate transaction that can be signed locally. (asynchronously) + * + * @param generateTransactionRequestV1 (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 + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request Error -
500 Internal Server Error -
+ */ + public okhttp3.Call generateTransactionV1Async(GenerateTransactionRequestV1 generateTransactionRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = generateTransactionV1ValidateBeforeCall(generateTransactionRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + 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 getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for runTransactionV1 + * @param runTransactionRequestV1Body (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 + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request error. -
405 Method Not Allowed error. -
500 Internal Server Error. -
+ */ + public okhttp3.Call runTransactionV1Call(RunTransactionRequestV1Body runTransactionRequestV1Body, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = runTransactionRequestV1Body; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha/run-transaction"; + + 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 runTransactionV1ValidateBeforeCall(RunTransactionRequestV1Body runTransactionRequestV1Body, final ApiCallback _callback) throws ApiException { + return runTransactionV1Call(runTransactionRequestV1Body, _callback); + + } + + /** + * Executes a transaction on a Iroha ledger + * + * @param runTransactionRequestV1Body (optional) + * @return RunTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request error. -
405 Method Not Allowed error. -
500 Internal Server Error. -
+ */ + public RunTransactionResponse runTransactionV1(RunTransactionRequestV1Body runTransactionRequestV1Body) throws ApiException { + ApiResponse localVarResp = runTransactionV1WithHttpInfo(runTransactionRequestV1Body); + return localVarResp.getData(); + } + + /** + * Executes a transaction on a Iroha ledger + * + * @param runTransactionRequestV1Body (optional) + * @return ApiResponse<RunTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request error. -
405 Method Not Allowed error. -
500 Internal Server Error. -
+ */ + public ApiResponse runTransactionV1WithHttpInfo(RunTransactionRequestV1Body runTransactionRequestV1Body) throws ApiException { + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequestV1Body, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Executes a transaction on a Iroha ledger (asynchronously) + * + * @param runTransactionRequestV1Body (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 + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request error. -
405 Method Not Allowed error. -
500 Internal Server Error. -
+ */ + public okhttp3.Call runTransactionV1Async(RunTransactionRequestV1Body runTransactionRequestV1Body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequestV1Body, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..99e466edccc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..9515de28b3c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..356af7f278a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..81e840e5201 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..2685f9cc87c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddAssetQuantityRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddAssetQuantityRequestParameters.java new file mode 100644 index 00000000000..c83542b945e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddAssetQuantityRequestParameters.java @@ -0,0 +1,246 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Add Asset Quantity. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AddAssetQuantityRequestParameters { + public static final String SERIALIZED_NAME_ASSET_ID = "assetId"; + @SerializedName(SERIALIZED_NAME_ASSET_ID) + private String assetId; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private BigDecimal amount; + + public AddAssetQuantityRequestParameters() { + } + + public AddAssetQuantityRequestParameters assetId(String assetId) { + + this.assetId = assetId; + return this; + } + + /** + * Get assetId + * @return assetId + **/ + @javax.annotation.Nonnull + public String getAssetId() { + return assetId; + } + + + public void setAssetId(String assetId) { + this.assetId = assetId; + } + + + public AddAssetQuantityRequestParameters amount(BigDecimal amount) { + + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + **/ + @javax.annotation.Nonnull + public BigDecimal getAmount() { + return amount; + } + + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddAssetQuantityRequestParameters addAssetQuantityRequestParameters = (AddAssetQuantityRequestParameters) o; + return Objects.equals(this.assetId, addAssetQuantityRequestParameters.assetId) && + Objects.equals(this.amount, addAssetQuantityRequestParameters.amount); + } + + @Override + public int hashCode() { + return Objects.hash(assetId, amount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddAssetQuantityRequestParameters {\n"); + sb.append(" assetId: ").append(toIndentedString(assetId)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("assetId"); + openapiFields.add("amount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("assetId"); + openapiRequiredFields.add("amount"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AddAssetQuantityRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddAssetQuantityRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AddAssetQuantityRequestParameters is not found in the empty JSON string", AddAssetQuantityRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddAssetQuantityRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddAssetQuantityRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddAssetQuantityRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("assetId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddAssetQuantityRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddAssetQuantityRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddAssetQuantityRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AddAssetQuantityRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddAssetQuantityRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddAssetQuantityRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddAssetQuantityRequestParameters + * @throws IOException if the JSON string is invalid with respect to AddAssetQuantityRequestParameters + */ + public static AddAssetQuantityRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddAssetQuantityRequestParameters.class); + } + + /** + * Convert an instance of AddAssetQuantityRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddPeerRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddPeerRequestParameters.java new file mode 100644 index 00000000000..e2a4d0187c8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddPeerRequestParameters.java @@ -0,0 +1,307 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Add Peer. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AddPeerRequestParameters { + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_PEER_KEY = "peerKey"; + @SerializedName(SERIALIZED_NAME_PEER_KEY) + private String peerKey; + + public static final String SERIALIZED_NAME_TLS_CERTIFICATE = "tlsCertificate"; + @SerializedName(SERIALIZED_NAME_TLS_CERTIFICATE) + private String tlsCertificate; + + public static final String SERIALIZED_NAME_SYNCING_PEER = "syncingPeer"; + @SerializedName(SERIALIZED_NAME_SYNCING_PEER) + private Boolean syncingPeer; + + public AddPeerRequestParameters() { + } + + public AddPeerRequestParameters address(String address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @javax.annotation.Nonnull + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public AddPeerRequestParameters peerKey(String peerKey) { + + this.peerKey = peerKey; + return this; + } + + /** + * Get peerKey + * @return peerKey + **/ + @javax.annotation.Nonnull + public String getPeerKey() { + return peerKey; + } + + + public void setPeerKey(String peerKey) { + this.peerKey = peerKey; + } + + + public AddPeerRequestParameters tlsCertificate(String tlsCertificate) { + + this.tlsCertificate = tlsCertificate; + return this; + } + + /** + * Get tlsCertificate + * @return tlsCertificate + **/ + @javax.annotation.Nullable + public String getTlsCertificate() { + return tlsCertificate; + } + + + public void setTlsCertificate(String tlsCertificate) { + this.tlsCertificate = tlsCertificate; + } + + + public AddPeerRequestParameters syncingPeer(Boolean syncingPeer) { + + this.syncingPeer = syncingPeer; + return this; + } + + /** + * Get syncingPeer + * @return syncingPeer + **/ + @javax.annotation.Nullable + public Boolean getSyncingPeer() { + return syncingPeer; + } + + + public void setSyncingPeer(Boolean syncingPeer) { + this.syncingPeer = syncingPeer; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddPeerRequestParameters addPeerRequestParameters = (AddPeerRequestParameters) o; + return Objects.equals(this.address, addPeerRequestParameters.address) && + Objects.equals(this.peerKey, addPeerRequestParameters.peerKey) && + Objects.equals(this.tlsCertificate, addPeerRequestParameters.tlsCertificate) && + Objects.equals(this.syncingPeer, addPeerRequestParameters.syncingPeer); + } + + @Override + public int hashCode() { + return Objects.hash(address, peerKey, tlsCertificate, syncingPeer); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddPeerRequestParameters {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" peerKey: ").append(toIndentedString(peerKey)).append("\n"); + sb.append(" tlsCertificate: ").append(toIndentedString(tlsCertificate)).append("\n"); + sb.append(" syncingPeer: ").append(toIndentedString(syncingPeer)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("address"); + openapiFields.add("peerKey"); + openapiFields.add("tlsCertificate"); + openapiFields.add("syncingPeer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("peerKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AddPeerRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddPeerRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AddPeerRequestParameters is not found in the empty JSON string", AddPeerRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddPeerRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddPeerRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddPeerRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if (!jsonObj.get("peerKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `peerKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("peerKey").toString())); + } + if ((jsonObj.get("tlsCertificate") != null && !jsonObj.get("tlsCertificate").isJsonNull()) && !jsonObj.get("tlsCertificate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tlsCertificate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tlsCertificate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddPeerRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddPeerRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddPeerRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AddPeerRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddPeerRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddPeerRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddPeerRequestParameters + * @throws IOException if the JSON string is invalid with respect to AddPeerRequestParameters + */ + public static AddPeerRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddPeerRequestParameters.class); + } + + /** + * Convert an instance of AddPeerRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddSignatoryRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddSignatoryRequestParameters.java new file mode 100644 index 00000000000..a0ce2fc4d21 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AddSignatoryRequestParameters.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Add Signatory. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AddSignatoryRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + private String publicKey; + + public AddSignatoryRequestParameters() { + } + + public AddSignatoryRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public AddSignatoryRequestParameters publicKey(String publicKey) { + + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + **/ + @javax.annotation.Nonnull + public String getPublicKey() { + return publicKey; + } + + + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddSignatoryRequestParameters addSignatoryRequestParameters = (AddSignatoryRequestParameters) o; + return Objects.equals(this.accountId, addSignatoryRequestParameters.accountId) && + Objects.equals(this.publicKey, addSignatoryRequestParameters.publicKey); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, publicKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddSignatoryRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("publicKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("publicKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AddSignatoryRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AddSignatoryRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AddSignatoryRequestParameters is not found in the empty JSON string", AddSignatoryRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AddSignatoryRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddSignatoryRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddSignatoryRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("publicKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddSignatoryRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddSignatoryRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddSignatoryRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AddSignatoryRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddSignatoryRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddSignatoryRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddSignatoryRequestParameters + * @throws IOException if the JSON string is invalid with respect to AddSignatoryRequestParameters + */ + public static AddSignatoryRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddSignatoryRequestParameters.class); + } + + /** + * Convert an instance of AddSignatoryRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AppendRoleRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AppendRoleRequestParameters.java new file mode 100644 index 00000000000..a1e53639af8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AppendRoleRequestParameters.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Append Role. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AppendRoleRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_ROLE_NAME = "roleName"; + @SerializedName(SERIALIZED_NAME_ROLE_NAME) + private String roleName; + + public AppendRoleRequestParameters() { + } + + public AppendRoleRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public AppendRoleRequestParameters roleName(String roleName) { + + this.roleName = roleName; + return this; + } + + /** + * Get roleName + * @return roleName + **/ + @javax.annotation.Nonnull + public String getRoleName() { + return roleName; + } + + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AppendRoleRequestParameters appendRoleRequestParameters = (AppendRoleRequestParameters) o; + return Objects.equals(this.accountId, appendRoleRequestParameters.accountId) && + Objects.equals(this.roleName, appendRoleRequestParameters.roleName); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, roleName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AppendRoleRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" roleName: ").append(toIndentedString(roleName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("roleName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("roleName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AppendRoleRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AppendRoleRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AppendRoleRequestParameters is not found in the empty JSON string", AppendRoleRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AppendRoleRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AppendRoleRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AppendRoleRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("roleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `roleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("roleName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AppendRoleRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AppendRoleRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AppendRoleRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AppendRoleRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AppendRoleRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AppendRoleRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of AppendRoleRequestParameters + * @throws IOException if the JSON string is invalid with respect to AppendRoleRequestParameters + */ + public static AppendRoleRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AppendRoleRequestParameters.class); + } + + /** + * Convert an instance of AppendRoleRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CallEngineRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CallEngineRequestParameters.java new file mode 100644 index 00000000000..7857c5d5bab --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CallEngineRequestParameters.java @@ -0,0 +1,280 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Call Engine. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CallEngineRequestParameters { + public static final String SERIALIZED_NAME_CALLER = "caller"; + @SerializedName(SERIALIZED_NAME_CALLER) + private String caller; + + public static final String SERIALIZED_NAME_CALLEE = "callee"; + @SerializedName(SERIALIZED_NAME_CALLEE) + private String callee; + + public static final String SERIALIZED_NAME_INPUT = "input"; + @SerializedName(SERIALIZED_NAME_INPUT) + private String input; + + public CallEngineRequestParameters() { + } + + public CallEngineRequestParameters caller(String caller) { + + this.caller = caller; + return this; + } + + /** + * Get caller + * @return caller + **/ + @javax.annotation.Nonnull + public String getCaller() { + return caller; + } + + + public void setCaller(String caller) { + this.caller = caller; + } + + + public CallEngineRequestParameters callee(String callee) { + + this.callee = callee; + return this; + } + + /** + * Get callee + * @return callee + **/ + @javax.annotation.Nonnull + public String getCallee() { + return callee; + } + + + public void setCallee(String callee) { + this.callee = callee; + } + + + public CallEngineRequestParameters input(String input) { + + this.input = input; + return this; + } + + /** + * Get input + * @return input + **/ + @javax.annotation.Nonnull + public String getInput() { + return input; + } + + + public void setInput(String input) { + this.input = input; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CallEngineRequestParameters callEngineRequestParameters = (CallEngineRequestParameters) o; + return Objects.equals(this.caller, callEngineRequestParameters.caller) && + Objects.equals(this.callee, callEngineRequestParameters.callee) && + Objects.equals(this.input, callEngineRequestParameters.input); + } + + @Override + public int hashCode() { + return Objects.hash(caller, callee, input); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CallEngineRequestParameters {\n"); + sb.append(" caller: ").append(toIndentedString(caller)).append("\n"); + sb.append(" callee: ").append(toIndentedString(callee)).append("\n"); + sb.append(" input: ").append(toIndentedString(input)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("caller"); + openapiFields.add("callee"); + openapiFields.add("input"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("caller"); + openapiRequiredFields.add("callee"); + openapiRequiredFields.add("input"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CallEngineRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CallEngineRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CallEngineRequestParameters is not found in the empty JSON string", CallEngineRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CallEngineRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CallEngineRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CallEngineRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("caller").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `caller` to be a primitive type in the JSON string but got `%s`", jsonObj.get("caller").toString())); + } + if (!jsonObj.get("callee").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `callee` to be a primitive type in the JSON string but got `%s`", jsonObj.get("callee").toString())); + } + if (!jsonObj.get("input").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `input` to be a primitive type in the JSON string but got `%s`", jsonObj.get("input").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CallEngineRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CallEngineRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CallEngineRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CallEngineRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CallEngineRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CallEngineRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of CallEngineRequestParameters + * @throws IOException if the JSON string is invalid with respect to CallEngineRequestParameters + */ + public static CallEngineRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CallEngineRequestParameters.class); + } + + /** + * Convert an instance of CallEngineRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParameters.java new file mode 100644 index 00000000000..ed357166fbe --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParameters.java @@ -0,0 +1,340 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Compare And Set Account Detail. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CompareAndSetAccountDetailRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_OLD_VALUE = "oldValue"; + @SerializedName(SERIALIZED_NAME_OLD_VALUE) + private String oldValue; + + public static final String SERIALIZED_NAME_CHECK_EMPTY = "check_empty"; + @SerializedName(SERIALIZED_NAME_CHECK_EMPTY) + private Boolean checkEmpty; + + public CompareAndSetAccountDetailRequestParameters() { + } + + public CompareAndSetAccountDetailRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public CompareAndSetAccountDetailRequestParameters key(String key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public CompareAndSetAccountDetailRequestParameters value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + public CompareAndSetAccountDetailRequestParameters oldValue(String oldValue) { + + this.oldValue = oldValue; + return this; + } + + /** + * Get oldValue + * @return oldValue + **/ + @javax.annotation.Nullable + public String getOldValue() { + return oldValue; + } + + + public void setOldValue(String oldValue) { + this.oldValue = oldValue; + } + + + public CompareAndSetAccountDetailRequestParameters checkEmpty(Boolean checkEmpty) { + + this.checkEmpty = checkEmpty; + return this; + } + + /** + * Get checkEmpty + * @return checkEmpty + **/ + @javax.annotation.Nonnull + public Boolean getCheckEmpty() { + return checkEmpty; + } + + + public void setCheckEmpty(Boolean checkEmpty) { + this.checkEmpty = checkEmpty; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CompareAndSetAccountDetailRequestParameters compareAndSetAccountDetailRequestParameters = (CompareAndSetAccountDetailRequestParameters) o; + return Objects.equals(this.accountId, compareAndSetAccountDetailRequestParameters.accountId) && + Objects.equals(this.key, compareAndSetAccountDetailRequestParameters.key) && + Objects.equals(this.value, compareAndSetAccountDetailRequestParameters.value) && + Objects.equals(this.oldValue, compareAndSetAccountDetailRequestParameters.oldValue) && + Objects.equals(this.checkEmpty, compareAndSetAccountDetailRequestParameters.checkEmpty); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, key, value, oldValue, checkEmpty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CompareAndSetAccountDetailRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" oldValue: ").append(toIndentedString(oldValue)).append("\n"); + sb.append(" checkEmpty: ").append(toIndentedString(checkEmpty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("key"); + openapiFields.add("value"); + openapiFields.add("oldValue"); + openapiFields.add("check_empty"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + openapiRequiredFields.add("check_empty"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CompareAndSetAccountDetailRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CompareAndSetAccountDetailRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CompareAndSetAccountDetailRequestParameters is not found in the empty JSON string", CompareAndSetAccountDetailRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CompareAndSetAccountDetailRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CompareAndSetAccountDetailRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CompareAndSetAccountDetailRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + if ((jsonObj.get("oldValue") != null && !jsonObj.get("oldValue").isJsonNull()) && !jsonObj.get("oldValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `oldValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("oldValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CompareAndSetAccountDetailRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CompareAndSetAccountDetailRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CompareAndSetAccountDetailRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CompareAndSetAccountDetailRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CompareAndSetAccountDetailRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CompareAndSetAccountDetailRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of CompareAndSetAccountDetailRequestParameters + * @throws IOException if the JSON string is invalid with respect to CompareAndSetAccountDetailRequestParameters + */ + public static CompareAndSetAccountDetailRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CompareAndSetAccountDetailRequestParameters.class); + } + + /** + * Convert an instance of CompareAndSetAccountDetailRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateAccountRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateAccountRequestParameters.java new file mode 100644 index 00000000000..9e106f78ebd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateAccountRequestParameters.java @@ -0,0 +1,280 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Create Account. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateAccountRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_NAME = "accountName"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NAME) + private String accountName; + + public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId"; + @SerializedName(SERIALIZED_NAME_DOMAIN_ID) + private String domainId; + + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + private String publicKey; + + public CreateAccountRequestParameters() { + } + + public CreateAccountRequestParameters accountName(String accountName) { + + this.accountName = accountName; + return this; + } + + /** + * Get accountName + * @return accountName + **/ + @javax.annotation.Nonnull + public String getAccountName() { + return accountName; + } + + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + + public CreateAccountRequestParameters domainId(String domainId) { + + this.domainId = domainId; + return this; + } + + /** + * Get domainId + * @return domainId + **/ + @javax.annotation.Nonnull + public String getDomainId() { + return domainId; + } + + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + + public CreateAccountRequestParameters publicKey(String publicKey) { + + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + **/ + @javax.annotation.Nonnull + public String getPublicKey() { + return publicKey; + } + + + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAccountRequestParameters createAccountRequestParameters = (CreateAccountRequestParameters) o; + return Objects.equals(this.accountName, createAccountRequestParameters.accountName) && + Objects.equals(this.domainId, createAccountRequestParameters.domainId) && + Objects.equals(this.publicKey, createAccountRequestParameters.publicKey); + } + + @Override + public int hashCode() { + return Objects.hash(accountName, domainId, publicKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAccountRequestParameters {\n"); + sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n"); + sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountName"); + openapiFields.add("domainId"); + openapiFields.add("publicKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountName"); + openapiRequiredFields.add("domainId"); + openapiRequiredFields.add("publicKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateAccountRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateAccountRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateAccountRequestParameters is not found in the empty JSON string", CreateAccountRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateAccountRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateAccountRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateAccountRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountName").toString())); + } + if (!jsonObj.get("domainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString())); + } + if (!jsonObj.get("publicKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateAccountRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAccountRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateAccountRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAccountRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateAccountRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateAccountRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateAccountRequestParameters + * @throws IOException if the JSON string is invalid with respect to CreateAccountRequestParameters + */ + public static CreateAccountRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAccountRequestParameters.class); + } + + /** + * Convert an instance of CreateAccountRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateAssetRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateAssetRequestParameters.java new file mode 100644 index 00000000000..66aa6380f83 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateAssetRequestParameters.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Create Asset. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateAssetRequestParameters { + public static final String SERIALIZED_NAME_ASSET_NAME = "assetName"; + @SerializedName(SERIALIZED_NAME_ASSET_NAME) + private String assetName; + + public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId"; + @SerializedName(SERIALIZED_NAME_DOMAIN_ID) + private String domainId; + + public static final String SERIALIZED_NAME_PRECISION = "precision"; + @SerializedName(SERIALIZED_NAME_PRECISION) + private Integer precision; + + public CreateAssetRequestParameters() { + } + + public CreateAssetRequestParameters assetName(String assetName) { + + this.assetName = assetName; + return this; + } + + /** + * Get assetName + * @return assetName + **/ + @javax.annotation.Nonnull + public String getAssetName() { + return assetName; + } + + + public void setAssetName(String assetName) { + this.assetName = assetName; + } + + + public CreateAssetRequestParameters domainId(String domainId) { + + this.domainId = domainId; + return this; + } + + /** + * Get domainId + * @return domainId + **/ + @javax.annotation.Nonnull + public String getDomainId() { + return domainId; + } + + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + + public CreateAssetRequestParameters precision(Integer precision) { + + this.precision = precision; + return this; + } + + /** + * Get precision + * @return precision + **/ + @javax.annotation.Nonnull + public Integer getPrecision() { + return precision; + } + + + public void setPrecision(Integer precision) { + this.precision = precision; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAssetRequestParameters createAssetRequestParameters = (CreateAssetRequestParameters) o; + return Objects.equals(this.assetName, createAssetRequestParameters.assetName) && + Objects.equals(this.domainId, createAssetRequestParameters.domainId) && + Objects.equals(this.precision, createAssetRequestParameters.precision); + } + + @Override + public int hashCode() { + return Objects.hash(assetName, domainId, precision); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAssetRequestParameters {\n"); + sb.append(" assetName: ").append(toIndentedString(assetName)).append("\n"); + sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n"); + sb.append(" precision: ").append(toIndentedString(precision)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("assetName"); + openapiFields.add("domainId"); + openapiFields.add("precision"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("assetName"); + openapiRequiredFields.add("domainId"); + openapiRequiredFields.add("precision"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateAssetRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateAssetRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateAssetRequestParameters is not found in the empty JSON string", CreateAssetRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateAssetRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateAssetRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateAssetRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("assetName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetName").toString())); + } + if (!jsonObj.get("domainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateAssetRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAssetRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateAssetRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAssetRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateAssetRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateAssetRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateAssetRequestParameters + * @throws IOException if the JSON string is invalid with respect to CreateAssetRequestParameters + */ + public static CreateAssetRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAssetRequestParameters.class); + } + + /** + * Convert an instance of CreateAssetRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateDomainRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateDomainRequestParameters.java new file mode 100644 index 00000000000..aae1c867016 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateDomainRequestParameters.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Create Domain. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateDomainRequestParameters { + public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId"; + @SerializedName(SERIALIZED_NAME_DOMAIN_ID) + private String domainId; + + public static final String SERIALIZED_NAME_DEFAULT_ROLE = "defaultRole"; + @SerializedName(SERIALIZED_NAME_DEFAULT_ROLE) + private String defaultRole; + + public CreateDomainRequestParameters() { + } + + public CreateDomainRequestParameters domainId(String domainId) { + + this.domainId = domainId; + return this; + } + + /** + * Get domainId + * @return domainId + **/ + @javax.annotation.Nonnull + public String getDomainId() { + return domainId; + } + + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + + public CreateDomainRequestParameters defaultRole(String defaultRole) { + + this.defaultRole = defaultRole; + return this; + } + + /** + * Get defaultRole + * @return defaultRole + **/ + @javax.annotation.Nonnull + public String getDefaultRole() { + return defaultRole; + } + + + public void setDefaultRole(String defaultRole) { + this.defaultRole = defaultRole; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateDomainRequestParameters createDomainRequestParameters = (CreateDomainRequestParameters) o; + return Objects.equals(this.domainId, createDomainRequestParameters.domainId) && + Objects.equals(this.defaultRole, createDomainRequestParameters.defaultRole); + } + + @Override + public int hashCode() { + return Objects.hash(domainId, defaultRole); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateDomainRequestParameters {\n"); + sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n"); + sb.append(" defaultRole: ").append(toIndentedString(defaultRole)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("domainId"); + openapiFields.add("defaultRole"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("domainId"); + openapiRequiredFields.add("defaultRole"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateDomainRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateDomainRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateDomainRequestParameters is not found in the empty JSON string", CreateDomainRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateDomainRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateDomainRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateDomainRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("domainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString())); + } + if (!jsonObj.get("defaultRole").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `defaultRole` to be a primitive type in the JSON string but got `%s`", jsonObj.get("defaultRole").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateDomainRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateDomainRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateDomainRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateDomainRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateDomainRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateDomainRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateDomainRequestParameters + * @throws IOException if the JSON string is invalid with respect to CreateDomainRequestParameters + */ + public static CreateDomainRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateDomainRequestParameters.class); + } + + /** + * Convert an instance of CreateDomainRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateRoleRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateRoleRequestParameters.java new file mode 100644 index 00000000000..55e3c253483 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CreateRoleRequestParameters.java @@ -0,0 +1,262 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Create Role. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateRoleRequestParameters { + public static final String SERIALIZED_NAME_ROLE_NAME = "roleName"; + @SerializedName(SERIALIZED_NAME_ROLE_NAME) + private String roleName; + + public static final String SERIALIZED_NAME_PERMISSIONS_LIST = "permissionsList"; + @SerializedName(SERIALIZED_NAME_PERMISSIONS_LIST) + private List permissionsList = new ArrayList<>(); + + public CreateRoleRequestParameters() { + } + + public CreateRoleRequestParameters roleName(String roleName) { + + this.roleName = roleName; + return this; + } + + /** + * Get roleName + * @return roleName + **/ + @javax.annotation.Nonnull + public String getRoleName() { + return roleName; + } + + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + + public CreateRoleRequestParameters permissionsList(List permissionsList) { + + this.permissionsList = permissionsList; + return this; + } + + public CreateRoleRequestParameters addPermissionsListItem(BigDecimal permissionsListItem) { + if (this.permissionsList == null) { + this.permissionsList = new ArrayList<>(); + } + this.permissionsList.add(permissionsListItem); + return this; + } + + /** + * Get permissionsList + * @return permissionsList + **/ + @javax.annotation.Nonnull + public List getPermissionsList() { + return permissionsList; + } + + + public void setPermissionsList(List permissionsList) { + this.permissionsList = permissionsList; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateRoleRequestParameters createRoleRequestParameters = (CreateRoleRequestParameters) o; + return Objects.equals(this.roleName, createRoleRequestParameters.roleName) && + Objects.equals(this.permissionsList, createRoleRequestParameters.permissionsList); + } + + @Override + public int hashCode() { + return Objects.hash(roleName, permissionsList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateRoleRequestParameters {\n"); + sb.append(" roleName: ").append(toIndentedString(roleName)).append("\n"); + sb.append(" permissionsList: ").append(toIndentedString(permissionsList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("roleName"); + openapiFields.add("permissionsList"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("roleName"); + openapiRequiredFields.add("permissionsList"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateRoleRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateRoleRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateRoleRequestParameters is not found in the empty JSON string", CreateRoleRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateRoleRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateRoleRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateRoleRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("roleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `roleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("roleName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("permissionsList") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("permissionsList").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `permissionsList` to be an array in the JSON string but got `%s`", jsonObj.get("permissionsList").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateRoleRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateRoleRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateRoleRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateRoleRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateRoleRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateRoleRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateRoleRequestParameters + * @throws IOException if the JSON string is invalid with respect to CreateRoleRequestParameters + */ + public static CreateRoleRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateRoleRequestParameters.class); + } + + /** + * Convert an instance of CreateRoleRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DetachRoleRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DetachRoleRequestParameters.java new file mode 100644 index 00000000000..90d1c4164de --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DetachRoleRequestParameters.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Detach Role. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DetachRoleRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_ROLE_NAME = "roleName"; + @SerializedName(SERIALIZED_NAME_ROLE_NAME) + private String roleName; + + public DetachRoleRequestParameters() { + } + + public DetachRoleRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public DetachRoleRequestParameters roleName(String roleName) { + + this.roleName = roleName; + return this; + } + + /** + * Get roleName + * @return roleName + **/ + @javax.annotation.Nonnull + public String getRoleName() { + return roleName; + } + + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DetachRoleRequestParameters detachRoleRequestParameters = (DetachRoleRequestParameters) o; + return Objects.equals(this.accountId, detachRoleRequestParameters.accountId) && + Objects.equals(this.roleName, detachRoleRequestParameters.roleName); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, roleName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DetachRoleRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" roleName: ").append(toIndentedString(roleName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("roleName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("roleName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DetachRoleRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DetachRoleRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DetachRoleRequestParameters is not found in the empty JSON string", DetachRoleRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DetachRoleRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DetachRoleRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DetachRoleRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("roleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `roleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("roleName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DetachRoleRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DetachRoleRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DetachRoleRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DetachRoleRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DetachRoleRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DetachRoleRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of DetachRoleRequestParameters + * @throws IOException if the JSON string is invalid with respect to DetachRoleRequestParameters + */ + public static DetachRoleRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DetachRoleRequestParameters.class); + } + + /** + * Convert an instance of DetachRoleRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1.java new file mode 100644 index 00000000000..960b9cf8901 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1.java @@ -0,0 +1,340 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ErrorExceptionJsonResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ErrorExceptionJsonResponseV1 { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private String error; + + public static final String SERIALIZED_NAME_STACK = "stack"; + @SerializedName(SERIALIZED_NAME_STACK) + private String stack; + + public static final String SERIALIZED_NAME_CAUSE = "cause"; + @SerializedName(SERIALIZED_NAME_CAUSE) + private String cause; + + public ErrorExceptionJsonResponseV1() { + } + + public ErrorExceptionJsonResponseV1 message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ErrorExceptionJsonResponseV1 name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public ErrorExceptionJsonResponseV1 error(String error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nullable + public String getError() { + return error; + } + + + public void setError(String error) { + this.error = error; + } + + + public ErrorExceptionJsonResponseV1 stack(String stack) { + + this.stack = stack; + return this; + } + + /** + * Get stack + * @return stack + **/ + @javax.annotation.Nullable + public String getStack() { + return stack; + } + + + public void setStack(String stack) { + this.stack = stack; + } + + + public ErrorExceptionJsonResponseV1 cause(String cause) { + + this.cause = cause; + return this; + } + + /** + * Get cause + * @return cause + **/ + @javax.annotation.Nullable + public String getCause() { + return cause; + } + + + public void setCause(String cause) { + this.cause = cause; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorExceptionJsonResponseV1 errorExceptionJsonResponseV1 = (ErrorExceptionJsonResponseV1) o; + return Objects.equals(this.message, errorExceptionJsonResponseV1.message) && + Objects.equals(this.name, errorExceptionJsonResponseV1.name) && + Objects.equals(this.error, errorExceptionJsonResponseV1.error) && + Objects.equals(this.stack, errorExceptionJsonResponseV1.stack) && + Objects.equals(this.cause, errorExceptionJsonResponseV1.cause); + } + + @Override + public int hashCode() { + return Objects.hash(message, name, error, stack, cause); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorExceptionJsonResponseV1 {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" stack: ").append(toIndentedString(stack)).append("\n"); + sb.append(" cause: ").append(toIndentedString(cause)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + openapiFields.add("name"); + openapiFields.add("error"); + openapiFields.add("stack"); + openapiFields.add("cause"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ErrorExceptionJsonResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ErrorExceptionJsonResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorExceptionJsonResponseV1 is not found in the empty JSON string", ErrorExceptionJsonResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ErrorExceptionJsonResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorExceptionJsonResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorExceptionJsonResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) && !jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + if ((jsonObj.get("stack") != null && !jsonObj.get("stack").isJsonNull()) && !jsonObj.get("stack").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stack` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stack").toString())); + } + if ((jsonObj.get("cause") != null && !jsonObj.get("cause").isJsonNull()) && !jsonObj.get("cause").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cause` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cause").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorExceptionJsonResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorExceptionJsonResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorExceptionJsonResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorExceptionJsonResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorExceptionJsonResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorExceptionJsonResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorExceptionJsonResponseV1 + * @throws IOException if the JSON string is invalid with respect to ErrorExceptionJsonResponseV1 + */ + public static ErrorExceptionJsonResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorExceptionJsonResponseV1.class); + } + + /** + * Convert an instance of ErrorExceptionJsonResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java new file mode 100644 index 00000000000..ed59db5de9f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ErrorExceptionResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ErrorExceptionResponseV1 { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private String error; + + public ErrorExceptionResponseV1() { + } + + public ErrorExceptionResponseV1 message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ErrorExceptionResponseV1 error(String error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nonnull + public String getError() { + return error; + } + + + public void setError(String error) { + this.error = error; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorExceptionResponseV1 errorExceptionResponseV1 = (ErrorExceptionResponseV1) o; + return Objects.equals(this.message, errorExceptionResponseV1.message) && + Objects.equals(this.error, errorExceptionResponseV1.error); + } + + @Override + public int hashCode() { + return Objects.hash(message, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorExceptionResponseV1 {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + openapiFields.add("error"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("error"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ErrorExceptionResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ErrorExceptionResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorExceptionResponseV1 is not found in the empty JSON string", ErrorExceptionResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ErrorExceptionResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorExceptionResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorExceptionResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if (!jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorExceptionResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorExceptionResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorExceptionResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorExceptionResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorExceptionResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorExceptionResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorExceptionResponseV1 + * @throws IOException if the JSON string is invalid with respect to ErrorExceptionResponseV1 + */ + public static ErrorExceptionResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorExceptionResponseV1.class); + } + + /** + * Convert an instance of ErrorExceptionResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java new file mode 100644 index 00000000000..c4076874c01 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java @@ -0,0 +1,304 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.IrohaCommand; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * GenerateTransactionRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GenerateTransactionRequestV1 { + public static final String SERIALIZED_NAME_COMMAND_NAME = "commandName"; + @SerializedName(SERIALIZED_NAME_COMMAND_NAME) + private IrohaCommand commandName = null; + + public static final String SERIALIZED_NAME_COMMAND_PARAMS = "commandParams"; + @SerializedName(SERIALIZED_NAME_COMMAND_PARAMS) + private Object commandParams; + + public static final String SERIALIZED_NAME_CREATOR_ACCOUNT_ID = "creatorAccountId"; + @SerializedName(SERIALIZED_NAME_CREATOR_ACCOUNT_ID) + private String creatorAccountId; + + public static final String SERIALIZED_NAME_QUORUM = "quorum"; + @SerializedName(SERIALIZED_NAME_QUORUM) + private BigDecimal quorum = new BigDecimal("1"); + + public GenerateTransactionRequestV1() { + } + + public GenerateTransactionRequestV1 commandName(IrohaCommand commandName) { + + this.commandName = commandName; + return this; + } + + /** + * Iroha command name. + * @return commandName + **/ + @javax.annotation.Nonnull + public IrohaCommand getCommandName() { + return commandName; + } + + + public void setCommandName(IrohaCommand commandName) { + this.commandName = commandName; + } + + + public GenerateTransactionRequestV1 commandParams(Object commandParams) { + + this.commandParams = commandParams; + return this; + } + + /** + * Parameters for iroha command specified in commandName + * @return commandParams + **/ + @javax.annotation.Nonnull + public Object getCommandParams() { + return commandParams; + } + + + public void setCommandParams(Object commandParams) { + this.commandParams = commandParams; + } + + + public GenerateTransactionRequestV1 creatorAccountId(String creatorAccountId) { + + this.creatorAccountId = creatorAccountId; + return this; + } + + /** + * Sender account id + * @return creatorAccountId + **/ + @javax.annotation.Nonnull + public String getCreatorAccountId() { + return creatorAccountId; + } + + + public void setCreatorAccountId(String creatorAccountId) { + this.creatorAccountId = creatorAccountId; + } + + + public GenerateTransactionRequestV1 quorum(BigDecimal quorum) { + + this.quorum = quorum; + return this; + } + + /** + * Requested transaction quorum + * @return quorum + **/ + @javax.annotation.Nullable + public BigDecimal getQuorum() { + return quorum; + } + + + public void setQuorum(BigDecimal quorum) { + this.quorum = quorum; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateTransactionRequestV1 generateTransactionRequestV1 = (GenerateTransactionRequestV1) o; + return Objects.equals(this.commandName, generateTransactionRequestV1.commandName) && + Objects.equals(this.commandParams, generateTransactionRequestV1.commandParams) && + Objects.equals(this.creatorAccountId, generateTransactionRequestV1.creatorAccountId) && + Objects.equals(this.quorum, generateTransactionRequestV1.quorum); + } + + @Override + public int hashCode() { + return Objects.hash(commandName, commandParams, creatorAccountId, quorum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateTransactionRequestV1 {\n"); + sb.append(" commandName: ").append(toIndentedString(commandName)).append("\n"); + sb.append(" commandParams: ").append(toIndentedString(commandParams)).append("\n"); + sb.append(" creatorAccountId: ").append(toIndentedString(creatorAccountId)).append("\n"); + sb.append(" quorum: ").append(toIndentedString(quorum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("commandName"); + openapiFields.add("commandParams"); + openapiFields.add("creatorAccountId"); + openapiFields.add("quorum"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("commandName"); + openapiRequiredFields.add("commandParams"); + openapiRequiredFields.add("creatorAccountId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GenerateTransactionRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GenerateTransactionRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GenerateTransactionRequestV1 is not found in the empty JSON string", GenerateTransactionRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GenerateTransactionRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GenerateTransactionRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GenerateTransactionRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("creatorAccountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `creatorAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorAccountId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GenerateTransactionRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GenerateTransactionRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GenerateTransactionRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GenerateTransactionRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GenerateTransactionRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GenerateTransactionRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GenerateTransactionRequestV1 + * @throws IOException if the JSON string is invalid with respect to GenerateTransactionRequestV1 + */ + public static GenerateTransactionRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GenerateTransactionRequestV1.class); + } + + /** + * Convert an instance of GenerateTransactionRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParameters.java new file mode 100644 index 00000000000..5487f043ae0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParameters.java @@ -0,0 +1,309 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Account Asset Transactions. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccountAssetTransactionsRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_ASSET_ID = "assetId"; + @SerializedName(SERIALIZED_NAME_ASSET_ID) + private String assetId; + + public static final String SERIALIZED_NAME_PAGE_SIZE = "pageSize"; + @SerializedName(SERIALIZED_NAME_PAGE_SIZE) + private Integer pageSize; + + public static final String SERIALIZED_NAME_FIRST_TX_HASH = "firstTxHash"; + @SerializedName(SERIALIZED_NAME_FIRST_TX_HASH) + private String firstTxHash; + + public GetAccountAssetTransactionsRequestParameters() { + } + + public GetAccountAssetTransactionsRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public GetAccountAssetTransactionsRequestParameters assetId(String assetId) { + + this.assetId = assetId; + return this; + } + + /** + * Get assetId + * @return assetId + **/ + @javax.annotation.Nonnull + public String getAssetId() { + return assetId; + } + + + public void setAssetId(String assetId) { + this.assetId = assetId; + } + + + public GetAccountAssetTransactionsRequestParameters pageSize(Integer pageSize) { + + this.pageSize = pageSize; + return this; + } + + /** + * Get pageSize + * @return pageSize + **/ + @javax.annotation.Nonnull + public Integer getPageSize() { + return pageSize; + } + + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + + public GetAccountAssetTransactionsRequestParameters firstTxHash(String firstTxHash) { + + this.firstTxHash = firstTxHash; + return this; + } + + /** + * Get firstTxHash + * @return firstTxHash + **/ + @javax.annotation.Nonnull + public String getFirstTxHash() { + return firstTxHash; + } + + + public void setFirstTxHash(String firstTxHash) { + this.firstTxHash = firstTxHash; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountAssetTransactionsRequestParameters getAccountAssetTransactionsRequestParameters = (GetAccountAssetTransactionsRequestParameters) o; + return Objects.equals(this.accountId, getAccountAssetTransactionsRequestParameters.accountId) && + Objects.equals(this.assetId, getAccountAssetTransactionsRequestParameters.assetId) && + Objects.equals(this.pageSize, getAccountAssetTransactionsRequestParameters.pageSize) && + Objects.equals(this.firstTxHash, getAccountAssetTransactionsRequestParameters.firstTxHash); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, assetId, pageSize, firstTxHash); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccountAssetTransactionsRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" assetId: ").append(toIndentedString(assetId)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" firstTxHash: ").append(toIndentedString(firstTxHash)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("assetId"); + openapiFields.add("pageSize"); + openapiFields.add("firstTxHash"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("assetId"); + openapiRequiredFields.add("pageSize"); + openapiRequiredFields.add("firstTxHash"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetAccountAssetTransactionsRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAccountAssetTransactionsRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAccountAssetTransactionsRequestParameters is not found in the empty JSON string", GetAccountAssetTransactionsRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAccountAssetTransactionsRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetAccountAssetTransactionsRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAccountAssetTransactionsRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("assetId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetId").toString())); + } + if (!jsonObj.get("firstTxHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `firstTxHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstTxHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAccountAssetTransactionsRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAccountAssetTransactionsRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAccountAssetTransactionsRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAccountAssetTransactionsRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAccountAssetTransactionsRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAccountAssetTransactionsRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAccountAssetTransactionsRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetAccountAssetTransactionsRequestParameters + */ + public static GetAccountAssetTransactionsRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAccountAssetTransactionsRequestParameters.class); + } + + /** + * Convert an instance of GetAccountAssetTransactionsRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountAssetsRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountAssetsRequestParameters.java new file mode 100644 index 00000000000..042367f7092 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountAssetsRequestParameters.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Account Assets. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccountAssetsRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_PAGE_SIZE = "pageSize"; + @SerializedName(SERIALIZED_NAME_PAGE_SIZE) + private BigDecimal pageSize; + + public static final String SERIALIZED_NAME_FIRST_ASSET_ID = "firstAssetId"; + @SerializedName(SERIALIZED_NAME_FIRST_ASSET_ID) + private String firstAssetId; + + public GetAccountAssetsRequestParameters() { + } + + public GetAccountAssetsRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public GetAccountAssetsRequestParameters pageSize(BigDecimal pageSize) { + + this.pageSize = pageSize; + return this; + } + + /** + * Get pageSize + * @return pageSize + **/ + @javax.annotation.Nonnull + public BigDecimal getPageSize() { + return pageSize; + } + + + public void setPageSize(BigDecimal pageSize) { + this.pageSize = pageSize; + } + + + public GetAccountAssetsRequestParameters firstAssetId(String firstAssetId) { + + this.firstAssetId = firstAssetId; + return this; + } + + /** + * Get firstAssetId + * @return firstAssetId + **/ + @javax.annotation.Nullable + public String getFirstAssetId() { + return firstAssetId; + } + + + public void setFirstAssetId(String firstAssetId) { + this.firstAssetId = firstAssetId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountAssetsRequestParameters getAccountAssetsRequestParameters = (GetAccountAssetsRequestParameters) o; + return Objects.equals(this.accountId, getAccountAssetsRequestParameters.accountId) && + Objects.equals(this.pageSize, getAccountAssetsRequestParameters.pageSize) && + Objects.equals(this.firstAssetId, getAccountAssetsRequestParameters.firstAssetId); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, pageSize, firstAssetId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccountAssetsRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" firstAssetId: ").append(toIndentedString(firstAssetId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("pageSize"); + openapiFields.add("firstAssetId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("pageSize"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetAccountAssetsRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAccountAssetsRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAccountAssetsRequestParameters is not found in the empty JSON string", GetAccountAssetsRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAccountAssetsRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetAccountAssetsRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAccountAssetsRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if ((jsonObj.get("firstAssetId") != null && !jsonObj.get("firstAssetId").isJsonNull()) && !jsonObj.get("firstAssetId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `firstAssetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstAssetId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAccountAssetsRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAccountAssetsRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAccountAssetsRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAccountAssetsRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAccountAssetsRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAccountAssetsRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAccountAssetsRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetAccountAssetsRequestParameters + */ + public static GetAccountAssetsRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAccountAssetsRequestParameters.class); + } + + /** + * Convert an instance of GetAccountAssetsRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountDetailRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountDetailRequestParameters.java new file mode 100644 index 00000000000..e0663161ec2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountDetailRequestParameters.java @@ -0,0 +1,370 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Account Detail. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccountDetailRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_WRITER = "writer"; + @SerializedName(SERIALIZED_NAME_WRITER) + private String writer; + + public static final String SERIALIZED_NAME_PAGE_SIZE = "pageSize"; + @SerializedName(SERIALIZED_NAME_PAGE_SIZE) + private Integer pageSize; + + public static final String SERIALIZED_NAME_PAGINATION_KEY = "paginationKey"; + @SerializedName(SERIALIZED_NAME_PAGINATION_KEY) + private String paginationKey; + + public static final String SERIALIZED_NAME_PAGINATION_WRITER = "paginationWriter"; + @SerializedName(SERIALIZED_NAME_PAGINATION_WRITER) + private String paginationWriter; + + public GetAccountDetailRequestParameters() { + } + + public GetAccountDetailRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nullable + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public GetAccountDetailRequestParameters key(String key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + **/ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public GetAccountDetailRequestParameters writer(String writer) { + + this.writer = writer; + return this; + } + + /** + * Get writer + * @return writer + **/ + @javax.annotation.Nullable + public String getWriter() { + return writer; + } + + + public void setWriter(String writer) { + this.writer = writer; + } + + + public GetAccountDetailRequestParameters pageSize(Integer pageSize) { + + this.pageSize = pageSize; + return this; + } + + /** + * Get pageSize + * @return pageSize + **/ + @javax.annotation.Nonnull + public Integer getPageSize() { + return pageSize; + } + + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + + public GetAccountDetailRequestParameters paginationKey(String paginationKey) { + + this.paginationKey = paginationKey; + return this; + } + + /** + * Get paginationKey + * @return paginationKey + **/ + @javax.annotation.Nonnull + public String getPaginationKey() { + return paginationKey; + } + + + public void setPaginationKey(String paginationKey) { + this.paginationKey = paginationKey; + } + + + public GetAccountDetailRequestParameters paginationWriter(String paginationWriter) { + + this.paginationWriter = paginationWriter; + return this; + } + + /** + * Get paginationWriter + * @return paginationWriter + **/ + @javax.annotation.Nonnull + public String getPaginationWriter() { + return paginationWriter; + } + + + public void setPaginationWriter(String paginationWriter) { + this.paginationWriter = paginationWriter; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountDetailRequestParameters getAccountDetailRequestParameters = (GetAccountDetailRequestParameters) o; + return Objects.equals(this.accountId, getAccountDetailRequestParameters.accountId) && + Objects.equals(this.key, getAccountDetailRequestParameters.key) && + Objects.equals(this.writer, getAccountDetailRequestParameters.writer) && + Objects.equals(this.pageSize, getAccountDetailRequestParameters.pageSize) && + Objects.equals(this.paginationKey, getAccountDetailRequestParameters.paginationKey) && + Objects.equals(this.paginationWriter, getAccountDetailRequestParameters.paginationWriter); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, key, writer, pageSize, paginationKey, paginationWriter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccountDetailRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" writer: ").append(toIndentedString(writer)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" paginationKey: ").append(toIndentedString(paginationKey)).append("\n"); + sb.append(" paginationWriter: ").append(toIndentedString(paginationWriter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("key"); + openapiFields.add("writer"); + openapiFields.add("pageSize"); + openapiFields.add("paginationKey"); + openapiFields.add("paginationWriter"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pageSize"); + openapiRequiredFields.add("paginationKey"); + openapiRequiredFields.add("paginationWriter"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetAccountDetailRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAccountDetailRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAccountDetailRequestParameters is not found in the empty JSON string", GetAccountDetailRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAccountDetailRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetAccountDetailRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAccountDetailRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("accountId") != null && !jsonObj.get("accountId").isJsonNull()) && !jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) && !jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if ((jsonObj.get("writer") != null && !jsonObj.get("writer").isJsonNull()) && !jsonObj.get("writer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `writer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("writer").toString())); + } + if (!jsonObj.get("paginationKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `paginationKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paginationKey").toString())); + } + if (!jsonObj.get("paginationWriter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `paginationWriter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paginationWriter").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAccountDetailRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAccountDetailRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAccountDetailRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAccountDetailRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAccountDetailRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAccountDetailRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAccountDetailRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetAccountDetailRequestParameters + */ + public static GetAccountDetailRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAccountDetailRequestParameters.class); + } + + /** + * Convert an instance of GetAccountDetailRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountRequestParameters.java new file mode 100644 index 00000000000..34b7f182e9c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountRequestParameters.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Account. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccountRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public GetAccountRequestParameters() { + } + + public GetAccountRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountRequestParameters getAccountRequestParameters = (GetAccountRequestParameters) o; + return Objects.equals(this.accountId, getAccountRequestParameters.accountId); + } + + @Override + public int hashCode() { + return Objects.hash(accountId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccountRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetAccountRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAccountRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAccountRequestParameters is not found in the empty JSON string", GetAccountRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAccountRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetAccountRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAccountRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAccountRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAccountRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAccountRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAccountRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAccountRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAccountRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAccountRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetAccountRequestParameters + */ + public static GetAccountRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAccountRequestParameters.class); + } + + /** + * Convert an instance of GetAccountRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountTransactionsRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountTransactionsRequestParameters.java new file mode 100644 index 00000000000..bc12bd1d97d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAccountTransactionsRequestParameters.java @@ -0,0 +1,389 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Account Transactions. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAccountTransactionsRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_PAGE_SIZE = "pageSize"; + @SerializedName(SERIALIZED_NAME_PAGE_SIZE) + private Integer pageSize; + + public static final String SERIALIZED_NAME_FIRST_TX_HASH = "firstTxHash"; + @SerializedName(SERIALIZED_NAME_FIRST_TX_HASH) + private String firstTxHash; + + public static final String SERIALIZED_NAME_FIRST_TX_TIME = "firstTxTime"; + @SerializedName(SERIALIZED_NAME_FIRST_TX_TIME) + private Object firstTxTime; + + public static final String SERIALIZED_NAME_LAST_TX_TIME = "lastTxTime"; + @SerializedName(SERIALIZED_NAME_LAST_TX_TIME) + private Object lastTxTime; + + public static final String SERIALIZED_NAME_FIRST_TX_HEIGHT = "firstTxHeight"; + @SerializedName(SERIALIZED_NAME_FIRST_TX_HEIGHT) + private Integer firstTxHeight; + + public static final String SERIALIZED_NAME_LAST_TX_HEIGHT = "lastTxHeight"; + @SerializedName(SERIALIZED_NAME_LAST_TX_HEIGHT) + private Integer lastTxHeight; + + public GetAccountTransactionsRequestParameters() { + } + + public GetAccountTransactionsRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public GetAccountTransactionsRequestParameters pageSize(Integer pageSize) { + + this.pageSize = pageSize; + return this; + } + + /** + * Get pageSize + * @return pageSize + **/ + @javax.annotation.Nonnull + public Integer getPageSize() { + return pageSize; + } + + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + + public GetAccountTransactionsRequestParameters firstTxHash(String firstTxHash) { + + this.firstTxHash = firstTxHash; + return this; + } + + /** + * Get firstTxHash + * @return firstTxHash + **/ + @javax.annotation.Nonnull + public String getFirstTxHash() { + return firstTxHash; + } + + + public void setFirstTxHash(String firstTxHash) { + this.firstTxHash = firstTxHash; + } + + + public GetAccountTransactionsRequestParameters firstTxTime(Object firstTxTime) { + + this.firstTxTime = firstTxTime; + return this; + } + + /** + * Get firstTxTime + * @return firstTxTime + **/ + @javax.annotation.Nullable + public Object getFirstTxTime() { + return firstTxTime; + } + + + public void setFirstTxTime(Object firstTxTime) { + this.firstTxTime = firstTxTime; + } + + + public GetAccountTransactionsRequestParameters lastTxTime(Object lastTxTime) { + + this.lastTxTime = lastTxTime; + return this; + } + + /** + * Get lastTxTime + * @return lastTxTime + **/ + @javax.annotation.Nullable + public Object getLastTxTime() { + return lastTxTime; + } + + + public void setLastTxTime(Object lastTxTime) { + this.lastTxTime = lastTxTime; + } + + + public GetAccountTransactionsRequestParameters firstTxHeight(Integer firstTxHeight) { + + this.firstTxHeight = firstTxHeight; + return this; + } + + /** + * Get firstTxHeight + * @return firstTxHeight + **/ + @javax.annotation.Nullable + public Integer getFirstTxHeight() { + return firstTxHeight; + } + + + public void setFirstTxHeight(Integer firstTxHeight) { + this.firstTxHeight = firstTxHeight; + } + + + public GetAccountTransactionsRequestParameters lastTxHeight(Integer lastTxHeight) { + + this.lastTxHeight = lastTxHeight; + return this; + } + + /** + * Get lastTxHeight + * @return lastTxHeight + **/ + @javax.annotation.Nullable + public Integer getLastTxHeight() { + return lastTxHeight; + } + + + public void setLastTxHeight(Integer lastTxHeight) { + this.lastTxHeight = lastTxHeight; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountTransactionsRequestParameters getAccountTransactionsRequestParameters = (GetAccountTransactionsRequestParameters) o; + return Objects.equals(this.accountId, getAccountTransactionsRequestParameters.accountId) && + Objects.equals(this.pageSize, getAccountTransactionsRequestParameters.pageSize) && + Objects.equals(this.firstTxHash, getAccountTransactionsRequestParameters.firstTxHash) && + Objects.equals(this.firstTxTime, getAccountTransactionsRequestParameters.firstTxTime) && + Objects.equals(this.lastTxTime, getAccountTransactionsRequestParameters.lastTxTime) && + Objects.equals(this.firstTxHeight, getAccountTransactionsRequestParameters.firstTxHeight) && + Objects.equals(this.lastTxHeight, getAccountTransactionsRequestParameters.lastTxHeight); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, pageSize, firstTxHash, firstTxTime, lastTxTime, firstTxHeight, lastTxHeight); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAccountTransactionsRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" firstTxHash: ").append(toIndentedString(firstTxHash)).append("\n"); + sb.append(" firstTxTime: ").append(toIndentedString(firstTxTime)).append("\n"); + sb.append(" lastTxTime: ").append(toIndentedString(lastTxTime)).append("\n"); + sb.append(" firstTxHeight: ").append(toIndentedString(firstTxHeight)).append("\n"); + sb.append(" lastTxHeight: ").append(toIndentedString(lastTxHeight)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("pageSize"); + openapiFields.add("firstTxHash"); + openapiFields.add("firstTxTime"); + openapiFields.add("lastTxTime"); + openapiFields.add("firstTxHeight"); + openapiFields.add("lastTxHeight"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("pageSize"); + openapiRequiredFields.add("firstTxHash"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetAccountTransactionsRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAccountTransactionsRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAccountTransactionsRequestParameters is not found in the empty JSON string", GetAccountTransactionsRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAccountTransactionsRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetAccountTransactionsRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAccountTransactionsRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("firstTxHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `firstTxHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstTxHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAccountTransactionsRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAccountTransactionsRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAccountTransactionsRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAccountTransactionsRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAccountTransactionsRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAccountTransactionsRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAccountTransactionsRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetAccountTransactionsRequestParameters + */ + public static GetAccountTransactionsRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAccountTransactionsRequestParameters.class); + } + + /** + * Convert an instance of GetAccountTransactionsRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAssetInfoRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAssetInfoRequestParameters.java new file mode 100644 index 00000000000..4d379789da6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetAssetInfoRequestParameters.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Asset Info. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetAssetInfoRequestParameters { + public static final String SERIALIZED_NAME_ASSET_ID = "assetId"; + @SerializedName(SERIALIZED_NAME_ASSET_ID) + private String assetId; + + public GetAssetInfoRequestParameters() { + } + + public GetAssetInfoRequestParameters assetId(String assetId) { + + this.assetId = assetId; + return this; + } + + /** + * Get assetId + * @return assetId + **/ + @javax.annotation.Nonnull + public String getAssetId() { + return assetId; + } + + + public void setAssetId(String assetId) { + this.assetId = assetId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAssetInfoRequestParameters getAssetInfoRequestParameters = (GetAssetInfoRequestParameters) o; + return Objects.equals(this.assetId, getAssetInfoRequestParameters.assetId); + } + + @Override + public int hashCode() { + return Objects.hash(assetId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAssetInfoRequestParameters {\n"); + sb.append(" assetId: ").append(toIndentedString(assetId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("assetId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("assetId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetAssetInfoRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetAssetInfoRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAssetInfoRequestParameters is not found in the empty JSON string", GetAssetInfoRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetAssetInfoRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetAssetInfoRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetAssetInfoRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("assetId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetAssetInfoRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAssetInfoRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAssetInfoRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetAssetInfoRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetAssetInfoRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAssetInfoRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAssetInfoRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetAssetInfoRequestParameters + */ + public static GetAssetInfoRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAssetInfoRequestParameters.class); + } + + /** + * Convert an instance of GetAssetInfoRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestParameters.java new file mode 100644 index 00000000000..b772a54c091 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetBlockRequestParameters.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Block. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetBlockRequestParameters { + public static final String SERIALIZED_NAME_HEIGHT = "height"; + @SerializedName(SERIALIZED_NAME_HEIGHT) + private Integer height; + + public GetBlockRequestParameters() { + } + + public GetBlockRequestParameters height(Integer height) { + + this.height = height; + return this; + } + + /** + * Get height + * @return height + **/ + @javax.annotation.Nonnull + public Integer getHeight() { + return height; + } + + + public void setHeight(Integer height) { + this.height = height; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBlockRequestParameters getBlockRequestParameters = (GetBlockRequestParameters) o; + return Objects.equals(this.height, getBlockRequestParameters.height); + } + + @Override + public int hashCode() { + return Objects.hash(height); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetBlockRequestParameters {\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(); + openapiFields.add("height"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("height"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetBlockRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetBlockRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetBlockRequestParameters is not found in the empty JSON string", GetBlockRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetBlockRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetBlockRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetBlockRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetBlockRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetBlockRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetBlockRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetBlockRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetBlockRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetBlockRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetBlockRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetBlockRequestParameters + */ + public static GetBlockRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetBlockRequestParameters.class); + } + + /** + * Convert an instance of GetBlockRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetEngineReceiptsRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetEngineReceiptsRequestParameters.java new file mode 100644 index 00000000000..b70f5471901 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetEngineReceiptsRequestParameters.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Engine Receipts. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetEngineReceiptsRequestParameters { + public static final String SERIALIZED_NAME_TX_HASH = "txHash"; + @SerializedName(SERIALIZED_NAME_TX_HASH) + private String txHash; + + public GetEngineReceiptsRequestParameters() { + } + + public GetEngineReceiptsRequestParameters txHash(String txHash) { + + this.txHash = txHash; + return this; + } + + /** + * Get txHash + * @return txHash + **/ + @javax.annotation.Nonnull + public String getTxHash() { + return txHash; + } + + + public void setTxHash(String txHash) { + this.txHash = txHash; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEngineReceiptsRequestParameters getEngineReceiptsRequestParameters = (GetEngineReceiptsRequestParameters) o; + return Objects.equals(this.txHash, getEngineReceiptsRequestParameters.txHash); + } + + @Override + public int hashCode() { + return Objects.hash(txHash); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEngineReceiptsRequestParameters {\n"); + sb.append(" txHash: ").append(toIndentedString(txHash)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("txHash"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("txHash"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetEngineReceiptsRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetEngineReceiptsRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetEngineReceiptsRequestParameters is not found in the empty JSON string", GetEngineReceiptsRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetEngineReceiptsRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetEngineReceiptsRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetEngineReceiptsRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("txHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `txHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetEngineReceiptsRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetEngineReceiptsRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetEngineReceiptsRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetEngineReceiptsRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetEngineReceiptsRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetEngineReceiptsRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetEngineReceiptsRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetEngineReceiptsRequestParameters + */ + public static GetEngineReceiptsRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetEngineReceiptsRequestParameters.class); + } + + /** + * Convert an instance of GetEngineReceiptsRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPendingTransactionsRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPendingTransactionsRequestParameters.java new file mode 100644 index 00000000000..19773253ef1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetPendingTransactionsRequestParameters.java @@ -0,0 +1,300 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Pending Transactions. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetPendingTransactionsRequestParameters { + public static final String SERIALIZED_NAME_PAGE_SIZE = "pageSize"; + @SerializedName(SERIALIZED_NAME_PAGE_SIZE) + private Integer pageSize; + + public static final String SERIALIZED_NAME_FIRST_TX_HASH = "firstTxHash"; + @SerializedName(SERIALIZED_NAME_FIRST_TX_HASH) + private String firstTxHash; + + public static final String SERIALIZED_NAME_FIRST_TX_TIME = "firstTxTime"; + @SerializedName(SERIALIZED_NAME_FIRST_TX_TIME) + private Object firstTxTime; + + public static final String SERIALIZED_NAME_LAST_TX_TIME = "lastTxTime"; + @SerializedName(SERIALIZED_NAME_LAST_TX_TIME) + private Object lastTxTime; + + public GetPendingTransactionsRequestParameters() { + } + + public GetPendingTransactionsRequestParameters pageSize(Integer pageSize) { + + this.pageSize = pageSize; + return this; + } + + /** + * Get pageSize + * @return pageSize + **/ + @javax.annotation.Nonnull + public Integer getPageSize() { + return pageSize; + } + + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + + public GetPendingTransactionsRequestParameters firstTxHash(String firstTxHash) { + + this.firstTxHash = firstTxHash; + return this; + } + + /** + * Get firstTxHash + * @return firstTxHash + **/ + @javax.annotation.Nullable + public String getFirstTxHash() { + return firstTxHash; + } + + + public void setFirstTxHash(String firstTxHash) { + this.firstTxHash = firstTxHash; + } + + + public GetPendingTransactionsRequestParameters firstTxTime(Object firstTxTime) { + + this.firstTxTime = firstTxTime; + return this; + } + + /** + * Get firstTxTime + * @return firstTxTime + **/ + @javax.annotation.Nullable + public Object getFirstTxTime() { + return firstTxTime; + } + + + public void setFirstTxTime(Object firstTxTime) { + this.firstTxTime = firstTxTime; + } + + + public GetPendingTransactionsRequestParameters lastTxTime(Object lastTxTime) { + + this.lastTxTime = lastTxTime; + return this; + } + + /** + * Get lastTxTime + * @return lastTxTime + **/ + @javax.annotation.Nullable + public Object getLastTxTime() { + return lastTxTime; + } + + + public void setLastTxTime(Object lastTxTime) { + this.lastTxTime = lastTxTime; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPendingTransactionsRequestParameters getPendingTransactionsRequestParameters = (GetPendingTransactionsRequestParameters) o; + return Objects.equals(this.pageSize, getPendingTransactionsRequestParameters.pageSize) && + Objects.equals(this.firstTxHash, getPendingTransactionsRequestParameters.firstTxHash) && + Objects.equals(this.firstTxTime, getPendingTransactionsRequestParameters.firstTxTime) && + Objects.equals(this.lastTxTime, getPendingTransactionsRequestParameters.lastTxTime); + } + + @Override + public int hashCode() { + return Objects.hash(pageSize, firstTxHash, firstTxTime, lastTxTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPendingTransactionsRequestParameters {\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" firstTxHash: ").append(toIndentedString(firstTxHash)).append("\n"); + sb.append(" firstTxTime: ").append(toIndentedString(firstTxTime)).append("\n"); + sb.append(" lastTxTime: ").append(toIndentedString(lastTxTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pageSize"); + openapiFields.add("firstTxHash"); + openapiFields.add("firstTxTime"); + openapiFields.add("lastTxTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pageSize"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetPendingTransactionsRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetPendingTransactionsRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetPendingTransactionsRequestParameters is not found in the empty JSON string", GetPendingTransactionsRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetPendingTransactionsRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetPendingTransactionsRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetPendingTransactionsRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("firstTxHash") != null && !jsonObj.get("firstTxHash").isJsonNull()) && !jsonObj.get("firstTxHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `firstTxHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstTxHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetPendingTransactionsRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetPendingTransactionsRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetPendingTransactionsRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetPendingTransactionsRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetPendingTransactionsRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetPendingTransactionsRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetPendingTransactionsRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetPendingTransactionsRequestParameters + */ + public static GetPendingTransactionsRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetPendingTransactionsRequestParameters.class); + } + + /** + * Convert an instance of GetPendingTransactionsRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetRolePermissionsRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetRolePermissionsRequestParameters.java new file mode 100644 index 00000000000..750cf4c213d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetRolePermissionsRequestParameters.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Role Permissions. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetRolePermissionsRequestParameters { + public static final String SERIALIZED_NAME_ROLE_ID = "roleId"; + @SerializedName(SERIALIZED_NAME_ROLE_ID) + private String roleId; + + public GetRolePermissionsRequestParameters() { + } + + public GetRolePermissionsRequestParameters roleId(String roleId) { + + this.roleId = roleId; + return this; + } + + /** + * Get roleId + * @return roleId + **/ + @javax.annotation.Nonnull + public String getRoleId() { + return roleId; + } + + + public void setRoleId(String roleId) { + this.roleId = roleId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRolePermissionsRequestParameters getRolePermissionsRequestParameters = (GetRolePermissionsRequestParameters) o; + return Objects.equals(this.roleId, getRolePermissionsRequestParameters.roleId); + } + + @Override + public int hashCode() { + return Objects.hash(roleId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetRolePermissionsRequestParameters {\n"); + sb.append(" roleId: ").append(toIndentedString(roleId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("roleId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("roleId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetRolePermissionsRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetRolePermissionsRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetRolePermissionsRequestParameters is not found in the empty JSON string", GetRolePermissionsRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetRolePermissionsRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetRolePermissionsRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetRolePermissionsRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("roleId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `roleId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("roleId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetRolePermissionsRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetRolePermissionsRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetRolePermissionsRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetRolePermissionsRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetRolePermissionsRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetRolePermissionsRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetRolePermissionsRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetRolePermissionsRequestParameters + */ + public static GetRolePermissionsRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetRolePermissionsRequestParameters.class); + } + + /** + * Convert an instance of GetRolePermissionsRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSignatoriesRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSignatoriesRequestParameters.java new file mode 100644 index 00000000000..0da6b0de62d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetSignatoriesRequestParameters.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Signatories. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetSignatoriesRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public GetSignatoriesRequestParameters() { + } + + public GetSignatoriesRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSignatoriesRequestParameters getSignatoriesRequestParameters = (GetSignatoriesRequestParameters) o; + return Objects.equals(this.accountId, getSignatoriesRequestParameters.accountId); + } + + @Override + public int hashCode() { + return Objects.hash(accountId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSignatoriesRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetSignatoriesRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetSignatoriesRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetSignatoriesRequestParameters is not found in the empty JSON string", GetSignatoriesRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetSignatoriesRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetSignatoriesRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetSignatoriesRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetSignatoriesRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSignatoriesRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetSignatoriesRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetSignatoriesRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetSignatoriesRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetSignatoriesRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSignatoriesRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetSignatoriesRequestParameters + */ + public static GetSignatoriesRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSignatoriesRequestParameters.class); + } + + /** + * Convert an instance of GetSignatoriesRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionsRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionsRequestParameters.java new file mode 100644 index 00000000000..f19cf2cac32 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionsRequestParameters.java @@ -0,0 +1,229 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Get Transactions. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransactionsRequestParameters { + public static final String SERIALIZED_NAME_TX_HASHES_LIST = "txHashesList"; + @SerializedName(SERIALIZED_NAME_TX_HASHES_LIST) + private List txHashesList = new ArrayList<>(); + + public GetTransactionsRequestParameters() { + } + + public GetTransactionsRequestParameters txHashesList(List txHashesList) { + + this.txHashesList = txHashesList; + return this; + } + + public GetTransactionsRequestParameters addTxHashesListItem(String txHashesListItem) { + if (this.txHashesList == null) { + this.txHashesList = new ArrayList<>(); + } + this.txHashesList.add(txHashesListItem); + return this; + } + + /** + * Get txHashesList + * @return txHashesList + **/ + @javax.annotation.Nonnull + public List getTxHashesList() { + return txHashesList; + } + + + public void setTxHashesList(List txHashesList) { + this.txHashesList = txHashesList; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransactionsRequestParameters getTransactionsRequestParameters = (GetTransactionsRequestParameters) o; + return Objects.equals(this.txHashesList, getTransactionsRequestParameters.txHashesList); + } + + @Override + public int hashCode() { + return Objects.hash(txHashesList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransactionsRequestParameters {\n"); + sb.append(" txHashesList: ").append(toIndentedString(txHashesList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("txHashesList"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("txHashesList"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransactionsRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransactionsRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetTransactionsRequestParameters is not found in the empty JSON string", GetTransactionsRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransactionsRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTransactionsRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTransactionsRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("txHashesList") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("txHashesList").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `txHashesList` to be an array in the JSON string but got `%s`", jsonObj.get("txHashesList").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransactionsRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransactionsRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetTransactionsRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransactionsRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransactionsRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransactionsRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransactionsRequestParameters + * @throws IOException if the JSON string is invalid with respect to GetTransactionsRequestParameters + */ + public static GetTransactionsRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransactionsRequestParameters.class); + } + + /** + * Convert an instance of GetTransactionsRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GrantPermissionRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GrantPermissionRequestParameters.java new file mode 100644 index 00000000000..b2c0945d6a9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GrantPermissionRequestParameters.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Grant Permission. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GrantPermissionRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_PERMISSION = "permission"; + @SerializedName(SERIALIZED_NAME_PERMISSION) + private String permission; + + public GrantPermissionRequestParameters() { + } + + public GrantPermissionRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public GrantPermissionRequestParameters permission(String permission) { + + this.permission = permission; + return this; + } + + /** + * Get permission + * @return permission + **/ + @javax.annotation.Nonnull + public String getPermission() { + return permission; + } + + + public void setPermission(String permission) { + this.permission = permission; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GrantPermissionRequestParameters grantPermissionRequestParameters = (GrantPermissionRequestParameters) o; + return Objects.equals(this.accountId, grantPermissionRequestParameters.accountId) && + Objects.equals(this.permission, grantPermissionRequestParameters.permission); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, permission); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GrantPermissionRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" permission: ").append(toIndentedString(permission)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("permission"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("permission"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GrantPermissionRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GrantPermissionRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GrantPermissionRequestParameters is not found in the empty JSON string", GrantPermissionRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GrantPermissionRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GrantPermissionRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GrantPermissionRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("permission").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `permission` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permission").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GrantPermissionRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GrantPermissionRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GrantPermissionRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GrantPermissionRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GrantPermissionRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GrantPermissionRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of GrantPermissionRequestParameters + * @throws IOException if the JSON string is invalid with respect to GrantPermissionRequestParameters + */ + public static GrantPermissionRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GrantPermissionRequestParameters.class); + } + + /** + * Convert an instance of GrantPermissionRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBaseConfig.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBaseConfig.java new file mode 100644 index 00000000000..921e962cc25 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBaseConfig.java @@ -0,0 +1,509 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * IrohaBaseConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaBaseConfig { + public static final String SERIALIZED_NAME_IROHA_HOST = "irohaHost"; + @SerializedName(SERIALIZED_NAME_IROHA_HOST) + private String irohaHost; + + public static final String SERIALIZED_NAME_IROHA_PORT = "irohaPort"; + @SerializedName(SERIALIZED_NAME_IROHA_PORT) + private BigDecimal irohaPort; + + public static final String SERIALIZED_NAME_CREATOR_ACCOUNT_ID = "creatorAccountId"; + @SerializedName(SERIALIZED_NAME_CREATOR_ACCOUNT_ID) + private String creatorAccountId; + + public static final String SERIALIZED_NAME_PRIV_KEY = "privKey"; + @SerializedName(SERIALIZED_NAME_PRIV_KEY) + private List privKey = null; + + public static final String SERIALIZED_NAME_QUORUM = "quorum"; + @SerializedName(SERIALIZED_NAME_QUORUM) + private BigDecimal quorum; + + public static final String SERIALIZED_NAME_TIMEOUT_LIMIT = "timeoutLimit"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_LIMIT) + private BigDecimal timeoutLimit; + + public static final String SERIALIZED_NAME_TLS = "tls"; + @SerializedName(SERIALIZED_NAME_TLS) + private Boolean tls; + + public static final String SERIALIZED_NAME_MONITOR_MODE = "monitorMode"; + @SerializedName(SERIALIZED_NAME_MONITOR_MODE) + private Boolean monitorMode; + + public IrohaBaseConfig() { + } + + public IrohaBaseConfig irohaHost(String irohaHost) { + + this.irohaHost = irohaHost; + return this; + } + + /** + * Get irohaHost + * @return irohaHost + **/ + @javax.annotation.Nullable + public String getIrohaHost() { + return irohaHost; + } + + + public void setIrohaHost(String irohaHost) { + this.irohaHost = irohaHost; + } + + + public IrohaBaseConfig irohaPort(BigDecimal irohaPort) { + + this.irohaPort = irohaPort; + return this; + } + + /** + * Get irohaPort + * @return irohaPort + **/ + @javax.annotation.Nullable + public BigDecimal getIrohaPort() { + return irohaPort; + } + + + public void setIrohaPort(BigDecimal irohaPort) { + this.irohaPort = irohaPort; + } + + + public IrohaBaseConfig creatorAccountId(String creatorAccountId) { + + this.creatorAccountId = creatorAccountId; + return this; + } + + /** + * Get creatorAccountId + * @return creatorAccountId + **/ + @javax.annotation.Nullable + public String getCreatorAccountId() { + return creatorAccountId; + } + + + public void setCreatorAccountId(String creatorAccountId) { + this.creatorAccountId = creatorAccountId; + } + + + public IrohaBaseConfig privKey(List privKey) { + + this.privKey = privKey; + return this; + } + + public IrohaBaseConfig addPrivKeyItem(Object privKeyItem) { + if (this.privKey == null) { + this.privKey = null; + } + this.privKey.add(privKeyItem); + return this; + } + + /** + * Get privKey + * @return privKey + **/ + @javax.annotation.Nullable + public List getPrivKey() { + return privKey; + } + + + public void setPrivKey(List privKey) { + this.privKey = privKey; + } + + + public IrohaBaseConfig quorum(BigDecimal quorum) { + + this.quorum = quorum; + return this; + } + + /** + * Get quorum + * @return quorum + **/ + @javax.annotation.Nullable + public BigDecimal getQuorum() { + return quorum; + } + + + public void setQuorum(BigDecimal quorum) { + this.quorum = quorum; + } + + + public IrohaBaseConfig timeoutLimit(BigDecimal timeoutLimit) { + + this.timeoutLimit = timeoutLimit; + return this; + } + + /** + * Get timeoutLimit + * @return timeoutLimit + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutLimit() { + return timeoutLimit; + } + + + public void setTimeoutLimit(BigDecimal timeoutLimit) { + this.timeoutLimit = timeoutLimit; + } + + + public IrohaBaseConfig tls(Boolean tls) { + + this.tls = tls; + return this; + } + + /** + * Can only be set to false for an insecure grpc connection. + * @return tls + **/ + @javax.annotation.Nullable + public Boolean getTls() { + return tls; + } + + + public void setTls(Boolean tls) { + this.tls = tls; + } + + + public IrohaBaseConfig monitorMode(Boolean monitorMode) { + + this.monitorMode = monitorMode; + return this; + } + + /** + * Flag used for monitoring. It changes default beahviour of transaction wrapper so it return error to caller instead of throwing RuntimeError straight away. + * @return monitorMode + **/ + @javax.annotation.Nullable + public Boolean getMonitorMode() { + return monitorMode; + } + + + public void setMonitorMode(Boolean monitorMode) { + this.monitorMode = monitorMode; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IrohaBaseConfig instance itself + */ + public IrohaBaseConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaBaseConfig irohaBaseConfig = (IrohaBaseConfig) o; + return Objects.equals(this.irohaHost, irohaBaseConfig.irohaHost) && + Objects.equals(this.irohaPort, irohaBaseConfig.irohaPort) && + Objects.equals(this.creatorAccountId, irohaBaseConfig.creatorAccountId) && + Objects.equals(this.privKey, irohaBaseConfig.privKey) && + Objects.equals(this.quorum, irohaBaseConfig.quorum) && + Objects.equals(this.timeoutLimit, irohaBaseConfig.timeoutLimit) && + Objects.equals(this.tls, irohaBaseConfig.tls) && + Objects.equals(this.monitorMode, irohaBaseConfig.monitorMode)&& + Objects.equals(this.additionalProperties, irohaBaseConfig.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(irohaHost, irohaPort, creatorAccountId, privKey, quorum, timeoutLimit, tls, monitorMode, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaBaseConfig {\n"); + sb.append(" irohaHost: ").append(toIndentedString(irohaHost)).append("\n"); + sb.append(" irohaPort: ").append(toIndentedString(irohaPort)).append("\n"); + sb.append(" creatorAccountId: ").append(toIndentedString(creatorAccountId)).append("\n"); + sb.append(" privKey: ").append(toIndentedString(privKey)).append("\n"); + sb.append(" quorum: ").append(toIndentedString(quorum)).append("\n"); + sb.append(" timeoutLimit: ").append(toIndentedString(timeoutLimit)).append("\n"); + sb.append(" tls: ").append(toIndentedString(tls)).append("\n"); + sb.append(" monitorMode: ").append(toIndentedString(monitorMode)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("irohaHost"); + openapiFields.add("irohaPort"); + openapiFields.add("creatorAccountId"); + openapiFields.add("privKey"); + openapiFields.add("quorum"); + openapiFields.add("timeoutLimit"); + openapiFields.add("tls"); + openapiFields.add("monitorMode"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaBaseConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaBaseConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaBaseConfig is not found in the empty JSON string", IrohaBaseConfig.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("irohaHost") != null && !jsonObj.get("irohaHost").isJsonNull()) && !jsonObj.get("irohaHost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `irohaHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("irohaHost").toString())); + } + if ((jsonObj.get("creatorAccountId") != null && !jsonObj.get("creatorAccountId").isJsonNull()) && !jsonObj.get("creatorAccountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `creatorAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creatorAccountId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("privKey") != null && !jsonObj.get("privKey").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `privKey` to be an array in the JSON string but got `%s`", jsonObj.get("privKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaBaseConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaBaseConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaBaseConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaBaseConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IrohaBaseConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + IrohaBaseConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaBaseConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaBaseConfig + * @throws IOException if the JSON string is invalid with respect to IrohaBaseConfig + */ + public static IrohaBaseConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaBaseConfig.class); + } + + /** + * Convert an instance of IrohaBaseConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockProgress.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockProgress.java new file mode 100644 index 00000000000..c1f94948000 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockProgress.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaBlockResponse; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * IrohaBlockProgress + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaBlockProgress { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private IrohaBlockResponse transactionReceipt; + + public IrohaBlockProgress() { + } + + public IrohaBlockProgress transactionReceipt(IrohaBlockResponse transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public IrohaBlockResponse getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(IrohaBlockResponse transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaBlockProgress irohaBlockProgress = (IrohaBlockProgress) o; + return Objects.equals(this.transactionReceipt, irohaBlockProgress.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaBlockProgress {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaBlockProgress + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaBlockProgress.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaBlockProgress is not found in the empty JSON string", IrohaBlockProgress.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IrohaBlockProgress.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IrohaBlockProgress` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IrohaBlockProgress.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `transactionReceipt` + IrohaBlockResponse.validateJsonObject(jsonObj.getAsJsonObject("transactionReceipt")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaBlockProgress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaBlockProgress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaBlockProgress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaBlockProgress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IrohaBlockProgress read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaBlockProgress given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaBlockProgress + * @throws IOException if the JSON string is invalid with respect to IrohaBlockProgress + */ + public static IrohaBlockProgress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaBlockProgress.class); + } + + /** + * Convert an instance of IrohaBlockProgress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockResponse.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockResponse.java new file mode 100644 index 00000000000..075b42980e5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockResponse.java @@ -0,0 +1,261 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.IrohaBlockResponsePayload; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * IrohaBlockResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaBlockResponse { + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private IrohaBlockResponsePayload payload; + + public static final String SERIALIZED_NAME_SIGNATURES_LIST = "signaturesList"; + @SerializedName(SERIALIZED_NAME_SIGNATURES_LIST) + private List signaturesList = new ArrayList<>(); + + public IrohaBlockResponse() { + } + + public IrohaBlockResponse payload(IrohaBlockResponsePayload payload) { + + this.payload = payload; + return this; + } + + /** + * Get payload + * @return payload + **/ + @javax.annotation.Nonnull + public IrohaBlockResponsePayload getPayload() { + return payload; + } + + + public void setPayload(IrohaBlockResponsePayload payload) { + this.payload = payload; + } + + + public IrohaBlockResponse signaturesList(List signaturesList) { + + this.signaturesList = signaturesList; + return this; + } + + public IrohaBlockResponse addSignaturesListItem(Object signaturesListItem) { + if (this.signaturesList == null) { + this.signaturesList = new ArrayList<>(); + } + this.signaturesList.add(signaturesListItem); + return this; + } + + /** + * Get signaturesList + * @return signaturesList + **/ + @javax.annotation.Nonnull + public List getSignaturesList() { + return signaturesList; + } + + + public void setSignaturesList(List signaturesList) { + this.signaturesList = signaturesList; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaBlockResponse irohaBlockResponse = (IrohaBlockResponse) o; + return Objects.equals(this.payload, irohaBlockResponse.payload) && + Objects.equals(this.signaturesList, irohaBlockResponse.signaturesList); + } + + @Override + public int hashCode() { + return Objects.hash(payload, signaturesList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaBlockResponse {\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append(" signaturesList: ").append(toIndentedString(signaturesList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("payload"); + openapiFields.add("signaturesList"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("payload"); + openapiRequiredFields.add("signaturesList"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaBlockResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaBlockResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaBlockResponse is not found in the empty JSON string", IrohaBlockResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IrohaBlockResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IrohaBlockResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IrohaBlockResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `payload` + IrohaBlockResponsePayload.validateJsonObject(jsonObj.getAsJsonObject("payload")); + // ensure the required json array is present + if (jsonObj.get("signaturesList") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("signaturesList").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `signaturesList` to be an array in the JSON string but got `%s`", jsonObj.get("signaturesList").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaBlockResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaBlockResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaBlockResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaBlockResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IrohaBlockResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaBlockResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaBlockResponse + * @throws IOException if the JSON string is invalid with respect to IrohaBlockResponse + */ + public static IrohaBlockResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaBlockResponse.class); + } + + /** + * Convert an instance of IrohaBlockResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockResponsePayload.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockResponsePayload.java new file mode 100644 index 00000000000..582e64be84f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaBlockResponsePayload.java @@ -0,0 +1,392 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * IrohaBlockResponsePayload + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaBlockResponsePayload { + public static final String SERIALIZED_NAME_TRANSACTIONS_LIST = "transactionsList"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS_LIST) + private List transactionsList = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TX_NUMBER = "txNumber"; + @SerializedName(SERIALIZED_NAME_TX_NUMBER) + private BigDecimal txNumber; + + public static final String SERIALIZED_NAME_HEIGHT = "height"; + @SerializedName(SERIALIZED_NAME_HEIGHT) + private BigDecimal height; + + public static final String SERIALIZED_NAME_PREV_BLOCK_HASH = "prevBlockHash"; + @SerializedName(SERIALIZED_NAME_PREV_BLOCK_HASH) + private String prevBlockHash; + + public static final String SERIALIZED_NAME_CREATED_TIME = "createdTime"; + @SerializedName(SERIALIZED_NAME_CREATED_TIME) + private BigDecimal createdTime; + + public static final String SERIALIZED_NAME_REJECTED_TRANSACTIONS_HASHES_LIST = "rejectedTransactionsHashesList"; + @SerializedName(SERIALIZED_NAME_REJECTED_TRANSACTIONS_HASHES_LIST) + private List rejectedTransactionsHashesList = new ArrayList<>(); + + public IrohaBlockResponsePayload() { + } + + public IrohaBlockResponsePayload transactionsList(List transactionsList) { + + this.transactionsList = transactionsList; + return this; + } + + public IrohaBlockResponsePayload addTransactionsListItem(Object transactionsListItem) { + if (this.transactionsList == null) { + this.transactionsList = new ArrayList<>(); + } + this.transactionsList.add(transactionsListItem); + return this; + } + + /** + * Get transactionsList + * @return transactionsList + **/ + @javax.annotation.Nonnull + public List getTransactionsList() { + return transactionsList; + } + + + public void setTransactionsList(List transactionsList) { + this.transactionsList = transactionsList; + } + + + public IrohaBlockResponsePayload txNumber(BigDecimal txNumber) { + + this.txNumber = txNumber; + return this; + } + + /** + * Get txNumber + * @return txNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getTxNumber() { + return txNumber; + } + + + public void setTxNumber(BigDecimal txNumber) { + this.txNumber = txNumber; + } + + + public IrohaBlockResponsePayload height(BigDecimal height) { + + this.height = height; + return this; + } + + /** + * Get height + * @return height + **/ + @javax.annotation.Nonnull + public BigDecimal getHeight() { + return height; + } + + + public void setHeight(BigDecimal height) { + this.height = height; + } + + + public IrohaBlockResponsePayload prevBlockHash(String prevBlockHash) { + + this.prevBlockHash = prevBlockHash; + return this; + } + + /** + * Get prevBlockHash + * @return prevBlockHash + **/ + @javax.annotation.Nonnull + public String getPrevBlockHash() { + return prevBlockHash; + } + + + public void setPrevBlockHash(String prevBlockHash) { + this.prevBlockHash = prevBlockHash; + } + + + public IrohaBlockResponsePayload createdTime(BigDecimal createdTime) { + + this.createdTime = createdTime; + return this; + } + + /** + * Get createdTime + * @return createdTime + **/ + @javax.annotation.Nonnull + public BigDecimal getCreatedTime() { + return createdTime; + } + + + public void setCreatedTime(BigDecimal createdTime) { + this.createdTime = createdTime; + } + + + public IrohaBlockResponsePayload rejectedTransactionsHashesList(List rejectedTransactionsHashesList) { + + this.rejectedTransactionsHashesList = rejectedTransactionsHashesList; + return this; + } + + public IrohaBlockResponsePayload addRejectedTransactionsHashesListItem(Object rejectedTransactionsHashesListItem) { + if (this.rejectedTransactionsHashesList == null) { + this.rejectedTransactionsHashesList = new ArrayList<>(); + } + this.rejectedTransactionsHashesList.add(rejectedTransactionsHashesListItem); + return this; + } + + /** + * Get rejectedTransactionsHashesList + * @return rejectedTransactionsHashesList + **/ + @javax.annotation.Nonnull + public List getRejectedTransactionsHashesList() { + return rejectedTransactionsHashesList; + } + + + public void setRejectedTransactionsHashesList(List rejectedTransactionsHashesList) { + this.rejectedTransactionsHashesList = rejectedTransactionsHashesList; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaBlockResponsePayload irohaBlockResponsePayload = (IrohaBlockResponsePayload) o; + return Objects.equals(this.transactionsList, irohaBlockResponsePayload.transactionsList) && + Objects.equals(this.txNumber, irohaBlockResponsePayload.txNumber) && + Objects.equals(this.height, irohaBlockResponsePayload.height) && + Objects.equals(this.prevBlockHash, irohaBlockResponsePayload.prevBlockHash) && + Objects.equals(this.createdTime, irohaBlockResponsePayload.createdTime) && + Objects.equals(this.rejectedTransactionsHashesList, irohaBlockResponsePayload.rejectedTransactionsHashesList); + } + + @Override + public int hashCode() { + return Objects.hash(transactionsList, txNumber, height, prevBlockHash, createdTime, rejectedTransactionsHashesList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaBlockResponsePayload {\n"); + sb.append(" transactionsList: ").append(toIndentedString(transactionsList)).append("\n"); + sb.append(" txNumber: ").append(toIndentedString(txNumber)).append("\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" prevBlockHash: ").append(toIndentedString(prevBlockHash)).append("\n"); + sb.append(" createdTime: ").append(toIndentedString(createdTime)).append("\n"); + sb.append(" rejectedTransactionsHashesList: ").append(toIndentedString(rejectedTransactionsHashesList)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionsList"); + openapiFields.add("txNumber"); + openapiFields.add("height"); + openapiFields.add("prevBlockHash"); + openapiFields.add("createdTime"); + openapiFields.add("rejectedTransactionsHashesList"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionsList"); + openapiRequiredFields.add("txNumber"); + openapiRequiredFields.add("height"); + openapiRequiredFields.add("prevBlockHash"); + openapiRequiredFields.add("createdTime"); + openapiRequiredFields.add("rejectedTransactionsHashesList"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaBlockResponsePayload + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaBlockResponsePayload.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaBlockResponsePayload is not found in the empty JSON string", IrohaBlockResponsePayload.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IrohaBlockResponsePayload.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IrohaBlockResponsePayload` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IrohaBlockResponsePayload.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("transactionsList") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("transactionsList").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionsList` to be an array in the JSON string but got `%s`", jsonObj.get("transactionsList").toString())); + } + if (!jsonObj.get("prevBlockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `prevBlockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prevBlockHash").toString())); + } + // ensure the required json array is present + if (jsonObj.get("rejectedTransactionsHashesList") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("rejectedTransactionsHashesList").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rejectedTransactionsHashesList` to be an array in the JSON string but got `%s`", jsonObj.get("rejectedTransactionsHashesList").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaBlockResponsePayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaBlockResponsePayload' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaBlockResponsePayload.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaBlockResponsePayload value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IrohaBlockResponsePayload read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaBlockResponsePayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaBlockResponsePayload + * @throws IOException if the JSON string is invalid with respect to IrohaBlockResponsePayload + */ + public static IrohaBlockResponsePayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaBlockResponsePayload.class); + } + + /** + * Convert an instance of IrohaBlockResponsePayload to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaCommand.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaCommand.java new file mode 100644 index 00000000000..d5d7c0c0278 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaCommand.java @@ -0,0 +1,169 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets IrohaCommand + */ +@JsonAdapter(IrohaCommand.Adapter.class) +public enum IrohaCommand { + + /** + * Make entity in the system, capable of sending transactions or queries, storing signatories, personal data and identifiers. + */ + CreateAccount("createAccount"), + + /** + * Set key-value information for a given account. + */ + SetAccountDetail("setAccountDetail"), + + /** + * Set the number of signatories required to confirm the identity of a user, who creates the transaction. + */ + SetAccountQuorum("setAccountQuorum"), + + /** + * Set key-value information for a given account if the old value matches the value passed. + */ + CompareAndSetAccountDetail("compareAndSetAccountDetail"), + + /** + * Create a new type of asset, unique in a domain. An asset is a countable representation of a commodity. + */ + CreateAsset("createAsset"), + + /** + * Increase the quantity of an asset on account of transaction creator. + */ + AddAssetQuantity("addAssetQuantity"), + + /** + * Decrease the number of assets on account of transaction creator. + */ + SubtractAssetQuantity("subtractAssetQuantity"), + + /** + * Share assets within the account in peer network: in the way that source account transfers assets to the target account. + */ + TransferAsset("transferAsset"), + + /** + * Make new domain in Iroha network, which is a group of accounts. + */ + CreateDomain("createDomain"), + + /** + * Create a new role in the system from the set of permissions. + */ + CreateRole("createRole"), + + /** + * Detach a role from the set of roles of an account. + */ + DetachRole("detachRole"), + + /** + * Promote an account to some created role in the system, where a role is a set of permissions account has to perform an action (command or query). + */ + AppendRole("appendRole"), + + /** + * Add an identifier to the account. Such identifier is a public key of another device or a public key of another user. + */ + AddSignatory("addSignatory"), + + /** + * Remove a public key, associated with an identity, from an account + */ + RemoveSignatory("removeSignatory"), + + /** + * Give another account rights to perform actions on the account of transaction sender (give someone right to do something with my account). + */ + GrantPermission("grantPermission"), + + /** + * Revoke or dismiss given granted permission from another account in the network. + */ + RevokePermission("revokePermission"), + + /** + * Write into ledger the fact of peer addition into the peer network. + */ + AddPeer("addPeer"), + + /** + * Write into ledger the fact of peer removal from the network. + */ + RemovePeer("removePeer"), + + /** + * This command is not available for use, it was added for backward compatibility with Iroha. + */ + SetSettingValue("setSettingValue"), + + /** + * This command is not availalbe for use because it is related to smart contract. + */ + CallEngine("callEngine"); + + private String value; + + IrohaCommand(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IrohaCommand fromValue(String value) { + for (IrohaCommand b : IrohaCommand.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final IrohaCommand enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IrohaCommand read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IrohaCommand.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQuery.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQuery.java new file mode 100644 index 00000000000..9b93867db28 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQuery.java @@ -0,0 +1,144 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets IrohaQuery + */ +@JsonAdapter(IrohaQuery.Adapter.class) +public enum IrohaQuery { + + /** + * To get the state of an account + */ + GetAccount("getAccount"), + + /** + * To get details of the account. + */ + GetAccountDetail("getAccountDetail"), + + /** + * To get information on the given asset (as for now - its precision). + */ + GetAssetInfo("getAssetInfo"), + + /** + * To get the state of all assets in an account (a balance). + */ + GetAccountAssets("getAccountAssets"), + + /** + * To retrieve information about transactions, based on their hashes. + */ + GetTransactions("getTransactions"), + + /** + * To retrieve a list of pending (not fully signed) multisignature transactions or batches of transactions issued by account of query creator. + */ + GetPendingTransactions("getPendingTransactions"), + + /** + * To retrieve a list of transactions per account. + */ + GetAccountTransactions("getAccountTransactions"), + + /** + * To retrieve all transactions associated with given account and asset. + */ + GetAccountAssetTransactions("getAccountAssetTransactions"), + + /** + * To get existing roles in the system. + */ + GetRoles("getRoles"), + + /** + * To get signatories, which act as an identity of the account. + */ + GetSignatories("getSignatories"), + + /** + * To get available permissions per role in the system. + */ + GetRolePermissions("getRolePermissions"), + + /** + * To get a specific block, using its height as an identifier. + */ + GetBlock("getBlock"), + + /** + * To retrieve a receipt of a CallEngine command. Allows to access the event log created during computations inside the EVM. + */ + GetEngineReceipts("getEngineReceipts"), + + /** + * To get new blocks as soon as they are committed, a user can invoke FetchCommits RPC call to Iroha network. + */ + FetchCommits("fetchCommits"), + + /** + * A query that returns a list of peers in Iroha network. + */ + GetPeers("getPeers"); + + private String value; + + IrohaQuery(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IrohaQuery fromValue(String value) { + for (IrohaQuery b : IrohaQuery.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final IrohaQuery enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IrohaQuery read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IrohaQuery.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaSocketIOTransactV1.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaSocketIOTransactV1.java new file mode 100644 index 00000000000..6b8866c29ab --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaSocketIOTransactV1.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets IrohaSocketIOTransactV1 + */ +@JsonAdapter(IrohaSocketIOTransactV1.Adapter.class) +public enum IrohaSocketIOTransactV1 { + + SendAsyncRequest("org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendAsyncRequest"), + + SendSyncRequest("org.hyperledger.cactus.api.async.iroha.IrohaSocketIOTransactV1.SendSyncRequest"); + + private String value; + + IrohaSocketIOTransactV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IrohaSocketIOTransactV1 fromValue(String value) { + for (IrohaSocketIOTransactV1 b : IrohaSocketIOTransactV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final IrohaSocketIOTransactV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IrohaSocketIOTransactV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IrohaSocketIOTransactV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/KeyPair.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/KeyPair.java new file mode 100644 index 00000000000..51603eddf3f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/KeyPair.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * KeyPair + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class KeyPair { + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + private String publicKey; + + public static final String SERIALIZED_NAME_PRIVATE_KEY = "privateKey"; + @SerializedName(SERIALIZED_NAME_PRIVATE_KEY) + private String privateKey; + + public KeyPair() { + } + + public KeyPair publicKey(String publicKey) { + + this.publicKey = publicKey; + return this; + } + + /** + * SHA-3 ed25519 public keys of length 64 are recommended. + * @return publicKey + **/ + @javax.annotation.Nonnull + public String getPublicKey() { + return publicKey; + } + + + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + + public KeyPair privateKey(String privateKey) { + + this.privateKey = privateKey; + return this; + } + + /** + * SHA-3 ed25519 private keys of length 64 are recommended. + * @return privateKey + **/ + @javax.annotation.Nonnull + public String getPrivateKey() { + return privateKey; + } + + + public void setPrivateKey(String privateKey) { + this.privateKey = privateKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + KeyPair keyPair = (KeyPair) o; + return Objects.equals(this.publicKey, keyPair.publicKey) && + Objects.equals(this.privateKey, keyPair.privateKey); + } + + @Override + public int hashCode() { + return Objects.hash(publicKey, privateKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class KeyPair {\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("publicKey"); + openapiFields.add("privateKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("publicKey"); + openapiRequiredFields.add("privateKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to KeyPair + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!KeyPair.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in KeyPair is not found in the empty JSON string", KeyPair.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!KeyPair.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `KeyPair` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : KeyPair.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("publicKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKey").toString())); + } + if (!jsonObj.get("privateKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `privateKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("privateKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!KeyPair.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'KeyPair' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(KeyPair.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, KeyPair value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public KeyPair read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of KeyPair given an JSON string + * + * @param jsonString JSON string + * @return An instance of KeyPair + * @throws IOException if the JSON string is invalid with respect to KeyPair + */ + public static KeyPair fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, KeyPair.class); + } + + /** + * Convert an instance of KeyPair to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RemovePeerRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RemovePeerRequestParameters.java new file mode 100644 index 00000000000..cec47f580fb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RemovePeerRequestParameters.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Remove Peer. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RemovePeerRequestParameters { + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + private String publicKey; + + public RemovePeerRequestParameters() { + } + + public RemovePeerRequestParameters publicKey(String publicKey) { + + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + **/ + @javax.annotation.Nonnull + public String getPublicKey() { + return publicKey; + } + + + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemovePeerRequestParameters removePeerRequestParameters = (RemovePeerRequestParameters) o; + return Objects.equals(this.publicKey, removePeerRequestParameters.publicKey); + } + + @Override + public int hashCode() { + return Objects.hash(publicKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemovePeerRequestParameters {\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("publicKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("publicKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RemovePeerRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RemovePeerRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RemovePeerRequestParameters is not found in the empty JSON string", RemovePeerRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RemovePeerRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RemovePeerRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RemovePeerRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("publicKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemovePeerRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RemovePeerRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RemovePeerRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RemovePeerRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemovePeerRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RemovePeerRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemovePeerRequestParameters + * @throws IOException if the JSON string is invalid with respect to RemovePeerRequestParameters + */ + public static RemovePeerRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RemovePeerRequestParameters.class); + } + + /** + * Convert an instance of RemovePeerRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RemoveSignatoryRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RemoveSignatoryRequestParameters.java new file mode 100644 index 00000000000..5b5fe8fac54 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RemoveSignatoryRequestParameters.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Remove Signatory. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RemoveSignatoryRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + private String publicKey; + + public RemoveSignatoryRequestParameters() { + } + + public RemoveSignatoryRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public RemoveSignatoryRequestParameters publicKey(String publicKey) { + + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + **/ + @javax.annotation.Nonnull + public String getPublicKey() { + return publicKey; + } + + + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveSignatoryRequestParameters removeSignatoryRequestParameters = (RemoveSignatoryRequestParameters) o; + return Objects.equals(this.accountId, removeSignatoryRequestParameters.accountId) && + Objects.equals(this.publicKey, removeSignatoryRequestParameters.publicKey); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, publicKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveSignatoryRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("publicKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("publicKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RemoveSignatoryRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RemoveSignatoryRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RemoveSignatoryRequestParameters is not found in the empty JSON string", RemoveSignatoryRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RemoveSignatoryRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RemoveSignatoryRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RemoveSignatoryRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("publicKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RemoveSignatoryRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RemoveSignatoryRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RemoveSignatoryRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RemoveSignatoryRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RemoveSignatoryRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveSignatoryRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveSignatoryRequestParameters + * @throws IOException if the JSON string is invalid with respect to RemoveSignatoryRequestParameters + */ + public static RemoveSignatoryRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RemoveSignatoryRequestParameters.class); + } + + /** + * Convert an instance of RemoveSignatoryRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RevokePermissionRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RevokePermissionRequestParameters.java new file mode 100644 index 00000000000..e2754311c88 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RevokePermissionRequestParameters.java @@ -0,0 +1,246 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Revoke Permission. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RevokePermissionRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_PERMISSION = "permission"; + @SerializedName(SERIALIZED_NAME_PERMISSION) + private BigDecimal permission; + + public RevokePermissionRequestParameters() { + } + + public RevokePermissionRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public RevokePermissionRequestParameters permission(BigDecimal permission) { + + this.permission = permission; + return this; + } + + /** + * Get permission + * @return permission + **/ + @javax.annotation.Nonnull + public BigDecimal getPermission() { + return permission; + } + + + public void setPermission(BigDecimal permission) { + this.permission = permission; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RevokePermissionRequestParameters revokePermissionRequestParameters = (RevokePermissionRequestParameters) o; + return Objects.equals(this.accountId, revokePermissionRequestParameters.accountId) && + Objects.equals(this.permission, revokePermissionRequestParameters.permission); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, permission); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RevokePermissionRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" permission: ").append(toIndentedString(permission)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("permission"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("permission"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RevokePermissionRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RevokePermissionRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RevokePermissionRequestParameters is not found in the empty JSON string", RevokePermissionRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RevokePermissionRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RevokePermissionRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RevokePermissionRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RevokePermissionRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RevokePermissionRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RevokePermissionRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RevokePermissionRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RevokePermissionRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RevokePermissionRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of RevokePermissionRequestParameters + * @throws IOException if the JSON string is invalid with respect to RevokePermissionRequestParameters + */ + public static RevokePermissionRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RevokePermissionRequestParameters.class); + } + + /** + * Convert an instance of RevokePermissionRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1.java new file mode 100644 index 00000000000..3d2390cff8a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaBaseConfig; +import org.openapitools.client.model.RunTransactionRequestV1Params; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionRequestV1 { + public static final String SERIALIZED_NAME_COMMAND_NAME = "commandName"; + @SerializedName(SERIALIZED_NAME_COMMAND_NAME) + private String commandName; + + public static final String SERIALIZED_NAME_BASE_CONFIG = "baseConfig"; + @SerializedName(SERIALIZED_NAME_BASE_CONFIG) + private IrohaBaseConfig baseConfig; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private RunTransactionRequestV1Params params; + + public RunTransactionRequestV1() { + } + + public RunTransactionRequestV1 commandName(String commandName) { + + this.commandName = commandName; + return this; + } + + /** + * Get commandName + * @return commandName + **/ + @javax.annotation.Nonnull + public String getCommandName() { + return commandName; + } + + + public void setCommandName(String commandName) { + this.commandName = commandName; + } + + + public RunTransactionRequestV1 baseConfig(IrohaBaseConfig baseConfig) { + + this.baseConfig = baseConfig; + return this; + } + + /** + * Get baseConfig + * @return baseConfig + **/ + @javax.annotation.Nonnull + public IrohaBaseConfig getBaseConfig() { + return baseConfig; + } + + + public void setBaseConfig(IrohaBaseConfig baseConfig) { + this.baseConfig = baseConfig; + } + + + public RunTransactionRequestV1 params(RunTransactionRequestV1Params params) { + + this.params = params; + return this; + } + + /** + * Get params + * @return params + **/ + @javax.annotation.Nonnull + public RunTransactionRequestV1Params getParams() { + return params; + } + + + public void setParams(RunTransactionRequestV1Params params) { + this.params = params; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionRequestV1 runTransactionRequestV1 = (RunTransactionRequestV1) o; + return Objects.equals(this.commandName, runTransactionRequestV1.commandName) && + Objects.equals(this.baseConfig, runTransactionRequestV1.baseConfig) && + Objects.equals(this.params, runTransactionRequestV1.params); + } + + @Override + public int hashCode() { + return Objects.hash(commandName, baseConfig, params); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionRequestV1 {\n"); + sb.append(" commandName: ").append(toIndentedString(commandName)).append("\n"); + sb.append(" baseConfig: ").append(toIndentedString(baseConfig)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("commandName"); + openapiFields.add("baseConfig"); + openapiFields.add("params"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("commandName"); + openapiRequiredFields.add("baseConfig"); + openapiRequiredFields.add("params"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionRequestV1 is not found in the empty JSON string", RunTransactionRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("commandName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commandName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commandName").toString())); + } + // validate the required field `params` + RunTransactionRequestV1Params.validateJsonObject(jsonObj.getAsJsonObject("params")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionRequestV1 + * @throws IOException if the JSON string is invalid with respect to RunTransactionRequestV1 + */ + public static RunTransactionRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionRequestV1.class); + } + + /** + * Convert an instance of RunTransactionRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1Body.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1Body.java new file mode 100644 index 00000000000..5c36ec7428f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1Body.java @@ -0,0 +1,286 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaBaseConfig; +import org.openapitools.client.model.RunTransactionRequestV1; +import org.openapitools.client.model.RunTransactionRequestV1Params; +import org.openapitools.client.model.RunTransactionSignedRequestV1; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionRequestV1Body extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(RunTransactionRequestV1Body.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionRequestV1Body.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionRequestV1Body' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterRunTransactionRequestV1 = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionRequestV1.class)); + final TypeAdapter adapterRunTransactionSignedRequestV1 = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionSignedRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionRequestV1Body value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `RunTransactionRequestV1` + if (value.getActualInstance() instanceof RunTransactionRequestV1) { + JsonObject obj = adapterRunTransactionRequestV1.toJsonTree((RunTransactionRequestV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `RunTransactionSignedRequestV1` + if (value.getActualInstance() instanceof RunTransactionSignedRequestV1) { + JsonObject obj = adapterRunTransactionSignedRequestV1.toJsonTree((RunTransactionSignedRequestV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: RunTransactionRequestV1, RunTransactionSignedRequestV1"); + } + + @Override + public RunTransactionRequestV1Body read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize RunTransactionRequestV1 + try { + // validate the JSON object to see if any exception is thrown + RunTransactionRequestV1.validateJsonObject(jsonObject); + actualAdapter = adapterRunTransactionRequestV1; + match++; + log.log(Level.FINER, "Input data matches schema 'RunTransactionRequestV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for RunTransactionRequestV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'RunTransactionRequestV1'", e); + } + + // deserialize RunTransactionSignedRequestV1 + try { + // validate the JSON object to see if any exception is thrown + RunTransactionSignedRequestV1.validateJsonObject(jsonObject); + actualAdapter = adapterRunTransactionSignedRequestV1; + match++; + log.log(Level.FINER, "Input data matches schema 'RunTransactionSignedRequestV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for RunTransactionSignedRequestV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'RunTransactionSignedRequestV1'", e); + } + + if (match == 1) { + RunTransactionRequestV1Body ret = new RunTransactionRequestV1Body(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for RunTransactionRequestV1Body: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public RunTransactionRequestV1Body() { + super("oneOf", Boolean.FALSE); + } + + public RunTransactionRequestV1Body(RunTransactionRequestV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Body(RunTransactionSignedRequestV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("RunTransactionRequestV1", new GenericType() { + }); + schemas.put("RunTransactionSignedRequestV1", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return RunTransactionRequestV1Body.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * RunTransactionRequestV1, RunTransactionSignedRequestV1 + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof RunTransactionRequestV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof RunTransactionSignedRequestV1) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be RunTransactionRequestV1, RunTransactionSignedRequestV1"); + } + + /** + * Get the actual instance, which can be the following: + * RunTransactionRequestV1, RunTransactionSignedRequestV1 + * + * @return The actual instance (RunTransactionRequestV1, RunTransactionSignedRequestV1) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `RunTransactionRequestV1`. If the actual instance is not `RunTransactionRequestV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `RunTransactionRequestV1` + * @throws ClassCastException if the instance is not `RunTransactionRequestV1` + */ + public RunTransactionRequestV1 getRunTransactionRequestV1() throws ClassCastException { + return (RunTransactionRequestV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `RunTransactionSignedRequestV1`. If the actual instance is not `RunTransactionSignedRequestV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `RunTransactionSignedRequestV1` + * @throws ClassCastException if the instance is not `RunTransactionSignedRequestV1` + */ + public RunTransactionSignedRequestV1 getRunTransactionSignedRequestV1() throws ClassCastException { + return (RunTransactionSignedRequestV1)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionRequestV1Body + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with RunTransactionRequestV1 + try { + RunTransactionRequestV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for RunTransactionRequestV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with RunTransactionSignedRequestV1 + try { + RunTransactionSignedRequestV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for RunTransactionSignedRequestV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for RunTransactionRequestV1Body with oneOf schemas: RunTransactionRequestV1, RunTransactionSignedRequestV1. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of RunTransactionRequestV1Body given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionRequestV1Body + * @throws IOException if the JSON string is invalid with respect to RunTransactionRequestV1Body + */ + public static RunTransactionRequestV1Body fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionRequestV1Body.class); + } + + /** + * Convert an instance of RunTransactionRequestV1Body to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1Params.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1Params.java new file mode 100644 index 00000000000..e4df4d607ad --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequestV1Params.java @@ -0,0 +1,1876 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.AddAssetQuantityRequestParameters; +import org.openapitools.client.model.AddPeerRequestParameters; +import org.openapitools.client.model.AddSignatoryRequestParameters; +import org.openapitools.client.model.AppendRoleRequestParameters; +import org.openapitools.client.model.CallEngineRequestParameters; +import org.openapitools.client.model.CompareAndSetAccountDetailRequestParameters; +import org.openapitools.client.model.CreateAccountRequestParameters; +import org.openapitools.client.model.CreateAssetRequestParameters; +import org.openapitools.client.model.CreateDomainRequestParameters; +import org.openapitools.client.model.CreateRoleRequestParameters; +import org.openapitools.client.model.DetachRoleRequestParameters; +import org.openapitools.client.model.GetAccountAssetTransactionsRequestParameters; +import org.openapitools.client.model.GetAccountAssetsRequestParameters; +import org.openapitools.client.model.GetAccountDetailRequestParameters; +import org.openapitools.client.model.GetAccountRequestParameters; +import org.openapitools.client.model.GetAccountTransactionsRequestParameters; +import org.openapitools.client.model.GetAssetInfoRequestParameters; +import org.openapitools.client.model.GetBlockRequestParameters; +import org.openapitools.client.model.GetEngineReceiptsRequestParameters; +import org.openapitools.client.model.GetPendingTransactionsRequestParameters; +import org.openapitools.client.model.GetRolePermissionsRequestParameters; +import org.openapitools.client.model.GetSignatoriesRequestParameters; +import org.openapitools.client.model.GetTransactionsRequestParameters; +import org.openapitools.client.model.GrantPermissionRequestParameters; +import org.openapitools.client.model.RemovePeerRequestParameters; +import org.openapitools.client.model.RemoveSignatoryRequestParameters; +import org.openapitools.client.model.RevokePermissionRequestParameters; +import org.openapitools.client.model.SetAccountDetailRequestParameters; +import org.openapitools.client.model.SetAccountQuorumRequestParameters; +import org.openapitools.client.model.SubtractAssetQuantityRequestParameters; +import org.openapitools.client.model.TransferAssetRequestParameters; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionRequestV1Params extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(RunTransactionRequestV1Params.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionRequestV1Params.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionRequestV1Params' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterAddAssetQuantityRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(AddAssetQuantityRequestParameters.class)); + final TypeAdapter adapterAddPeerRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(AddPeerRequestParameters.class)); + final TypeAdapter adapterAddSignatoryRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(AddSignatoryRequestParameters.class)); + final TypeAdapter adapterAppendRoleRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(AppendRoleRequestParameters.class)); + final TypeAdapter adapterCallEngineRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(CallEngineRequestParameters.class)); + final TypeAdapter adapterCompareAndSetAccountDetailRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(CompareAndSetAccountDetailRequestParameters.class)); + final TypeAdapter adapterCreateAccountRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(CreateAccountRequestParameters.class)); + final TypeAdapter adapterCreateAssetRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(CreateAssetRequestParameters.class)); + final TypeAdapter adapterCreateDomainRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(CreateDomainRequestParameters.class)); + final TypeAdapter adapterCreateRoleRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(CreateRoleRequestParameters.class)); + final TypeAdapter adapterDetachRoleRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(DetachRoleRequestParameters.class)); + final TypeAdapter adapterGetAccountAssetTransactionsRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetAccountAssetTransactionsRequestParameters.class)); + final TypeAdapter adapterGetAccountAssetsRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetAccountAssetsRequestParameters.class)); + final TypeAdapter adapterGetAccountDetailRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetAccountDetailRequestParameters.class)); + final TypeAdapter adapterGetAccountRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetAccountRequestParameters.class)); + final TypeAdapter adapterGetAccountTransactionsRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetAccountTransactionsRequestParameters.class)); + final TypeAdapter adapterGetAssetInfoRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetAssetInfoRequestParameters.class)); + final TypeAdapter adapterGetBlockRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetBlockRequestParameters.class)); + final TypeAdapter adapterGetEngineReceiptsRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetEngineReceiptsRequestParameters.class)); + final TypeAdapter adapterGetPendingTransactionsRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetPendingTransactionsRequestParameters.class)); + final TypeAdapter adapterGetRolePermissionsRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetRolePermissionsRequestParameters.class)); + final TypeAdapter adapterGetSignatoriesRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetSignatoriesRequestParameters.class)); + final TypeAdapter adapterGetTransactionsRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GetTransactionsRequestParameters.class)); + final TypeAdapter adapterGrantPermissionRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(GrantPermissionRequestParameters.class)); + final TypeAdapter adapterList<Object> = gson.getDelegateAdapter(this, TypeToken.get(List<Object>.class)); + final TypeAdapter adapterRemovePeerRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(RemovePeerRequestParameters.class)); + final TypeAdapter adapterRemoveSignatoryRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(RemoveSignatoryRequestParameters.class)); + final TypeAdapter adapterRevokePermissionRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(RevokePermissionRequestParameters.class)); + final TypeAdapter adapterSetAccountDetailRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(SetAccountDetailRequestParameters.class)); + final TypeAdapter adapterSetAccountQuorumRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(SetAccountQuorumRequestParameters.class)); + final TypeAdapter adapterSubtractAssetQuantityRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(SubtractAssetQuantityRequestParameters.class)); + final TypeAdapter adapterTransferAssetRequestParameters = gson.getDelegateAdapter(this, TypeToken.get(TransferAssetRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionRequestV1Params value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `AddAssetQuantityRequestParameters` + if (value.getActualInstance() instanceof AddAssetQuantityRequestParameters) { + JsonObject obj = adapterAddAssetQuantityRequestParameters.toJsonTree((AddAssetQuantityRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `AddPeerRequestParameters` + if (value.getActualInstance() instanceof AddPeerRequestParameters) { + JsonObject obj = adapterAddPeerRequestParameters.toJsonTree((AddPeerRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `AddSignatoryRequestParameters` + if (value.getActualInstance() instanceof AddSignatoryRequestParameters) { + JsonObject obj = adapterAddSignatoryRequestParameters.toJsonTree((AddSignatoryRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `AppendRoleRequestParameters` + if (value.getActualInstance() instanceof AppendRoleRequestParameters) { + JsonObject obj = adapterAppendRoleRequestParameters.toJsonTree((AppendRoleRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `CallEngineRequestParameters` + if (value.getActualInstance() instanceof CallEngineRequestParameters) { + JsonObject obj = adapterCallEngineRequestParameters.toJsonTree((CallEngineRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `CompareAndSetAccountDetailRequestParameters` + if (value.getActualInstance() instanceof CompareAndSetAccountDetailRequestParameters) { + JsonObject obj = adapterCompareAndSetAccountDetailRequestParameters.toJsonTree((CompareAndSetAccountDetailRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `CreateAccountRequestParameters` + if (value.getActualInstance() instanceof CreateAccountRequestParameters) { + JsonObject obj = adapterCreateAccountRequestParameters.toJsonTree((CreateAccountRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `CreateAssetRequestParameters` + if (value.getActualInstance() instanceof CreateAssetRequestParameters) { + JsonObject obj = adapterCreateAssetRequestParameters.toJsonTree((CreateAssetRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `CreateDomainRequestParameters` + if (value.getActualInstance() instanceof CreateDomainRequestParameters) { + JsonObject obj = adapterCreateDomainRequestParameters.toJsonTree((CreateDomainRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `CreateRoleRequestParameters` + if (value.getActualInstance() instanceof CreateRoleRequestParameters) { + JsonObject obj = adapterCreateRoleRequestParameters.toJsonTree((CreateRoleRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `DetachRoleRequestParameters` + if (value.getActualInstance() instanceof DetachRoleRequestParameters) { + JsonObject obj = adapterDetachRoleRequestParameters.toJsonTree((DetachRoleRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetAccountAssetTransactionsRequestParameters` + if (value.getActualInstance() instanceof GetAccountAssetTransactionsRequestParameters) { + JsonObject obj = adapterGetAccountAssetTransactionsRequestParameters.toJsonTree((GetAccountAssetTransactionsRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetAccountAssetsRequestParameters` + if (value.getActualInstance() instanceof GetAccountAssetsRequestParameters) { + JsonObject obj = adapterGetAccountAssetsRequestParameters.toJsonTree((GetAccountAssetsRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetAccountDetailRequestParameters` + if (value.getActualInstance() instanceof GetAccountDetailRequestParameters) { + JsonObject obj = adapterGetAccountDetailRequestParameters.toJsonTree((GetAccountDetailRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetAccountRequestParameters` + if (value.getActualInstance() instanceof GetAccountRequestParameters) { + JsonObject obj = adapterGetAccountRequestParameters.toJsonTree((GetAccountRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetAccountTransactionsRequestParameters` + if (value.getActualInstance() instanceof GetAccountTransactionsRequestParameters) { + JsonObject obj = adapterGetAccountTransactionsRequestParameters.toJsonTree((GetAccountTransactionsRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetAssetInfoRequestParameters` + if (value.getActualInstance() instanceof GetAssetInfoRequestParameters) { + JsonObject obj = adapterGetAssetInfoRequestParameters.toJsonTree((GetAssetInfoRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetBlockRequestParameters` + if (value.getActualInstance() instanceof GetBlockRequestParameters) { + JsonObject obj = adapterGetBlockRequestParameters.toJsonTree((GetBlockRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetEngineReceiptsRequestParameters` + if (value.getActualInstance() instanceof GetEngineReceiptsRequestParameters) { + JsonObject obj = adapterGetEngineReceiptsRequestParameters.toJsonTree((GetEngineReceiptsRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetPendingTransactionsRequestParameters` + if (value.getActualInstance() instanceof GetPendingTransactionsRequestParameters) { + JsonObject obj = adapterGetPendingTransactionsRequestParameters.toJsonTree((GetPendingTransactionsRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetRolePermissionsRequestParameters` + if (value.getActualInstance() instanceof GetRolePermissionsRequestParameters) { + JsonObject obj = adapterGetRolePermissionsRequestParameters.toJsonTree((GetRolePermissionsRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetSignatoriesRequestParameters` + if (value.getActualInstance() instanceof GetSignatoriesRequestParameters) { + JsonObject obj = adapterGetSignatoriesRequestParameters.toJsonTree((GetSignatoriesRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GetTransactionsRequestParameters` + if (value.getActualInstance() instanceof GetTransactionsRequestParameters) { + JsonObject obj = adapterGetTransactionsRequestParameters.toJsonTree((GetTransactionsRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `GrantPermissionRequestParameters` + if (value.getActualInstance() instanceof GrantPermissionRequestParameters) { + JsonObject obj = adapterGrantPermissionRequestParameters.toJsonTree((GrantPermissionRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<Object>) { + JsonObject obj = adapterList<Object>.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `RemovePeerRequestParameters` + if (value.getActualInstance() instanceof RemovePeerRequestParameters) { + JsonObject obj = adapterRemovePeerRequestParameters.toJsonTree((RemovePeerRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `RemoveSignatoryRequestParameters` + if (value.getActualInstance() instanceof RemoveSignatoryRequestParameters) { + JsonObject obj = adapterRemoveSignatoryRequestParameters.toJsonTree((RemoveSignatoryRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `RevokePermissionRequestParameters` + if (value.getActualInstance() instanceof RevokePermissionRequestParameters) { + JsonObject obj = adapterRevokePermissionRequestParameters.toJsonTree((RevokePermissionRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `SetAccountDetailRequestParameters` + if (value.getActualInstance() instanceof SetAccountDetailRequestParameters) { + JsonObject obj = adapterSetAccountDetailRequestParameters.toJsonTree((SetAccountDetailRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `SetAccountQuorumRequestParameters` + if (value.getActualInstance() instanceof SetAccountQuorumRequestParameters) { + JsonObject obj = adapterSetAccountQuorumRequestParameters.toJsonTree((SetAccountQuorumRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `SubtractAssetQuantityRequestParameters` + if (value.getActualInstance() instanceof SubtractAssetQuantityRequestParameters) { + JsonObject obj = adapterSubtractAssetQuantityRequestParameters.toJsonTree((SubtractAssetQuantityRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `TransferAssetRequestParameters` + if (value.getActualInstance() instanceof TransferAssetRequestParameters) { + JsonObject obj = adapterTransferAssetRequestParameters.toJsonTree((TransferAssetRequestParameters)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: AddAssetQuantityRequestParameters, AddPeerRequestParameters, AddSignatoryRequestParameters, AppendRoleRequestParameters, CallEngineRequestParameters, CompareAndSetAccountDetailRequestParameters, CreateAccountRequestParameters, CreateAssetRequestParameters, CreateDomainRequestParameters, CreateRoleRequestParameters, DetachRoleRequestParameters, GetAccountAssetTransactionsRequestParameters, GetAccountAssetsRequestParameters, GetAccountDetailRequestParameters, GetAccountRequestParameters, GetAccountTransactionsRequestParameters, GetAssetInfoRequestParameters, GetBlockRequestParameters, GetEngineReceiptsRequestParameters, GetPendingTransactionsRequestParameters, GetRolePermissionsRequestParameters, GetSignatoriesRequestParameters, GetTransactionsRequestParameters, GrantPermissionRequestParameters, List, RemovePeerRequestParameters, RemoveSignatoryRequestParameters, RevokePermissionRequestParameters, SetAccountDetailRequestParameters, SetAccountQuorumRequestParameters, SubtractAssetQuantityRequestParameters, TransferAssetRequestParameters"); + } + + @Override + public RunTransactionRequestV1Params read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize AddAssetQuantityRequestParameters + try { + // validate the JSON object to see if any exception is thrown + AddAssetQuantityRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterAddAssetQuantityRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'AddAssetQuantityRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AddAssetQuantityRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AddAssetQuantityRequestParameters'", e); + } + + // deserialize AddPeerRequestParameters + try { + // validate the JSON object to see if any exception is thrown + AddPeerRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterAddPeerRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'AddPeerRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AddPeerRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AddPeerRequestParameters'", e); + } + + // deserialize AddSignatoryRequestParameters + try { + // validate the JSON object to see if any exception is thrown + AddSignatoryRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterAddSignatoryRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'AddSignatoryRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AddSignatoryRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AddSignatoryRequestParameters'", e); + } + + // deserialize AppendRoleRequestParameters + try { + // validate the JSON object to see if any exception is thrown + AppendRoleRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterAppendRoleRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'AppendRoleRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AppendRoleRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AppendRoleRequestParameters'", e); + } + + // deserialize CallEngineRequestParameters + try { + // validate the JSON object to see if any exception is thrown + CallEngineRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterCallEngineRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'CallEngineRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CallEngineRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CallEngineRequestParameters'", e); + } + + // deserialize CompareAndSetAccountDetailRequestParameters + try { + // validate the JSON object to see if any exception is thrown + CompareAndSetAccountDetailRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterCompareAndSetAccountDetailRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'CompareAndSetAccountDetailRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CompareAndSetAccountDetailRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CompareAndSetAccountDetailRequestParameters'", e); + } + + // deserialize CreateAccountRequestParameters + try { + // validate the JSON object to see if any exception is thrown + CreateAccountRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterCreateAccountRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'CreateAccountRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CreateAccountRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CreateAccountRequestParameters'", e); + } + + // deserialize CreateAssetRequestParameters + try { + // validate the JSON object to see if any exception is thrown + CreateAssetRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterCreateAssetRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'CreateAssetRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CreateAssetRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CreateAssetRequestParameters'", e); + } + + // deserialize CreateDomainRequestParameters + try { + // validate the JSON object to see if any exception is thrown + CreateDomainRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterCreateDomainRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'CreateDomainRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CreateDomainRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CreateDomainRequestParameters'", e); + } + + // deserialize CreateRoleRequestParameters + try { + // validate the JSON object to see if any exception is thrown + CreateRoleRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterCreateRoleRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'CreateRoleRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CreateRoleRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CreateRoleRequestParameters'", e); + } + + // deserialize DetachRoleRequestParameters + try { + // validate the JSON object to see if any exception is thrown + DetachRoleRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterDetachRoleRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'DetachRoleRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for DetachRoleRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'DetachRoleRequestParameters'", e); + } + + // deserialize GetAccountAssetTransactionsRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetAccountAssetTransactionsRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetAccountAssetTransactionsRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetAccountAssetTransactionsRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetAccountAssetTransactionsRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetAccountAssetTransactionsRequestParameters'", e); + } + + // deserialize GetAccountAssetsRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetAccountAssetsRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetAccountAssetsRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetAccountAssetsRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetAccountAssetsRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetAccountAssetsRequestParameters'", e); + } + + // deserialize GetAccountDetailRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetAccountDetailRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetAccountDetailRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetAccountDetailRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetAccountDetailRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetAccountDetailRequestParameters'", e); + } + + // deserialize GetAccountRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetAccountRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetAccountRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetAccountRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetAccountRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetAccountRequestParameters'", e); + } + + // deserialize GetAccountTransactionsRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetAccountTransactionsRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetAccountTransactionsRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetAccountTransactionsRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetAccountTransactionsRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetAccountTransactionsRequestParameters'", e); + } + + // deserialize GetAssetInfoRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetAssetInfoRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetAssetInfoRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetAssetInfoRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetAssetInfoRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetAssetInfoRequestParameters'", e); + } + + // deserialize GetBlockRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetBlockRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetBlockRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetBlockRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetBlockRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetBlockRequestParameters'", e); + } + + // deserialize GetEngineReceiptsRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetEngineReceiptsRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetEngineReceiptsRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetEngineReceiptsRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetEngineReceiptsRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetEngineReceiptsRequestParameters'", e); + } + + // deserialize GetPendingTransactionsRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetPendingTransactionsRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetPendingTransactionsRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetPendingTransactionsRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetPendingTransactionsRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetPendingTransactionsRequestParameters'", e); + } + + // deserialize GetRolePermissionsRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetRolePermissionsRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetRolePermissionsRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetRolePermissionsRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetRolePermissionsRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetRolePermissionsRequestParameters'", e); + } + + // deserialize GetSignatoriesRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetSignatoriesRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetSignatoriesRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetSignatoriesRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetSignatoriesRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetSignatoriesRequestParameters'", e); + } + + // deserialize GetTransactionsRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GetTransactionsRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGetTransactionsRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GetTransactionsRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GetTransactionsRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GetTransactionsRequestParameters'", e); + } + + // deserialize GrantPermissionRequestParameters + try { + // validate the JSON object to see if any exception is thrown + GrantPermissionRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterGrantPermissionRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'GrantPermissionRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for GrantPermissionRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'GrantPermissionRequestParameters'", e); + } + + // deserialize List + try { + // validate the JSON object to see if any exception is thrown + List<Object>.validateJsonObject(jsonObject); + actualAdapter = adapterList<Object>; + match++; + log.log(Level.FINER, "Input data matches schema 'List'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List'", e); + } + + // deserialize RemovePeerRequestParameters + try { + // validate the JSON object to see if any exception is thrown + RemovePeerRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterRemovePeerRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'RemovePeerRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for RemovePeerRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'RemovePeerRequestParameters'", e); + } + + // deserialize RemoveSignatoryRequestParameters + try { + // validate the JSON object to see if any exception is thrown + RemoveSignatoryRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterRemoveSignatoryRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'RemoveSignatoryRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for RemoveSignatoryRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'RemoveSignatoryRequestParameters'", e); + } + + // deserialize RevokePermissionRequestParameters + try { + // validate the JSON object to see if any exception is thrown + RevokePermissionRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterRevokePermissionRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'RevokePermissionRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for RevokePermissionRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'RevokePermissionRequestParameters'", e); + } + + // deserialize SetAccountDetailRequestParameters + try { + // validate the JSON object to see if any exception is thrown + SetAccountDetailRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterSetAccountDetailRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'SetAccountDetailRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SetAccountDetailRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SetAccountDetailRequestParameters'", e); + } + + // deserialize SetAccountQuorumRequestParameters + try { + // validate the JSON object to see if any exception is thrown + SetAccountQuorumRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterSetAccountQuorumRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'SetAccountQuorumRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SetAccountQuorumRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SetAccountQuorumRequestParameters'", e); + } + + // deserialize SubtractAssetQuantityRequestParameters + try { + // validate the JSON object to see if any exception is thrown + SubtractAssetQuantityRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterSubtractAssetQuantityRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'SubtractAssetQuantityRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SubtractAssetQuantityRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SubtractAssetQuantityRequestParameters'", e); + } + + // deserialize TransferAssetRequestParameters + try { + // validate the JSON object to see if any exception is thrown + TransferAssetRequestParameters.validateJsonObject(jsonObject); + actualAdapter = adapterTransferAssetRequestParameters; + match++; + log.log(Level.FINER, "Input data matches schema 'TransferAssetRequestParameters'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for TransferAssetRequestParameters failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'TransferAssetRequestParameters'", e); + } + + if (match == 1) { + RunTransactionRequestV1Params ret = new RunTransactionRequestV1Params(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for RunTransactionRequestV1Params: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public RunTransactionRequestV1Params() { + super("oneOf", Boolean.FALSE); + } + + public RunTransactionRequestV1Params(AddAssetQuantityRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(AddPeerRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(AddSignatoryRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(AppendRoleRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(CallEngineRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(CompareAndSetAccountDetailRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(CreateAccountRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(CreateAssetRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(CreateDomainRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(CreateRoleRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(DetachRoleRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetAccountAssetTransactionsRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetAccountAssetsRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetAccountDetailRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetAccountRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetAccountTransactionsRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetAssetInfoRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetBlockRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetEngineReceiptsRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetPendingTransactionsRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetRolePermissionsRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetSignatoriesRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GetTransactionsRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(GrantPermissionRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(List o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(RemovePeerRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(RemoveSignatoryRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(RevokePermissionRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(SetAccountDetailRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(SetAccountQuorumRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(SubtractAssetQuantityRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public RunTransactionRequestV1Params(TransferAssetRequestParameters o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AddAssetQuantityRequestParameters", new GenericType() { + }); + schemas.put("AddPeerRequestParameters", new GenericType() { + }); + schemas.put("AddSignatoryRequestParameters", new GenericType() { + }); + schemas.put("AppendRoleRequestParameters", new GenericType() { + }); + schemas.put("CallEngineRequestParameters", new GenericType() { + }); + schemas.put("CompareAndSetAccountDetailRequestParameters", new GenericType() { + }); + schemas.put("CreateAccountRequestParameters", new GenericType() { + }); + schemas.put("CreateAssetRequestParameters", new GenericType() { + }); + schemas.put("CreateDomainRequestParameters", new GenericType() { + }); + schemas.put("CreateRoleRequestParameters", new GenericType() { + }); + schemas.put("DetachRoleRequestParameters", new GenericType() { + }); + schemas.put("GetAccountAssetTransactionsRequestParameters", new GenericType() { + }); + schemas.put("GetAccountAssetsRequestParameters", new GenericType() { + }); + schemas.put("GetAccountDetailRequestParameters", new GenericType() { + }); + schemas.put("GetAccountRequestParameters", new GenericType() { + }); + schemas.put("GetAccountTransactionsRequestParameters", new GenericType() { + }); + schemas.put("GetAssetInfoRequestParameters", new GenericType() { + }); + schemas.put("GetBlockRequestParameters", new GenericType() { + }); + schemas.put("GetEngineReceiptsRequestParameters", new GenericType() { + }); + schemas.put("GetPendingTransactionsRequestParameters", new GenericType() { + }); + schemas.put("GetRolePermissionsRequestParameters", new GenericType() { + }); + schemas.put("GetSignatoriesRequestParameters", new GenericType() { + }); + schemas.put("GetTransactionsRequestParameters", new GenericType() { + }); + schemas.put("GrantPermissionRequestParameters", new GenericType() { + }); + schemas.put("List", new GenericType>() { + }); + schemas.put("RemovePeerRequestParameters", new GenericType() { + }); + schemas.put("RemoveSignatoryRequestParameters", new GenericType() { + }); + schemas.put("RevokePermissionRequestParameters", new GenericType() { + }); + schemas.put("SetAccountDetailRequestParameters", new GenericType() { + }); + schemas.put("SetAccountQuorumRequestParameters", new GenericType() { + }); + schemas.put("SubtractAssetQuantityRequestParameters", new GenericType() { + }); + schemas.put("TransferAssetRequestParameters", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return RunTransactionRequestV1Params.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * AddAssetQuantityRequestParameters, AddPeerRequestParameters, AddSignatoryRequestParameters, AppendRoleRequestParameters, CallEngineRequestParameters, CompareAndSetAccountDetailRequestParameters, CreateAccountRequestParameters, CreateAssetRequestParameters, CreateDomainRequestParameters, CreateRoleRequestParameters, DetachRoleRequestParameters, GetAccountAssetTransactionsRequestParameters, GetAccountAssetsRequestParameters, GetAccountDetailRequestParameters, GetAccountRequestParameters, GetAccountTransactionsRequestParameters, GetAssetInfoRequestParameters, GetBlockRequestParameters, GetEngineReceiptsRequestParameters, GetPendingTransactionsRequestParameters, GetRolePermissionsRequestParameters, GetSignatoriesRequestParameters, GetTransactionsRequestParameters, GrantPermissionRequestParameters, List, RemovePeerRequestParameters, RemoveSignatoryRequestParameters, RevokePermissionRequestParameters, SetAccountDetailRequestParameters, SetAccountQuorumRequestParameters, SubtractAssetQuantityRequestParameters, TransferAssetRequestParameters + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof AddAssetQuantityRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AddPeerRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AddSignatoryRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AppendRoleRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CallEngineRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CompareAndSetAccountDetailRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CreateAccountRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CreateAssetRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CreateDomainRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CreateRoleRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DetachRoleRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetAccountAssetTransactionsRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetAccountAssetsRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetAccountDetailRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetAccountRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetAccountTransactionsRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetAssetInfoRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetBlockRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetEngineReceiptsRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetPendingTransactionsRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetRolePermissionsRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetSignatoriesRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GetTransactionsRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof GrantPermissionRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof List) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof RemovePeerRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof RemoveSignatoryRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof RevokePermissionRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SetAccountDetailRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SetAccountQuorumRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SubtractAssetQuantityRequestParameters) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof TransferAssetRequestParameters) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AddAssetQuantityRequestParameters, AddPeerRequestParameters, AddSignatoryRequestParameters, AppendRoleRequestParameters, CallEngineRequestParameters, CompareAndSetAccountDetailRequestParameters, CreateAccountRequestParameters, CreateAssetRequestParameters, CreateDomainRequestParameters, CreateRoleRequestParameters, DetachRoleRequestParameters, GetAccountAssetTransactionsRequestParameters, GetAccountAssetsRequestParameters, GetAccountDetailRequestParameters, GetAccountRequestParameters, GetAccountTransactionsRequestParameters, GetAssetInfoRequestParameters, GetBlockRequestParameters, GetEngineReceiptsRequestParameters, GetPendingTransactionsRequestParameters, GetRolePermissionsRequestParameters, GetSignatoriesRequestParameters, GetTransactionsRequestParameters, GrantPermissionRequestParameters, List, RemovePeerRequestParameters, RemoveSignatoryRequestParameters, RevokePermissionRequestParameters, SetAccountDetailRequestParameters, SetAccountQuorumRequestParameters, SubtractAssetQuantityRequestParameters, TransferAssetRequestParameters"); + } + + /** + * Get the actual instance, which can be the following: + * AddAssetQuantityRequestParameters, AddPeerRequestParameters, AddSignatoryRequestParameters, AppendRoleRequestParameters, CallEngineRequestParameters, CompareAndSetAccountDetailRequestParameters, CreateAccountRequestParameters, CreateAssetRequestParameters, CreateDomainRequestParameters, CreateRoleRequestParameters, DetachRoleRequestParameters, GetAccountAssetTransactionsRequestParameters, GetAccountAssetsRequestParameters, GetAccountDetailRequestParameters, GetAccountRequestParameters, GetAccountTransactionsRequestParameters, GetAssetInfoRequestParameters, GetBlockRequestParameters, GetEngineReceiptsRequestParameters, GetPendingTransactionsRequestParameters, GetRolePermissionsRequestParameters, GetSignatoriesRequestParameters, GetTransactionsRequestParameters, GrantPermissionRequestParameters, List, RemovePeerRequestParameters, RemoveSignatoryRequestParameters, RevokePermissionRequestParameters, SetAccountDetailRequestParameters, SetAccountQuorumRequestParameters, SubtractAssetQuantityRequestParameters, TransferAssetRequestParameters + * + * @return The actual instance (AddAssetQuantityRequestParameters, AddPeerRequestParameters, AddSignatoryRequestParameters, AppendRoleRequestParameters, CallEngineRequestParameters, CompareAndSetAccountDetailRequestParameters, CreateAccountRequestParameters, CreateAssetRequestParameters, CreateDomainRequestParameters, CreateRoleRequestParameters, DetachRoleRequestParameters, GetAccountAssetTransactionsRequestParameters, GetAccountAssetsRequestParameters, GetAccountDetailRequestParameters, GetAccountRequestParameters, GetAccountTransactionsRequestParameters, GetAssetInfoRequestParameters, GetBlockRequestParameters, GetEngineReceiptsRequestParameters, GetPendingTransactionsRequestParameters, GetRolePermissionsRequestParameters, GetSignatoriesRequestParameters, GetTransactionsRequestParameters, GrantPermissionRequestParameters, List, RemovePeerRequestParameters, RemoveSignatoryRequestParameters, RevokePermissionRequestParameters, SetAccountDetailRequestParameters, SetAccountQuorumRequestParameters, SubtractAssetQuantityRequestParameters, TransferAssetRequestParameters) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AddAssetQuantityRequestParameters`. If the actual instance is not `AddAssetQuantityRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AddAssetQuantityRequestParameters` + * @throws ClassCastException if the instance is not `AddAssetQuantityRequestParameters` + */ + public AddAssetQuantityRequestParameters getAddAssetQuantityRequestParameters() throws ClassCastException { + return (AddAssetQuantityRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `AddPeerRequestParameters`. If the actual instance is not `AddPeerRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AddPeerRequestParameters` + * @throws ClassCastException if the instance is not `AddPeerRequestParameters` + */ + public AddPeerRequestParameters getAddPeerRequestParameters() throws ClassCastException { + return (AddPeerRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `AddSignatoryRequestParameters`. If the actual instance is not `AddSignatoryRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AddSignatoryRequestParameters` + * @throws ClassCastException if the instance is not `AddSignatoryRequestParameters` + */ + public AddSignatoryRequestParameters getAddSignatoryRequestParameters() throws ClassCastException { + return (AddSignatoryRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `AppendRoleRequestParameters`. If the actual instance is not `AppendRoleRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AppendRoleRequestParameters` + * @throws ClassCastException if the instance is not `AppendRoleRequestParameters` + */ + public AppendRoleRequestParameters getAppendRoleRequestParameters() throws ClassCastException { + return (AppendRoleRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `CallEngineRequestParameters`. If the actual instance is not `CallEngineRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CallEngineRequestParameters` + * @throws ClassCastException if the instance is not `CallEngineRequestParameters` + */ + public CallEngineRequestParameters getCallEngineRequestParameters() throws ClassCastException { + return (CallEngineRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `CompareAndSetAccountDetailRequestParameters`. If the actual instance is not `CompareAndSetAccountDetailRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CompareAndSetAccountDetailRequestParameters` + * @throws ClassCastException if the instance is not `CompareAndSetAccountDetailRequestParameters` + */ + public CompareAndSetAccountDetailRequestParameters getCompareAndSetAccountDetailRequestParameters() throws ClassCastException { + return (CompareAndSetAccountDetailRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateAccountRequestParameters`. If the actual instance is not `CreateAccountRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CreateAccountRequestParameters` + * @throws ClassCastException if the instance is not `CreateAccountRequestParameters` + */ + public CreateAccountRequestParameters getCreateAccountRequestParameters() throws ClassCastException { + return (CreateAccountRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateAssetRequestParameters`. If the actual instance is not `CreateAssetRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CreateAssetRequestParameters` + * @throws ClassCastException if the instance is not `CreateAssetRequestParameters` + */ + public CreateAssetRequestParameters getCreateAssetRequestParameters() throws ClassCastException { + return (CreateAssetRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateDomainRequestParameters`. If the actual instance is not `CreateDomainRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CreateDomainRequestParameters` + * @throws ClassCastException if the instance is not `CreateDomainRequestParameters` + */ + public CreateDomainRequestParameters getCreateDomainRequestParameters() throws ClassCastException { + return (CreateDomainRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateRoleRequestParameters`. If the actual instance is not `CreateRoleRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CreateRoleRequestParameters` + * @throws ClassCastException if the instance is not `CreateRoleRequestParameters` + */ + public CreateRoleRequestParameters getCreateRoleRequestParameters() throws ClassCastException { + return (CreateRoleRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `DetachRoleRequestParameters`. If the actual instance is not `DetachRoleRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DetachRoleRequestParameters` + * @throws ClassCastException if the instance is not `DetachRoleRequestParameters` + */ + public DetachRoleRequestParameters getDetachRoleRequestParameters() throws ClassCastException { + return (DetachRoleRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetAccountAssetTransactionsRequestParameters`. If the actual instance is not `GetAccountAssetTransactionsRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetAccountAssetTransactionsRequestParameters` + * @throws ClassCastException if the instance is not `GetAccountAssetTransactionsRequestParameters` + */ + public GetAccountAssetTransactionsRequestParameters getGetAccountAssetTransactionsRequestParameters() throws ClassCastException { + return (GetAccountAssetTransactionsRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetAccountAssetsRequestParameters`. If the actual instance is not `GetAccountAssetsRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetAccountAssetsRequestParameters` + * @throws ClassCastException if the instance is not `GetAccountAssetsRequestParameters` + */ + public GetAccountAssetsRequestParameters getGetAccountAssetsRequestParameters() throws ClassCastException { + return (GetAccountAssetsRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetAccountDetailRequestParameters`. If the actual instance is not `GetAccountDetailRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetAccountDetailRequestParameters` + * @throws ClassCastException if the instance is not `GetAccountDetailRequestParameters` + */ + public GetAccountDetailRequestParameters getGetAccountDetailRequestParameters() throws ClassCastException { + return (GetAccountDetailRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetAccountRequestParameters`. If the actual instance is not `GetAccountRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetAccountRequestParameters` + * @throws ClassCastException if the instance is not `GetAccountRequestParameters` + */ + public GetAccountRequestParameters getGetAccountRequestParameters() throws ClassCastException { + return (GetAccountRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetAccountTransactionsRequestParameters`. If the actual instance is not `GetAccountTransactionsRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetAccountTransactionsRequestParameters` + * @throws ClassCastException if the instance is not `GetAccountTransactionsRequestParameters` + */ + public GetAccountTransactionsRequestParameters getGetAccountTransactionsRequestParameters() throws ClassCastException { + return (GetAccountTransactionsRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetAssetInfoRequestParameters`. If the actual instance is not `GetAssetInfoRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetAssetInfoRequestParameters` + * @throws ClassCastException if the instance is not `GetAssetInfoRequestParameters` + */ + public GetAssetInfoRequestParameters getGetAssetInfoRequestParameters() throws ClassCastException { + return (GetAssetInfoRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetBlockRequestParameters`. If the actual instance is not `GetBlockRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetBlockRequestParameters` + * @throws ClassCastException if the instance is not `GetBlockRequestParameters` + */ + public GetBlockRequestParameters getGetBlockRequestParameters() throws ClassCastException { + return (GetBlockRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetEngineReceiptsRequestParameters`. If the actual instance is not `GetEngineReceiptsRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetEngineReceiptsRequestParameters` + * @throws ClassCastException if the instance is not `GetEngineReceiptsRequestParameters` + */ + public GetEngineReceiptsRequestParameters getGetEngineReceiptsRequestParameters() throws ClassCastException { + return (GetEngineReceiptsRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetPendingTransactionsRequestParameters`. If the actual instance is not `GetPendingTransactionsRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetPendingTransactionsRequestParameters` + * @throws ClassCastException if the instance is not `GetPendingTransactionsRequestParameters` + */ + public GetPendingTransactionsRequestParameters getGetPendingTransactionsRequestParameters() throws ClassCastException { + return (GetPendingTransactionsRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetRolePermissionsRequestParameters`. If the actual instance is not `GetRolePermissionsRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetRolePermissionsRequestParameters` + * @throws ClassCastException if the instance is not `GetRolePermissionsRequestParameters` + */ + public GetRolePermissionsRequestParameters getGetRolePermissionsRequestParameters() throws ClassCastException { + return (GetRolePermissionsRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetSignatoriesRequestParameters`. If the actual instance is not `GetSignatoriesRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetSignatoriesRequestParameters` + * @throws ClassCastException if the instance is not `GetSignatoriesRequestParameters` + */ + public GetSignatoriesRequestParameters getGetSignatoriesRequestParameters() throws ClassCastException { + return (GetSignatoriesRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GetTransactionsRequestParameters`. If the actual instance is not `GetTransactionsRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GetTransactionsRequestParameters` + * @throws ClassCastException if the instance is not `GetTransactionsRequestParameters` + */ + public GetTransactionsRequestParameters getGetTransactionsRequestParameters() throws ClassCastException { + return (GetTransactionsRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `GrantPermissionRequestParameters`. If the actual instance is not `GrantPermissionRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `GrantPermissionRequestParameters` + * @throws ClassCastException if the instance is not `GrantPermissionRequestParameters` + */ + public GrantPermissionRequestParameters getGrantPermissionRequestParameters() throws ClassCastException { + return (GrantPermissionRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `List`. If the actual instance is not `List`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List` + * @throws ClassCastException if the instance is not `List` + */ + public List getList() throws ClassCastException { + return (List)super.getActualInstance(); + } + + /** + * Get the actual instance of `RemovePeerRequestParameters`. If the actual instance is not `RemovePeerRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `RemovePeerRequestParameters` + * @throws ClassCastException if the instance is not `RemovePeerRequestParameters` + */ + public RemovePeerRequestParameters getRemovePeerRequestParameters() throws ClassCastException { + return (RemovePeerRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `RemoveSignatoryRequestParameters`. If the actual instance is not `RemoveSignatoryRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `RemoveSignatoryRequestParameters` + * @throws ClassCastException if the instance is not `RemoveSignatoryRequestParameters` + */ + public RemoveSignatoryRequestParameters getRemoveSignatoryRequestParameters() throws ClassCastException { + return (RemoveSignatoryRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `RevokePermissionRequestParameters`. If the actual instance is not `RevokePermissionRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `RevokePermissionRequestParameters` + * @throws ClassCastException if the instance is not `RevokePermissionRequestParameters` + */ + public RevokePermissionRequestParameters getRevokePermissionRequestParameters() throws ClassCastException { + return (RevokePermissionRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `SetAccountDetailRequestParameters`. If the actual instance is not `SetAccountDetailRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SetAccountDetailRequestParameters` + * @throws ClassCastException if the instance is not `SetAccountDetailRequestParameters` + */ + public SetAccountDetailRequestParameters getSetAccountDetailRequestParameters() throws ClassCastException { + return (SetAccountDetailRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `SetAccountQuorumRequestParameters`. If the actual instance is not `SetAccountQuorumRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SetAccountQuorumRequestParameters` + * @throws ClassCastException if the instance is not `SetAccountQuorumRequestParameters` + */ + public SetAccountQuorumRequestParameters getSetAccountQuorumRequestParameters() throws ClassCastException { + return (SetAccountQuorumRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `SubtractAssetQuantityRequestParameters`. If the actual instance is not `SubtractAssetQuantityRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SubtractAssetQuantityRequestParameters` + * @throws ClassCastException if the instance is not `SubtractAssetQuantityRequestParameters` + */ + public SubtractAssetQuantityRequestParameters getSubtractAssetQuantityRequestParameters() throws ClassCastException { + return (SubtractAssetQuantityRequestParameters)super.getActualInstance(); + } + + /** + * Get the actual instance of `TransferAssetRequestParameters`. If the actual instance is not `TransferAssetRequestParameters`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `TransferAssetRequestParameters` + * @throws ClassCastException if the instance is not `TransferAssetRequestParameters` + */ + public TransferAssetRequestParameters getTransferAssetRequestParameters() throws ClassCastException { + return (TransferAssetRequestParameters)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionRequestV1Params + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with AddAssetQuantityRequestParameters + try { + AddAssetQuantityRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AddAssetQuantityRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with AddPeerRequestParameters + try { + AddPeerRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AddPeerRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with AddSignatoryRequestParameters + try { + AddSignatoryRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AddSignatoryRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with AppendRoleRequestParameters + try { + AppendRoleRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AppendRoleRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CallEngineRequestParameters + try { + CallEngineRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CallEngineRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CompareAndSetAccountDetailRequestParameters + try { + CompareAndSetAccountDetailRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CompareAndSetAccountDetailRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CreateAccountRequestParameters + try { + CreateAccountRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CreateAccountRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CreateAssetRequestParameters + try { + CreateAssetRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CreateAssetRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CreateDomainRequestParameters + try { + CreateDomainRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CreateDomainRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CreateRoleRequestParameters + try { + CreateRoleRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CreateRoleRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with DetachRoleRequestParameters + try { + DetachRoleRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for DetachRoleRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetAccountAssetTransactionsRequestParameters + try { + GetAccountAssetTransactionsRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetAccountAssetTransactionsRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetAccountAssetsRequestParameters + try { + GetAccountAssetsRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetAccountAssetsRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetAccountDetailRequestParameters + try { + GetAccountDetailRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetAccountDetailRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetAccountRequestParameters + try { + GetAccountRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetAccountRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetAccountTransactionsRequestParameters + try { + GetAccountTransactionsRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetAccountTransactionsRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetAssetInfoRequestParameters + try { + GetAssetInfoRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetAssetInfoRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetBlockRequestParameters + try { + GetBlockRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetBlockRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetEngineReceiptsRequestParameters + try { + GetEngineReceiptsRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetEngineReceiptsRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetPendingTransactionsRequestParameters + try { + GetPendingTransactionsRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetPendingTransactionsRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetRolePermissionsRequestParameters + try { + GetRolePermissionsRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetRolePermissionsRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetSignatoriesRequestParameters + try { + GetSignatoriesRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetSignatoriesRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GetTransactionsRequestParameters + try { + GetTransactionsRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GetTransactionsRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with GrantPermissionRequestParameters + try { + GrantPermissionRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for GrantPermissionRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with List + try { + List.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with RemovePeerRequestParameters + try { + RemovePeerRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for RemovePeerRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with RemoveSignatoryRequestParameters + try { + RemoveSignatoryRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for RemoveSignatoryRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with RevokePermissionRequestParameters + try { + RevokePermissionRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for RevokePermissionRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with SetAccountDetailRequestParameters + try { + SetAccountDetailRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SetAccountDetailRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with SetAccountQuorumRequestParameters + try { + SetAccountQuorumRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SetAccountQuorumRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with SubtractAssetQuantityRequestParameters + try { + SubtractAssetQuantityRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SubtractAssetQuantityRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with TransferAssetRequestParameters + try { + TransferAssetRequestParameters.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for TransferAssetRequestParameters failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for RunTransactionRequestV1Params with oneOf schemas: AddAssetQuantityRequestParameters, AddPeerRequestParameters, AddSignatoryRequestParameters, AppendRoleRequestParameters, CallEngineRequestParameters, CompareAndSetAccountDetailRequestParameters, CreateAccountRequestParameters, CreateAssetRequestParameters, CreateDomainRequestParameters, CreateRoleRequestParameters, DetachRoleRequestParameters, GetAccountAssetTransactionsRequestParameters, GetAccountAssetsRequestParameters, GetAccountDetailRequestParameters, GetAccountRequestParameters, GetAccountTransactionsRequestParameters, GetAssetInfoRequestParameters, GetBlockRequestParameters, GetEngineReceiptsRequestParameters, GetPendingTransactionsRequestParameters, GetRolePermissionsRequestParameters, GetSignatoriesRequestParameters, GetTransactionsRequestParameters, GrantPermissionRequestParameters, List, RemovePeerRequestParameters, RemoveSignatoryRequestParameters, RevokePermissionRequestParameters, SetAccountDetailRequestParameters, SetAccountQuorumRequestParameters, SubtractAssetQuantityRequestParameters, TransferAssetRequestParameters. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of RunTransactionRequestV1Params given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionRequestV1Params + * @throws IOException if the JSON string is invalid with respect to RunTransactionRequestV1Params + */ + public static RunTransactionRequestV1Params fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionRequestV1Params.class); + } + + /** + * Convert an instance of RunTransactionRequestV1Params to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java new file mode 100644 index 00000000000..1838315f21f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionResponse { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Object transactionReceipt = null; + + public RunTransactionResponse() { + } + + public RunTransactionResponse transactionReceipt(Object transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nullable + public Object getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Object transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionResponse runTransactionResponse = (RunTransactionResponse) o; + return Objects.equals(this.transactionReceipt, runTransactionResponse.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionResponse {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionResponse is not found in the empty JSON string", RunTransactionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionResponse + * @throws IOException if the JSON string is invalid with respect to RunTransactionResponse + */ + public static RunTransactionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionResponse.class); + } + + /** + * Convert an instance of RunTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionSignedRequestV1.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionSignedRequestV1.java new file mode 100644 index 00000000000..cf252af00b9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionSignedRequestV1.java @@ -0,0 +1,245 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaBaseConfig; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionSignedRequestV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionSignedRequestV1 { + public static final String SERIALIZED_NAME_SIGNED_TRANSACTION = "signedTransaction"; + @SerializedName(SERIALIZED_NAME_SIGNED_TRANSACTION) + private String signedTransaction; + + public static final String SERIALIZED_NAME_BASE_CONFIG = "baseConfig"; + @SerializedName(SERIALIZED_NAME_BASE_CONFIG) + private IrohaBaseConfig baseConfig; + + public RunTransactionSignedRequestV1() { + } + + public RunTransactionSignedRequestV1 signedTransaction(String signedTransaction) { + + this.signedTransaction = signedTransaction; + return this; + } + + /** + * Signed transaction binary data received from generate-transaction endpoint. + * @return signedTransaction + **/ + @javax.annotation.Nonnull + public String getSignedTransaction() { + return signedTransaction; + } + + + public void setSignedTransaction(String signedTransaction) { + this.signedTransaction = signedTransaction; + } + + + public RunTransactionSignedRequestV1 baseConfig(IrohaBaseConfig baseConfig) { + + this.baseConfig = baseConfig; + return this; + } + + /** + * Get baseConfig + * @return baseConfig + **/ + @javax.annotation.Nullable + public IrohaBaseConfig getBaseConfig() { + return baseConfig; + } + + + public void setBaseConfig(IrohaBaseConfig baseConfig) { + this.baseConfig = baseConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionSignedRequestV1 runTransactionSignedRequestV1 = (RunTransactionSignedRequestV1) o; + return Objects.equals(this.signedTransaction, runTransactionSignedRequestV1.signedTransaction) && + Objects.equals(this.baseConfig, runTransactionSignedRequestV1.baseConfig); + } + + @Override + public int hashCode() { + return Objects.hash(signedTransaction, baseConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionSignedRequestV1 {\n"); + sb.append(" signedTransaction: ").append(toIndentedString(signedTransaction)).append("\n"); + sb.append(" baseConfig: ").append(toIndentedString(baseConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("signedTransaction"); + openapiFields.add("baseConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("signedTransaction"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionSignedRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionSignedRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionSignedRequestV1 is not found in the empty JSON string", RunTransactionSignedRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionSignedRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionSignedRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionSignedRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("signedTransaction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signedTransaction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signedTransaction").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionSignedRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionSignedRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionSignedRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionSignedRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionSignedRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionSignedRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionSignedRequestV1 + * @throws IOException if the JSON string is invalid with respect to RunTransactionSignedRequestV1 + */ + public static RunTransactionSignedRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionSignedRequestV1.class); + } + + /** + * Convert an instance of RunTransactionSignedRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetAccountDetailRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetAccountDetailRequestParameters.java new file mode 100644 index 00000000000..0ecc03e77aa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetAccountDetailRequestParameters.java @@ -0,0 +1,280 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Set Account Detail. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetAccountDetailRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public SetAccountDetailRequestParameters() { + } + + public SetAccountDetailRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public SetAccountDetailRequestParameters key(String key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + **/ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public SetAccountDetailRequestParameters value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetAccountDetailRequestParameters setAccountDetailRequestParameters = (SetAccountDetailRequestParameters) o; + return Objects.equals(this.accountId, setAccountDetailRequestParameters.accountId) && + Objects.equals(this.key, setAccountDetailRequestParameters.key) && + Objects.equals(this.value, setAccountDetailRequestParameters.value); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetAccountDetailRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetAccountDetailRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetAccountDetailRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetAccountDetailRequestParameters is not found in the empty JSON string", SetAccountDetailRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetAccountDetailRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetAccountDetailRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetAccountDetailRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetAccountDetailRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetAccountDetailRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetAccountDetailRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetAccountDetailRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetAccountDetailRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetAccountDetailRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetAccountDetailRequestParameters + * @throws IOException if the JSON string is invalid with respect to SetAccountDetailRequestParameters + */ + public static SetAccountDetailRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetAccountDetailRequestParameters.class); + } + + /** + * Convert an instance of SetAccountDetailRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetAccountQuorumRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetAccountQuorumRequestParameters.java new file mode 100644 index 00000000000..07a10ea1b27 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SetAccountQuorumRequestParameters.java @@ -0,0 +1,245 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Set Account Quorum. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SetAccountQuorumRequestParameters { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_QUORUM = "quorum"; + @SerializedName(SERIALIZED_NAME_QUORUM) + private Integer quorum; + + public SetAccountQuorumRequestParameters() { + } + + public SetAccountQuorumRequestParameters accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nonnull + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public SetAccountQuorumRequestParameters quorum(Integer quorum) { + + this.quorum = quorum; + return this; + } + + /** + * Get quorum + * @return quorum + **/ + @javax.annotation.Nonnull + public Integer getQuorum() { + return quorum; + } + + + public void setQuorum(Integer quorum) { + this.quorum = quorum; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetAccountQuorumRequestParameters setAccountQuorumRequestParameters = (SetAccountQuorumRequestParameters) o; + return Objects.equals(this.accountId, setAccountQuorumRequestParameters.accountId) && + Objects.equals(this.quorum, setAccountQuorumRequestParameters.quorum); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, quorum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetAccountQuorumRequestParameters {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" quorum: ").append(toIndentedString(quorum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountId"); + openapiFields.add("quorum"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountId"); + openapiRequiredFields.add("quorum"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SetAccountQuorumRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SetAccountQuorumRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetAccountQuorumRequestParameters is not found in the empty JSON string", SetAccountQuorumRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SetAccountQuorumRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SetAccountQuorumRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetAccountQuorumRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("accountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SetAccountQuorumRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetAccountQuorumRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetAccountQuorumRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SetAccountQuorumRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SetAccountQuorumRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetAccountQuorumRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetAccountQuorumRequestParameters + * @throws IOException if the JSON string is invalid with respect to SetAccountQuorumRequestParameters + */ + public static SetAccountQuorumRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetAccountQuorumRequestParameters.class); + } + + /** + * Convert an instance of SetAccountQuorumRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SubtractAssetQuantityRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SubtractAssetQuantityRequestParameters.java new file mode 100644 index 00000000000..1d3409f2037 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SubtractAssetQuantityRequestParameters.java @@ -0,0 +1,246 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Subtract Asset Quantity. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SubtractAssetQuantityRequestParameters { + public static final String SERIALIZED_NAME_ASSET_ID = "assetId"; + @SerializedName(SERIALIZED_NAME_ASSET_ID) + private String assetId; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private BigDecimal amount; + + public SubtractAssetQuantityRequestParameters() { + } + + public SubtractAssetQuantityRequestParameters assetId(String assetId) { + + this.assetId = assetId; + return this; + } + + /** + * Get assetId + * @return assetId + **/ + @javax.annotation.Nonnull + public String getAssetId() { + return assetId; + } + + + public void setAssetId(String assetId) { + this.assetId = assetId; + } + + + public SubtractAssetQuantityRequestParameters amount(BigDecimal amount) { + + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + **/ + @javax.annotation.Nonnull + public BigDecimal getAmount() { + return amount; + } + + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubtractAssetQuantityRequestParameters subtractAssetQuantityRequestParameters = (SubtractAssetQuantityRequestParameters) o; + return Objects.equals(this.assetId, subtractAssetQuantityRequestParameters.assetId) && + Objects.equals(this.amount, subtractAssetQuantityRequestParameters.amount); + } + + @Override + public int hashCode() { + return Objects.hash(assetId, amount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubtractAssetQuantityRequestParameters {\n"); + sb.append(" assetId: ").append(toIndentedString(assetId)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("assetId"); + openapiFields.add("amount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("assetId"); + openapiRequiredFields.add("amount"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SubtractAssetQuantityRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SubtractAssetQuantityRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SubtractAssetQuantityRequestParameters is not found in the empty JSON string", SubtractAssetQuantityRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SubtractAssetQuantityRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SubtractAssetQuantityRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SubtractAssetQuantityRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("assetId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubtractAssetQuantityRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubtractAssetQuantityRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubtractAssetQuantityRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubtractAssetQuantityRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubtractAssetQuantityRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubtractAssetQuantityRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubtractAssetQuantityRequestParameters + * @throws IOException if the JSON string is invalid with respect to SubtractAssetQuantityRequestParameters + */ + public static SubtractAssetQuantityRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubtractAssetQuantityRequestParameters.class); + } + + /** + * Convert an instance of SubtractAssetQuantityRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferAssetRequestParameters.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferAssetRequestParameters.java new file mode 100644 index 00000000000..0495346f263 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferAssetRequestParameters.java @@ -0,0 +1,342 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * The list of arguments to pass in to the transaction request to Transfer Asset. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransferAssetRequestParameters { + public static final String SERIALIZED_NAME_SRC_ACCOUNT_ID = "srcAccountId"; + @SerializedName(SERIALIZED_NAME_SRC_ACCOUNT_ID) + private String srcAccountId; + + public static final String SERIALIZED_NAME_DEST_ACCOUNT_ID = "destAccountId"; + @SerializedName(SERIALIZED_NAME_DEST_ACCOUNT_ID) + private String destAccountId; + + public static final String SERIALIZED_NAME_ASSET_ID = "assetId"; + @SerializedName(SERIALIZED_NAME_ASSET_ID) + private String assetId; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private BigDecimal amount; + + public TransferAssetRequestParameters() { + } + + public TransferAssetRequestParameters srcAccountId(String srcAccountId) { + + this.srcAccountId = srcAccountId; + return this; + } + + /** + * Get srcAccountId + * @return srcAccountId + **/ + @javax.annotation.Nonnull + public String getSrcAccountId() { + return srcAccountId; + } + + + public void setSrcAccountId(String srcAccountId) { + this.srcAccountId = srcAccountId; + } + + + public TransferAssetRequestParameters destAccountId(String destAccountId) { + + this.destAccountId = destAccountId; + return this; + } + + /** + * Get destAccountId + * @return destAccountId + **/ + @javax.annotation.Nonnull + public String getDestAccountId() { + return destAccountId; + } + + + public void setDestAccountId(String destAccountId) { + this.destAccountId = destAccountId; + } + + + public TransferAssetRequestParameters assetId(String assetId) { + + this.assetId = assetId; + return this; + } + + /** + * Get assetId + * @return assetId + **/ + @javax.annotation.Nonnull + public String getAssetId() { + return assetId; + } + + + public void setAssetId(String assetId) { + this.assetId = assetId; + } + + + public TransferAssetRequestParameters description(String description) { + + this.description = description; + return this; + } + + /** + * Get description + * @return description + **/ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public TransferAssetRequestParameters amount(BigDecimal amount) { + + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + **/ + @javax.annotation.Nonnull + public BigDecimal getAmount() { + return amount; + } + + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferAssetRequestParameters transferAssetRequestParameters = (TransferAssetRequestParameters) o; + return Objects.equals(this.srcAccountId, transferAssetRequestParameters.srcAccountId) && + Objects.equals(this.destAccountId, transferAssetRequestParameters.destAccountId) && + Objects.equals(this.assetId, transferAssetRequestParameters.assetId) && + Objects.equals(this.description, transferAssetRequestParameters.description) && + Objects.equals(this.amount, transferAssetRequestParameters.amount); + } + + @Override + public int hashCode() { + return Objects.hash(srcAccountId, destAccountId, assetId, description, amount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferAssetRequestParameters {\n"); + sb.append(" srcAccountId: ").append(toIndentedString(srcAccountId)).append("\n"); + sb.append(" destAccountId: ").append(toIndentedString(destAccountId)).append("\n"); + sb.append(" assetId: ").append(toIndentedString(assetId)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("srcAccountId"); + openapiFields.add("destAccountId"); + openapiFields.add("assetId"); + openapiFields.add("description"); + openapiFields.add("amount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("srcAccountId"); + openapiRequiredFields.add("destAccountId"); + openapiRequiredFields.add("assetId"); + openapiRequiredFields.add("description"); + openapiRequiredFields.add("amount"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferAssetRequestParameters + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransferAssetRequestParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferAssetRequestParameters is not found in the empty JSON string", TransferAssetRequestParameters.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferAssetRequestParameters.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransferAssetRequestParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransferAssetRequestParameters.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("srcAccountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `srcAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("srcAccountId").toString())); + } + if (!jsonObj.get("destAccountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `destAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destAccountId").toString())); + } + if (!jsonObj.get("assetId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetId").toString())); + } + if (!jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransferAssetRequestParameters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferAssetRequestParameters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferAssetRequestParameters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferAssetRequestParameters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferAssetRequestParameters read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferAssetRequestParameters given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferAssetRequestParameters + * @throws IOException if the JSON string is invalid with respect to TransferAssetRequestParameters + */ + public static TransferAssetRequestParameters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferAssetRequestParameters.class); + } + + /** + * Convert an instance of TransferAssetRequestParameters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java new file mode 100644 index 00000000000..03031b5739f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets WatchBlocksV1 + */ +@JsonAdapter(WatchBlocksV1.Adapter.class) +public enum WatchBlocksV1 { + + Subscribe("org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Subscribe"), + + Next("org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Next"), + + Unsubscribe("org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Unsubscribe"), + + Error("org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Error"), + + Complete("org.hyperledger.cactus.api.async.iroha.WatchBlocksV1.Complete"); + + private String value; + + WatchBlocksV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchBlocksV1 fromValue(String value) { + for (WatchBlocksV1 b : WatchBlocksV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchBlocksV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchBlocksV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchBlocksV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..0ca3bfcb28c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.ErrorExceptionJsonResponseV1; +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.GenerateTransactionRequestV1; +import org.openapitools.client.model.RunTransactionRequestV1Body; +import org.openapitools.client.model.RunTransactionResponse; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Generate transaction that can be signed locally. + * + * @throws ApiException if the Api call fails + */ + @Test + public void generateTransactionV1Test() throws ApiException { + GenerateTransactionRequestV1 generateTransactionRequestV1 = null; + String response = api.generateTransactionV1(generateTransactionRequestV1); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Executes a transaction on a Iroha ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void runTransactionV1Test() throws ApiException { + RunTransactionRequestV1Body runTransactionRequestV1Body = null; + RunTransactionResponse response = api.runTransactionV1(runTransactionRequestV1Body); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddAssetQuantityRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddAssetQuantityRequestParametersTest.java new file mode 100644 index 00000000000..0551151e28d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddAssetQuantityRequestParametersTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AddAssetQuantityRequestParameters + */ +public class AddAssetQuantityRequestParametersTest { + private final AddAssetQuantityRequestParameters model = new AddAssetQuantityRequestParameters(); + + /** + * Model tests for AddAssetQuantityRequestParameters + */ + @Test + public void testAddAssetQuantityRequestParameters() { + // TODO: test AddAssetQuantityRequestParameters + } + + /** + * Test the property 'assetId' + */ + @Test + public void assetIdTest() { + // TODO: test assetId + } + + /** + * Test the property 'amount' + */ + @Test + public void amountTest() { + // TODO: test amount + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddPeerRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddPeerRequestParametersTest.java new file mode 100644 index 00000000000..bd24ef7c0bc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddPeerRequestParametersTest.java @@ -0,0 +1,72 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AddPeerRequestParameters + */ +public class AddPeerRequestParametersTest { + private final AddPeerRequestParameters model = new AddPeerRequestParameters(); + + /** + * Model tests for AddPeerRequestParameters + */ + @Test + public void testAddPeerRequestParameters() { + // TODO: test AddPeerRequestParameters + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'peerKey' + */ + @Test + public void peerKeyTest() { + // TODO: test peerKey + } + + /** + * Test the property 'tlsCertificate' + */ + @Test + public void tlsCertificateTest() { + // TODO: test tlsCertificate + } + + /** + * Test the property 'syncingPeer' + */ + @Test + public void syncingPeerTest() { + // TODO: test syncingPeer + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddSignatoryRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddSignatoryRequestParametersTest.java new file mode 100644 index 00000000000..ed89c8d9cc9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AddSignatoryRequestParametersTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AddSignatoryRequestParameters + */ +public class AddSignatoryRequestParametersTest { + private final AddSignatoryRequestParameters model = new AddSignatoryRequestParameters(); + + /** + * Model tests for AddSignatoryRequestParameters + */ + @Test + public void testAddSignatoryRequestParameters() { + // TODO: test AddSignatoryRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'publicKey' + */ + @Test + public void publicKeyTest() { + // TODO: test publicKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AppendRoleRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AppendRoleRequestParametersTest.java new file mode 100644 index 00000000000..db76fd9a67c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AppendRoleRequestParametersTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AppendRoleRequestParameters + */ +public class AppendRoleRequestParametersTest { + private final AppendRoleRequestParameters model = new AppendRoleRequestParameters(); + + /** + * Model tests for AppendRoleRequestParameters + */ + @Test + public void testAppendRoleRequestParameters() { + // TODO: test AppendRoleRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'roleName' + */ + @Test + public void roleNameTest() { + // TODO: test roleName + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CallEngineRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CallEngineRequestParametersTest.java new file mode 100644 index 00000000000..1e428e20b62 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CallEngineRequestParametersTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CallEngineRequestParameters + */ +public class CallEngineRequestParametersTest { + private final CallEngineRequestParameters model = new CallEngineRequestParameters(); + + /** + * Model tests for CallEngineRequestParameters + */ + @Test + public void testCallEngineRequestParameters() { + // TODO: test CallEngineRequestParameters + } + + /** + * Test the property 'caller' + */ + @Test + public void callerTest() { + // TODO: test caller + } + + /** + * Test the property 'callee' + */ + @Test + public void calleeTest() { + // TODO: test callee + } + + /** + * Test the property 'input' + */ + @Test + public void inputTest() { + // TODO: test input + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParametersTest.java new file mode 100644 index 00000000000..397b6a5144c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CompareAndSetAccountDetailRequestParametersTest.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CompareAndSetAccountDetailRequestParameters + */ +public class CompareAndSetAccountDetailRequestParametersTest { + private final CompareAndSetAccountDetailRequestParameters model = new CompareAndSetAccountDetailRequestParameters(); + + /** + * Model tests for CompareAndSetAccountDetailRequestParameters + */ + @Test + public void testCompareAndSetAccountDetailRequestParameters() { + // TODO: test CompareAndSetAccountDetailRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'oldValue' + */ + @Test + public void oldValueTest() { + // TODO: test oldValue + } + + /** + * Test the property 'checkEmpty' + */ + @Test + public void checkEmptyTest() { + // TODO: test checkEmpty + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateAccountRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateAccountRequestParametersTest.java new file mode 100644 index 00000000000..93790314e90 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateAccountRequestParametersTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CreateAccountRequestParameters + */ +public class CreateAccountRequestParametersTest { + private final CreateAccountRequestParameters model = new CreateAccountRequestParameters(); + + /** + * Model tests for CreateAccountRequestParameters + */ + @Test + public void testCreateAccountRequestParameters() { + // TODO: test CreateAccountRequestParameters + } + + /** + * Test the property 'accountName' + */ + @Test + public void accountNameTest() { + // TODO: test accountName + } + + /** + * Test the property 'domainId' + */ + @Test + public void domainIdTest() { + // TODO: test domainId + } + + /** + * Test the property 'publicKey' + */ + @Test + public void publicKeyTest() { + // TODO: test publicKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateAssetRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateAssetRequestParametersTest.java new file mode 100644 index 00000000000..8a6901563d3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateAssetRequestParametersTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CreateAssetRequestParameters + */ +public class CreateAssetRequestParametersTest { + private final CreateAssetRequestParameters model = new CreateAssetRequestParameters(); + + /** + * Model tests for CreateAssetRequestParameters + */ + @Test + public void testCreateAssetRequestParameters() { + // TODO: test CreateAssetRequestParameters + } + + /** + * Test the property 'assetName' + */ + @Test + public void assetNameTest() { + // TODO: test assetName + } + + /** + * Test the property 'domainId' + */ + @Test + public void domainIdTest() { + // TODO: test domainId + } + + /** + * Test the property 'precision' + */ + @Test + public void precisionTest() { + // TODO: test precision + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateDomainRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateDomainRequestParametersTest.java new file mode 100644 index 00000000000..227a94e450b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateDomainRequestParametersTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CreateDomainRequestParameters + */ +public class CreateDomainRequestParametersTest { + private final CreateDomainRequestParameters model = new CreateDomainRequestParameters(); + + /** + * Model tests for CreateDomainRequestParameters + */ + @Test + public void testCreateDomainRequestParameters() { + // TODO: test CreateDomainRequestParameters + } + + /** + * Test the property 'domainId' + */ + @Test + public void domainIdTest() { + // TODO: test domainId + } + + /** + * Test the property 'defaultRole' + */ + @Test + public void defaultRoleTest() { + // TODO: test defaultRole + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateRoleRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateRoleRequestParametersTest.java new file mode 100644 index 00000000000..b3284e21ec9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CreateRoleRequestParametersTest.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CreateRoleRequestParameters + */ +public class CreateRoleRequestParametersTest { + private final CreateRoleRequestParameters model = new CreateRoleRequestParameters(); + + /** + * Model tests for CreateRoleRequestParameters + */ + @Test + public void testCreateRoleRequestParameters() { + // TODO: test CreateRoleRequestParameters + } + + /** + * Test the property 'roleName' + */ + @Test + public void roleNameTest() { + // TODO: test roleName + } + + /** + * Test the property 'permissionsList' + */ + @Test + public void permissionsListTest() { + // TODO: test permissionsList + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DetachRoleRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DetachRoleRequestParametersTest.java new file mode 100644 index 00000000000..fe3e8069df2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DetachRoleRequestParametersTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DetachRoleRequestParameters + */ +public class DetachRoleRequestParametersTest { + private final DetachRoleRequestParameters model = new DetachRoleRequestParameters(); + + /** + * Model tests for DetachRoleRequestParameters + */ + @Test + public void testDetachRoleRequestParameters() { + // TODO: test DetachRoleRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'roleName' + */ + @Test + public void roleNameTest() { + // TODO: test roleName + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1Test.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1Test.java new file mode 100644 index 00000000000..1c3d6570ce5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionJsonResponseV1Test.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ErrorExceptionJsonResponseV1 + */ +public class ErrorExceptionJsonResponseV1Test { + private final ErrorExceptionJsonResponseV1 model = new ErrorExceptionJsonResponseV1(); + + /** + * Model tests for ErrorExceptionJsonResponseV1 + */ + @Test + public void testErrorExceptionJsonResponseV1() { + // TODO: test ErrorExceptionJsonResponseV1 + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + + /** + * Test the property 'stack' + */ + @Test + public void stackTest() { + // TODO: test stack + } + + /** + * Test the property 'cause' + */ + @Test + public void causeTest() { + // TODO: test cause + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java new file mode 100644 index 00000000000..0f0a39fe11e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ErrorExceptionResponseV1 + */ +public class ErrorExceptionResponseV1Test { + private final ErrorExceptionResponseV1 model = new ErrorExceptionResponseV1(); + + /** + * Model tests for ErrorExceptionResponseV1 + */ + @Test + public void testErrorExceptionResponseV1() { + // TODO: test ErrorExceptionResponseV1 + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1Test.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1Test.java new file mode 100644 index 00000000000..ed4d5933ca6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1Test.java @@ -0,0 +1,74 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.client.model.IrohaCommand; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GenerateTransactionRequestV1 + */ +public class GenerateTransactionRequestV1Test { + private final GenerateTransactionRequestV1 model = new GenerateTransactionRequestV1(); + + /** + * Model tests for GenerateTransactionRequestV1 + */ + @Test + public void testGenerateTransactionRequestV1() { + // TODO: test GenerateTransactionRequestV1 + } + + /** + * Test the property 'commandName' + */ + @Test + public void commandNameTest() { + // TODO: test commandName + } + + /** + * Test the property 'commandParams' + */ + @Test + public void commandParamsTest() { + // TODO: test commandParams + } + + /** + * Test the property 'creatorAccountId' + */ + @Test + public void creatorAccountIdTest() { + // TODO: test creatorAccountId + } + + /** + * Test the property 'quorum' + */ + @Test + public void quorumTest() { + // TODO: test quorum + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParametersTest.java new file mode 100644 index 00000000000..736bc68e417 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountAssetTransactionsRequestParametersTest.java @@ -0,0 +1,72 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetAccountAssetTransactionsRequestParameters + */ +public class GetAccountAssetTransactionsRequestParametersTest { + private final GetAccountAssetTransactionsRequestParameters model = new GetAccountAssetTransactionsRequestParameters(); + + /** + * Model tests for GetAccountAssetTransactionsRequestParameters + */ + @Test + public void testGetAccountAssetTransactionsRequestParameters() { + // TODO: test GetAccountAssetTransactionsRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'assetId' + */ + @Test + public void assetIdTest() { + // TODO: test assetId + } + + /** + * Test the property 'pageSize' + */ + @Test + public void pageSizeTest() { + // TODO: test pageSize + } + + /** + * Test the property 'firstTxHash' + */ + @Test + public void firstTxHashTest() { + // TODO: test firstTxHash + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountAssetsRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountAssetsRequestParametersTest.java new file mode 100644 index 00000000000..d22d2e48a2f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountAssetsRequestParametersTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetAccountAssetsRequestParameters + */ +public class GetAccountAssetsRequestParametersTest { + private final GetAccountAssetsRequestParameters model = new GetAccountAssetsRequestParameters(); + + /** + * Model tests for GetAccountAssetsRequestParameters + */ + @Test + public void testGetAccountAssetsRequestParameters() { + // TODO: test GetAccountAssetsRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'pageSize' + */ + @Test + public void pageSizeTest() { + // TODO: test pageSize + } + + /** + * Test the property 'firstAssetId' + */ + @Test + public void firstAssetIdTest() { + // TODO: test firstAssetId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountDetailRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountDetailRequestParametersTest.java new file mode 100644 index 00000000000..dee852e2a25 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountDetailRequestParametersTest.java @@ -0,0 +1,88 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetAccountDetailRequestParameters + */ +public class GetAccountDetailRequestParametersTest { + private final GetAccountDetailRequestParameters model = new GetAccountDetailRequestParameters(); + + /** + * Model tests for GetAccountDetailRequestParameters + */ + @Test + public void testGetAccountDetailRequestParameters() { + // TODO: test GetAccountDetailRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'writer' + */ + @Test + public void writerTest() { + // TODO: test writer + } + + /** + * Test the property 'pageSize' + */ + @Test + public void pageSizeTest() { + // TODO: test pageSize + } + + /** + * Test the property 'paginationKey' + */ + @Test + public void paginationKeyTest() { + // TODO: test paginationKey + } + + /** + * Test the property 'paginationWriter' + */ + @Test + public void paginationWriterTest() { + // TODO: test paginationWriter + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountRequestParametersTest.java new file mode 100644 index 00000000000..35c7c535b7d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountRequestParametersTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetAccountRequestParameters + */ +public class GetAccountRequestParametersTest { + private final GetAccountRequestParameters model = new GetAccountRequestParameters(); + + /** + * Model tests for GetAccountRequestParameters + */ + @Test + public void testGetAccountRequestParameters() { + // TODO: test GetAccountRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountTransactionsRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountTransactionsRequestParametersTest.java new file mode 100644 index 00000000000..c371efd2069 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAccountTransactionsRequestParametersTest.java @@ -0,0 +1,96 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetAccountTransactionsRequestParameters + */ +public class GetAccountTransactionsRequestParametersTest { + private final GetAccountTransactionsRequestParameters model = new GetAccountTransactionsRequestParameters(); + + /** + * Model tests for GetAccountTransactionsRequestParameters + */ + @Test + public void testGetAccountTransactionsRequestParameters() { + // TODO: test GetAccountTransactionsRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'pageSize' + */ + @Test + public void pageSizeTest() { + // TODO: test pageSize + } + + /** + * Test the property 'firstTxHash' + */ + @Test + public void firstTxHashTest() { + // TODO: test firstTxHash + } + + /** + * Test the property 'firstTxTime' + */ + @Test + public void firstTxTimeTest() { + // TODO: test firstTxTime + } + + /** + * Test the property 'lastTxTime' + */ + @Test + public void lastTxTimeTest() { + // TODO: test lastTxTime + } + + /** + * Test the property 'firstTxHeight' + */ + @Test + public void firstTxHeightTest() { + // TODO: test firstTxHeight + } + + /** + * Test the property 'lastTxHeight' + */ + @Test + public void lastTxHeightTest() { + // TODO: test lastTxHeight + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAssetInfoRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAssetInfoRequestParametersTest.java new file mode 100644 index 00000000000..c05b385b332 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetAssetInfoRequestParametersTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetAssetInfoRequestParameters + */ +public class GetAssetInfoRequestParametersTest { + private final GetAssetInfoRequestParameters model = new GetAssetInfoRequestParameters(); + + /** + * Model tests for GetAssetInfoRequestParameters + */ + @Test + public void testGetAssetInfoRequestParameters() { + // TODO: test GetAssetInfoRequestParameters + } + + /** + * Test the property 'assetId' + */ + @Test + public void assetIdTest() { + // TODO: test assetId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestParametersTest.java new file mode 100644 index 00000000000..ab55de1865a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetBlockRequestParametersTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetBlockRequestParameters + */ +public class GetBlockRequestParametersTest { + private final GetBlockRequestParameters model = new GetBlockRequestParameters(); + + /** + * Model tests for GetBlockRequestParameters + */ + @Test + public void testGetBlockRequestParameters() { + // TODO: test GetBlockRequestParameters + } + + /** + * Test the property 'height' + */ + @Test + public void heightTest() { + // TODO: test height + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetEngineReceiptsRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetEngineReceiptsRequestParametersTest.java new file mode 100644 index 00000000000..ea2ab463cc1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetEngineReceiptsRequestParametersTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetEngineReceiptsRequestParameters + */ +public class GetEngineReceiptsRequestParametersTest { + private final GetEngineReceiptsRequestParameters model = new GetEngineReceiptsRequestParameters(); + + /** + * Model tests for GetEngineReceiptsRequestParameters + */ + @Test + public void testGetEngineReceiptsRequestParameters() { + // TODO: test GetEngineReceiptsRequestParameters + } + + /** + * Test the property 'txHash' + */ + @Test + public void txHashTest() { + // TODO: test txHash + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPendingTransactionsRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPendingTransactionsRequestParametersTest.java new file mode 100644 index 00000000000..92b7c99011e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetPendingTransactionsRequestParametersTest.java @@ -0,0 +1,72 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetPendingTransactionsRequestParameters + */ +public class GetPendingTransactionsRequestParametersTest { + private final GetPendingTransactionsRequestParameters model = new GetPendingTransactionsRequestParameters(); + + /** + * Model tests for GetPendingTransactionsRequestParameters + */ + @Test + public void testGetPendingTransactionsRequestParameters() { + // TODO: test GetPendingTransactionsRequestParameters + } + + /** + * Test the property 'pageSize' + */ + @Test + public void pageSizeTest() { + // TODO: test pageSize + } + + /** + * Test the property 'firstTxHash' + */ + @Test + public void firstTxHashTest() { + // TODO: test firstTxHash + } + + /** + * Test the property 'firstTxTime' + */ + @Test + public void firstTxTimeTest() { + // TODO: test firstTxTime + } + + /** + * Test the property 'lastTxTime' + */ + @Test + public void lastTxTimeTest() { + // TODO: test lastTxTime + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetRolePermissionsRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetRolePermissionsRequestParametersTest.java new file mode 100644 index 00000000000..61c945be700 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetRolePermissionsRequestParametersTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetRolePermissionsRequestParameters + */ +public class GetRolePermissionsRequestParametersTest { + private final GetRolePermissionsRequestParameters model = new GetRolePermissionsRequestParameters(); + + /** + * Model tests for GetRolePermissionsRequestParameters + */ + @Test + public void testGetRolePermissionsRequestParameters() { + // TODO: test GetRolePermissionsRequestParameters + } + + /** + * Test the property 'roleId' + */ + @Test + public void roleIdTest() { + // TODO: test roleId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSignatoriesRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSignatoriesRequestParametersTest.java new file mode 100644 index 00000000000..aafca2fcf05 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetSignatoriesRequestParametersTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetSignatoriesRequestParameters + */ +public class GetSignatoriesRequestParametersTest { + private final GetSignatoriesRequestParameters model = new GetSignatoriesRequestParameters(); + + /** + * Model tests for GetSignatoriesRequestParameters + */ + @Test + public void testGetSignatoriesRequestParameters() { + // TODO: test GetSignatoriesRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionsRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionsRequestParametersTest.java new file mode 100644 index 00000000000..5a93acffa51 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionsRequestParametersTest.java @@ -0,0 +1,50 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetTransactionsRequestParameters + */ +public class GetTransactionsRequestParametersTest { + private final GetTransactionsRequestParameters model = new GetTransactionsRequestParameters(); + + /** + * Model tests for GetTransactionsRequestParameters + */ + @Test + public void testGetTransactionsRequestParameters() { + // TODO: test GetTransactionsRequestParameters + } + + /** + * Test the property 'txHashesList' + */ + @Test + public void txHashesListTest() { + // TODO: test txHashesList + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GrantPermissionRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GrantPermissionRequestParametersTest.java new file mode 100644 index 00000000000..dcc5a989835 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GrantPermissionRequestParametersTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GrantPermissionRequestParameters + */ +public class GrantPermissionRequestParametersTest { + private final GrantPermissionRequestParameters model = new GrantPermissionRequestParameters(); + + /** + * Model tests for GrantPermissionRequestParameters + */ + @Test + public void testGrantPermissionRequestParameters() { + // TODO: test GrantPermissionRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'permission' + */ + @Test + public void permissionTest() { + // TODO: test permission + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBaseConfigTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBaseConfigTest.java new file mode 100644 index 00000000000..7f9d680e6fb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBaseConfigTest.java @@ -0,0 +1,108 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaBaseConfig + */ +public class IrohaBaseConfigTest { + private final IrohaBaseConfig model = new IrohaBaseConfig(); + + /** + * Model tests for IrohaBaseConfig + */ + @Test + public void testIrohaBaseConfig() { + // TODO: test IrohaBaseConfig + } + + /** + * Test the property 'irohaHost' + */ + @Test + public void irohaHostTest() { + // TODO: test irohaHost + } + + /** + * Test the property 'irohaPort' + */ + @Test + public void irohaPortTest() { + // TODO: test irohaPort + } + + /** + * Test the property 'creatorAccountId' + */ + @Test + public void creatorAccountIdTest() { + // TODO: test creatorAccountId + } + + /** + * Test the property 'privKey' + */ + @Test + public void privKeyTest() { + // TODO: test privKey + } + + /** + * Test the property 'quorum' + */ + @Test + public void quorumTest() { + // TODO: test quorum + } + + /** + * Test the property 'timeoutLimit' + */ + @Test + public void timeoutLimitTest() { + // TODO: test timeoutLimit + } + + /** + * Test the property 'tls' + */ + @Test + public void tlsTest() { + // TODO: test tls + } + + /** + * Test the property 'monitorMode' + */ + @Test + public void monitorModeTest() { + // TODO: test monitorMode + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockProgressTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockProgressTest.java new file mode 100644 index 00000000000..48f879cc067 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockProgressTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.IrohaBlockResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaBlockProgress + */ +public class IrohaBlockProgressTest { + private final IrohaBlockProgress model = new IrohaBlockProgress(); + + /** + * Model tests for IrohaBlockProgress + */ + @Test + public void testIrohaBlockProgress() { + // TODO: test IrohaBlockProgress + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockResponsePayloadTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockResponsePayloadTest.java new file mode 100644 index 00000000000..93e8a43587b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockResponsePayloadTest.java @@ -0,0 +1,91 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaBlockResponsePayload + */ +public class IrohaBlockResponsePayloadTest { + private final IrohaBlockResponsePayload model = new IrohaBlockResponsePayload(); + + /** + * Model tests for IrohaBlockResponsePayload + */ + @Test + public void testIrohaBlockResponsePayload() { + // TODO: test IrohaBlockResponsePayload + } + + /** + * Test the property 'transactionsList' + */ + @Test + public void transactionsListTest() { + // TODO: test transactionsList + } + + /** + * Test the property 'txNumber' + */ + @Test + public void txNumberTest() { + // TODO: test txNumber + } + + /** + * Test the property 'height' + */ + @Test + public void heightTest() { + // TODO: test height + } + + /** + * Test the property 'prevBlockHash' + */ + @Test + public void prevBlockHashTest() { + // TODO: test prevBlockHash + } + + /** + * Test the property 'createdTime' + */ + @Test + public void createdTimeTest() { + // TODO: test createdTime + } + + /** + * Test the property 'rejectedTransactionsHashesList' + */ + @Test + public void rejectedTransactionsHashesListTest() { + // TODO: test rejectedTransactionsHashesList + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockResponseTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockResponseTest.java new file mode 100644 index 00000000000..4f385baf320 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaBlockResponseTest.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.IrohaBlockResponsePayload; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaBlockResponse + */ +public class IrohaBlockResponseTest { + private final IrohaBlockResponse model = new IrohaBlockResponse(); + + /** + * Model tests for IrohaBlockResponse + */ + @Test + public void testIrohaBlockResponse() { + // TODO: test IrohaBlockResponse + } + + /** + * Test the property 'payload' + */ + @Test + public void payloadTest() { + // TODO: test payload + } + + /** + * Test the property 'signaturesList' + */ + @Test + public void signaturesListTest() { + // TODO: test signaturesList + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaCommandTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaCommandTest.java new file mode 100644 index 00000000000..85311a1a7a1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaCommandTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaCommand + */ +public class IrohaCommandTest { + /** + * Model tests for IrohaCommand + */ + @Test + public void testIrohaCommand() { + // TODO: test IrohaCommand + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryTest.java new file mode 100644 index 00000000000..4432814a1a3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaQuery + */ +public class IrohaQueryTest { + /** + * Model tests for IrohaQuery + */ + @Test + public void testIrohaQuery() { + // TODO: test IrohaQuery + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaSocketIOTransactV1Test.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaSocketIOTransactV1Test.java new file mode 100644 index 00000000000..2aa3dc08a41 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaSocketIOTransactV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaSocketIOTransactV1 + */ +public class IrohaSocketIOTransactV1Test { + /** + * Model tests for IrohaSocketIOTransactV1 + */ + @Test + public void testIrohaSocketIOTransactV1() { + // TODO: test IrohaSocketIOTransactV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/KeyPairTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/KeyPairTest.java new file mode 100644 index 00000000000..c210b234341 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/KeyPairTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for KeyPair + */ +public class KeyPairTest { + private final KeyPair model = new KeyPair(); + + /** + * Model tests for KeyPair + */ + @Test + public void testKeyPair() { + // TODO: test KeyPair + } + + /** + * Test the property 'publicKey' + */ + @Test + public void publicKeyTest() { + // TODO: test publicKey + } + + /** + * Test the property 'privateKey' + */ + @Test + public void privateKeyTest() { + // TODO: test privateKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RemovePeerRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RemovePeerRequestParametersTest.java new file mode 100644 index 00000000000..a8e75d9927f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RemovePeerRequestParametersTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RemovePeerRequestParameters + */ +public class RemovePeerRequestParametersTest { + private final RemovePeerRequestParameters model = new RemovePeerRequestParameters(); + + /** + * Model tests for RemovePeerRequestParameters + */ + @Test + public void testRemovePeerRequestParameters() { + // TODO: test RemovePeerRequestParameters + } + + /** + * Test the property 'publicKey' + */ + @Test + public void publicKeyTest() { + // TODO: test publicKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RemoveSignatoryRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RemoveSignatoryRequestParametersTest.java new file mode 100644 index 00000000000..582b4ce0f91 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RemoveSignatoryRequestParametersTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RemoveSignatoryRequestParameters + */ +public class RemoveSignatoryRequestParametersTest { + private final RemoveSignatoryRequestParameters model = new RemoveSignatoryRequestParameters(); + + /** + * Model tests for RemoveSignatoryRequestParameters + */ + @Test + public void testRemoveSignatoryRequestParameters() { + // TODO: test RemoveSignatoryRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'publicKey' + */ + @Test + public void publicKeyTest() { + // TODO: test publicKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RevokePermissionRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RevokePermissionRequestParametersTest.java new file mode 100644 index 00000000000..9ae144ef17e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RevokePermissionRequestParametersTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RevokePermissionRequestParameters + */ +public class RevokePermissionRequestParametersTest { + private final RevokePermissionRequestParameters model = new RevokePermissionRequestParameters(); + + /** + * Model tests for RevokePermissionRequestParameters + */ + @Test + public void testRevokePermissionRequestParameters() { + // TODO: test RevokePermissionRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'permission' + */ + @Test + public void permissionTest() { + // TODO: test permission + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1BodyTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1BodyTest.java new file mode 100644 index 00000000000..ea5242d426b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1BodyTest.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.IrohaBaseConfig; +import org.openapitools.client.model.RunTransactionRequestV1; +import org.openapitools.client.model.RunTransactionRequestV1Params; +import org.openapitools.client.model.RunTransactionSignedRequestV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionRequestV1Body + */ +public class RunTransactionRequestV1BodyTest { + private final RunTransactionRequestV1Body model = new RunTransactionRequestV1Body(); + + /** + * Model tests for RunTransactionRequestV1Body + */ + @Test + public void testRunTransactionRequestV1Body() { + // TODO: test RunTransactionRequestV1Body + } + + /** + * Test the property 'commandName' + */ + @Test + public void commandNameTest() { + // TODO: test commandName + } + + /** + * Test the property 'baseConfig' + */ + @Test + public void baseConfigTest() { + // TODO: test baseConfig + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'signedTransaction' + */ + @Test + public void signedTransactionTest() { + // TODO: test signedTransaction + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1ParamsTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1ParamsTest.java new file mode 100644 index 00000000000..da102a67d6b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1ParamsTest.java @@ -0,0 +1,402 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.AddAssetQuantityRequestParameters; +import org.openapitools.client.model.AddPeerRequestParameters; +import org.openapitools.client.model.AddSignatoryRequestParameters; +import org.openapitools.client.model.AppendRoleRequestParameters; +import org.openapitools.client.model.CallEngineRequestParameters; +import org.openapitools.client.model.CompareAndSetAccountDetailRequestParameters; +import org.openapitools.client.model.CreateAccountRequestParameters; +import org.openapitools.client.model.CreateAssetRequestParameters; +import org.openapitools.client.model.CreateDomainRequestParameters; +import org.openapitools.client.model.CreateRoleRequestParameters; +import org.openapitools.client.model.DetachRoleRequestParameters; +import org.openapitools.client.model.GetAccountAssetTransactionsRequestParameters; +import org.openapitools.client.model.GetAccountAssetsRequestParameters; +import org.openapitools.client.model.GetAccountDetailRequestParameters; +import org.openapitools.client.model.GetAccountRequestParameters; +import org.openapitools.client.model.GetAccountTransactionsRequestParameters; +import org.openapitools.client.model.GetAssetInfoRequestParameters; +import org.openapitools.client.model.GetBlockRequestParameters; +import org.openapitools.client.model.GetEngineReceiptsRequestParameters; +import org.openapitools.client.model.GetPendingTransactionsRequestParameters; +import org.openapitools.client.model.GetRolePermissionsRequestParameters; +import org.openapitools.client.model.GetSignatoriesRequestParameters; +import org.openapitools.client.model.GetTransactionsRequestParameters; +import org.openapitools.client.model.GrantPermissionRequestParameters; +import org.openapitools.client.model.RemovePeerRequestParameters; +import org.openapitools.client.model.RemoveSignatoryRequestParameters; +import org.openapitools.client.model.RevokePermissionRequestParameters; +import org.openapitools.client.model.SetAccountDetailRequestParameters; +import org.openapitools.client.model.SetAccountQuorumRequestParameters; +import org.openapitools.client.model.SubtractAssetQuantityRequestParameters; +import org.openapitools.client.model.TransferAssetRequestParameters; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionRequestV1Params + */ +public class RunTransactionRequestV1ParamsTest { + private final RunTransactionRequestV1Params model = new RunTransactionRequestV1Params(); + + /** + * Model tests for RunTransactionRequestV1Params + */ + @Test + public void testRunTransactionRequestV1Params() { + // TODO: test RunTransactionRequestV1Params + } + + /** + * Test the property 'assetId' + */ + @Test + public void assetIdTest() { + // TODO: test assetId + } + + /** + * Test the property 'amount' + */ + @Test + public void amountTest() { + // TODO: test amount + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'peerKey' + */ + @Test + public void peerKeyTest() { + // TODO: test peerKey + } + + /** + * Test the property 'tlsCertificate' + */ + @Test + public void tlsCertificateTest() { + // TODO: test tlsCertificate + } + + /** + * Test the property 'syncingPeer' + */ + @Test + public void syncingPeerTest() { + // TODO: test syncingPeer + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'publicKey' + */ + @Test + public void publicKeyTest() { + // TODO: test publicKey + } + + /** + * Test the property 'roleName' + */ + @Test + public void roleNameTest() { + // TODO: test roleName + } + + /** + * Test the property 'caller' + */ + @Test + public void callerTest() { + // TODO: test caller + } + + /** + * Test the property 'callee' + */ + @Test + public void calleeTest() { + // TODO: test callee + } + + /** + * Test the property 'input' + */ + @Test + public void inputTest() { + // TODO: test input + } + + /** + * Test the property 'accountName' + */ + @Test + public void accountNameTest() { + // TODO: test accountName + } + + /** + * Test the property 'domainId' + */ + @Test + public void domainIdTest() { + // TODO: test domainId + } + + /** + * Test the property 'assetName' + */ + @Test + public void assetNameTest() { + // TODO: test assetName + } + + /** + * Test the property 'precision' + */ + @Test + public void precisionTest() { + // TODO: test precision + } + + /** + * Test the property 'defaultRole' + */ + @Test + public void defaultRoleTest() { + // TODO: test defaultRole + } + + /** + * Test the property 'permissionsList' + */ + @Test + public void permissionsListTest() { + // TODO: test permissionsList + } + + /** + * Test the property 'permission' + */ + @Test + public void permissionTest() { + // TODO: test permission + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'quorum' + */ + @Test + public void quorumTest() { + // TODO: test quorum + } + + /** + * Test the property 'srcAccountId' + */ + @Test + public void srcAccountIdTest() { + // TODO: test srcAccountId + } + + /** + * Test the property 'destAccountId' + */ + @Test + public void destAccountIdTest() { + // TODO: test destAccountId + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'oldValue' + */ + @Test + public void oldValueTest() { + // TODO: test oldValue + } + + /** + * Test the property 'checkEmpty' + */ + @Test + public void checkEmptyTest() { + // TODO: test checkEmpty + } + + /** + * Test the property 'height' + */ + @Test + public void heightTest() { + // TODO: test height + } + + /** + * Test the property 'txHashesList' + */ + @Test + public void txHashesListTest() { + // TODO: test txHashesList + } + + /** + * Test the property 'pageSize' + */ + @Test + public void pageSizeTest() { + // TODO: test pageSize + } + + /** + * Test the property 'firstTxHash' + */ + @Test + public void firstTxHashTest() { + // TODO: test firstTxHash + } + + /** + * Test the property 'firstTxTime' + */ + @Test + public void firstTxTimeTest() { + // TODO: test firstTxTime + } + + /** + * Test the property 'lastTxTime' + */ + @Test + public void lastTxTimeTest() { + // TODO: test lastTxTime + } + + /** + * Test the property 'firstTxHeight' + */ + @Test + public void firstTxHeightTest() { + // TODO: test firstTxHeight + } + + /** + * Test the property 'lastTxHeight' + */ + @Test + public void lastTxHeightTest() { + // TODO: test lastTxHeight + } + + /** + * Test the property 'firstAssetId' + */ + @Test + public void firstAssetIdTest() { + // TODO: test firstAssetId + } + + /** + * Test the property 'writer' + */ + @Test + public void writerTest() { + // TODO: test writer + } + + /** + * Test the property 'paginationKey' + */ + @Test + public void paginationKeyTest() { + // TODO: test paginationKey + } + + /** + * Test the property 'paginationWriter' + */ + @Test + public void paginationWriterTest() { + // TODO: test paginationWriter + } + + /** + * Test the property 'roleId' + */ + @Test + public void roleIdTest() { + // TODO: test roleId + } + + /** + * Test the property 'txHash' + */ + @Test + public void txHashTest() { + // TODO: test txHash + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1Test.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1Test.java new file mode 100644 index 00000000000..c3cf8cc0c24 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestV1Test.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.IrohaBaseConfig; +import org.openapitools.client.model.RunTransactionRequestV1Params; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionRequestV1 + */ +public class RunTransactionRequestV1Test { + private final RunTransactionRequestV1 model = new RunTransactionRequestV1(); + + /** + * Model tests for RunTransactionRequestV1 + */ + @Test + public void testRunTransactionRequestV1() { + // TODO: test RunTransactionRequestV1 + } + + /** + * Test the property 'commandName' + */ + @Test + public void commandNameTest() { + // TODO: test commandName + } + + /** + * Test the property 'baseConfig' + */ + @Test + public void baseConfigTest() { + // TODO: test baseConfig + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java new file mode 100644 index 00000000000..c27155f5cbb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionResponse + */ +public class RunTransactionResponseTest { + private final RunTransactionResponse model = new RunTransactionResponse(); + + /** + * Model tests for RunTransactionResponse + */ + @Test + public void testRunTransactionResponse() { + // TODO: test RunTransactionResponse + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionSignedRequestV1Test.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionSignedRequestV1Test.java new file mode 100644 index 00000000000..2ce5782229f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionSignedRequestV1Test.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.IrohaBaseConfig; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionSignedRequestV1 + */ +public class RunTransactionSignedRequestV1Test { + private final RunTransactionSignedRequestV1 model = new RunTransactionSignedRequestV1(); + + /** + * Model tests for RunTransactionSignedRequestV1 + */ + @Test + public void testRunTransactionSignedRequestV1() { + // TODO: test RunTransactionSignedRequestV1 + } + + /** + * Test the property 'signedTransaction' + */ + @Test + public void signedTransactionTest() { + // TODO: test signedTransaction + } + + /** + * Test the property 'baseConfig' + */ + @Test + public void baseConfigTest() { + // TODO: test baseConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetAccountDetailRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetAccountDetailRequestParametersTest.java new file mode 100644 index 00000000000..6e021417bee --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetAccountDetailRequestParametersTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetAccountDetailRequestParameters + */ +public class SetAccountDetailRequestParametersTest { + private final SetAccountDetailRequestParameters model = new SetAccountDetailRequestParameters(); + + /** + * Model tests for SetAccountDetailRequestParameters + */ + @Test + public void testSetAccountDetailRequestParameters() { + // TODO: test SetAccountDetailRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetAccountQuorumRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetAccountQuorumRequestParametersTest.java new file mode 100644 index 00000000000..bad1bc49ae9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SetAccountQuorumRequestParametersTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SetAccountQuorumRequestParameters + */ +public class SetAccountQuorumRequestParametersTest { + private final SetAccountQuorumRequestParameters model = new SetAccountQuorumRequestParameters(); + + /** + * Model tests for SetAccountQuorumRequestParameters + */ + @Test + public void testSetAccountQuorumRequestParameters() { + // TODO: test SetAccountQuorumRequestParameters + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'quorum' + */ + @Test + public void quorumTest() { + // TODO: test quorum + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SubtractAssetQuantityRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SubtractAssetQuantityRequestParametersTest.java new file mode 100644 index 00000000000..5de394da3df --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SubtractAssetQuantityRequestParametersTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SubtractAssetQuantityRequestParameters + */ +public class SubtractAssetQuantityRequestParametersTest { + private final SubtractAssetQuantityRequestParameters model = new SubtractAssetQuantityRequestParameters(); + + /** + * Model tests for SubtractAssetQuantityRequestParameters + */ + @Test + public void testSubtractAssetQuantityRequestParameters() { + // TODO: test SubtractAssetQuantityRequestParameters + } + + /** + * Test the property 'assetId' + */ + @Test + public void assetIdTest() { + // TODO: test assetId + } + + /** + * Test the property 'amount' + */ + @Test + public void amountTest() { + // TODO: test amount + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferAssetRequestParametersTest.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferAssetRequestParametersTest.java new file mode 100644 index 00000000000..ac95c975517 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferAssetRequestParametersTest.java @@ -0,0 +1,81 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransferAssetRequestParameters + */ +public class TransferAssetRequestParametersTest { + private final TransferAssetRequestParameters model = new TransferAssetRequestParameters(); + + /** + * Model tests for TransferAssetRequestParameters + */ + @Test + public void testTransferAssetRequestParameters() { + // TODO: test TransferAssetRequestParameters + } + + /** + * Test the property 'srcAccountId' + */ + @Test + public void srcAccountIdTest() { + // TODO: test srcAccountId + } + + /** + * Test the property 'destAccountId' + */ + @Test + public void destAccountIdTest() { + // TODO: test destAccountId + } + + /** + * Test the property 'assetId' + */ + @Test + public void assetIdTest() { + // TODO: test assetId + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'amount' + */ + @Test + public void amountTest() { + // TODO: test amount + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java new file mode 100644 index 00000000000..27bba6e5edf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha + * Can perform basic tasks on a Iroha ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1 + */ +public class WatchBlocksV1Test { + /** + * Model tests for WatchBlocksV1 + */ + @Test + public void testWatchBlocksV1() { + // TODO: test WatchBlocksV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/package.json b/packages/cactus-plugin-ledger-connector-iroha2/package.json index 8e912dd7316..8f7b8b6e78b 100644 --- a/packages/cactus-plugin-ledger-connector-iroha2/package.json +++ b/packages/cactus-plugin-ledger-connector-iroha2/package.json @@ -43,7 +43,9 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", - "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore" + "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore" }, "dependencies": { "@hyperledger/cactus-common": "2.0.0-alpha.2", diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..985839e334c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,40 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_block_type_v1.go +model_error_exception_response_v1.go +model_generate_transaction_request_v1.go +model_generate_transaction_request_v1_request.go +model_iroha2_account_id.go +model_iroha2_base_config.go +model_iroha2_base_config_signing_credential.go +model_iroha2_base_config_torii.go +model_iroha2_key_json.go +model_iroha2_key_pair.go +model_iroha_instruction.go +model_iroha_instruction_request_v1.go +model_iroha_query.go +model_iroha_query_definition_v1.go +model_iroha_signed_query_definition_v1.go +model_iroha_transaction_definition_v1.go +model_iroha_transaction_definition_v1_instruction.go +model_iroha_transaction_parameters_v1.go +model_keychain_reference.go +model_query_request_v1.go +model_query_response_v1.go +model_transact_request_v1.go +model_transact_response_v1.go +model_transaction_status_v1.go +model_watch_blocks_binary_response_v1.go +model_watch_blocks_options_v1.go +model_watch_blocks_raw_response_v1.go +model_watch_blocks_response_v1.go +model_watch_blocks_v1.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..1a77910f3e4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,142 @@ +# Go API client for cactus-plugin-ledger-connector-iroha2 + +Can perform basic tasks on a Iroha V2 ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-iroha2 "github.com/hyperledger/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-iroha2.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-iroha2.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-iroha2.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-iroha2.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GenerateTransactionV1**](docs/DefaultApi.md#generatetransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/generate-transaction | Generate transaction that can be signed locally. +*DefaultApi* | [**QueryV1**](docs/DefaultApi.md#queryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/query | Executes a query on a Iroha V2 ledger and returns it's results. +*DefaultApi* | [**TransactV1**](docs/DefaultApi.md#transactv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/transact | Executes a transaction on a Iroha V2 ledger (by sending some instructions) + + +## Documentation For Models + + - [BlockTypeV1](docs/BlockTypeV1.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [GenerateTransactionRequestV1](docs/GenerateTransactionRequestV1.md) + - [GenerateTransactionRequestV1Request](docs/GenerateTransactionRequestV1Request.md) + - [Iroha2AccountId](docs/Iroha2AccountId.md) + - [Iroha2BaseConfig](docs/Iroha2BaseConfig.md) + - [Iroha2BaseConfigSigningCredential](docs/Iroha2BaseConfigSigningCredential.md) + - [Iroha2BaseConfigTorii](docs/Iroha2BaseConfigTorii.md) + - [Iroha2KeyJson](docs/Iroha2KeyJson.md) + - [Iroha2KeyPair](docs/Iroha2KeyPair.md) + - [IrohaInstruction](docs/IrohaInstruction.md) + - [IrohaInstructionRequestV1](docs/IrohaInstructionRequestV1.md) + - [IrohaQuery](docs/IrohaQuery.md) + - [IrohaQueryDefinitionV1](docs/IrohaQueryDefinitionV1.md) + - [IrohaSignedQueryDefinitionV1](docs/IrohaSignedQueryDefinitionV1.md) + - [IrohaTransactionDefinitionV1](docs/IrohaTransactionDefinitionV1.md) + - [IrohaTransactionDefinitionV1Instruction](docs/IrohaTransactionDefinitionV1Instruction.md) + - [IrohaTransactionParametersV1](docs/IrohaTransactionParametersV1.md) + - [KeychainReference](docs/KeychainReference.md) + - [QueryRequestV1](docs/QueryRequestV1.md) + - [QueryResponseV1](docs/QueryResponseV1.md) + - [TransactRequestV1](docs/TransactRequestV1.md) + - [TransactResponseV1](docs/TransactResponseV1.md) + - [TransactionStatusV1](docs/TransactionStatusV1.md) + - [WatchBlocksBinaryResponseV1](docs/WatchBlocksBinaryResponseV1.md) + - [WatchBlocksOptionsV1](docs/WatchBlocksOptionsV1.md) + - [WatchBlocksRawResponseV1](docs/WatchBlocksRawResponseV1.md) + - [WatchBlocksResponseV1](docs/WatchBlocksResponseV1.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..cd4e67dfb3c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,585 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Iroha V2 ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Iroha V2 + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/transact: + post: + operationId: TransactV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransactRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TransactResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error. + summary: Executes a transaction on a Iroha V2 ledger (by sending some instructions) + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/transact + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/generate-transaction: + post: + operationId: generateTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateTransactionRequestV1' + responses: + "200": + content: + text/plain: + schema: + type: string + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Generate transaction that can be signed locally. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/generate-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/query: + post: + operationId: QueryV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/QueryRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/QueryResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error. + summary: Executes a query on a Iroha V2 ledger and returns it's results. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/query +components: + schemas: + IrohaInstruction: + description: Command names that correspond to Iroha Special Instructions (https://hyperledger.github.io/iroha-2-docs/guide/advanced/isi.html) + enum: + - registerDomain + - registerAssetDefinition + - registerAsset + - mintAsset + - burnAsset + - transferAsset + - registerAccount + type: string + x-enum-descriptions: + - Register new domain + - Register new asset definition + - Register new asset + - Mint asset value + - Burn asset value + - Transfer asset between accounts + - Register new account + x-enum-varnames: + - RegisterDomain + - RegisterAssetDefinition + - RegisterAsset + - MintAsset + - BurnAsset + - TransferAsset + - RegisterAccount + IrohaQuery: + description: Command names that correspond to Iroha queries (https://hyperledger.github.io/iroha-2-docs/guide/advanced/queries.html) + enum: + - findAllDomains + - findDomainById + - findAssetDefinitionById + - findAllAssetsDefinitions + - findAssetById + - findAllAssets + - findAllPeers + - findAllBlocks + - findAccountById + - findAllAccounts + - findAllTransactions + - findTransactionByHash + type: string + x-enum-descriptions: + - Get list of all registered domains + - Get domain with specified ID + - Get asset definition with specified ID + - Get list of all registered asset definition + - Get asset with specified ID + - Get list of all registered assets + - Get list of all ledger peers + - Get list of all ledger blocks + - Get account with specified ID + - Get list of all registered accounts + - Get list of all transactions + - Get transaction with specified hash + x-enum-varnames: + - FindAllDomains + - FindDomainById + - FindAssetDefinitionById + - FindAllAssetsDefinitions + - FindAssetById + - FindAllAssets + - FindAllPeers + - FindAllBlocks + - FindAccountById + - FindAllAccounts + - FindAllTransactions + - FindTransactionByHash + WatchBlocksV1: + description: Websocket requests for monitoring new blocks. + enum: + - org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + BlockTypeV1: + description: Iroha V2 block response type. + enum: + - raw + - binary + type: string + x-enum-descriptions: + - Default JSON-encoded string full block data. + - Encoded format that must be decoded with Iroha SDK on client side before use + x-enum-varnames: + - Raw + - Binary + TransactionStatusV1: + description: Status of Iroha V2 transaction. + enum: + - submitted + - committed + - rejected + type: string + x-enum-descriptions: + - Transaction was submitted to the ledger - use other tools to check if it was + accepted and committed. + - Transaction was committed to the ledger. + - Transaction was rejected. + x-enum-varnames: + - Submitted + - Committed + - Rejected + WatchBlocksOptionsV1: + description: Options passed when subscribing to block monitoring. + properties: + type: + $ref: '#/components/schemas/BlockTypeV1' + startBlock: + description: Number of block to start monitoring from. + minLength: 1 + nullable: false + type: string + baseConfig: + $ref: '#/components/schemas/Iroha2BaseConfig' + type: object + WatchBlocksRawResponseV1: + description: Default JSON-encoded string full block data. + properties: + blockData: + nullable: false + type: string + required: + - blockData + type: object + WatchBlocksBinaryResponseV1: + description: Binary encoded response of block data. + properties: + binaryBlock: + nullable: false + type: string + required: + - binaryBlock + type: object + WatchBlocksResponseV1: + oneOf: + - $ref: '#/components/schemas/WatchBlocksRawResponseV1' + - $ref: '#/components/schemas/WatchBlocksBinaryResponseV1' + - $ref: '#/components/schemas/ErrorExceptionResponseV1' + Iroha2AccountId: + additionalProperties: false + description: Iroha V2 account ID. + example: + name: name + domainId: domainId + nullable: false + properties: + name: + nullable: false + type: string + domainId: + nullable: false + type: string + required: + - domainId + - name + type: object + Iroha2KeyJson: + additionalProperties: false + description: Private/Public key JSON containing payload and digest function. + nullable: false + properties: + digestFunction: + nullable: false + type: string + payload: + nullable: false + type: string + required: + - digestFunction + - payload + type: object + KeychainReference: + description: Reference to entry stored in Cactus keychain plugin. + properties: + keychainId: + description: Keychain plugin ID. + maxLength: 100 + minLength: 1 + nullable: false + type: string + keychainRef: + description: Key reference name. + maxLength: 100 + minLength: 1 + nullable: false + type: string + required: + - keychainId + - keychainRef + type: object + Iroha2KeyPair: + description: Pair of Iroha account private and public keys. + properties: + privateKey: + $ref: '#/components/schemas/Iroha2KeyJson' + publicKey: + nullable: false + type: string + required: + - privateKey + - publicKey + type: object + Iroha2BaseConfigTorii: + additionalProperties: false + description: Iroha V2 peer connection information. + example: + apiURL: apiURL + telemetryURL: telemetryURL + nullable: false + properties: + apiURL: + nullable: false + type: string + telemetryURL: + nullable: false + type: string + type: object + Iroha2BaseConfig: + additionalProperties: false + description: Iroha V2 connection configuration. + example: + torii: + apiURL: apiURL + telemetryURL: telemetryURL + accountId: + name: name + domainId: domainId + signingCredential: null + properties: + torii: + $ref: '#/components/schemas/Iroha2BaseConfigTorii' + accountId: + $ref: '#/components/schemas/Iroha2AccountId' + signingCredential: + $ref: '#/components/schemas/Iroha2BaseConfig_signingCredential' + required: + - torii + type: object + IrohaInstructionRequestV1: + additionalProperties: false + description: Single Iroha V2 instruction to be executed request. + properties: + name: + description: Iroha V2 instruction name. + nullable: false + type: IrohaInstruction + params: + description: The list of arguments to pass with specified instruction. + items: {} + type: array + required: + - name + - params + type: object + IrohaTransactionParametersV1: + additionalProperties: true + description: Iroha V2 transaction payload parameters + example: + creationTime: creationTime + ttl: ttl + nonce: 0.8008281904610115 + properties: + ttl: + description: BigInt time to live. + nullable: false + type: string + creationTime: + description: BigInt creation time + nullable: false + type: string + nonce: + description: Transaction nonce + nullable: false + type: number + type: object + IrohaTransactionDefinitionV1: + additionalProperties: false + description: Iroha V2 transaction definition + example: + instruction: null + params: + creationTime: creationTime + ttl: ttl + nonce: 0.8008281904610115 + properties: + instruction: + $ref: '#/components/schemas/IrohaTransactionDefinitionV1_instruction' + params: + $ref: '#/components/schemas/IrohaTransactionParametersV1' + required: + - instruction + type: object + IrohaQueryDefinitionV1: + additionalProperties: false + description: Iroha V2 query definition. + example: + query: "" + params: + - "" + - "" + properties: + query: + description: Name of the query to be executed. + nullable: false + type: IrohaQuery + params: + description: The list of arguments to pass with the query. + items: {} + type: array + required: + - query + type: object + IrohaSignedQueryDefinitionV1: + additionalProperties: false + description: Iroha V2 signed query definition + example: + payload: payload + query: "" + properties: + query: + description: Name of the query to be executed. + nullable: false + type: IrohaQuery + payload: + description: Signed query transaction binary data received from generate-transaction + endpoint. + nullable: false + type: string + required: + - payload + - query + type: object + TransactRequestV1: + additionalProperties: false + description: Request to transact endpoint. + example: + waitForCommit: false + signedTransaction: signedTransaction + transaction: + instruction: null + params: + creationTime: creationTime + ttl: ttl + nonce: 0.8008281904610115 + baseConfig: + torii: + apiURL: apiURL + telemetryURL: telemetryURL + accountId: + name: name + domainId: domainId + signingCredential: null + properties: + signedTransaction: + description: Signed transaction binary data received from generate-transaction + endpoint. + nullable: false + type: string + transaction: + $ref: '#/components/schemas/IrohaTransactionDefinitionV1' + waitForCommit: + default: false + description: Wait unitl transaction is sent and return the final status + (committed / rejected) + nullable: false + type: boolean + baseConfig: + $ref: '#/components/schemas/Iroha2BaseConfig' + type: object + TransactResponseV1: + description: Response from transaction endpoint with operation status. + example: + rejectReason: rejectReason + hash: hash + status: null + properties: + hash: + description: Hexadecimal hash of the transaction sent to the ledger. + nullable: false + type: string + status: + $ref: '#/components/schemas/TransactionStatusV1' + rejectReason: + description: "When waitForCommit was suplied and the transaction was rejected,\ + \ contains the reason of the rejection." + nullable: false + type: string + required: + - hash + - status + type: object + QueryRequestV1: + additionalProperties: false + description: Request to query endpoint. + example: + query: + query: "" + params: + - "" + - "" + signedQuery: + payload: payload + query: "" + baseConfig: + torii: + apiURL: apiURL + telemetryURL: telemetryURL + accountId: + name: name + domainId: domainId + signingCredential: null + properties: + query: + $ref: '#/components/schemas/IrohaQueryDefinitionV1' + signedQuery: + $ref: '#/components/schemas/IrohaSignedQueryDefinitionV1' + baseConfig: + $ref: '#/components/schemas/Iroha2BaseConfig' + type: object + QueryResponseV1: + description: Response with the query results. + example: + response: "" + properties: + response: + description: Query response data that varies between different queries. + nullable: false + required: + - response + type: object + GenerateTransactionRequestV1: + additionalProperties: false + description: Request for generating transaction or query payload that can be + signed on the client side. + example: + request: null + baseConfig: + torii: + apiURL: apiURL + telemetryURL: telemetryURL + accountId: + name: name + domainId: domainId + signingCredential: null + properties: + request: + $ref: '#/components/schemas/GenerateTransactionRequestV1_request' + baseConfig: + $ref: '#/components/schemas/Iroha2BaseConfig' + required: + - request + type: object + ErrorExceptionResponseV1: + description: Error response from the connector. + properties: + message: + description: Short error description message. + nullable: false + type: string + error: + description: Detailed error information. + nullable: false + type: string + required: + - error + - message + type: object + Iroha2BaseConfig_signingCredential: + oneOf: + - $ref: '#/components/schemas/Iroha2KeyPair' + - $ref: '#/components/schemas/KeychainReference' + IrohaTransactionDefinitionV1_instruction: + oneOf: + - $ref: '#/components/schemas/IrohaInstructionRequestV1' + - items: + $ref: '#/components/schemas/IrohaInstructionRequestV1' + type: array + GenerateTransactionRequestV1_request: + oneOf: + - $ref: '#/components/schemas/IrohaTransactionDefinitionV1' + - $ref: '#/components/schemas/IrohaQueryDefinitionV1' diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..4c599015a74 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,368 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGenerateTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + generateTransactionRequestV1 *GenerateTransactionRequestV1 +} + +func (r ApiGenerateTransactionV1Request) GenerateTransactionRequestV1(generateTransactionRequestV1 GenerateTransactionRequestV1) ApiGenerateTransactionV1Request { + r.generateTransactionRequestV1 = &generateTransactionRequestV1 + return r +} + +func (r ApiGenerateTransactionV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GenerateTransactionV1Execute(r) +} + +/* +GenerateTransactionV1 Generate transaction that can be signed locally. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGenerateTransactionV1Request +*/ +func (a *DefaultApiService) GenerateTransactionV1(ctx context.Context) ApiGenerateTransactionV1Request { + return ApiGenerateTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GenerateTransactionV1Execute(r ApiGenerateTransactionV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GenerateTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/generate-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.generateTransactionRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiQueryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + queryRequestV1 *QueryRequestV1 +} + +func (r ApiQueryV1Request) QueryRequestV1(queryRequestV1 QueryRequestV1) ApiQueryV1Request { + r.queryRequestV1 = &queryRequestV1 + return r +} + +func (r ApiQueryV1Request) Execute() (*QueryResponseV1, *http.Response, error) { + return r.ApiService.QueryV1Execute(r) +} + +/* +QueryV1 Executes a query on a Iroha V2 ledger and returns it's results. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiQueryV1Request +*/ +func (a *DefaultApiService) QueryV1(ctx context.Context) ApiQueryV1Request { + return ApiQueryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return QueryResponseV1 +func (a *DefaultApiService) QueryV1Execute(r ApiQueryV1Request) (*QueryResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *QueryResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.QueryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/query" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.queryRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTransactV1Request struct { + ctx context.Context + ApiService *DefaultApiService + transactRequestV1 *TransactRequestV1 +} + +func (r ApiTransactV1Request) TransactRequestV1(transactRequestV1 TransactRequestV1) ApiTransactV1Request { + r.transactRequestV1 = &transactRequestV1 + return r +} + +func (r ApiTransactV1Request) Execute() (*TransactResponseV1, *http.Response, error) { + return r.ApiService.TransactV1Execute(r) +} + +/* +TransactV1 Executes a transaction on a Iroha V2 ledger (by sending some instructions) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTransactV1Request +*/ +func (a *DefaultApiService) TransactV1(ctx context.Context) ApiTransactV1Request { + return ApiTransactV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return TransactResponseV1 +func (a *DefaultApiService) TransactV1Execute(r ApiTransactV1Request) (*TransactResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TransactResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.TransactV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/transact" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.transactRequestV1 + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..feaeb4ab57d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Connector Iroha V2 API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..6e408b52870 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..2a2fe99e0e2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_block_type_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_block_type_v1.go new file mode 100644 index 00000000000..5ad1706ecd9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_block_type_v1.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// BlockTypeV1 Iroha V2 block response type. +type BlockTypeV1 string + +// List of BlockTypeV1 +const ( + Raw BlockTypeV1 = "raw" + Binary BlockTypeV1 = "binary" +) + +// All allowed values of BlockTypeV1 enum +var AllowedBlockTypeV1EnumValues = []BlockTypeV1{ + "raw", + "binary", +} + +func (v *BlockTypeV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BlockTypeV1(value) + for _, existing := range AllowedBlockTypeV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BlockTypeV1", value) +} + +// NewBlockTypeV1FromValue returns a pointer to a valid BlockTypeV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBlockTypeV1FromValue(v string) (*BlockTypeV1, error) { + ev := BlockTypeV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BlockTypeV1: valid values are %v", v, AllowedBlockTypeV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BlockTypeV1) IsValid() bool { + for _, existing := range AllowedBlockTypeV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to BlockTypeV1 value +func (v BlockTypeV1) Ptr() *BlockTypeV1 { + return &v +} + +type NullableBlockTypeV1 struct { + value *BlockTypeV1 + isSet bool +} + +func (v NullableBlockTypeV1) Get() *BlockTypeV1 { + return v.value +} + +func (v *NullableBlockTypeV1) Set(val *BlockTypeV1) { + v.value = val + v.isSet = true +} + +func (v NullableBlockTypeV1) IsSet() bool { + return v.isSet +} + +func (v *NullableBlockTypeV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBlockTypeV1(val *BlockTypeV1) *NullableBlockTypeV1 { + return &NullableBlockTypeV1{value: val, isSet: true} +} + +func (v NullableBlockTypeV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBlockTypeV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go new file mode 100644 index 00000000000..1c2eab38a39 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the ErrorExceptionResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorExceptionResponseV1{} + +// ErrorExceptionResponseV1 Error response from the connector. +type ErrorExceptionResponseV1 struct { + // Short error description message. + Message string `json:"message"` + // Detailed error information. + Error string `json:"error"` +} + +// NewErrorExceptionResponseV1 instantiates a new ErrorExceptionResponseV1 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 +// will change when the set of required properties is changed +func NewErrorExceptionResponseV1(message string, error_ string) *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + this.Message = message + this.Error = error_ + return &this +} + +// NewErrorExceptionResponseV1WithDefaults instantiates a new ErrorExceptionResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorExceptionResponseV1WithDefaults() *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + return &this +} + +// GetMessage returns the Message field value +func (o *ErrorExceptionResponseV1) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ErrorExceptionResponseV1) SetMessage(v string) { + o.Message = v +} + +// GetError returns the Error field value +func (o *ErrorExceptionResponseV1) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *ErrorExceptionResponseV1) SetError(v string) { + o.Error = v +} + +func (o ErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorExceptionResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + toSerialize["error"] = o.Error + return toSerialize, nil +} + +type NullableErrorExceptionResponseV1 struct { + value *ErrorExceptionResponseV1 + isSet bool +} + +func (v NullableErrorExceptionResponseV1) Get() *ErrorExceptionResponseV1 { + return v.value +} + +func (v *NullableErrorExceptionResponseV1) Set(val *ErrorExceptionResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableErrorExceptionResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorExceptionResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorExceptionResponseV1(val *ErrorExceptionResponseV1) *NullableErrorExceptionResponseV1 { + return &NullableErrorExceptionResponseV1{value: val, isSet: true} +} + +func (v NullableErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorExceptionResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1.go new file mode 100644 index 00000000000..f76d80a23a8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1.go @@ -0,0 +1,153 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the GenerateTransactionRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GenerateTransactionRequestV1{} + +// GenerateTransactionRequestV1 Request for generating transaction or query payload that can be signed on the client side. +type GenerateTransactionRequestV1 struct { + Request GenerateTransactionRequestV1Request `json:"request"` + BaseConfig *Iroha2BaseConfig `json:"baseConfig,omitempty"` +} + +// NewGenerateTransactionRequestV1 instantiates a new GenerateTransactionRequestV1 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 +// will change when the set of required properties is changed +func NewGenerateTransactionRequestV1(request GenerateTransactionRequestV1Request) *GenerateTransactionRequestV1 { + this := GenerateTransactionRequestV1{} + this.Request = request + return &this +} + +// NewGenerateTransactionRequestV1WithDefaults instantiates a new GenerateTransactionRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGenerateTransactionRequestV1WithDefaults() *GenerateTransactionRequestV1 { + this := GenerateTransactionRequestV1{} + return &this +} + +// GetRequest returns the Request field value +func (o *GenerateTransactionRequestV1) GetRequest() GenerateTransactionRequestV1Request { + if o == nil { + var ret GenerateTransactionRequestV1Request + return ret + } + + return o.Request +} + +// GetRequestOk returns a tuple with the Request field value +// and a boolean to check if the value has been set. +func (o *GenerateTransactionRequestV1) GetRequestOk() (*GenerateTransactionRequestV1Request, bool) { + if o == nil { + return nil, false + } + return &o.Request, true +} + +// SetRequest sets field value +func (o *GenerateTransactionRequestV1) SetRequest(v GenerateTransactionRequestV1Request) { + o.Request = v +} + +// GetBaseConfig returns the BaseConfig field value if set, zero value otherwise. +func (o *GenerateTransactionRequestV1) GetBaseConfig() Iroha2BaseConfig { + if o == nil || IsNil(o.BaseConfig) { + var ret Iroha2BaseConfig + return ret + } + return *o.BaseConfig +} + +// GetBaseConfigOk returns a tuple with the BaseConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenerateTransactionRequestV1) GetBaseConfigOk() (*Iroha2BaseConfig, bool) { + if o == nil || IsNil(o.BaseConfig) { + return nil, false + } + return o.BaseConfig, true +} + +// HasBaseConfig returns a boolean if a field has been set. +func (o *GenerateTransactionRequestV1) HasBaseConfig() bool { + if o != nil && !IsNil(o.BaseConfig) { + return true + } + + return false +} + +// SetBaseConfig gets a reference to the given Iroha2BaseConfig and assigns it to the BaseConfig field. +func (o *GenerateTransactionRequestV1) SetBaseConfig(v Iroha2BaseConfig) { + o.BaseConfig = &v +} + +func (o GenerateTransactionRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GenerateTransactionRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["request"] = o.Request + if !IsNil(o.BaseConfig) { + toSerialize["baseConfig"] = o.BaseConfig + } + return toSerialize, nil +} + +type NullableGenerateTransactionRequestV1 struct { + value *GenerateTransactionRequestV1 + isSet bool +} + +func (v NullableGenerateTransactionRequestV1) Get() *GenerateTransactionRequestV1 { + return v.value +} + +func (v *NullableGenerateTransactionRequestV1) Set(val *GenerateTransactionRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGenerateTransactionRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGenerateTransactionRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenerateTransactionRequestV1(val *GenerateTransactionRequestV1) *NullableGenerateTransactionRequestV1 { + return &NullableGenerateTransactionRequestV1{value: val, isSet: true} +} + +func (v NullableGenerateTransactionRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenerateTransactionRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1_request.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1_request.go new file mode 100644 index 00000000000..0c0f16a6424 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_generate_transaction_request_v1_request.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// GenerateTransactionRequestV1Request - struct for GenerateTransactionRequestV1Request +type GenerateTransactionRequestV1Request struct { + IrohaQueryDefinitionV1 *IrohaQueryDefinitionV1 + IrohaTransactionDefinitionV1 *IrohaTransactionDefinitionV1 +} + +// IrohaQueryDefinitionV1AsGenerateTransactionRequestV1Request is a convenience function that returns IrohaQueryDefinitionV1 wrapped in GenerateTransactionRequestV1Request +func IrohaQueryDefinitionV1AsGenerateTransactionRequestV1Request(v *IrohaQueryDefinitionV1) GenerateTransactionRequestV1Request { + return GenerateTransactionRequestV1Request{ + IrohaQueryDefinitionV1: v, + } +} + +// IrohaTransactionDefinitionV1AsGenerateTransactionRequestV1Request is a convenience function that returns IrohaTransactionDefinitionV1 wrapped in GenerateTransactionRequestV1Request +func IrohaTransactionDefinitionV1AsGenerateTransactionRequestV1Request(v *IrohaTransactionDefinitionV1) GenerateTransactionRequestV1Request { + return GenerateTransactionRequestV1Request{ + IrohaTransactionDefinitionV1: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *GenerateTransactionRequestV1Request) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into IrohaQueryDefinitionV1 + err = newStrictDecoder(data).Decode(&dst.IrohaQueryDefinitionV1) + if err == nil { + jsonIrohaQueryDefinitionV1, _ := json.Marshal(dst.IrohaQueryDefinitionV1) + if string(jsonIrohaQueryDefinitionV1) == "{}" { // empty struct + dst.IrohaQueryDefinitionV1 = nil + } else { + match++ + } + } else { + dst.IrohaQueryDefinitionV1 = nil + } + + // try to unmarshal data into IrohaTransactionDefinitionV1 + err = newStrictDecoder(data).Decode(&dst.IrohaTransactionDefinitionV1) + if err == nil { + jsonIrohaTransactionDefinitionV1, _ := json.Marshal(dst.IrohaTransactionDefinitionV1) + if string(jsonIrohaTransactionDefinitionV1) == "{}" { // empty struct + dst.IrohaTransactionDefinitionV1 = nil + } else { + match++ + } + } else { + dst.IrohaTransactionDefinitionV1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.IrohaQueryDefinitionV1 = nil + dst.IrohaTransactionDefinitionV1 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(GenerateTransactionRequestV1Request)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(GenerateTransactionRequestV1Request)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src GenerateTransactionRequestV1Request) MarshalJSON() ([]byte, error) { + if src.IrohaQueryDefinitionV1 != nil { + return json.Marshal(&src.IrohaQueryDefinitionV1) + } + + if src.IrohaTransactionDefinitionV1 != nil { + return json.Marshal(&src.IrohaTransactionDefinitionV1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *GenerateTransactionRequestV1Request) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.IrohaQueryDefinitionV1 != nil { + return obj.IrohaQueryDefinitionV1 + } + + if obj.IrohaTransactionDefinitionV1 != nil { + return obj.IrohaTransactionDefinitionV1 + } + + // all schemas are nil + return nil +} + +type NullableGenerateTransactionRequestV1Request struct { + value *GenerateTransactionRequestV1Request + isSet bool +} + +func (v NullableGenerateTransactionRequestV1Request) Get() *GenerateTransactionRequestV1Request { + return v.value +} + +func (v *NullableGenerateTransactionRequestV1Request) Set(val *GenerateTransactionRequestV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableGenerateTransactionRequestV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableGenerateTransactionRequestV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenerateTransactionRequestV1Request(val *GenerateTransactionRequestV1Request) *NullableGenerateTransactionRequestV1Request { + return &NullableGenerateTransactionRequestV1Request{value: val, isSet: true} +} + +func (v NullableGenerateTransactionRequestV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenerateTransactionRequestV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_account_id.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_account_id.go new file mode 100644 index 00000000000..871a94cd6e5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_account_id.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the Iroha2AccountId type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Iroha2AccountId{} + +// Iroha2AccountId Iroha V2 account ID. +type Iroha2AccountId struct { + Name string `json:"name"` + DomainId string `json:"domainId"` +} + +// NewIroha2AccountId instantiates a new Iroha2AccountId 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 +// will change when the set of required properties is changed +func NewIroha2AccountId(name string, domainId string) *Iroha2AccountId { + this := Iroha2AccountId{} + this.Name = name + this.DomainId = domainId + return &this +} + +// NewIroha2AccountIdWithDefaults instantiates a new Iroha2AccountId object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIroha2AccountIdWithDefaults() *Iroha2AccountId { + this := Iroha2AccountId{} + return &this +} + +// GetName returns the Name field value +func (o *Iroha2AccountId) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Iroha2AccountId) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Iroha2AccountId) SetName(v string) { + o.Name = v +} + +// GetDomainId returns the DomainId field value +func (o *Iroha2AccountId) GetDomainId() string { + if o == nil { + var ret string + return ret + } + + return o.DomainId +} + +// GetDomainIdOk returns a tuple with the DomainId field value +// and a boolean to check if the value has been set. +func (o *Iroha2AccountId) GetDomainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DomainId, true +} + +// SetDomainId sets field value +func (o *Iroha2AccountId) SetDomainId(v string) { + o.DomainId = v +} + +func (o Iroha2AccountId) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Iroha2AccountId) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["domainId"] = o.DomainId + return toSerialize, nil +} + +type NullableIroha2AccountId struct { + value *Iroha2AccountId + isSet bool +} + +func (v NullableIroha2AccountId) Get() *Iroha2AccountId { + return v.value +} + +func (v *NullableIroha2AccountId) Set(val *Iroha2AccountId) { + v.value = val + v.isSet = true +} + +func (v NullableIroha2AccountId) IsSet() bool { + return v.isSet +} + +func (v *NullableIroha2AccountId) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIroha2AccountId(val *Iroha2AccountId) *NullableIroha2AccountId { + return &NullableIroha2AccountId{value: val, isSet: true} +} + +func (v NullableIroha2AccountId) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIroha2AccountId) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config.go new file mode 100644 index 00000000000..638f79d92ba --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config.go @@ -0,0 +1,189 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the Iroha2BaseConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Iroha2BaseConfig{} + +// Iroha2BaseConfig Iroha V2 connection configuration. +type Iroha2BaseConfig struct { + Torii Iroha2BaseConfigTorii `json:"torii"` + AccountId *Iroha2AccountId `json:"accountId,omitempty"` + SigningCredential *Iroha2BaseConfigSigningCredential `json:"signingCredential,omitempty"` +} + +// NewIroha2BaseConfig instantiates a new Iroha2BaseConfig 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 +// will change when the set of required properties is changed +func NewIroha2BaseConfig(torii Iroha2BaseConfigTorii) *Iroha2BaseConfig { + this := Iroha2BaseConfig{} + this.Torii = torii + return &this +} + +// NewIroha2BaseConfigWithDefaults instantiates a new Iroha2BaseConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIroha2BaseConfigWithDefaults() *Iroha2BaseConfig { + this := Iroha2BaseConfig{} + return &this +} + +// GetTorii returns the Torii field value +func (o *Iroha2BaseConfig) GetTorii() Iroha2BaseConfigTorii { + if o == nil { + var ret Iroha2BaseConfigTorii + return ret + } + + return o.Torii +} + +// GetToriiOk returns a tuple with the Torii field value +// and a boolean to check if the value has been set. +func (o *Iroha2BaseConfig) GetToriiOk() (*Iroha2BaseConfigTorii, bool) { + if o == nil { + return nil, false + } + return &o.Torii, true +} + +// SetTorii sets field value +func (o *Iroha2BaseConfig) SetTorii(v Iroha2BaseConfigTorii) { + o.Torii = v +} + +// GetAccountId returns the AccountId field value if set, zero value otherwise. +func (o *Iroha2BaseConfig) GetAccountId() Iroha2AccountId { + if o == nil || IsNil(o.AccountId) { + var ret Iroha2AccountId + return ret + } + return *o.AccountId +} + +// GetAccountIdOk returns a tuple with the AccountId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Iroha2BaseConfig) GetAccountIdOk() (*Iroha2AccountId, bool) { + if o == nil || IsNil(o.AccountId) { + return nil, false + } + return o.AccountId, true +} + +// HasAccountId returns a boolean if a field has been set. +func (o *Iroha2BaseConfig) HasAccountId() bool { + if o != nil && !IsNil(o.AccountId) { + return true + } + + return false +} + +// SetAccountId gets a reference to the given Iroha2AccountId and assigns it to the AccountId field. +func (o *Iroha2BaseConfig) SetAccountId(v Iroha2AccountId) { + o.AccountId = &v +} + +// GetSigningCredential returns the SigningCredential field value if set, zero value otherwise. +func (o *Iroha2BaseConfig) GetSigningCredential() Iroha2BaseConfigSigningCredential { + if o == nil || IsNil(o.SigningCredential) { + var ret Iroha2BaseConfigSigningCredential + return ret + } + return *o.SigningCredential +} + +// GetSigningCredentialOk returns a tuple with the SigningCredential field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Iroha2BaseConfig) GetSigningCredentialOk() (*Iroha2BaseConfigSigningCredential, bool) { + if o == nil || IsNil(o.SigningCredential) { + return nil, false + } + return o.SigningCredential, true +} + +// HasSigningCredential returns a boolean if a field has been set. +func (o *Iroha2BaseConfig) HasSigningCredential() bool { + if o != nil && !IsNil(o.SigningCredential) { + return true + } + + return false +} + +// SetSigningCredential gets a reference to the given Iroha2BaseConfigSigningCredential and assigns it to the SigningCredential field. +func (o *Iroha2BaseConfig) SetSigningCredential(v Iroha2BaseConfigSigningCredential) { + o.SigningCredential = &v +} + +func (o Iroha2BaseConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Iroha2BaseConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["torii"] = o.Torii + if !IsNil(o.AccountId) { + toSerialize["accountId"] = o.AccountId + } + if !IsNil(o.SigningCredential) { + toSerialize["signingCredential"] = o.SigningCredential + } + return toSerialize, nil +} + +type NullableIroha2BaseConfig struct { + value *Iroha2BaseConfig + isSet bool +} + +func (v NullableIroha2BaseConfig) Get() *Iroha2BaseConfig { + return v.value +} + +func (v *NullableIroha2BaseConfig) Set(val *Iroha2BaseConfig) { + v.value = val + v.isSet = true +} + +func (v NullableIroha2BaseConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableIroha2BaseConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIroha2BaseConfig(val *Iroha2BaseConfig) *NullableIroha2BaseConfig { + return &NullableIroha2BaseConfig{value: val, isSet: true} +} + +func (v NullableIroha2BaseConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIroha2BaseConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config_signing_credential.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config_signing_credential.go new file mode 100644 index 00000000000..9967a35c8cb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config_signing_credential.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// Iroha2BaseConfigSigningCredential - struct for Iroha2BaseConfigSigningCredential +type Iroha2BaseConfigSigningCredential struct { + Iroha2KeyPair *Iroha2KeyPair + KeychainReference *KeychainReference +} + +// Iroha2KeyPairAsIroha2BaseConfigSigningCredential is a convenience function that returns Iroha2KeyPair wrapped in Iroha2BaseConfigSigningCredential +func Iroha2KeyPairAsIroha2BaseConfigSigningCredential(v *Iroha2KeyPair) Iroha2BaseConfigSigningCredential { + return Iroha2BaseConfigSigningCredential{ + Iroha2KeyPair: v, + } +} + +// KeychainReferenceAsIroha2BaseConfigSigningCredential is a convenience function that returns KeychainReference wrapped in Iroha2BaseConfigSigningCredential +func KeychainReferenceAsIroha2BaseConfigSigningCredential(v *KeychainReference) Iroha2BaseConfigSigningCredential { + return Iroha2BaseConfigSigningCredential{ + KeychainReference: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Iroha2BaseConfigSigningCredential) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Iroha2KeyPair + err = newStrictDecoder(data).Decode(&dst.Iroha2KeyPair) + if err == nil { + jsonIroha2KeyPair, _ := json.Marshal(dst.Iroha2KeyPair) + if string(jsonIroha2KeyPair) == "{}" { // empty struct + dst.Iroha2KeyPair = nil + } else { + match++ + } + } else { + dst.Iroha2KeyPair = nil + } + + // try to unmarshal data into KeychainReference + err = newStrictDecoder(data).Decode(&dst.KeychainReference) + if err == nil { + jsonKeychainReference, _ := json.Marshal(dst.KeychainReference) + if string(jsonKeychainReference) == "{}" { // empty struct + dst.KeychainReference = nil + } else { + match++ + } + } else { + dst.KeychainReference = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Iroha2KeyPair = nil + dst.KeychainReference = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Iroha2BaseConfigSigningCredential)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Iroha2BaseConfigSigningCredential)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Iroha2BaseConfigSigningCredential) MarshalJSON() ([]byte, error) { + if src.Iroha2KeyPair != nil { + return json.Marshal(&src.Iroha2KeyPair) + } + + if src.KeychainReference != nil { + return json.Marshal(&src.KeychainReference) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Iroha2BaseConfigSigningCredential) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Iroha2KeyPair != nil { + return obj.Iroha2KeyPair + } + + if obj.KeychainReference != nil { + return obj.KeychainReference + } + + // all schemas are nil + return nil +} + +type NullableIroha2BaseConfigSigningCredential struct { + value *Iroha2BaseConfigSigningCredential + isSet bool +} + +func (v NullableIroha2BaseConfigSigningCredential) Get() *Iroha2BaseConfigSigningCredential { + return v.value +} + +func (v *NullableIroha2BaseConfigSigningCredential) Set(val *Iroha2BaseConfigSigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableIroha2BaseConfigSigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableIroha2BaseConfigSigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIroha2BaseConfigSigningCredential(val *Iroha2BaseConfigSigningCredential) *NullableIroha2BaseConfigSigningCredential { + return &NullableIroha2BaseConfigSigningCredential{value: val, isSet: true} +} + +func (v NullableIroha2BaseConfigSigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIroha2BaseConfigSigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config_torii.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config_torii.go new file mode 100644 index 00000000000..98dcbb34330 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_base_config_torii.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the Iroha2BaseConfigTorii type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Iroha2BaseConfigTorii{} + +// Iroha2BaseConfigTorii Iroha V2 peer connection information. +type Iroha2BaseConfigTorii struct { + ApiURL *string `json:"apiURL,omitempty"` + TelemetryURL *string `json:"telemetryURL,omitempty"` +} + +// NewIroha2BaseConfigTorii instantiates a new Iroha2BaseConfigTorii 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 +// will change when the set of required properties is changed +func NewIroha2BaseConfigTorii() *Iroha2BaseConfigTorii { + this := Iroha2BaseConfigTorii{} + return &this +} + +// NewIroha2BaseConfigToriiWithDefaults instantiates a new Iroha2BaseConfigTorii object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIroha2BaseConfigToriiWithDefaults() *Iroha2BaseConfigTorii { + this := Iroha2BaseConfigTorii{} + return &this +} + +// GetApiURL returns the ApiURL field value if set, zero value otherwise. +func (o *Iroha2BaseConfigTorii) GetApiURL() string { + if o == nil || IsNil(o.ApiURL) { + var ret string + return ret + } + return *o.ApiURL +} + +// GetApiURLOk returns a tuple with the ApiURL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Iroha2BaseConfigTorii) GetApiURLOk() (*string, bool) { + if o == nil || IsNil(o.ApiURL) { + return nil, false + } + return o.ApiURL, true +} + +// HasApiURL returns a boolean if a field has been set. +func (o *Iroha2BaseConfigTorii) HasApiURL() bool { + if o != nil && !IsNil(o.ApiURL) { + return true + } + + return false +} + +// SetApiURL gets a reference to the given string and assigns it to the ApiURL field. +func (o *Iroha2BaseConfigTorii) SetApiURL(v string) { + o.ApiURL = &v +} + +// GetTelemetryURL returns the TelemetryURL field value if set, zero value otherwise. +func (o *Iroha2BaseConfigTorii) GetTelemetryURL() string { + if o == nil || IsNil(o.TelemetryURL) { + var ret string + return ret + } + return *o.TelemetryURL +} + +// GetTelemetryURLOk returns a tuple with the TelemetryURL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Iroha2BaseConfigTorii) GetTelemetryURLOk() (*string, bool) { + if o == nil || IsNil(o.TelemetryURL) { + return nil, false + } + return o.TelemetryURL, true +} + +// HasTelemetryURL returns a boolean if a field has been set. +func (o *Iroha2BaseConfigTorii) HasTelemetryURL() bool { + if o != nil && !IsNil(o.TelemetryURL) { + return true + } + + return false +} + +// SetTelemetryURL gets a reference to the given string and assigns it to the TelemetryURL field. +func (o *Iroha2BaseConfigTorii) SetTelemetryURL(v string) { + o.TelemetryURL = &v +} + +func (o Iroha2BaseConfigTorii) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Iroha2BaseConfigTorii) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ApiURL) { + toSerialize["apiURL"] = o.ApiURL + } + if !IsNil(o.TelemetryURL) { + toSerialize["telemetryURL"] = o.TelemetryURL + } + return toSerialize, nil +} + +type NullableIroha2BaseConfigTorii struct { + value *Iroha2BaseConfigTorii + isSet bool +} + +func (v NullableIroha2BaseConfigTorii) Get() *Iroha2BaseConfigTorii { + return v.value +} + +func (v *NullableIroha2BaseConfigTorii) Set(val *Iroha2BaseConfigTorii) { + v.value = val + v.isSet = true +} + +func (v NullableIroha2BaseConfigTorii) IsSet() bool { + return v.isSet +} + +func (v *NullableIroha2BaseConfigTorii) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIroha2BaseConfigTorii(val *Iroha2BaseConfigTorii) *NullableIroha2BaseConfigTorii { + return &NullableIroha2BaseConfigTorii{value: val, isSet: true} +} + +func (v NullableIroha2BaseConfigTorii) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIroha2BaseConfigTorii) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_key_json.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_key_json.go new file mode 100644 index 00000000000..695510712fe --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_key_json.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the Iroha2KeyJson type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Iroha2KeyJson{} + +// Iroha2KeyJson Private/Public key JSON containing payload and digest function. +type Iroha2KeyJson struct { + DigestFunction string `json:"digestFunction"` + Payload string `json:"payload"` +} + +// NewIroha2KeyJson instantiates a new Iroha2KeyJson 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 +// will change when the set of required properties is changed +func NewIroha2KeyJson(digestFunction string, payload string) *Iroha2KeyJson { + this := Iroha2KeyJson{} + this.DigestFunction = digestFunction + this.Payload = payload + return &this +} + +// NewIroha2KeyJsonWithDefaults instantiates a new Iroha2KeyJson object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIroha2KeyJsonWithDefaults() *Iroha2KeyJson { + this := Iroha2KeyJson{} + return &this +} + +// GetDigestFunction returns the DigestFunction field value +func (o *Iroha2KeyJson) GetDigestFunction() string { + if o == nil { + var ret string + return ret + } + + return o.DigestFunction +} + +// GetDigestFunctionOk returns a tuple with the DigestFunction field value +// and a boolean to check if the value has been set. +func (o *Iroha2KeyJson) GetDigestFunctionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DigestFunction, true +} + +// SetDigestFunction sets field value +func (o *Iroha2KeyJson) SetDigestFunction(v string) { + o.DigestFunction = v +} + +// GetPayload returns the Payload field value +func (o *Iroha2KeyJson) GetPayload() string { + if o == nil { + var ret string + return ret + } + + return o.Payload +} + +// GetPayloadOk returns a tuple with the Payload field value +// and a boolean to check if the value has been set. +func (o *Iroha2KeyJson) GetPayloadOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Payload, true +} + +// SetPayload sets field value +func (o *Iroha2KeyJson) SetPayload(v string) { + o.Payload = v +} + +func (o Iroha2KeyJson) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Iroha2KeyJson) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["digestFunction"] = o.DigestFunction + toSerialize["payload"] = o.Payload + return toSerialize, nil +} + +type NullableIroha2KeyJson struct { + value *Iroha2KeyJson + isSet bool +} + +func (v NullableIroha2KeyJson) Get() *Iroha2KeyJson { + return v.value +} + +func (v *NullableIroha2KeyJson) Set(val *Iroha2KeyJson) { + v.value = val + v.isSet = true +} + +func (v NullableIroha2KeyJson) IsSet() bool { + return v.isSet +} + +func (v *NullableIroha2KeyJson) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIroha2KeyJson(val *Iroha2KeyJson) *NullableIroha2KeyJson { + return &NullableIroha2KeyJson{value: val, isSet: true} +} + +func (v NullableIroha2KeyJson) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIroha2KeyJson) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_key_pair.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_key_pair.go new file mode 100644 index 00000000000..31b7dbc0d25 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha2_key_pair.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the Iroha2KeyPair type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Iroha2KeyPair{} + +// Iroha2KeyPair Pair of Iroha account private and public keys. +type Iroha2KeyPair struct { + PrivateKey Iroha2KeyJson `json:"privateKey"` + PublicKey string `json:"publicKey"` +} + +// NewIroha2KeyPair instantiates a new Iroha2KeyPair 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 +// will change when the set of required properties is changed +func NewIroha2KeyPair(privateKey Iroha2KeyJson, publicKey string) *Iroha2KeyPair { + this := Iroha2KeyPair{} + this.PrivateKey = privateKey + this.PublicKey = publicKey + return &this +} + +// NewIroha2KeyPairWithDefaults instantiates a new Iroha2KeyPair object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIroha2KeyPairWithDefaults() *Iroha2KeyPair { + this := Iroha2KeyPair{} + return &this +} + +// GetPrivateKey returns the PrivateKey field value +func (o *Iroha2KeyPair) GetPrivateKey() Iroha2KeyJson { + if o == nil { + var ret Iroha2KeyJson + return ret + } + + return o.PrivateKey +} + +// GetPrivateKeyOk returns a tuple with the PrivateKey field value +// and a boolean to check if the value has been set. +func (o *Iroha2KeyPair) GetPrivateKeyOk() (*Iroha2KeyJson, bool) { + if o == nil { + return nil, false + } + return &o.PrivateKey, true +} + +// SetPrivateKey sets field value +func (o *Iroha2KeyPair) SetPrivateKey(v Iroha2KeyJson) { + o.PrivateKey = v +} + +// GetPublicKey returns the PublicKey field value +func (o *Iroha2KeyPair) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *Iroha2KeyPair) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *Iroha2KeyPair) SetPublicKey(v string) { + o.PublicKey = v +} + +func (o Iroha2KeyPair) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Iroha2KeyPair) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["privateKey"] = o.PrivateKey + toSerialize["publicKey"] = o.PublicKey + return toSerialize, nil +} + +type NullableIroha2KeyPair struct { + value *Iroha2KeyPair + isSet bool +} + +func (v NullableIroha2KeyPair) Get() *Iroha2KeyPair { + return v.value +} + +func (v *NullableIroha2KeyPair) Set(val *Iroha2KeyPair) { + v.value = val + v.isSet = true +} + +func (v NullableIroha2KeyPair) IsSet() bool { + return v.isSet +} + +func (v *NullableIroha2KeyPair) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIroha2KeyPair(val *Iroha2KeyPair) *NullableIroha2KeyPair { + return &NullableIroha2KeyPair{value: val, isSet: true} +} + +func (v NullableIroha2KeyPair) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIroha2KeyPair) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_instruction.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_instruction.go new file mode 100644 index 00000000000..e59196c5c25 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_instruction.go @@ -0,0 +1,121 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// IrohaInstruction Command names that correspond to Iroha Special Instructions (https://hyperledger.github.io/iroha-2-docs/guide/advanced/isi.html) +type IrohaInstruction string + +// List of IrohaInstruction +const ( + RegisterDomain IrohaInstruction = "registerDomain" + RegisterAssetDefinition IrohaInstruction = "registerAssetDefinition" + RegisterAsset IrohaInstruction = "registerAsset" + MintAsset IrohaInstruction = "mintAsset" + BurnAsset IrohaInstruction = "burnAsset" + TransferAsset IrohaInstruction = "transferAsset" + RegisterAccount IrohaInstruction = "registerAccount" +) + +// All allowed values of IrohaInstruction enum +var AllowedIrohaInstructionEnumValues = []IrohaInstruction{ + "registerDomain", + "registerAssetDefinition", + "registerAsset", + "mintAsset", + "burnAsset", + "transferAsset", + "registerAccount", +} + +func (v *IrohaInstruction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IrohaInstruction(value) + for _, existing := range AllowedIrohaInstructionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IrohaInstruction", value) +} + +// NewIrohaInstructionFromValue returns a pointer to a valid IrohaInstruction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIrohaInstructionFromValue(v string) (*IrohaInstruction, error) { + ev := IrohaInstruction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IrohaInstruction: valid values are %v", v, AllowedIrohaInstructionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IrohaInstruction) IsValid() bool { + for _, existing := range AllowedIrohaInstructionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IrohaInstruction value +func (v IrohaInstruction) Ptr() *IrohaInstruction { + return &v +} + +type NullableIrohaInstruction struct { + value *IrohaInstruction + isSet bool +} + +func (v NullableIrohaInstruction) Get() *IrohaInstruction { + return v.value +} + +func (v *NullableIrohaInstruction) Set(val *IrohaInstruction) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaInstruction) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaInstruction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaInstruction(val *IrohaInstruction) *NullableIrohaInstruction { + return &NullableIrohaInstruction{value: val, isSet: true} +} + +func (v NullableIrohaInstruction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaInstruction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_instruction_request_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_instruction_request_v1.go new file mode 100644 index 00000000000..143d03a7750 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_instruction_request_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the IrohaInstructionRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaInstructionRequestV1{} + +// IrohaInstructionRequestV1 Single Iroha V2 instruction to be executed request. +type IrohaInstructionRequestV1 struct { + // Iroha V2 instruction name. + Name IrohaInstruction `json:"name"` + // The list of arguments to pass with specified instruction. + Params []interface{} `json:"params"` +} + +// NewIrohaInstructionRequestV1 instantiates a new IrohaInstructionRequestV1 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 +// will change when the set of required properties is changed +func NewIrohaInstructionRequestV1(name IrohaInstruction, params []interface{}) *IrohaInstructionRequestV1 { + this := IrohaInstructionRequestV1{} + this.Name = name + this.Params = params + return &this +} + +// NewIrohaInstructionRequestV1WithDefaults instantiates a new IrohaInstructionRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaInstructionRequestV1WithDefaults() *IrohaInstructionRequestV1 { + this := IrohaInstructionRequestV1{} + return &this +} + +// GetName returns the Name field value +func (o *IrohaInstructionRequestV1) GetName() IrohaInstruction { + if o == nil { + var ret IrohaInstruction + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *IrohaInstructionRequestV1) GetNameOk() (*IrohaInstruction, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *IrohaInstructionRequestV1) SetName(v IrohaInstruction) { + o.Name = v +} + +// GetParams returns the Params field value +func (o *IrohaInstructionRequestV1) GetParams() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *IrohaInstructionRequestV1) GetParamsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *IrohaInstructionRequestV1) SetParams(v []interface{}) { + o.Params = v +} + +func (o IrohaInstructionRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaInstructionRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["params"] = o.Params + return toSerialize, nil +} + +type NullableIrohaInstructionRequestV1 struct { + value *IrohaInstructionRequestV1 + isSet bool +} + +func (v NullableIrohaInstructionRequestV1) Get() *IrohaInstructionRequestV1 { + return v.value +} + +func (v *NullableIrohaInstructionRequestV1) Set(val *IrohaInstructionRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaInstructionRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaInstructionRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaInstructionRequestV1(val *IrohaInstructionRequestV1) *NullableIrohaInstructionRequestV1 { + return &NullableIrohaInstructionRequestV1{value: val, isSet: true} +} + +func (v NullableIrohaInstructionRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaInstructionRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_query.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_query.go new file mode 100644 index 00000000000..98f0985de0e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_query.go @@ -0,0 +1,131 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// IrohaQuery Command names that correspond to Iroha queries (https://hyperledger.github.io/iroha-2-docs/guide/advanced/queries.html) +type IrohaQuery string + +// List of IrohaQuery +const ( + FindAllDomains IrohaQuery = "findAllDomains" + FindDomainById IrohaQuery = "findDomainById" + FindAssetDefinitionById IrohaQuery = "findAssetDefinitionById" + FindAllAssetsDefinitions IrohaQuery = "findAllAssetsDefinitions" + FindAssetById IrohaQuery = "findAssetById" + FindAllAssets IrohaQuery = "findAllAssets" + FindAllPeers IrohaQuery = "findAllPeers" + FindAllBlocks IrohaQuery = "findAllBlocks" + FindAccountById IrohaQuery = "findAccountById" + FindAllAccounts IrohaQuery = "findAllAccounts" + FindAllTransactions IrohaQuery = "findAllTransactions" + FindTransactionByHash IrohaQuery = "findTransactionByHash" +) + +// All allowed values of IrohaQuery enum +var AllowedIrohaQueryEnumValues = []IrohaQuery{ + "findAllDomains", + "findDomainById", + "findAssetDefinitionById", + "findAllAssetsDefinitions", + "findAssetById", + "findAllAssets", + "findAllPeers", + "findAllBlocks", + "findAccountById", + "findAllAccounts", + "findAllTransactions", + "findTransactionByHash", +} + +func (v *IrohaQuery) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IrohaQuery(value) + for _, existing := range AllowedIrohaQueryEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IrohaQuery", value) +} + +// NewIrohaQueryFromValue returns a pointer to a valid IrohaQuery +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIrohaQueryFromValue(v string) (*IrohaQuery, error) { + ev := IrohaQuery(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IrohaQuery: valid values are %v", v, AllowedIrohaQueryEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IrohaQuery) IsValid() bool { + for _, existing := range AllowedIrohaQueryEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IrohaQuery value +func (v IrohaQuery) Ptr() *IrohaQuery { + return &v +} + +type NullableIrohaQuery struct { + value *IrohaQuery + isSet bool +} + +func (v NullableIrohaQuery) Get() *IrohaQuery { + return v.value +} + +func (v *NullableIrohaQuery) Set(val *IrohaQuery) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaQuery) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaQuery) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaQuery(val *IrohaQuery) *NullableIrohaQuery { + return &NullableIrohaQuery{value: val, isSet: true} +} + +func (v NullableIrohaQuery) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaQuery) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_query_definition_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_query_definition_v1.go new file mode 100644 index 00000000000..d34ef733589 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_query_definition_v1.go @@ -0,0 +1,155 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the IrohaQueryDefinitionV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaQueryDefinitionV1{} + +// IrohaQueryDefinitionV1 Iroha V2 query definition. +type IrohaQueryDefinitionV1 struct { + // Name of the query to be executed. + Query IrohaQuery `json:"query"` + // The list of arguments to pass with the query. + Params []interface{} `json:"params,omitempty"` +} + +// NewIrohaQueryDefinitionV1 instantiates a new IrohaQueryDefinitionV1 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 +// will change when the set of required properties is changed +func NewIrohaQueryDefinitionV1(query IrohaQuery) *IrohaQueryDefinitionV1 { + this := IrohaQueryDefinitionV1{} + this.Query = query + return &this +} + +// NewIrohaQueryDefinitionV1WithDefaults instantiates a new IrohaQueryDefinitionV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaQueryDefinitionV1WithDefaults() *IrohaQueryDefinitionV1 { + this := IrohaQueryDefinitionV1{} + return &this +} + +// GetQuery returns the Query field value +func (o *IrohaQueryDefinitionV1) GetQuery() IrohaQuery { + if o == nil { + var ret IrohaQuery + return ret + } + + return o.Query +} + +// GetQueryOk returns a tuple with the Query field value +// and a boolean to check if the value has been set. +func (o *IrohaQueryDefinitionV1) GetQueryOk() (*IrohaQuery, bool) { + if o == nil { + return nil, false + } + return &o.Query, true +} + +// SetQuery sets field value +func (o *IrohaQueryDefinitionV1) SetQuery(v IrohaQuery) { + o.Query = v +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *IrohaQueryDefinitionV1) GetParams() []interface{} { + if o == nil || IsNil(o.Params) { + var ret []interface{} + return ret + } + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaQueryDefinitionV1) GetParamsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Params) { + return nil, false + } + return o.Params, true +} + +// HasParams returns a boolean if a field has been set. +func (o *IrohaQueryDefinitionV1) HasParams() bool { + if o != nil && !IsNil(o.Params) { + return true + } + + return false +} + +// SetParams gets a reference to the given []interface{} and assigns it to the Params field. +func (o *IrohaQueryDefinitionV1) SetParams(v []interface{}) { + o.Params = v +} + +func (o IrohaQueryDefinitionV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaQueryDefinitionV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["query"] = o.Query + if !IsNil(o.Params) { + toSerialize["params"] = o.Params + } + return toSerialize, nil +} + +type NullableIrohaQueryDefinitionV1 struct { + value *IrohaQueryDefinitionV1 + isSet bool +} + +func (v NullableIrohaQueryDefinitionV1) Get() *IrohaQueryDefinitionV1 { + return v.value +} + +func (v *NullableIrohaQueryDefinitionV1) Set(val *IrohaQueryDefinitionV1) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaQueryDefinitionV1) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaQueryDefinitionV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaQueryDefinitionV1(val *IrohaQueryDefinitionV1) *NullableIrohaQueryDefinitionV1 { + return &NullableIrohaQueryDefinitionV1{value: val, isSet: true} +} + +func (v NullableIrohaQueryDefinitionV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaQueryDefinitionV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_signed_query_definition_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_signed_query_definition_v1.go new file mode 100644 index 00000000000..ccaafbebec8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_signed_query_definition_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the IrohaSignedQueryDefinitionV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaSignedQueryDefinitionV1{} + +// IrohaSignedQueryDefinitionV1 Iroha V2 signed query definition +type IrohaSignedQueryDefinitionV1 struct { + // Name of the query to be executed. + Query IrohaQuery `json:"query"` + // Signed query transaction binary data received from generate-transaction endpoint. + Payload string `json:"payload"` +} + +// NewIrohaSignedQueryDefinitionV1 instantiates a new IrohaSignedQueryDefinitionV1 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 +// will change when the set of required properties is changed +func NewIrohaSignedQueryDefinitionV1(query IrohaQuery, payload string) *IrohaSignedQueryDefinitionV1 { + this := IrohaSignedQueryDefinitionV1{} + this.Query = query + this.Payload = payload + return &this +} + +// NewIrohaSignedQueryDefinitionV1WithDefaults instantiates a new IrohaSignedQueryDefinitionV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaSignedQueryDefinitionV1WithDefaults() *IrohaSignedQueryDefinitionV1 { + this := IrohaSignedQueryDefinitionV1{} + return &this +} + +// GetQuery returns the Query field value +func (o *IrohaSignedQueryDefinitionV1) GetQuery() IrohaQuery { + if o == nil { + var ret IrohaQuery + return ret + } + + return o.Query +} + +// GetQueryOk returns a tuple with the Query field value +// and a boolean to check if the value has been set. +func (o *IrohaSignedQueryDefinitionV1) GetQueryOk() (*IrohaQuery, bool) { + if o == nil { + return nil, false + } + return &o.Query, true +} + +// SetQuery sets field value +func (o *IrohaSignedQueryDefinitionV1) SetQuery(v IrohaQuery) { + o.Query = v +} + +// GetPayload returns the Payload field value +func (o *IrohaSignedQueryDefinitionV1) GetPayload() string { + if o == nil { + var ret string + return ret + } + + return o.Payload +} + +// GetPayloadOk returns a tuple with the Payload field value +// and a boolean to check if the value has been set. +func (o *IrohaSignedQueryDefinitionV1) GetPayloadOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Payload, true +} + +// SetPayload sets field value +func (o *IrohaSignedQueryDefinitionV1) SetPayload(v string) { + o.Payload = v +} + +func (o IrohaSignedQueryDefinitionV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaSignedQueryDefinitionV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["query"] = o.Query + toSerialize["payload"] = o.Payload + return toSerialize, nil +} + +type NullableIrohaSignedQueryDefinitionV1 struct { + value *IrohaSignedQueryDefinitionV1 + isSet bool +} + +func (v NullableIrohaSignedQueryDefinitionV1) Get() *IrohaSignedQueryDefinitionV1 { + return v.value +} + +func (v *NullableIrohaSignedQueryDefinitionV1) Set(val *IrohaSignedQueryDefinitionV1) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaSignedQueryDefinitionV1) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaSignedQueryDefinitionV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaSignedQueryDefinitionV1(val *IrohaSignedQueryDefinitionV1) *NullableIrohaSignedQueryDefinitionV1 { + return &NullableIrohaSignedQueryDefinitionV1{value: val, isSet: true} +} + +func (v NullableIrohaSignedQueryDefinitionV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaSignedQueryDefinitionV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_definition_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_definition_v1.go new file mode 100644 index 00000000000..97f8e67ac2b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_definition_v1.go @@ -0,0 +1,153 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the IrohaTransactionDefinitionV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaTransactionDefinitionV1{} + +// IrohaTransactionDefinitionV1 Iroha V2 transaction definition +type IrohaTransactionDefinitionV1 struct { + Instruction IrohaTransactionDefinitionV1Instruction `json:"instruction"` + Params *IrohaTransactionParametersV1 `json:"params,omitempty"` +} + +// NewIrohaTransactionDefinitionV1 instantiates a new IrohaTransactionDefinitionV1 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 +// will change when the set of required properties is changed +func NewIrohaTransactionDefinitionV1(instruction IrohaTransactionDefinitionV1Instruction) *IrohaTransactionDefinitionV1 { + this := IrohaTransactionDefinitionV1{} + this.Instruction = instruction + return &this +} + +// NewIrohaTransactionDefinitionV1WithDefaults instantiates a new IrohaTransactionDefinitionV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaTransactionDefinitionV1WithDefaults() *IrohaTransactionDefinitionV1 { + this := IrohaTransactionDefinitionV1{} + return &this +} + +// GetInstruction returns the Instruction field value +func (o *IrohaTransactionDefinitionV1) GetInstruction() IrohaTransactionDefinitionV1Instruction { + if o == nil { + var ret IrohaTransactionDefinitionV1Instruction + return ret + } + + return o.Instruction +} + +// GetInstructionOk returns a tuple with the Instruction field value +// and a boolean to check if the value has been set. +func (o *IrohaTransactionDefinitionV1) GetInstructionOk() (*IrohaTransactionDefinitionV1Instruction, bool) { + if o == nil { + return nil, false + } + return &o.Instruction, true +} + +// SetInstruction sets field value +func (o *IrohaTransactionDefinitionV1) SetInstruction(v IrohaTransactionDefinitionV1Instruction) { + o.Instruction = v +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *IrohaTransactionDefinitionV1) GetParams() IrohaTransactionParametersV1 { + if o == nil || IsNil(o.Params) { + var ret IrohaTransactionParametersV1 + return ret + } + return *o.Params +} + +// GetParamsOk returns a tuple with the Params field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaTransactionDefinitionV1) GetParamsOk() (*IrohaTransactionParametersV1, bool) { + if o == nil || IsNil(o.Params) { + return nil, false + } + return o.Params, true +} + +// HasParams returns a boolean if a field has been set. +func (o *IrohaTransactionDefinitionV1) HasParams() bool { + if o != nil && !IsNil(o.Params) { + return true + } + + return false +} + +// SetParams gets a reference to the given IrohaTransactionParametersV1 and assigns it to the Params field. +func (o *IrohaTransactionDefinitionV1) SetParams(v IrohaTransactionParametersV1) { + o.Params = &v +} + +func (o IrohaTransactionDefinitionV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaTransactionDefinitionV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instruction"] = o.Instruction + if !IsNil(o.Params) { + toSerialize["params"] = o.Params + } + return toSerialize, nil +} + +type NullableIrohaTransactionDefinitionV1 struct { + value *IrohaTransactionDefinitionV1 + isSet bool +} + +func (v NullableIrohaTransactionDefinitionV1) Get() *IrohaTransactionDefinitionV1 { + return v.value +} + +func (v *NullableIrohaTransactionDefinitionV1) Set(val *IrohaTransactionDefinitionV1) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaTransactionDefinitionV1) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaTransactionDefinitionV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaTransactionDefinitionV1(val *IrohaTransactionDefinitionV1) *NullableIrohaTransactionDefinitionV1 { + return &NullableIrohaTransactionDefinitionV1{value: val, isSet: true} +} + +func (v NullableIrohaTransactionDefinitionV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaTransactionDefinitionV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_definition_v1_instruction.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_definition_v1_instruction.go new file mode 100644 index 00000000000..2242a4a2a41 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_definition_v1_instruction.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// IrohaTransactionDefinitionV1Instruction - struct for IrohaTransactionDefinitionV1Instruction +type IrohaTransactionDefinitionV1Instruction struct { + IrohaInstructionRequestV1 *IrohaInstructionRequestV1 + ArrayOfIrohaInstructionRequestV1 *[]IrohaInstructionRequestV1 +} + +// IrohaInstructionRequestV1AsIrohaTransactionDefinitionV1Instruction is a convenience function that returns IrohaInstructionRequestV1 wrapped in IrohaTransactionDefinitionV1Instruction +func IrohaInstructionRequestV1AsIrohaTransactionDefinitionV1Instruction(v *IrohaInstructionRequestV1) IrohaTransactionDefinitionV1Instruction { + return IrohaTransactionDefinitionV1Instruction{ + IrohaInstructionRequestV1: v, + } +} + +// []IrohaInstructionRequestV1AsIrohaTransactionDefinitionV1Instruction is a convenience function that returns []IrohaInstructionRequestV1 wrapped in IrohaTransactionDefinitionV1Instruction +func ArrayOfIrohaInstructionRequestV1AsIrohaTransactionDefinitionV1Instruction(v *[]IrohaInstructionRequestV1) IrohaTransactionDefinitionV1Instruction { + return IrohaTransactionDefinitionV1Instruction{ + ArrayOfIrohaInstructionRequestV1: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *IrohaTransactionDefinitionV1Instruction) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into IrohaInstructionRequestV1 + err = newStrictDecoder(data).Decode(&dst.IrohaInstructionRequestV1) + if err == nil { + jsonIrohaInstructionRequestV1, _ := json.Marshal(dst.IrohaInstructionRequestV1) + if string(jsonIrohaInstructionRequestV1) == "{}" { // empty struct + dst.IrohaInstructionRequestV1 = nil + } else { + match++ + } + } else { + dst.IrohaInstructionRequestV1 = nil + } + + // try to unmarshal data into ArrayOfIrohaInstructionRequestV1 + err = newStrictDecoder(data).Decode(&dst.ArrayOfIrohaInstructionRequestV1) + if err == nil { + jsonArrayOfIrohaInstructionRequestV1, _ := json.Marshal(dst.ArrayOfIrohaInstructionRequestV1) + if string(jsonArrayOfIrohaInstructionRequestV1) == "{}" { // empty struct + dst.ArrayOfIrohaInstructionRequestV1 = nil + } else { + match++ + } + } else { + dst.ArrayOfIrohaInstructionRequestV1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.IrohaInstructionRequestV1 = nil + dst.ArrayOfIrohaInstructionRequestV1 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(IrohaTransactionDefinitionV1Instruction)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(IrohaTransactionDefinitionV1Instruction)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src IrohaTransactionDefinitionV1Instruction) MarshalJSON() ([]byte, error) { + if src.IrohaInstructionRequestV1 != nil { + return json.Marshal(&src.IrohaInstructionRequestV1) + } + + if src.ArrayOfIrohaInstructionRequestV1 != nil { + return json.Marshal(&src.ArrayOfIrohaInstructionRequestV1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *IrohaTransactionDefinitionV1Instruction) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.IrohaInstructionRequestV1 != nil { + return obj.IrohaInstructionRequestV1 + } + + if obj.ArrayOfIrohaInstructionRequestV1 != nil { + return obj.ArrayOfIrohaInstructionRequestV1 + } + + // all schemas are nil + return nil +} + +type NullableIrohaTransactionDefinitionV1Instruction struct { + value *IrohaTransactionDefinitionV1Instruction + isSet bool +} + +func (v NullableIrohaTransactionDefinitionV1Instruction) Get() *IrohaTransactionDefinitionV1Instruction { + return v.value +} + +func (v *NullableIrohaTransactionDefinitionV1Instruction) Set(val *IrohaTransactionDefinitionV1Instruction) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaTransactionDefinitionV1Instruction) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaTransactionDefinitionV1Instruction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaTransactionDefinitionV1Instruction(val *IrohaTransactionDefinitionV1Instruction) *NullableIrohaTransactionDefinitionV1Instruction { + return &NullableIrohaTransactionDefinitionV1Instruction{value: val, isSet: true} +} + +func (v NullableIrohaTransactionDefinitionV1Instruction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaTransactionDefinitionV1Instruction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_parameters_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_parameters_v1.go new file mode 100644 index 00000000000..e69be44440e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_iroha_transaction_parameters_v1.go @@ -0,0 +1,228 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the IrohaTransactionParametersV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IrohaTransactionParametersV1{} + +// IrohaTransactionParametersV1 Iroha V2 transaction payload parameters +type IrohaTransactionParametersV1 struct { + // BigInt time to live. + Ttl *string `json:"ttl,omitempty"` + // BigInt creation time + CreationTime *string `json:"creationTime,omitempty"` + // Transaction nonce + Nonce *float32 `json:"nonce,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IrohaTransactionParametersV1 IrohaTransactionParametersV1 + +// NewIrohaTransactionParametersV1 instantiates a new IrohaTransactionParametersV1 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 +// will change when the set of required properties is changed +func NewIrohaTransactionParametersV1() *IrohaTransactionParametersV1 { + this := IrohaTransactionParametersV1{} + return &this +} + +// NewIrohaTransactionParametersV1WithDefaults instantiates a new IrohaTransactionParametersV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIrohaTransactionParametersV1WithDefaults() *IrohaTransactionParametersV1 { + this := IrohaTransactionParametersV1{} + return &this +} + +// GetTtl returns the Ttl field value if set, zero value otherwise. +func (o *IrohaTransactionParametersV1) GetTtl() string { + if o == nil || IsNil(o.Ttl) { + var ret string + return ret + } + return *o.Ttl +} + +// GetTtlOk returns a tuple with the Ttl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaTransactionParametersV1) GetTtlOk() (*string, bool) { + if o == nil || IsNil(o.Ttl) { + return nil, false + } + return o.Ttl, true +} + +// HasTtl returns a boolean if a field has been set. +func (o *IrohaTransactionParametersV1) HasTtl() bool { + if o != nil && !IsNil(o.Ttl) { + return true + } + + return false +} + +// SetTtl gets a reference to the given string and assigns it to the Ttl field. +func (o *IrohaTransactionParametersV1) SetTtl(v string) { + o.Ttl = &v +} + +// GetCreationTime returns the CreationTime field value if set, zero value otherwise. +func (o *IrohaTransactionParametersV1) GetCreationTime() string { + if o == nil || IsNil(o.CreationTime) { + var ret string + return ret + } + return *o.CreationTime +} + +// GetCreationTimeOk returns a tuple with the CreationTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaTransactionParametersV1) GetCreationTimeOk() (*string, bool) { + if o == nil || IsNil(o.CreationTime) { + return nil, false + } + return o.CreationTime, true +} + +// HasCreationTime returns a boolean if a field has been set. +func (o *IrohaTransactionParametersV1) HasCreationTime() bool { + if o != nil && !IsNil(o.CreationTime) { + return true + } + + return false +} + +// SetCreationTime gets a reference to the given string and assigns it to the CreationTime field. +func (o *IrohaTransactionParametersV1) SetCreationTime(v string) { + o.CreationTime = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *IrohaTransactionParametersV1) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IrohaTransactionParametersV1) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *IrohaTransactionParametersV1) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *IrohaTransactionParametersV1) SetNonce(v float32) { + o.Nonce = &v +} + +func (o IrohaTransactionParametersV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IrohaTransactionParametersV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ttl) { + toSerialize["ttl"] = o.Ttl + } + if !IsNil(o.CreationTime) { + toSerialize["creationTime"] = o.CreationTime + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IrohaTransactionParametersV1) UnmarshalJSON(bytes []byte) (err error) { + varIrohaTransactionParametersV1 := _IrohaTransactionParametersV1{} + + if err = json.Unmarshal(bytes, &varIrohaTransactionParametersV1); err == nil { + *o = IrohaTransactionParametersV1(varIrohaTransactionParametersV1) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "ttl") + delete(additionalProperties, "creationTime") + delete(additionalProperties, "nonce") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIrohaTransactionParametersV1 struct { + value *IrohaTransactionParametersV1 + isSet bool +} + +func (v NullableIrohaTransactionParametersV1) Get() *IrohaTransactionParametersV1 { + return v.value +} + +func (v *NullableIrohaTransactionParametersV1) Set(val *IrohaTransactionParametersV1) { + v.value = val + v.isSet = true +} + +func (v NullableIrohaTransactionParametersV1) IsSet() bool { + return v.isSet +} + +func (v *NullableIrohaTransactionParametersV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIrohaTransactionParametersV1(val *IrohaTransactionParametersV1) *NullableIrohaTransactionParametersV1 { + return &NullableIrohaTransactionParametersV1{value: val, isSet: true} +} + +func (v NullableIrohaTransactionParametersV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIrohaTransactionParametersV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_keychain_reference.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_keychain_reference.go new file mode 100644 index 00000000000..d93bceb3d6c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_keychain_reference.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the KeychainReference type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeychainReference{} + +// KeychainReference Reference to entry stored in Cactus keychain plugin. +type KeychainReference struct { + // Keychain plugin ID. + KeychainId string `json:"keychainId"` + // Key reference name. + KeychainRef string `json:"keychainRef"` +} + +// NewKeychainReference instantiates a new KeychainReference 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 +// will change when the set of required properties is changed +func NewKeychainReference(keychainId string, keychainRef string) *KeychainReference { + this := KeychainReference{} + this.KeychainId = keychainId + this.KeychainRef = keychainRef + return &this +} + +// NewKeychainReferenceWithDefaults instantiates a new KeychainReference object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKeychainReferenceWithDefaults() *KeychainReference { + this := KeychainReference{} + return &this +} + +// GetKeychainId returns the KeychainId field value +func (o *KeychainReference) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *KeychainReference) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *KeychainReference) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetKeychainRef returns the KeychainRef field value +func (o *KeychainReference) GetKeychainRef() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainRef +} + +// GetKeychainRefOk returns a tuple with the KeychainRef field value +// and a boolean to check if the value has been set. +func (o *KeychainReference) GetKeychainRefOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainRef, true +} + +// SetKeychainRef sets field value +func (o *KeychainReference) SetKeychainRef(v string) { + o.KeychainRef = v +} + +func (o KeychainReference) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeychainReference) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["keychainId"] = o.KeychainId + toSerialize["keychainRef"] = o.KeychainRef + return toSerialize, nil +} + +type NullableKeychainReference struct { + value *KeychainReference + isSet bool +} + +func (v NullableKeychainReference) Get() *KeychainReference { + return v.value +} + +func (v *NullableKeychainReference) Set(val *KeychainReference) { + v.value = val + v.isSet = true +} + +func (v NullableKeychainReference) IsSet() bool { + return v.isSet +} + +func (v *NullableKeychainReference) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeychainReference(val *KeychainReference) *NullableKeychainReference { + return &NullableKeychainReference{value: val, isSet: true} +} + +func (v NullableKeychainReference) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeychainReference) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_query_request_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_query_request_v1.go new file mode 100644 index 00000000000..e1f547c09a1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_query_request_v1.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the QueryRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QueryRequestV1{} + +// QueryRequestV1 Request to query endpoint. +type QueryRequestV1 struct { + Query *IrohaQueryDefinitionV1 `json:"query,omitempty"` + SignedQuery *IrohaSignedQueryDefinitionV1 `json:"signedQuery,omitempty"` + BaseConfig *Iroha2BaseConfig `json:"baseConfig,omitempty"` +} + +// NewQueryRequestV1 instantiates a new QueryRequestV1 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 +// will change when the set of required properties is changed +func NewQueryRequestV1() *QueryRequestV1 { + this := QueryRequestV1{} + return &this +} + +// NewQueryRequestV1WithDefaults instantiates a new QueryRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQueryRequestV1WithDefaults() *QueryRequestV1 { + this := QueryRequestV1{} + return &this +} + +// GetQuery returns the Query field value if set, zero value otherwise. +func (o *QueryRequestV1) GetQuery() IrohaQueryDefinitionV1 { + if o == nil || IsNil(o.Query) { + var ret IrohaQueryDefinitionV1 + return ret + } + return *o.Query +} + +// GetQueryOk returns a tuple with the Query field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QueryRequestV1) GetQueryOk() (*IrohaQueryDefinitionV1, bool) { + if o == nil || IsNil(o.Query) { + return nil, false + } + return o.Query, true +} + +// HasQuery returns a boolean if a field has been set. +func (o *QueryRequestV1) HasQuery() bool { + if o != nil && !IsNil(o.Query) { + return true + } + + return false +} + +// SetQuery gets a reference to the given IrohaQueryDefinitionV1 and assigns it to the Query field. +func (o *QueryRequestV1) SetQuery(v IrohaQueryDefinitionV1) { + o.Query = &v +} + +// GetSignedQuery returns the SignedQuery field value if set, zero value otherwise. +func (o *QueryRequestV1) GetSignedQuery() IrohaSignedQueryDefinitionV1 { + if o == nil || IsNil(o.SignedQuery) { + var ret IrohaSignedQueryDefinitionV1 + return ret + } + return *o.SignedQuery +} + +// GetSignedQueryOk returns a tuple with the SignedQuery field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QueryRequestV1) GetSignedQueryOk() (*IrohaSignedQueryDefinitionV1, bool) { + if o == nil || IsNil(o.SignedQuery) { + return nil, false + } + return o.SignedQuery, true +} + +// HasSignedQuery returns a boolean if a field has been set. +func (o *QueryRequestV1) HasSignedQuery() bool { + if o != nil && !IsNil(o.SignedQuery) { + return true + } + + return false +} + +// SetSignedQuery gets a reference to the given IrohaSignedQueryDefinitionV1 and assigns it to the SignedQuery field. +func (o *QueryRequestV1) SetSignedQuery(v IrohaSignedQueryDefinitionV1) { + o.SignedQuery = &v +} + +// GetBaseConfig returns the BaseConfig field value if set, zero value otherwise. +func (o *QueryRequestV1) GetBaseConfig() Iroha2BaseConfig { + if o == nil || IsNil(o.BaseConfig) { + var ret Iroha2BaseConfig + return ret + } + return *o.BaseConfig +} + +// GetBaseConfigOk returns a tuple with the BaseConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QueryRequestV1) GetBaseConfigOk() (*Iroha2BaseConfig, bool) { + if o == nil || IsNil(o.BaseConfig) { + return nil, false + } + return o.BaseConfig, true +} + +// HasBaseConfig returns a boolean if a field has been set. +func (o *QueryRequestV1) HasBaseConfig() bool { + if o != nil && !IsNil(o.BaseConfig) { + return true + } + + return false +} + +// SetBaseConfig gets a reference to the given Iroha2BaseConfig and assigns it to the BaseConfig field. +func (o *QueryRequestV1) SetBaseConfig(v Iroha2BaseConfig) { + o.BaseConfig = &v +} + +func (o QueryRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QueryRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Query) { + toSerialize["query"] = o.Query + } + if !IsNil(o.SignedQuery) { + toSerialize["signedQuery"] = o.SignedQuery + } + if !IsNil(o.BaseConfig) { + toSerialize["baseConfig"] = o.BaseConfig + } + return toSerialize, nil +} + +type NullableQueryRequestV1 struct { + value *QueryRequestV1 + isSet bool +} + +func (v NullableQueryRequestV1) Get() *QueryRequestV1 { + return v.value +} + +func (v *NullableQueryRequestV1) Set(val *QueryRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableQueryRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableQueryRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQueryRequestV1(val *QueryRequestV1) *NullableQueryRequestV1 { + return &NullableQueryRequestV1{value: val, isSet: true} +} + +func (v NullableQueryRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQueryRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_query_response_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_query_response_v1.go new file mode 100644 index 00000000000..eec5c647184 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_query_response_v1.go @@ -0,0 +1,122 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the QueryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QueryResponseV1{} + +// QueryResponseV1 Response with the query results. +type QueryResponseV1 struct { + // Query response data that varies between different queries. + Response interface{} `json:"response"` +} + +// NewQueryResponseV1 instantiates a new QueryResponseV1 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 +// will change when the set of required properties is changed +func NewQueryResponseV1(response interface{}) *QueryResponseV1 { + this := QueryResponseV1{} + this.Response = response + return &this +} + +// NewQueryResponseV1WithDefaults instantiates a new QueryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQueryResponseV1WithDefaults() *QueryResponseV1 { + this := QueryResponseV1{} + return &this +} + +// GetResponse returns the Response field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *QueryResponseV1) GetResponse() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Response +} + +// GetResponseOk returns a tuple with the Response field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *QueryResponseV1) GetResponseOk() (*interface{}, bool) { + if o == nil || IsNil(o.Response) { + return nil, false + } + return &o.Response, true +} + +// SetResponse sets field value +func (o *QueryResponseV1) SetResponse(v interface{}) { + o.Response = v +} + +func (o QueryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QueryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Response != nil { + toSerialize["response"] = o.Response + } + return toSerialize, nil +} + +type NullableQueryResponseV1 struct { + value *QueryResponseV1 + isSet bool +} + +func (v NullableQueryResponseV1) Get() *QueryResponseV1 { + return v.value +} + +func (v *NullableQueryResponseV1) Set(val *QueryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableQueryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableQueryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQueryResponseV1(val *QueryResponseV1) *NullableQueryResponseV1 { + return &NullableQueryResponseV1{value: val, isSet: true} +} + +func (v NullableQueryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQueryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transact_request_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transact_request_v1.go new file mode 100644 index 00000000000..5e9149ce290 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transact_request_v1.go @@ -0,0 +1,240 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the TransactRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactRequestV1{} + +// TransactRequestV1 Request to transact endpoint. +type TransactRequestV1 struct { + // Signed transaction binary data received from generate-transaction endpoint. + SignedTransaction *string `json:"signedTransaction,omitempty"` + Transaction *IrohaTransactionDefinitionV1 `json:"transaction,omitempty"` + // Wait unitl transaction is sent and return the final status (committed / rejected) + WaitForCommit *bool `json:"waitForCommit,omitempty"` + BaseConfig *Iroha2BaseConfig `json:"baseConfig,omitempty"` +} + +// NewTransactRequestV1 instantiates a new TransactRequestV1 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 +// will change when the set of required properties is changed +func NewTransactRequestV1() *TransactRequestV1 { + this := TransactRequestV1{} + var waitForCommit bool = false + this.WaitForCommit = &waitForCommit + return &this +} + +// NewTransactRequestV1WithDefaults instantiates a new TransactRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactRequestV1WithDefaults() *TransactRequestV1 { + this := TransactRequestV1{} + var waitForCommit bool = false + this.WaitForCommit = &waitForCommit + return &this +} + +// GetSignedTransaction returns the SignedTransaction field value if set, zero value otherwise. +func (o *TransactRequestV1) GetSignedTransaction() string { + if o == nil || IsNil(o.SignedTransaction) { + var ret string + return ret + } + return *o.SignedTransaction +} + +// GetSignedTransactionOk returns a tuple with the SignedTransaction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactRequestV1) GetSignedTransactionOk() (*string, bool) { + if o == nil || IsNil(o.SignedTransaction) { + return nil, false + } + return o.SignedTransaction, true +} + +// HasSignedTransaction returns a boolean if a field has been set. +func (o *TransactRequestV1) HasSignedTransaction() bool { + if o != nil && !IsNil(o.SignedTransaction) { + return true + } + + return false +} + +// SetSignedTransaction gets a reference to the given string and assigns it to the SignedTransaction field. +func (o *TransactRequestV1) SetSignedTransaction(v string) { + o.SignedTransaction = &v +} + +// GetTransaction returns the Transaction field value if set, zero value otherwise. +func (o *TransactRequestV1) GetTransaction() IrohaTransactionDefinitionV1 { + if o == nil || IsNil(o.Transaction) { + var ret IrohaTransactionDefinitionV1 + return ret + } + return *o.Transaction +} + +// GetTransactionOk returns a tuple with the Transaction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactRequestV1) GetTransactionOk() (*IrohaTransactionDefinitionV1, bool) { + if o == nil || IsNil(o.Transaction) { + return nil, false + } + return o.Transaction, true +} + +// HasTransaction returns a boolean if a field has been set. +func (o *TransactRequestV1) HasTransaction() bool { + if o != nil && !IsNil(o.Transaction) { + return true + } + + return false +} + +// SetTransaction gets a reference to the given IrohaTransactionDefinitionV1 and assigns it to the Transaction field. +func (o *TransactRequestV1) SetTransaction(v IrohaTransactionDefinitionV1) { + o.Transaction = &v +} + +// GetWaitForCommit returns the WaitForCommit field value if set, zero value otherwise. +func (o *TransactRequestV1) GetWaitForCommit() bool { + if o == nil || IsNil(o.WaitForCommit) { + var ret bool + return ret + } + return *o.WaitForCommit +} + +// GetWaitForCommitOk returns a tuple with the WaitForCommit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactRequestV1) GetWaitForCommitOk() (*bool, bool) { + if o == nil || IsNil(o.WaitForCommit) { + return nil, false + } + return o.WaitForCommit, true +} + +// HasWaitForCommit returns a boolean if a field has been set. +func (o *TransactRequestV1) HasWaitForCommit() bool { + if o != nil && !IsNil(o.WaitForCommit) { + return true + } + + return false +} + +// SetWaitForCommit gets a reference to the given bool and assigns it to the WaitForCommit field. +func (o *TransactRequestV1) SetWaitForCommit(v bool) { + o.WaitForCommit = &v +} + +// GetBaseConfig returns the BaseConfig field value if set, zero value otherwise. +func (o *TransactRequestV1) GetBaseConfig() Iroha2BaseConfig { + if o == nil || IsNil(o.BaseConfig) { + var ret Iroha2BaseConfig + return ret + } + return *o.BaseConfig +} + +// GetBaseConfigOk returns a tuple with the BaseConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactRequestV1) GetBaseConfigOk() (*Iroha2BaseConfig, bool) { + if o == nil || IsNil(o.BaseConfig) { + return nil, false + } + return o.BaseConfig, true +} + +// HasBaseConfig returns a boolean if a field has been set. +func (o *TransactRequestV1) HasBaseConfig() bool { + if o != nil && !IsNil(o.BaseConfig) { + return true + } + + return false +} + +// SetBaseConfig gets a reference to the given Iroha2BaseConfig and assigns it to the BaseConfig field. +func (o *TransactRequestV1) SetBaseConfig(v Iroha2BaseConfig) { + o.BaseConfig = &v +} + +func (o TransactRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SignedTransaction) { + toSerialize["signedTransaction"] = o.SignedTransaction + } + if !IsNil(o.Transaction) { + toSerialize["transaction"] = o.Transaction + } + if !IsNil(o.WaitForCommit) { + toSerialize["waitForCommit"] = o.WaitForCommit + } + if !IsNil(o.BaseConfig) { + toSerialize["baseConfig"] = o.BaseConfig + } + return toSerialize, nil +} + +type NullableTransactRequestV1 struct { + value *TransactRequestV1 + isSet bool +} + +func (v NullableTransactRequestV1) Get() *TransactRequestV1 { + return v.value +} + +func (v *NullableTransactRequestV1) Set(val *TransactRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableTransactRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactRequestV1(val *TransactRequestV1) *NullableTransactRequestV1 { + return &NullableTransactRequestV1{value: val, isSet: true} +} + +func (v NullableTransactRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transact_response_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transact_response_v1.go new file mode 100644 index 00000000000..2ae1c04f35f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transact_response_v1.go @@ -0,0 +1,182 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the TransactResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactResponseV1{} + +// TransactResponseV1 Response from transaction endpoint with operation status. +type TransactResponseV1 struct { + // Hexadecimal hash of the transaction sent to the ledger. + Hash string `json:"hash"` + Status TransactionStatusV1 `json:"status"` + // When waitForCommit was suplied and the transaction was rejected, contains the reason of the rejection. + RejectReason *string `json:"rejectReason,omitempty"` +} + +// NewTransactResponseV1 instantiates a new TransactResponseV1 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 +// will change when the set of required properties is changed +func NewTransactResponseV1(hash string, status TransactionStatusV1) *TransactResponseV1 { + this := TransactResponseV1{} + this.Hash = hash + this.Status = status + return &this +} + +// NewTransactResponseV1WithDefaults instantiates a new TransactResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactResponseV1WithDefaults() *TransactResponseV1 { + this := TransactResponseV1{} + return &this +} + +// GetHash returns the Hash field value +func (o *TransactResponseV1) GetHash() string { + if o == nil { + var ret string + return ret + } + + return o.Hash +} + +// GetHashOk returns a tuple with the Hash field value +// and a boolean to check if the value has been set. +func (o *TransactResponseV1) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *TransactResponseV1) SetHash(v string) { + o.Hash = v +} + +// GetStatus returns the Status field value +func (o *TransactResponseV1) GetStatus() TransactionStatusV1 { + if o == nil { + var ret TransactionStatusV1 + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *TransactResponseV1) GetStatusOk() (*TransactionStatusV1, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *TransactResponseV1) SetStatus(v TransactionStatusV1) { + o.Status = v +} + +// GetRejectReason returns the RejectReason field value if set, zero value otherwise. +func (o *TransactResponseV1) GetRejectReason() string { + if o == nil || IsNil(o.RejectReason) { + var ret string + return ret + } + return *o.RejectReason +} + +// GetRejectReasonOk returns a tuple with the RejectReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactResponseV1) GetRejectReasonOk() (*string, bool) { + if o == nil || IsNil(o.RejectReason) { + return nil, false + } + return o.RejectReason, true +} + +// HasRejectReason returns a boolean if a field has been set. +func (o *TransactResponseV1) HasRejectReason() bool { + if o != nil && !IsNil(o.RejectReason) { + return true + } + + return false +} + +// SetRejectReason gets a reference to the given string and assigns it to the RejectReason field. +func (o *TransactResponseV1) SetRejectReason(v string) { + o.RejectReason = &v +} + +func (o TransactResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["hash"] = o.Hash + toSerialize["status"] = o.Status + if !IsNil(o.RejectReason) { + toSerialize["rejectReason"] = o.RejectReason + } + return toSerialize, nil +} + +type NullableTransactResponseV1 struct { + value *TransactResponseV1 + isSet bool +} + +func (v NullableTransactResponseV1) Get() *TransactResponseV1 { + return v.value +} + +func (v *NullableTransactResponseV1) Set(val *TransactResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableTransactResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactResponseV1(val *TransactResponseV1) *NullableTransactResponseV1 { + return &NullableTransactResponseV1{value: val, isSet: true} +} + +func (v NullableTransactResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transaction_status_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transaction_status_v1.go new file mode 100644 index 00000000000..6b2510af137 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_transaction_status_v1.go @@ -0,0 +1,113 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// TransactionStatusV1 Status of Iroha V2 transaction. +type TransactionStatusV1 string + +// List of TransactionStatusV1 +const ( + Submitted TransactionStatusV1 = "submitted" + Committed TransactionStatusV1 = "committed" + Rejected TransactionStatusV1 = "rejected" +) + +// All allowed values of TransactionStatusV1 enum +var AllowedTransactionStatusV1EnumValues = []TransactionStatusV1{ + "submitted", + "committed", + "rejected", +} + +func (v *TransactionStatusV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TransactionStatusV1(value) + for _, existing := range AllowedTransactionStatusV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid TransactionStatusV1", value) +} + +// NewTransactionStatusV1FromValue returns a pointer to a valid TransactionStatusV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTransactionStatusV1FromValue(v string) (*TransactionStatusV1, error) { + ev := TransactionStatusV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TransactionStatusV1: valid values are %v", v, AllowedTransactionStatusV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TransactionStatusV1) IsValid() bool { + for _, existing := range AllowedTransactionStatusV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TransactionStatusV1 value +func (v TransactionStatusV1) Ptr() *TransactionStatusV1 { + return &v +} + +type NullableTransactionStatusV1 struct { + value *TransactionStatusV1 + isSet bool +} + +func (v NullableTransactionStatusV1) Get() *TransactionStatusV1 { + return v.value +} + +func (v *NullableTransactionStatusV1) Set(val *TransactionStatusV1) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionStatusV1) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionStatusV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionStatusV1(val *TransactionStatusV1) *NullableTransactionStatusV1 { + return &NullableTransactionStatusV1{value: val, isSet: true} +} + +func (v NullableTransactionStatusV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionStatusV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_binary_response_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_binary_response_v1.go new file mode 100644 index 00000000000..068a3cc1095 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_binary_response_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the WatchBlocksBinaryResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksBinaryResponseV1{} + +// WatchBlocksBinaryResponseV1 Binary encoded response of block data. +type WatchBlocksBinaryResponseV1 struct { + BinaryBlock string `json:"binaryBlock"` +} + +// NewWatchBlocksBinaryResponseV1 instantiates a new WatchBlocksBinaryResponseV1 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 +// will change when the set of required properties is changed +func NewWatchBlocksBinaryResponseV1(binaryBlock string) *WatchBlocksBinaryResponseV1 { + this := WatchBlocksBinaryResponseV1{} + this.BinaryBlock = binaryBlock + return &this +} + +// NewWatchBlocksBinaryResponseV1WithDefaults instantiates a new WatchBlocksBinaryResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksBinaryResponseV1WithDefaults() *WatchBlocksBinaryResponseV1 { + this := WatchBlocksBinaryResponseV1{} + return &this +} + +// GetBinaryBlock returns the BinaryBlock field value +func (o *WatchBlocksBinaryResponseV1) GetBinaryBlock() string { + if o == nil { + var ret string + return ret + } + + return o.BinaryBlock +} + +// GetBinaryBlockOk returns a tuple with the BinaryBlock field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksBinaryResponseV1) GetBinaryBlockOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BinaryBlock, true +} + +// SetBinaryBlock sets field value +func (o *WatchBlocksBinaryResponseV1) SetBinaryBlock(v string) { + o.BinaryBlock = v +} + +func (o WatchBlocksBinaryResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksBinaryResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["binaryBlock"] = o.BinaryBlock + return toSerialize, nil +} + +type NullableWatchBlocksBinaryResponseV1 struct { + value *WatchBlocksBinaryResponseV1 + isSet bool +} + +func (v NullableWatchBlocksBinaryResponseV1) Get() *WatchBlocksBinaryResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksBinaryResponseV1) Set(val *WatchBlocksBinaryResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksBinaryResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksBinaryResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksBinaryResponseV1(val *WatchBlocksBinaryResponseV1) *NullableWatchBlocksBinaryResponseV1 { + return &NullableWatchBlocksBinaryResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksBinaryResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksBinaryResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_options_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_options_v1.go new file mode 100644 index 00000000000..b73c554e6ab --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_options_v1.go @@ -0,0 +1,199 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the WatchBlocksOptionsV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksOptionsV1{} + +// WatchBlocksOptionsV1 Options passed when subscribing to block monitoring. +type WatchBlocksOptionsV1 struct { + Type *BlockTypeV1 `json:"type,omitempty"` + // Number of block to start monitoring from. + StartBlock *string `json:"startBlock,omitempty"` + BaseConfig *Iroha2BaseConfig `json:"baseConfig,omitempty"` +} + +// NewWatchBlocksOptionsV1 instantiates a new WatchBlocksOptionsV1 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 +// will change when the set of required properties is changed +func NewWatchBlocksOptionsV1() *WatchBlocksOptionsV1 { + this := WatchBlocksOptionsV1{} + return &this +} + +// NewWatchBlocksOptionsV1WithDefaults instantiates a new WatchBlocksOptionsV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksOptionsV1WithDefaults() *WatchBlocksOptionsV1 { + this := WatchBlocksOptionsV1{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WatchBlocksOptionsV1) GetType() BlockTypeV1 { + if o == nil || IsNil(o.Type) { + var ret BlockTypeV1 + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksOptionsV1) GetTypeOk() (*BlockTypeV1, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WatchBlocksOptionsV1) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given BlockTypeV1 and assigns it to the Type field. +func (o *WatchBlocksOptionsV1) SetType(v BlockTypeV1) { + o.Type = &v +} + +// GetStartBlock returns the StartBlock field value if set, zero value otherwise. +func (o *WatchBlocksOptionsV1) GetStartBlock() string { + if o == nil || IsNil(o.StartBlock) { + var ret string + return ret + } + return *o.StartBlock +} + +// GetStartBlockOk returns a tuple with the StartBlock field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksOptionsV1) GetStartBlockOk() (*string, bool) { + if o == nil || IsNil(o.StartBlock) { + return nil, false + } + return o.StartBlock, true +} + +// HasStartBlock returns a boolean if a field has been set. +func (o *WatchBlocksOptionsV1) HasStartBlock() bool { + if o != nil && !IsNil(o.StartBlock) { + return true + } + + return false +} + +// SetStartBlock gets a reference to the given string and assigns it to the StartBlock field. +func (o *WatchBlocksOptionsV1) SetStartBlock(v string) { + o.StartBlock = &v +} + +// GetBaseConfig returns the BaseConfig field value if set, zero value otherwise. +func (o *WatchBlocksOptionsV1) GetBaseConfig() Iroha2BaseConfig { + if o == nil || IsNil(o.BaseConfig) { + var ret Iroha2BaseConfig + return ret + } + return *o.BaseConfig +} + +// GetBaseConfigOk returns a tuple with the BaseConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksOptionsV1) GetBaseConfigOk() (*Iroha2BaseConfig, bool) { + if o == nil || IsNil(o.BaseConfig) { + return nil, false + } + return o.BaseConfig, true +} + +// HasBaseConfig returns a boolean if a field has been set. +func (o *WatchBlocksOptionsV1) HasBaseConfig() bool { + if o != nil && !IsNil(o.BaseConfig) { + return true + } + + return false +} + +// SetBaseConfig gets a reference to the given Iroha2BaseConfig and assigns it to the BaseConfig field. +func (o *WatchBlocksOptionsV1) SetBaseConfig(v Iroha2BaseConfig) { + o.BaseConfig = &v +} + +func (o WatchBlocksOptionsV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksOptionsV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.StartBlock) { + toSerialize["startBlock"] = o.StartBlock + } + if !IsNil(o.BaseConfig) { + toSerialize["baseConfig"] = o.BaseConfig + } + return toSerialize, nil +} + +type NullableWatchBlocksOptionsV1 struct { + value *WatchBlocksOptionsV1 + isSet bool +} + +func (v NullableWatchBlocksOptionsV1) Get() *WatchBlocksOptionsV1 { + return v.value +} + +func (v *NullableWatchBlocksOptionsV1) Set(val *WatchBlocksOptionsV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksOptionsV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksOptionsV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksOptionsV1(val *WatchBlocksOptionsV1) *NullableWatchBlocksOptionsV1 { + return &NullableWatchBlocksOptionsV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksOptionsV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksOptionsV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_raw_response_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_raw_response_v1.go new file mode 100644 index 00000000000..bce3355eb19 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_raw_response_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" +) + +// checks if the WatchBlocksRawResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksRawResponseV1{} + +// WatchBlocksRawResponseV1 Default JSON-encoded string full block data. +type WatchBlocksRawResponseV1 struct { + BlockData string `json:"blockData"` +} + +// NewWatchBlocksRawResponseV1 instantiates a new WatchBlocksRawResponseV1 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 +// will change when the set of required properties is changed +func NewWatchBlocksRawResponseV1(blockData string) *WatchBlocksRawResponseV1 { + this := WatchBlocksRawResponseV1{} + this.BlockData = blockData + return &this +} + +// NewWatchBlocksRawResponseV1WithDefaults instantiates a new WatchBlocksRawResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksRawResponseV1WithDefaults() *WatchBlocksRawResponseV1 { + this := WatchBlocksRawResponseV1{} + return &this +} + +// GetBlockData returns the BlockData field value +func (o *WatchBlocksRawResponseV1) GetBlockData() string { + if o == nil { + var ret string + return ret + } + + return o.BlockData +} + +// GetBlockDataOk returns a tuple with the BlockData field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksRawResponseV1) GetBlockDataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockData, true +} + +// SetBlockData sets field value +func (o *WatchBlocksRawResponseV1) SetBlockData(v string) { + o.BlockData = v +} + +func (o WatchBlocksRawResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksRawResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["blockData"] = o.BlockData + return toSerialize, nil +} + +type NullableWatchBlocksRawResponseV1 struct { + value *WatchBlocksRawResponseV1 + isSet bool +} + +func (v NullableWatchBlocksRawResponseV1) Get() *WatchBlocksRawResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksRawResponseV1) Set(val *WatchBlocksRawResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksRawResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksRawResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksRawResponseV1(val *WatchBlocksRawResponseV1) *NullableWatchBlocksRawResponseV1 { + return &NullableWatchBlocksRawResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksRawResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksRawResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_response_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_response_v1.go new file mode 100644 index 00000000000..78de66d26c9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_response_v1.go @@ -0,0 +1,178 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksResponseV1 - struct for WatchBlocksResponseV1 +type WatchBlocksResponseV1 struct { + ErrorExceptionResponseV1 *ErrorExceptionResponseV1 + WatchBlocksBinaryResponseV1 *WatchBlocksBinaryResponseV1 + WatchBlocksRawResponseV1 *WatchBlocksRawResponseV1 +} + +// ErrorExceptionResponseV1AsWatchBlocksResponseV1 is a convenience function that returns ErrorExceptionResponseV1 wrapped in WatchBlocksResponseV1 +func ErrorExceptionResponseV1AsWatchBlocksResponseV1(v *ErrorExceptionResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + ErrorExceptionResponseV1: v, + } +} + +// WatchBlocksBinaryResponseV1AsWatchBlocksResponseV1 is a convenience function that returns WatchBlocksBinaryResponseV1 wrapped in WatchBlocksResponseV1 +func WatchBlocksBinaryResponseV1AsWatchBlocksResponseV1(v *WatchBlocksBinaryResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + WatchBlocksBinaryResponseV1: v, + } +} + +// WatchBlocksRawResponseV1AsWatchBlocksResponseV1 is a convenience function that returns WatchBlocksRawResponseV1 wrapped in WatchBlocksResponseV1 +func WatchBlocksRawResponseV1AsWatchBlocksResponseV1(v *WatchBlocksRawResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + WatchBlocksRawResponseV1: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *WatchBlocksResponseV1) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into ErrorExceptionResponseV1 + err = newStrictDecoder(data).Decode(&dst.ErrorExceptionResponseV1) + if err == nil { + jsonErrorExceptionResponseV1, _ := json.Marshal(dst.ErrorExceptionResponseV1) + if string(jsonErrorExceptionResponseV1) == "{}" { // empty struct + dst.ErrorExceptionResponseV1 = nil + } else { + match++ + } + } else { + dst.ErrorExceptionResponseV1 = nil + } + + // try to unmarshal data into WatchBlocksBinaryResponseV1 + err = newStrictDecoder(data).Decode(&dst.WatchBlocksBinaryResponseV1) + if err == nil { + jsonWatchBlocksBinaryResponseV1, _ := json.Marshal(dst.WatchBlocksBinaryResponseV1) + if string(jsonWatchBlocksBinaryResponseV1) == "{}" { // empty struct + dst.WatchBlocksBinaryResponseV1 = nil + } else { + match++ + } + } else { + dst.WatchBlocksBinaryResponseV1 = nil + } + + // try to unmarshal data into WatchBlocksRawResponseV1 + err = newStrictDecoder(data).Decode(&dst.WatchBlocksRawResponseV1) + if err == nil { + jsonWatchBlocksRawResponseV1, _ := json.Marshal(dst.WatchBlocksRawResponseV1) + if string(jsonWatchBlocksRawResponseV1) == "{}" { // empty struct + dst.WatchBlocksRawResponseV1 = nil + } else { + match++ + } + } else { + dst.WatchBlocksRawResponseV1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.ErrorExceptionResponseV1 = nil + dst.WatchBlocksBinaryResponseV1 = nil + dst.WatchBlocksRawResponseV1 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(WatchBlocksResponseV1)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(WatchBlocksResponseV1)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src WatchBlocksResponseV1) MarshalJSON() ([]byte, error) { + if src.ErrorExceptionResponseV1 != nil { + return json.Marshal(&src.ErrorExceptionResponseV1) + } + + if src.WatchBlocksBinaryResponseV1 != nil { + return json.Marshal(&src.WatchBlocksBinaryResponseV1) + } + + if src.WatchBlocksRawResponseV1 != nil { + return json.Marshal(&src.WatchBlocksRawResponseV1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *WatchBlocksResponseV1) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.ErrorExceptionResponseV1 != nil { + return obj.ErrorExceptionResponseV1 + } + + if obj.WatchBlocksBinaryResponseV1 != nil { + return obj.WatchBlocksBinaryResponseV1 + } + + if obj.WatchBlocksRawResponseV1 != nil { + return obj.WatchBlocksRawResponseV1 + } + + // all schemas are nil + return nil +} + +type NullableWatchBlocksResponseV1 struct { + value *WatchBlocksResponseV1 + isSet bool +} + +func (v NullableWatchBlocksResponseV1) Get() *WatchBlocksResponseV1 { + return v.value +} + +func (v *NullableWatchBlocksResponseV1) Set(val *WatchBlocksResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksResponseV1(val *WatchBlocksResponseV1) *NullableWatchBlocksResponseV1 { + return &NullableWatchBlocksResponseV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go new file mode 100644 index 00000000000..61bcb00a53d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksV1 Websocket requests for monitoring new blocks. +type WatchBlocksV1 string + +// List of WatchBlocksV1 +const ( + Subscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Subscribe" + Next WatchBlocksV1 = "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Next" + Unsubscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Unsubscribe" + Error WatchBlocksV1 = "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Error" + Complete WatchBlocksV1 = "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Complete" +) + +// All allowed values of WatchBlocksV1 enum +var AllowedWatchBlocksV1EnumValues = []WatchBlocksV1{ + "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Subscribe", + "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Next", + "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Unsubscribe", + "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Error", + "org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Complete", +} + +func (v *WatchBlocksV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchBlocksV1(value) + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchBlocksV1", value) +} + +// NewWatchBlocksV1FromValue returns a pointer to a valid WatchBlocksV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchBlocksV1FromValue(v string) (*WatchBlocksV1, error) { + ev := WatchBlocksV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchBlocksV1: valid values are %v", v, AllowedWatchBlocksV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchBlocksV1) IsValid() bool { + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchBlocksV1 value +func (v WatchBlocksV1) Ptr() *WatchBlocksV1 { + return &v +} + +type NullableWatchBlocksV1 struct { + value *WatchBlocksV1 + isSet bool +} + +func (v NullableWatchBlocksV1) Get() *WatchBlocksV1 { + return v.value +} + +func (v *NullableWatchBlocksV1) Set(val *WatchBlocksV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1(val *WatchBlocksV1) *NullableWatchBlocksV1 { + return &NullableWatchBlocksV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..4b19d786a65 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..ef61ecb479e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,61 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-ledger-connector-iroha2_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService GenerateTransactionV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GenerateTransactionV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService QueryV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.QueryV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService TransactV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.TransactV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..25703c5fc87 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Connector Iroha V2 + +Can perform basic tasks on a Iroha V2 ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-iroha2 + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..f2fa20fbb76 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - Connector Iroha V2 + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..6e5d9534296 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,90 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/BlockTypeV1.java +src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java +src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java +src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1Request.java +src/main/java/org/openapitools/client/model/Iroha2AccountId.java +src/main/java/org/openapitools/client/model/Iroha2BaseConfig.java +src/main/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredential.java +src/main/java/org/openapitools/client/model/Iroha2BaseConfigTorii.java +src/main/java/org/openapitools/client/model/Iroha2KeyJson.java +src/main/java/org/openapitools/client/model/Iroha2KeyPair.java +src/main/java/org/openapitools/client/model/IrohaInstruction.java +src/main/java/org/openapitools/client/model/IrohaInstructionRequestV1.java +src/main/java/org/openapitools/client/model/IrohaQuery.java +src/main/java/org/openapitools/client/model/IrohaQueryDefinitionV1.java +src/main/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1.java +src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1.java +src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Instruction.java +src/main/java/org/openapitools/client/model/IrohaTransactionParametersV1.java +src/main/java/org/openapitools/client/model/KeychainReference.java +src/main/java/org/openapitools/client/model/QueryRequestV1.java +src/main/java/org/openapitools/client/model/QueryResponseV1.java +src/main/java/org/openapitools/client/model/TransactRequestV1.java +src/main/java/org/openapitools/client/model/TransactResponseV1.java +src/main/java/org/openapitools/client/model/TransactionStatusV1.java +src/main/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java +src/main/java/org/openapitools/client/model/WatchBlocksRawResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksV1.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/BlockTypeV1Test.java +src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java +src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1RequestTest.java +src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1Test.java +src/test/java/org/openapitools/client/model/Iroha2AccountIdTest.java +src/test/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredentialTest.java +src/test/java/org/openapitools/client/model/Iroha2BaseConfigTest.java +src/test/java/org/openapitools/client/model/Iroha2BaseConfigToriiTest.java +src/test/java/org/openapitools/client/model/Iroha2KeyJsonTest.java +src/test/java/org/openapitools/client/model/Iroha2KeyPairTest.java +src/test/java/org/openapitools/client/model/IrohaInstructionRequestV1Test.java +src/test/java/org/openapitools/client/model/IrohaInstructionTest.java +src/test/java/org/openapitools/client/model/IrohaQueryDefinitionV1Test.java +src/test/java/org/openapitools/client/model/IrohaQueryTest.java +src/test/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1Test.java +src/test/java/org/openapitools/client/model/IrohaTransactionDefinitionV1InstructionTest.java +src/test/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Test.java +src/test/java/org/openapitools/client/model/IrohaTransactionParametersV1Test.java +src/test/java/org/openapitools/client/model/KeychainReferenceTest.java +src/test/java/org/openapitools/client/model/QueryRequestV1Test.java +src/test/java/org/openapitools/client/model/QueryResponseV1Test.java +src/test/java/org/openapitools/client/model/TransactRequestV1Test.java +src/test/java/org/openapitools/client/model/TransactResponseV1Test.java +src/test/java/org/openapitools/client/model/TransactionStatusV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksOptionsV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksRawResponseV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksResponseV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..7b414204b2a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,167 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Connector Iroha V2 +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a Iroha V2 ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + GenerateTransactionRequestV1 generateTransactionRequestV1 = new GenerateTransactionRequestV1(); // GenerateTransactionRequestV1 | + try { + String result = apiInstance.generateTransactionV1(generateTransactionRequestV1); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#generateTransactionV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**generateTransactionV1**](docs/DefaultApi.md#generateTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/generate-transaction | Generate transaction that can be signed locally. +*DefaultApi* | [**queryV1**](docs/DefaultApi.md#queryV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/query | Executes a query on a Iroha V2 ledger and returns it's results. +*DefaultApi* | [**transactV1**](docs/DefaultApi.md#transactV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/transact | Executes a transaction on a Iroha V2 ledger (by sending some instructions) + + +## Documentation for Models + + - [BlockTypeV1](docs/BlockTypeV1.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [GenerateTransactionRequestV1](docs/GenerateTransactionRequestV1.md) + - [GenerateTransactionRequestV1Request](docs/GenerateTransactionRequestV1Request.md) + - [Iroha2AccountId](docs/Iroha2AccountId.md) + - [Iroha2BaseConfig](docs/Iroha2BaseConfig.md) + - [Iroha2BaseConfigSigningCredential](docs/Iroha2BaseConfigSigningCredential.md) + - [Iroha2BaseConfigTorii](docs/Iroha2BaseConfigTorii.md) + - [Iroha2KeyJson](docs/Iroha2KeyJson.md) + - [Iroha2KeyPair](docs/Iroha2KeyPair.md) + - [IrohaInstruction](docs/IrohaInstruction.md) + - [IrohaInstructionRequestV1](docs/IrohaInstructionRequestV1.md) + - [IrohaQuery](docs/IrohaQuery.md) + - [IrohaQueryDefinitionV1](docs/IrohaQueryDefinitionV1.md) + - [IrohaSignedQueryDefinitionV1](docs/IrohaSignedQueryDefinitionV1.md) + - [IrohaTransactionDefinitionV1](docs/IrohaTransactionDefinitionV1.md) + - [IrohaTransactionDefinitionV1Instruction](docs/IrohaTransactionDefinitionV1Instruction.md) + - [IrohaTransactionParametersV1](docs/IrohaTransactionParametersV1.md) + - [KeychainReference](docs/KeychainReference.md) + - [QueryRequestV1](docs/QueryRequestV1.md) + - [QueryResponseV1](docs/QueryResponseV1.md) + - [TransactRequestV1](docs/TransactRequestV1.md) + - [TransactResponseV1](docs/TransactResponseV1.md) + - [TransactionStatusV1](docs/TransactionStatusV1.md) + - [WatchBlocksBinaryResponseV1](docs/WatchBlocksBinaryResponseV1.md) + - [WatchBlocksOptionsV1](docs/WatchBlocksOptionsV1.md) + - [WatchBlocksRawResponseV1](docs/WatchBlocksRawResponseV1.md) + - [WatchBlocksResponseV1](docs/WatchBlocksResponseV1.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..07fb6d1b96c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,592 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Iroha V2 ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Iroha V2 + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/transact: + post: + operationId: TransactV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransactRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TransactResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error. + summary: Executes a transaction on a Iroha V2 ledger (by sending some instructions) + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/transact + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/generate-transaction: + post: + operationId: generateTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateTransactionRequestV1' + responses: + "200": + content: + text/plain: + schema: + type: string + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Generate transaction that can be signed locally. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/generate-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/query: + post: + operationId: QueryV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/QueryRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/QueryResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error. + summary: Executes a query on a Iroha V2 ledger and returns it's results. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/query + x-content-type: application/json + x-accepts: application/json +components: + schemas: + IrohaInstruction: + description: Command names that correspond to Iroha Special Instructions (https://hyperledger.github.io/iroha-2-docs/guide/advanced/isi.html) + enum: + - registerDomain + - registerAssetDefinition + - registerAsset + - mintAsset + - burnAsset + - transferAsset + - registerAccount + type: string + x-enum-descriptions: + - Register new domain + - Register new asset definition + - Register new asset + - Mint asset value + - Burn asset value + - Transfer asset between accounts + - Register new account + x-enum-varnames: + - RegisterDomain + - RegisterAssetDefinition + - RegisterAsset + - MintAsset + - BurnAsset + - TransferAsset + - RegisterAccount + IrohaQuery: + description: Command names that correspond to Iroha queries (https://hyperledger.github.io/iroha-2-docs/guide/advanced/queries.html) + enum: + - findAllDomains + - findDomainById + - findAssetDefinitionById + - findAllAssetsDefinitions + - findAssetById + - findAllAssets + - findAllPeers + - findAllBlocks + - findAccountById + - findAllAccounts + - findAllTransactions + - findTransactionByHash + type: string + x-enum-descriptions: + - Get list of all registered domains + - Get domain with specified ID + - Get asset definition with specified ID + - Get list of all registered asset definition + - Get asset with specified ID + - Get list of all registered assets + - Get list of all ledger peers + - Get list of all ledger blocks + - Get account with specified ID + - Get list of all registered accounts + - Get list of all transactions + - Get transaction with specified hash + x-enum-varnames: + - FindAllDomains + - FindDomainById + - FindAssetDefinitionById + - FindAllAssetsDefinitions + - FindAssetById + - FindAllAssets + - FindAllPeers + - FindAllBlocks + - FindAccountById + - FindAllAccounts + - FindAllTransactions + - FindTransactionByHash + WatchBlocksV1: + description: Websocket requests for monitoring new blocks. + enum: + - org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + BlockTypeV1: + description: Iroha V2 block response type. + enum: + - raw + - binary + type: string + x-enum-descriptions: + - Default JSON-encoded string full block data. + - Encoded format that must be decoded with Iroha SDK on client side before use + x-enum-varnames: + - Raw + - Binary + TransactionStatusV1: + description: Status of Iroha V2 transaction. + enum: + - submitted + - committed + - rejected + type: string + x-enum-descriptions: + - Transaction was submitted to the ledger - use other tools to check if it was + accepted and committed. + - Transaction was committed to the ledger. + - Transaction was rejected. + x-enum-varnames: + - Submitted + - Committed + - Rejected + WatchBlocksOptionsV1: + description: Options passed when subscribing to block monitoring. + properties: + type: + $ref: '#/components/schemas/BlockTypeV1' + startBlock: + description: Number of block to start monitoring from. + minLength: 1 + nullable: false + type: string + baseConfig: + $ref: '#/components/schemas/Iroha2BaseConfig' + type: object + WatchBlocksRawResponseV1: + description: Default JSON-encoded string full block data. + properties: + blockData: + nullable: false + type: string + required: + - blockData + type: object + WatchBlocksBinaryResponseV1: + description: Binary encoded response of block data. + properties: + binaryBlock: + nullable: false + type: string + required: + - binaryBlock + type: object + WatchBlocksResponseV1: + oneOf: + - $ref: '#/components/schemas/WatchBlocksRawResponseV1' + - $ref: '#/components/schemas/WatchBlocksBinaryResponseV1' + - $ref: '#/components/schemas/ErrorExceptionResponseV1' + Iroha2AccountId: + additionalProperties: false + description: Iroha V2 account ID. + example: + name: name + domainId: domainId + nullable: false + properties: + name: + nullable: false + type: string + domainId: + nullable: false + type: string + required: + - domainId + - name + type: object + Iroha2KeyJson: + additionalProperties: false + description: Private/Public key JSON containing payload and digest function. + nullable: false + properties: + digestFunction: + nullable: false + type: string + payload: + nullable: false + type: string + required: + - digestFunction + - payload + type: object + KeychainReference: + description: Reference to entry stored in Cactus keychain plugin. + properties: + keychainId: + description: Keychain plugin ID. + maxLength: 100 + minLength: 1 + nullable: false + type: string + keychainRef: + description: Key reference name. + maxLength: 100 + minLength: 1 + nullable: false + type: string + required: + - keychainId + - keychainRef + type: object + Iroha2KeyPair: + description: Pair of Iroha account private and public keys. + properties: + privateKey: + $ref: '#/components/schemas/Iroha2KeyJson' + publicKey: + nullable: false + type: string + required: + - privateKey + - publicKey + type: object + Iroha2BaseConfigTorii: + additionalProperties: false + description: Iroha V2 peer connection information. + example: + apiURL: apiURL + telemetryURL: telemetryURL + nullable: false + properties: + apiURL: + nullable: false + type: string + telemetryURL: + nullable: false + type: string + type: object + Iroha2BaseConfig: + additionalProperties: false + description: Iroha V2 connection configuration. + example: + torii: + apiURL: apiURL + telemetryURL: telemetryURL + accountId: + name: name + domainId: domainId + signingCredential: null + properties: + torii: + $ref: '#/components/schemas/Iroha2BaseConfigTorii' + accountId: + $ref: '#/components/schemas/Iroha2AccountId' + signingCredential: + $ref: '#/components/schemas/Iroha2BaseConfig_signingCredential' + required: + - torii + type: object + IrohaInstructionRequestV1: + additionalProperties: false + description: Single Iroha V2 instruction to be executed request. + properties: + name: + description: Iroha V2 instruction name. + nullable: false + type: IrohaInstruction + params: + description: The list of arguments to pass with specified instruction. + items: {} + type: array + required: + - name + - params + type: object + IrohaTransactionParametersV1: + additionalProperties: true + description: Iroha V2 transaction payload parameters + example: + creationTime: creationTime + ttl: ttl + nonce: 0.8008281904610115 + properties: + ttl: + description: BigInt time to live. + nullable: false + type: string + creationTime: + description: BigInt creation time + nullable: false + type: string + nonce: + description: Transaction nonce + nullable: false + type: number + type: object + IrohaTransactionDefinitionV1: + additionalProperties: false + description: Iroha V2 transaction definition + example: + instruction: null + params: + creationTime: creationTime + ttl: ttl + nonce: 0.8008281904610115 + properties: + instruction: + $ref: '#/components/schemas/IrohaTransactionDefinitionV1_instruction' + params: + $ref: '#/components/schemas/IrohaTransactionParametersV1' + required: + - instruction + type: object + IrohaQueryDefinitionV1: + additionalProperties: false + description: Iroha V2 query definition. + example: + query: "" + params: + - "" + - "" + properties: + query: + description: Name of the query to be executed. + nullable: false + type: IrohaQuery + params: + description: The list of arguments to pass with the query. + items: {} + type: array + required: + - query + type: object + IrohaSignedQueryDefinitionV1: + additionalProperties: false + description: Iroha V2 signed query definition + example: + payload: payload + query: "" + properties: + query: + description: Name of the query to be executed. + nullable: false + type: IrohaQuery + payload: + description: Signed query transaction binary data received from generate-transaction + endpoint. + nullable: false + type: string + required: + - payload + - query + type: object + TransactRequestV1: + additionalProperties: false + description: Request to transact endpoint. + example: + waitForCommit: false + signedTransaction: signedTransaction + transaction: + instruction: null + params: + creationTime: creationTime + ttl: ttl + nonce: 0.8008281904610115 + baseConfig: + torii: + apiURL: apiURL + telemetryURL: telemetryURL + accountId: + name: name + domainId: domainId + signingCredential: null + properties: + signedTransaction: + description: Signed transaction binary data received from generate-transaction + endpoint. + nullable: false + type: string + transaction: + $ref: '#/components/schemas/IrohaTransactionDefinitionV1' + waitForCommit: + default: false + description: Wait unitl transaction is sent and return the final status + (committed / rejected) + nullable: false + type: boolean + baseConfig: + $ref: '#/components/schemas/Iroha2BaseConfig' + type: object + TransactResponseV1: + description: Response from transaction endpoint with operation status. + example: + rejectReason: rejectReason + hash: hash + status: null + properties: + hash: + description: Hexadecimal hash of the transaction sent to the ledger. + nullable: false + type: string + status: + $ref: '#/components/schemas/TransactionStatusV1' + rejectReason: + description: "When waitForCommit was suplied and the transaction was rejected,\ + \ contains the reason of the rejection." + nullable: false + type: string + required: + - hash + - status + type: object + QueryRequestV1: + additionalProperties: false + description: Request to query endpoint. + example: + query: + query: "" + params: + - "" + - "" + signedQuery: + payload: payload + query: "" + baseConfig: + torii: + apiURL: apiURL + telemetryURL: telemetryURL + accountId: + name: name + domainId: domainId + signingCredential: null + properties: + query: + $ref: '#/components/schemas/IrohaQueryDefinitionV1' + signedQuery: + $ref: '#/components/schemas/IrohaSignedQueryDefinitionV1' + baseConfig: + $ref: '#/components/schemas/Iroha2BaseConfig' + type: object + QueryResponseV1: + description: Response with the query results. + example: + response: "" + properties: + response: + description: Query response data that varies between different queries. + nullable: false + required: + - response + type: object + GenerateTransactionRequestV1: + additionalProperties: false + description: Request for generating transaction or query payload that can be + signed on the client side. + example: + request: null + baseConfig: + torii: + apiURL: apiURL + telemetryURL: telemetryURL + accountId: + name: name + domainId: domainId + signingCredential: null + properties: + request: + $ref: '#/components/schemas/GenerateTransactionRequestV1_request' + baseConfig: + $ref: '#/components/schemas/Iroha2BaseConfig' + required: + - request + type: object + ErrorExceptionResponseV1: + description: Error response from the connector. + properties: + message: + description: Short error description message. + nullable: false + type: string + error: + description: Detailed error information. + nullable: false + type: string + required: + - error + - message + type: object + Iroha2BaseConfig_signingCredential: + oneOf: + - $ref: '#/components/schemas/Iroha2KeyPair' + - $ref: '#/components/schemas/KeychainReference' + IrohaTransactionDefinitionV1_instruction: + oneOf: + - $ref: '#/components/schemas/IrohaInstructionRequestV1' + - items: + $ref: '#/components/schemas/IrohaInstructionRequestV1' + type: array + GenerateTransactionRequestV1_request: + oneOf: + - $ref: '#/components/schemas/IrohaTransactionDefinitionV1' + - $ref: '#/components/schemas/IrohaQueryDefinitionV1' + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..b0c75a0a49e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..16d5dcb4e8b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..d039fc91a9b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..7fddf5d9b1f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..9fc3def545d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..33638e95671 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..1e4d4277756 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,424 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.ErrorExceptionResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GenerateTransactionRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GenerateTransactionRequestV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Iroha2AccountId.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Iroha2BaseConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Iroha2BaseConfigSigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Iroha2BaseConfigTorii.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Iroha2KeyJson.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Iroha2KeyPair.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaInstructionRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaQueryDefinitionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaSignedQueryDefinitionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaTransactionDefinitionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaTransactionDefinitionV1Instruction.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.IrohaTransactionParametersV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.KeychainReference.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.QueryRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.QueryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactRequestV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksBinaryResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksOptionsV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksRawResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksResponseV1.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); + } + } + } + + /** + * 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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..77817efd7a9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..9d1b0681d84 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..3940b6f8e7d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..ecb2b6a3726 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..05532036635 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,448 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.ErrorExceptionResponseV1; +import org.openapitools.client.model.GenerateTransactionRequestV1; +import org.openapitools.client.model.QueryRequestV1; +import org.openapitools.client.model.QueryResponseV1; +import org.openapitools.client.model.TransactRequestV1; +import org.openapitools.client.model.TransactResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 generateTransactionV1 + * @param generateTransactionRequestV1 (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call generateTransactionV1Call(GenerateTransactionRequestV1 generateTransactionRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = generateTransactionRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/generate-transaction"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain", + "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 generateTransactionV1ValidateBeforeCall(GenerateTransactionRequestV1 generateTransactionRequestV1, final ApiCallback _callback) throws ApiException { + return generateTransactionV1Call(generateTransactionRequestV1, _callback); + + } + + /** + * Generate transaction that can be signed locally. + * + * @param generateTransactionRequestV1 (optional) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public String generateTransactionV1(GenerateTransactionRequestV1 generateTransactionRequestV1) throws ApiException { + ApiResponse localVarResp = generateTransactionV1WithHttpInfo(generateTransactionRequestV1); + return localVarResp.getData(); + } + + /** + * Generate transaction that can be signed locally. + * + * @param generateTransactionRequestV1 (optional) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public ApiResponse generateTransactionV1WithHttpInfo(GenerateTransactionRequestV1 generateTransactionRequestV1) throws ApiException { + okhttp3.Call localVarCall = generateTransactionV1ValidateBeforeCall(generateTransactionRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Generate transaction that can be signed locally. (asynchronously) + * + * @param generateTransactionRequestV1 (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call generateTransactionV1Async(GenerateTransactionRequestV1 generateTransactionRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = generateTransactionV1ValidateBeforeCall(generateTransactionRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for queryV1 + * @param queryRequestV1 (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error. -
+ */ + public okhttp3.Call queryV1Call(QueryRequestV1 queryRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = queryRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/query"; + + 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 queryV1ValidateBeforeCall(QueryRequestV1 queryRequestV1, final ApiCallback _callback) throws ApiException { + return queryV1Call(queryRequestV1, _callback); + + } + + /** + * Executes a query on a Iroha V2 ledger and returns it's results. + * + * @param queryRequestV1 (optional) + * @return QueryResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error. -
+ */ + public QueryResponseV1 queryV1(QueryRequestV1 queryRequestV1) throws ApiException { + ApiResponse localVarResp = queryV1WithHttpInfo(queryRequestV1); + return localVarResp.getData(); + } + + /** + * Executes a query on a Iroha V2 ledger and returns it's results. + * + * @param queryRequestV1 (optional) + * @return ApiResponse<QueryResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error. -
+ */ + public ApiResponse queryV1WithHttpInfo(QueryRequestV1 queryRequestV1) throws ApiException { + okhttp3.Call localVarCall = queryV1ValidateBeforeCall(queryRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Executes a query on a Iroha V2 ledger and returns it's results. (asynchronously) + * + * @param queryRequestV1 (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error. -
+ */ + public okhttp3.Call queryV1Async(QueryRequestV1 queryRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = queryV1ValidateBeforeCall(queryRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for transactV1 + * @param transactRequestV1 (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error. -
+ */ + public okhttp3.Call transactV1Call(TransactRequestV1 transactRequestV1, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = transactRequestV1; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-iroha2/transact"; + + 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 transactV1ValidateBeforeCall(TransactRequestV1 transactRequestV1, final ApiCallback _callback) throws ApiException { + return transactV1Call(transactRequestV1, _callback); + + } + + /** + * Executes a transaction on a Iroha V2 ledger (by sending some instructions) + * + * @param transactRequestV1 (optional) + * @return TransactResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error. -
+ */ + public TransactResponseV1 transactV1(TransactRequestV1 transactRequestV1) throws ApiException { + ApiResponse localVarResp = transactV1WithHttpInfo(transactRequestV1); + return localVarResp.getData(); + } + + /** + * Executes a transaction on a Iroha V2 ledger (by sending some instructions) + * + * @param transactRequestV1 (optional) + * @return ApiResponse<TransactResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error. -
+ */ + public ApiResponse transactV1WithHttpInfo(TransactRequestV1 transactRequestV1) throws ApiException { + okhttp3.Call localVarCall = transactV1ValidateBeforeCall(transactRequestV1, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Executes a transaction on a Iroha V2 ledger (by sending some instructions) (asynchronously) + * + * @param transactRequestV1 (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error. -
+ */ + public okhttp3.Call transactV1Async(TransactRequestV1 transactRequestV1, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = transactV1ValidateBeforeCall(transactRequestV1, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..68161c54ee8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..9be9fd67186 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..054a7d0c4ef --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..81f0698077d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..39d6ba0cdb0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BlockTypeV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BlockTypeV1.java new file mode 100644 index 00000000000..0fad06da3a6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/BlockTypeV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Iroha V2 block response type. + */ +@JsonAdapter(BlockTypeV1.Adapter.class) +public enum BlockTypeV1 { + + /** + * Default JSON-encoded string full block data. + */ + Raw("raw"), + + /** + * Encoded format that must be decoded with Iroha SDK on client side before use + */ + Binary("binary"); + + private String value; + + BlockTypeV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static BlockTypeV1 fromValue(String value) { + for (BlockTypeV1 b : BlockTypeV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final BlockTypeV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public BlockTypeV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return BlockTypeV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java new file mode 100644 index 00000000000..0cca3cb4a78 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Error response from the connector. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ErrorExceptionResponseV1 { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private String error; + + public ErrorExceptionResponseV1() { + } + + public ErrorExceptionResponseV1 message(String message) { + + this.message = message; + return this; + } + + /** + * Short error description message. + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ErrorExceptionResponseV1 error(String error) { + + this.error = error; + return this; + } + + /** + * Detailed error information. + * @return error + **/ + @javax.annotation.Nonnull + public String getError() { + return error; + } + + + public void setError(String error) { + this.error = error; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorExceptionResponseV1 errorExceptionResponseV1 = (ErrorExceptionResponseV1) o; + return Objects.equals(this.message, errorExceptionResponseV1.message) && + Objects.equals(this.error, errorExceptionResponseV1.error); + } + + @Override + public int hashCode() { + return Objects.hash(message, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorExceptionResponseV1 {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + openapiFields.add("error"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("error"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ErrorExceptionResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ErrorExceptionResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorExceptionResponseV1 is not found in the empty JSON string", ErrorExceptionResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ErrorExceptionResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorExceptionResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorExceptionResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if (!jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorExceptionResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorExceptionResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorExceptionResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorExceptionResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorExceptionResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorExceptionResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorExceptionResponseV1 + * @throws IOException if the JSON string is invalid with respect to ErrorExceptionResponseV1 + */ + public static ErrorExceptionResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorExceptionResponseV1.class); + } + + /** + * Convert an instance of ErrorExceptionResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java new file mode 100644 index 00000000000..4132520b013 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1.java @@ -0,0 +1,249 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.GenerateTransactionRequestV1Request; +import org.openapitools.client.model.Iroha2BaseConfig; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Request for generating transaction or query payload that can be signed on the client side. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GenerateTransactionRequestV1 { + public static final String SERIALIZED_NAME_REQUEST = "request"; + @SerializedName(SERIALIZED_NAME_REQUEST) + private GenerateTransactionRequestV1Request request; + + public static final String SERIALIZED_NAME_BASE_CONFIG = "baseConfig"; + @SerializedName(SERIALIZED_NAME_BASE_CONFIG) + private Iroha2BaseConfig baseConfig; + + public GenerateTransactionRequestV1() { + } + + public GenerateTransactionRequestV1 request(GenerateTransactionRequestV1Request request) { + + this.request = request; + return this; + } + + /** + * Get request + * @return request + **/ + @javax.annotation.Nonnull + public GenerateTransactionRequestV1Request getRequest() { + return request; + } + + + public void setRequest(GenerateTransactionRequestV1Request request) { + this.request = request; + } + + + public GenerateTransactionRequestV1 baseConfig(Iroha2BaseConfig baseConfig) { + + this.baseConfig = baseConfig; + return this; + } + + /** + * Get baseConfig + * @return baseConfig + **/ + @javax.annotation.Nullable + public Iroha2BaseConfig getBaseConfig() { + return baseConfig; + } + + + public void setBaseConfig(Iroha2BaseConfig baseConfig) { + this.baseConfig = baseConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateTransactionRequestV1 generateTransactionRequestV1 = (GenerateTransactionRequestV1) o; + return Objects.equals(this.request, generateTransactionRequestV1.request) && + Objects.equals(this.baseConfig, generateTransactionRequestV1.baseConfig); + } + + @Override + public int hashCode() { + return Objects.hash(request, baseConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateTransactionRequestV1 {\n"); + sb.append(" request: ").append(toIndentedString(request)).append("\n"); + sb.append(" baseConfig: ").append(toIndentedString(baseConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("request"); + openapiFields.add("baseConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("request"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GenerateTransactionRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GenerateTransactionRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GenerateTransactionRequestV1 is not found in the empty JSON string", GenerateTransactionRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GenerateTransactionRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GenerateTransactionRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GenerateTransactionRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `request` + GenerateTransactionRequestV1Request.validateJsonObject(jsonObj.getAsJsonObject("request")); + // validate the optional field `baseConfig` + if (jsonObj.get("baseConfig") != null && !jsonObj.get("baseConfig").isJsonNull()) { + Iroha2BaseConfig.validateJsonObject(jsonObj.getAsJsonObject("baseConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GenerateTransactionRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GenerateTransactionRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GenerateTransactionRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GenerateTransactionRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GenerateTransactionRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GenerateTransactionRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GenerateTransactionRequestV1 + * @throws IOException if the JSON string is invalid with respect to GenerateTransactionRequestV1 + */ + public static GenerateTransactionRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GenerateTransactionRequestV1.class); + } + + /** + * Convert an instance of GenerateTransactionRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1Request.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1Request.java new file mode 100644 index 00000000000..8b1e1364a9b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GenerateTransactionRequestV1Request.java @@ -0,0 +1,288 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.IrohaQuery; +import org.openapitools.client.model.IrohaQueryDefinitionV1; +import org.openapitools.client.model.IrohaTransactionDefinitionV1; +import org.openapitools.client.model.IrohaTransactionDefinitionV1Instruction; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GenerateTransactionRequestV1Request extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(GenerateTransactionRequestV1Request.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GenerateTransactionRequestV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GenerateTransactionRequestV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterIrohaQueryDefinitionV1 = gson.getDelegateAdapter(this, TypeToken.get(IrohaQueryDefinitionV1.class)); + final TypeAdapter adapterIrohaTransactionDefinitionV1 = gson.getDelegateAdapter(this, TypeToken.get(IrohaTransactionDefinitionV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GenerateTransactionRequestV1Request value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `IrohaQueryDefinitionV1` + if (value.getActualInstance() instanceof IrohaQueryDefinitionV1) { + JsonObject obj = adapterIrohaQueryDefinitionV1.toJsonTree((IrohaQueryDefinitionV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `IrohaTransactionDefinitionV1` + if (value.getActualInstance() instanceof IrohaTransactionDefinitionV1) { + JsonObject obj = adapterIrohaTransactionDefinitionV1.toJsonTree((IrohaTransactionDefinitionV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: IrohaQueryDefinitionV1, IrohaTransactionDefinitionV1"); + } + + @Override + public GenerateTransactionRequestV1Request read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize IrohaQueryDefinitionV1 + try { + // validate the JSON object to see if any exception is thrown + IrohaQueryDefinitionV1.validateJsonObject(jsonObject); + actualAdapter = adapterIrohaQueryDefinitionV1; + match++; + log.log(Level.FINER, "Input data matches schema 'IrohaQueryDefinitionV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IrohaQueryDefinitionV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IrohaQueryDefinitionV1'", e); + } + + // deserialize IrohaTransactionDefinitionV1 + try { + // validate the JSON object to see if any exception is thrown + IrohaTransactionDefinitionV1.validateJsonObject(jsonObject); + actualAdapter = adapterIrohaTransactionDefinitionV1; + match++; + log.log(Level.FINER, "Input data matches schema 'IrohaTransactionDefinitionV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IrohaTransactionDefinitionV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IrohaTransactionDefinitionV1'", e); + } + + if (match == 1) { + GenerateTransactionRequestV1Request ret = new GenerateTransactionRequestV1Request(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for GenerateTransactionRequestV1Request: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public GenerateTransactionRequestV1Request() { + super("oneOf", Boolean.FALSE); + } + + public GenerateTransactionRequestV1Request(IrohaQueryDefinitionV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public GenerateTransactionRequestV1Request(IrohaTransactionDefinitionV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("IrohaQueryDefinitionV1", new GenericType() { + }); + schemas.put("IrohaTransactionDefinitionV1", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return GenerateTransactionRequestV1Request.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * IrohaQueryDefinitionV1, IrohaTransactionDefinitionV1 + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof IrohaQueryDefinitionV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof IrohaTransactionDefinitionV1) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be IrohaQueryDefinitionV1, IrohaTransactionDefinitionV1"); + } + + /** + * Get the actual instance, which can be the following: + * IrohaQueryDefinitionV1, IrohaTransactionDefinitionV1 + * + * @return The actual instance (IrohaQueryDefinitionV1, IrohaTransactionDefinitionV1) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `IrohaQueryDefinitionV1`. If the actual instance is not `IrohaQueryDefinitionV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IrohaQueryDefinitionV1` + * @throws ClassCastException if the instance is not `IrohaQueryDefinitionV1` + */ + public IrohaQueryDefinitionV1 getIrohaQueryDefinitionV1() throws ClassCastException { + return (IrohaQueryDefinitionV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `IrohaTransactionDefinitionV1`. If the actual instance is not `IrohaTransactionDefinitionV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IrohaTransactionDefinitionV1` + * @throws ClassCastException if the instance is not `IrohaTransactionDefinitionV1` + */ + public IrohaTransactionDefinitionV1 getIrohaTransactionDefinitionV1() throws ClassCastException { + return (IrohaTransactionDefinitionV1)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GenerateTransactionRequestV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with IrohaQueryDefinitionV1 + try { + IrohaQueryDefinitionV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IrohaQueryDefinitionV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with IrohaTransactionDefinitionV1 + try { + IrohaTransactionDefinitionV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IrohaTransactionDefinitionV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for GenerateTransactionRequestV1Request with oneOf schemas: IrohaQueryDefinitionV1, IrohaTransactionDefinitionV1. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of GenerateTransactionRequestV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of GenerateTransactionRequestV1Request + * @throws IOException if the JSON string is invalid with respect to GenerateTransactionRequestV1Request + */ + public static GenerateTransactionRequestV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GenerateTransactionRequestV1Request.class); + } + + /** + * Convert an instance of GenerateTransactionRequestV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2AccountId.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2AccountId.java new file mode 100644 index 00000000000..bb98c511781 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2AccountId.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Iroha V2 account ID. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Iroha2AccountId { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_DOMAIN_ID = "domainId"; + @SerializedName(SERIALIZED_NAME_DOMAIN_ID) + private String domainId; + + public Iroha2AccountId() { + } + + public Iroha2AccountId name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public Iroha2AccountId domainId(String domainId) { + + this.domainId = domainId; + return this; + } + + /** + * Get domainId + * @return domainId + **/ + @javax.annotation.Nonnull + public String getDomainId() { + return domainId; + } + + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Iroha2AccountId iroha2AccountId = (Iroha2AccountId) o; + return Objects.equals(this.name, iroha2AccountId.name) && + Objects.equals(this.domainId, iroha2AccountId.domainId); + } + + @Override + public int hashCode() { + return Objects.hash(name, domainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Iroha2AccountId {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" domainId: ").append(toIndentedString(domainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("domainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("domainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Iroha2AccountId + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Iroha2AccountId.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Iroha2AccountId is not found in the empty JSON string", Iroha2AccountId.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Iroha2AccountId.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Iroha2AccountId` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Iroha2AccountId.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("domainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `domainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Iroha2AccountId.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Iroha2AccountId' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Iroha2AccountId.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Iroha2AccountId value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Iroha2AccountId read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Iroha2AccountId given an JSON string + * + * @param jsonString JSON string + * @return An instance of Iroha2AccountId + * @throws IOException if the JSON string is invalid with respect to Iroha2AccountId + */ + public static Iroha2AccountId fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Iroha2AccountId.class); + } + + /** + * Convert an instance of Iroha2AccountId to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfig.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfig.java new file mode 100644 index 00000000000..0143a90984d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfig.java @@ -0,0 +1,282 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Iroha2AccountId; +import org.openapitools.client.model.Iroha2BaseConfigSigningCredential; +import org.openapitools.client.model.Iroha2BaseConfigTorii; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Iroha V2 connection configuration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Iroha2BaseConfig { + public static final String SERIALIZED_NAME_TORII = "torii"; + @SerializedName(SERIALIZED_NAME_TORII) + private Iroha2BaseConfigTorii torii; + + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private Iroha2AccountId accountId; + + public static final String SERIALIZED_NAME_SIGNING_CREDENTIAL = "signingCredential"; + @SerializedName(SERIALIZED_NAME_SIGNING_CREDENTIAL) + private Iroha2BaseConfigSigningCredential signingCredential; + + public Iroha2BaseConfig() { + } + + public Iroha2BaseConfig torii(Iroha2BaseConfigTorii torii) { + + this.torii = torii; + return this; + } + + /** + * Get torii + * @return torii + **/ + @javax.annotation.Nonnull + public Iroha2BaseConfigTorii getTorii() { + return torii; + } + + + public void setTorii(Iroha2BaseConfigTorii torii) { + this.torii = torii; + } + + + public Iroha2BaseConfig accountId(Iroha2AccountId accountId) { + + this.accountId = accountId; + return this; + } + + /** + * Get accountId + * @return accountId + **/ + @javax.annotation.Nullable + public Iroha2AccountId getAccountId() { + return accountId; + } + + + public void setAccountId(Iroha2AccountId accountId) { + this.accountId = accountId; + } + + + public Iroha2BaseConfig signingCredential(Iroha2BaseConfigSigningCredential signingCredential) { + + this.signingCredential = signingCredential; + return this; + } + + /** + * Get signingCredential + * @return signingCredential + **/ + @javax.annotation.Nullable + public Iroha2BaseConfigSigningCredential getSigningCredential() { + return signingCredential; + } + + + public void setSigningCredential(Iroha2BaseConfigSigningCredential signingCredential) { + this.signingCredential = signingCredential; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Iroha2BaseConfig iroha2BaseConfig = (Iroha2BaseConfig) o; + return Objects.equals(this.torii, iroha2BaseConfig.torii) && + Objects.equals(this.accountId, iroha2BaseConfig.accountId) && + Objects.equals(this.signingCredential, iroha2BaseConfig.signingCredential); + } + + @Override + public int hashCode() { + return Objects.hash(torii, accountId, signingCredential); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Iroha2BaseConfig {\n"); + sb.append(" torii: ").append(toIndentedString(torii)).append("\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" signingCredential: ").append(toIndentedString(signingCredential)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("torii"); + openapiFields.add("accountId"); + openapiFields.add("signingCredential"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("torii"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Iroha2BaseConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Iroha2BaseConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Iroha2BaseConfig is not found in the empty JSON string", Iroha2BaseConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Iroha2BaseConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Iroha2BaseConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Iroha2BaseConfig.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `torii` + Iroha2BaseConfigTorii.validateJsonObject(jsonObj.getAsJsonObject("torii")); + // validate the optional field `accountId` + if (jsonObj.get("accountId") != null && !jsonObj.get("accountId").isJsonNull()) { + Iroha2AccountId.validateJsonObject(jsonObj.getAsJsonObject("accountId")); + } + // validate the optional field `signingCredential` + if (jsonObj.get("signingCredential") != null && !jsonObj.get("signingCredential").isJsonNull()) { + Iroha2BaseConfigSigningCredential.validateJsonObject(jsonObj.getAsJsonObject("signingCredential")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Iroha2BaseConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Iroha2BaseConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Iroha2BaseConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Iroha2BaseConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Iroha2BaseConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Iroha2BaseConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of Iroha2BaseConfig + * @throws IOException if the JSON string is invalid with respect to Iroha2BaseConfig + */ + public static Iroha2BaseConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Iroha2BaseConfig.class); + } + + /** + * Convert an instance of Iroha2BaseConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredential.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredential.java new file mode 100644 index 00000000000..3f7ecb85610 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredential.java @@ -0,0 +1,285 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Iroha2KeyJson; +import org.openapitools.client.model.Iroha2KeyPair; +import org.openapitools.client.model.KeychainReference; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Iroha2BaseConfigSigningCredential extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Iroha2BaseConfigSigningCredential.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Iroha2BaseConfigSigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Iroha2BaseConfigSigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterIroha2KeyPair = gson.getDelegateAdapter(this, TypeToken.get(Iroha2KeyPair.class)); + final TypeAdapter adapterKeychainReference = gson.getDelegateAdapter(this, TypeToken.get(KeychainReference.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Iroha2BaseConfigSigningCredential value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Iroha2KeyPair` + if (value.getActualInstance() instanceof Iroha2KeyPair) { + JsonObject obj = adapterIroha2KeyPair.toJsonTree((Iroha2KeyPair)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `KeychainReference` + if (value.getActualInstance() instanceof KeychainReference) { + JsonObject obj = adapterKeychainReference.toJsonTree((KeychainReference)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Iroha2KeyPair, KeychainReference"); + } + + @Override + public Iroha2BaseConfigSigningCredential read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Iroha2KeyPair + try { + // validate the JSON object to see if any exception is thrown + Iroha2KeyPair.validateJsonObject(jsonObject); + actualAdapter = adapterIroha2KeyPair; + match++; + log.log(Level.FINER, "Input data matches schema 'Iroha2KeyPair'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Iroha2KeyPair failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Iroha2KeyPair'", e); + } + + // deserialize KeychainReference + try { + // validate the JSON object to see if any exception is thrown + KeychainReference.validateJsonObject(jsonObject); + actualAdapter = adapterKeychainReference; + match++; + log.log(Level.FINER, "Input data matches schema 'KeychainReference'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for KeychainReference failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'KeychainReference'", e); + } + + if (match == 1) { + Iroha2BaseConfigSigningCredential ret = new Iroha2BaseConfigSigningCredential(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Iroha2BaseConfigSigningCredential: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Iroha2BaseConfigSigningCredential() { + super("oneOf", Boolean.FALSE); + } + + public Iroha2BaseConfigSigningCredential(Iroha2KeyPair o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Iroha2BaseConfigSigningCredential(KeychainReference o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Iroha2KeyPair", new GenericType() { + }); + schemas.put("KeychainReference", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Iroha2BaseConfigSigningCredential.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Iroha2KeyPair, KeychainReference + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Iroha2KeyPair) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof KeychainReference) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Iroha2KeyPair, KeychainReference"); + } + + /** + * Get the actual instance, which can be the following: + * Iroha2KeyPair, KeychainReference + * + * @return The actual instance (Iroha2KeyPair, KeychainReference) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Iroha2KeyPair`. If the actual instance is not `Iroha2KeyPair`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Iroha2KeyPair` + * @throws ClassCastException if the instance is not `Iroha2KeyPair` + */ + public Iroha2KeyPair getIroha2KeyPair() throws ClassCastException { + return (Iroha2KeyPair)super.getActualInstance(); + } + + /** + * Get the actual instance of `KeychainReference`. If the actual instance is not `KeychainReference`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `KeychainReference` + * @throws ClassCastException if the instance is not `KeychainReference` + */ + public KeychainReference getKeychainReference() throws ClassCastException { + return (KeychainReference)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Iroha2BaseConfigSigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Iroha2KeyPair + try { + Iroha2KeyPair.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Iroha2KeyPair failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with KeychainReference + try { + KeychainReference.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for KeychainReference failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Iroha2BaseConfigSigningCredential with oneOf schemas: Iroha2KeyPair, KeychainReference. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Iroha2BaseConfigSigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Iroha2BaseConfigSigningCredential + * @throws IOException if the JSON string is invalid with respect to Iroha2BaseConfigSigningCredential + */ + public static Iroha2BaseConfigSigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Iroha2BaseConfigSigningCredential.class); + } + + /** + * Convert an instance of Iroha2BaseConfigSigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfigTorii.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfigTorii.java new file mode 100644 index 00000000000..63aa09eb1fd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2BaseConfigTorii.java @@ -0,0 +1,239 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Iroha V2 peer connection information. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Iroha2BaseConfigTorii { + public static final String SERIALIZED_NAME_API_U_R_L = "apiURL"; + @SerializedName(SERIALIZED_NAME_API_U_R_L) + private String apiURL; + + public static final String SERIALIZED_NAME_TELEMETRY_U_R_L = "telemetryURL"; + @SerializedName(SERIALIZED_NAME_TELEMETRY_U_R_L) + private String telemetryURL; + + public Iroha2BaseConfigTorii() { + } + + public Iroha2BaseConfigTorii apiURL(String apiURL) { + + this.apiURL = apiURL; + return this; + } + + /** + * Get apiURL + * @return apiURL + **/ + @javax.annotation.Nullable + public String getApiURL() { + return apiURL; + } + + + public void setApiURL(String apiURL) { + this.apiURL = apiURL; + } + + + public Iroha2BaseConfigTorii telemetryURL(String telemetryURL) { + + this.telemetryURL = telemetryURL; + return this; + } + + /** + * Get telemetryURL + * @return telemetryURL + **/ + @javax.annotation.Nullable + public String getTelemetryURL() { + return telemetryURL; + } + + + public void setTelemetryURL(String telemetryURL) { + this.telemetryURL = telemetryURL; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Iroha2BaseConfigTorii iroha2BaseConfigTorii = (Iroha2BaseConfigTorii) o; + return Objects.equals(this.apiURL, iroha2BaseConfigTorii.apiURL) && + Objects.equals(this.telemetryURL, iroha2BaseConfigTorii.telemetryURL); + } + + @Override + public int hashCode() { + return Objects.hash(apiURL, telemetryURL); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Iroha2BaseConfigTorii {\n"); + sb.append(" apiURL: ").append(toIndentedString(apiURL)).append("\n"); + sb.append(" telemetryURL: ").append(toIndentedString(telemetryURL)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("apiURL"); + openapiFields.add("telemetryURL"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Iroha2BaseConfigTorii + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Iroha2BaseConfigTorii.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Iroha2BaseConfigTorii is not found in the empty JSON string", Iroha2BaseConfigTorii.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Iroha2BaseConfigTorii.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Iroha2BaseConfigTorii` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("apiURL") != null && !jsonObj.get("apiURL").isJsonNull()) && !jsonObj.get("apiURL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `apiURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiURL").toString())); + } + if ((jsonObj.get("telemetryURL") != null && !jsonObj.get("telemetryURL").isJsonNull()) && !jsonObj.get("telemetryURL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `telemetryURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telemetryURL").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Iroha2BaseConfigTorii.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Iroha2BaseConfigTorii' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Iroha2BaseConfigTorii.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Iroha2BaseConfigTorii value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Iroha2BaseConfigTorii read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Iroha2BaseConfigTorii given an JSON string + * + * @param jsonString JSON string + * @return An instance of Iroha2BaseConfigTorii + * @throws IOException if the JSON string is invalid with respect to Iroha2BaseConfigTorii + */ + public static Iroha2BaseConfigTorii fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Iroha2BaseConfigTorii.class); + } + + /** + * Convert an instance of Iroha2BaseConfigTorii to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2KeyJson.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2KeyJson.java new file mode 100644 index 00000000000..57e45964cb9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2KeyJson.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Private/Public key JSON containing payload and digest function. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Iroha2KeyJson { + public static final String SERIALIZED_NAME_DIGEST_FUNCTION = "digestFunction"; + @SerializedName(SERIALIZED_NAME_DIGEST_FUNCTION) + private String digestFunction; + + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private String payload; + + public Iroha2KeyJson() { + } + + public Iroha2KeyJson digestFunction(String digestFunction) { + + this.digestFunction = digestFunction; + return this; + } + + /** + * Get digestFunction + * @return digestFunction + **/ + @javax.annotation.Nonnull + public String getDigestFunction() { + return digestFunction; + } + + + public void setDigestFunction(String digestFunction) { + this.digestFunction = digestFunction; + } + + + public Iroha2KeyJson payload(String payload) { + + this.payload = payload; + return this; + } + + /** + * Get payload + * @return payload + **/ + @javax.annotation.Nonnull + public String getPayload() { + return payload; + } + + + public void setPayload(String payload) { + this.payload = payload; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Iroha2KeyJson iroha2KeyJson = (Iroha2KeyJson) o; + return Objects.equals(this.digestFunction, iroha2KeyJson.digestFunction) && + Objects.equals(this.payload, iroha2KeyJson.payload); + } + + @Override + public int hashCode() { + return Objects.hash(digestFunction, payload); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Iroha2KeyJson {\n"); + sb.append(" digestFunction: ").append(toIndentedString(digestFunction)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("digestFunction"); + openapiFields.add("payload"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("digestFunction"); + openapiRequiredFields.add("payload"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Iroha2KeyJson + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Iroha2KeyJson.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Iroha2KeyJson is not found in the empty JSON string", Iroha2KeyJson.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Iroha2KeyJson.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Iroha2KeyJson` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Iroha2KeyJson.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("digestFunction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `digestFunction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("digestFunction").toString())); + } + if (!jsonObj.get("payload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payload").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Iroha2KeyJson.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Iroha2KeyJson' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Iroha2KeyJson.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Iroha2KeyJson value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Iroha2KeyJson read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Iroha2KeyJson given an JSON string + * + * @param jsonString JSON string + * @return An instance of Iroha2KeyJson + * @throws IOException if the JSON string is invalid with respect to Iroha2KeyJson + */ + public static Iroha2KeyJson fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Iroha2KeyJson.class); + } + + /** + * Convert an instance of Iroha2KeyJson to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2KeyPair.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2KeyPair.java new file mode 100644 index 00000000000..ed5a700625c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Iroha2KeyPair.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Iroha2KeyJson; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Pair of Iroha account private and public keys. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Iroha2KeyPair { + public static final String SERIALIZED_NAME_PRIVATE_KEY = "privateKey"; + @SerializedName(SERIALIZED_NAME_PRIVATE_KEY) + private Iroha2KeyJson privateKey; + + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + private String publicKey; + + public Iroha2KeyPair() { + } + + public Iroha2KeyPair privateKey(Iroha2KeyJson privateKey) { + + this.privateKey = privateKey; + return this; + } + + /** + * Get privateKey + * @return privateKey + **/ + @javax.annotation.Nonnull + public Iroha2KeyJson getPrivateKey() { + return privateKey; + } + + + public void setPrivateKey(Iroha2KeyJson privateKey) { + this.privateKey = privateKey; + } + + + public Iroha2KeyPair publicKey(String publicKey) { + + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + **/ + @javax.annotation.Nonnull + public String getPublicKey() { + return publicKey; + } + + + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Iroha2KeyPair iroha2KeyPair = (Iroha2KeyPair) o; + return Objects.equals(this.privateKey, iroha2KeyPair.privateKey) && + Objects.equals(this.publicKey, iroha2KeyPair.publicKey); + } + + @Override + public int hashCode() { + return Objects.hash(privateKey, publicKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Iroha2KeyPair {\n"); + sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("privateKey"); + openapiFields.add("publicKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("privateKey"); + openapiRequiredFields.add("publicKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Iroha2KeyPair + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Iroha2KeyPair.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Iroha2KeyPair is not found in the empty JSON string", Iroha2KeyPair.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Iroha2KeyPair.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Iroha2KeyPair` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Iroha2KeyPair.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `privateKey` + Iroha2KeyJson.validateJsonObject(jsonObj.getAsJsonObject("privateKey")); + if (!jsonObj.get("publicKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Iroha2KeyPair.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Iroha2KeyPair' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Iroha2KeyPair.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Iroha2KeyPair value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Iroha2KeyPair read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Iroha2KeyPair given an JSON string + * + * @param jsonString JSON string + * @return An instance of Iroha2KeyPair + * @throws IOException if the JSON string is invalid with respect to Iroha2KeyPair + */ + public static Iroha2KeyPair fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Iroha2KeyPair.class); + } + + /** + * Convert an instance of Iroha2KeyPair to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaInstruction.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaInstruction.java new file mode 100644 index 00000000000..63e382156fe --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaInstruction.java @@ -0,0 +1,104 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Command names that correspond to Iroha Special Instructions (https://hyperledger.github.io/iroha-2-docs/guide/advanced/isi.html) + */ +@JsonAdapter(IrohaInstruction.Adapter.class) +public enum IrohaInstruction { + + /** + * Register new domain + */ + RegisterDomain("registerDomain"), + + /** + * Register new asset definition + */ + RegisterAssetDefinition("registerAssetDefinition"), + + /** + * Register new asset + */ + RegisterAsset("registerAsset"), + + /** + * Mint asset value + */ + MintAsset("mintAsset"), + + /** + * Burn asset value + */ + BurnAsset("burnAsset"), + + /** + * Transfer asset between accounts + */ + TransferAsset("transferAsset"), + + /** + * Register new account + */ + RegisterAccount("registerAccount"); + + private String value; + + IrohaInstruction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IrohaInstruction fromValue(String value) { + for (IrohaInstruction b : IrohaInstruction.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final IrohaInstruction enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IrohaInstruction read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IrohaInstruction.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaInstructionRequestV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaInstructionRequestV1.java new file mode 100644 index 00000000000..7fdcb4de498 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaInstructionRequestV1.java @@ -0,0 +1,259 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.IrohaInstruction; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Single Iroha V2 instruction to be executed request. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaInstructionRequestV1 { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private IrohaInstruction name = null; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = new ArrayList<>(); + + public IrohaInstructionRequestV1() { + } + + public IrohaInstructionRequestV1 name(IrohaInstruction name) { + + this.name = name; + return this; + } + + /** + * Iroha V2 instruction name. + * @return name + **/ + @javax.annotation.Nonnull + public IrohaInstruction getName() { + return name; + } + + + public void setName(IrohaInstruction name) { + this.name = name; + } + + + public IrohaInstructionRequestV1 params(List params) { + + this.params = params; + return this; + } + + public IrohaInstructionRequestV1 addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = new ArrayList<>(); + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass with specified instruction. + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaInstructionRequestV1 irohaInstructionRequestV1 = (IrohaInstructionRequestV1) o; + return Objects.equals(this.name, irohaInstructionRequestV1.name) && + Objects.equals(this.params, irohaInstructionRequestV1.params); + } + + @Override + public int hashCode() { + return Objects.hash(name, params); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaInstructionRequestV1 {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("params"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("params"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaInstructionRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaInstructionRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaInstructionRequestV1 is not found in the empty JSON string", IrohaInstructionRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IrohaInstructionRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IrohaInstructionRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IrohaInstructionRequestV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaInstructionRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaInstructionRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaInstructionRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaInstructionRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IrohaInstructionRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaInstructionRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaInstructionRequestV1 + * @throws IOException if the JSON string is invalid with respect to IrohaInstructionRequestV1 + */ + public static IrohaInstructionRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaInstructionRequestV1.class); + } + + /** + * Convert an instance of IrohaInstructionRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQuery.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQuery.java new file mode 100644 index 00000000000..3790013c5e2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQuery.java @@ -0,0 +1,129 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Command names that correspond to Iroha queries (https://hyperledger.github.io/iroha-2-docs/guide/advanced/queries.html) + */ +@JsonAdapter(IrohaQuery.Adapter.class) +public enum IrohaQuery { + + /** + * Get list of all registered domains + */ + FindAllDomains("findAllDomains"), + + /** + * Get domain with specified ID + */ + FindDomainById("findDomainById"), + + /** + * Get asset definition with specified ID + */ + FindAssetDefinitionById("findAssetDefinitionById"), + + /** + * Get list of all registered asset definition + */ + FindAllAssetsDefinitions("findAllAssetsDefinitions"), + + /** + * Get asset with specified ID + */ + FindAssetById("findAssetById"), + + /** + * Get list of all registered assets + */ + FindAllAssets("findAllAssets"), + + /** + * Get list of all ledger peers + */ + FindAllPeers("findAllPeers"), + + /** + * Get list of all ledger blocks + */ + FindAllBlocks("findAllBlocks"), + + /** + * Get account with specified ID + */ + FindAccountById("findAccountById"), + + /** + * Get list of all registered accounts + */ + FindAllAccounts("findAllAccounts"), + + /** + * Get list of all transactions + */ + FindAllTransactions("findAllTransactions"), + + /** + * Get transaction with specified hash + */ + FindTransactionByHash("findTransactionByHash"); + + private String value; + + IrohaQuery(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IrohaQuery fromValue(String value) { + for (IrohaQuery b : IrohaQuery.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final IrohaQuery enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IrohaQuery read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IrohaQuery.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQueryDefinitionV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQueryDefinitionV1.java new file mode 100644 index 00000000000..36db7ae4957 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaQueryDefinitionV1.java @@ -0,0 +1,256 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.IrohaQuery; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Iroha V2 query definition. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaQueryDefinitionV1 { + public static final String SERIALIZED_NAME_QUERY = "query"; + @SerializedName(SERIALIZED_NAME_QUERY) + private IrohaQuery query = null; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params; + + public IrohaQueryDefinitionV1() { + } + + public IrohaQueryDefinitionV1 query(IrohaQuery query) { + + this.query = query; + return this; + } + + /** + * Name of the query to be executed. + * @return query + **/ + @javax.annotation.Nonnull + public IrohaQuery getQuery() { + return query; + } + + + public void setQuery(IrohaQuery query) { + this.query = query; + } + + + public IrohaQueryDefinitionV1 params(List params) { + + this.params = params; + return this; + } + + public IrohaQueryDefinitionV1 addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = new ArrayList<>(); + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass with the query. + * @return params + **/ + @javax.annotation.Nullable + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaQueryDefinitionV1 irohaQueryDefinitionV1 = (IrohaQueryDefinitionV1) o; + return Objects.equals(this.query, irohaQueryDefinitionV1.query) && + Objects.equals(this.params, irohaQueryDefinitionV1.params); + } + + @Override + public int hashCode() { + return Objects.hash(query, params); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaQueryDefinitionV1 {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("query"); + openapiFields.add("params"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("query"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaQueryDefinitionV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaQueryDefinitionV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaQueryDefinitionV1 is not found in the empty JSON string", IrohaQueryDefinitionV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IrohaQueryDefinitionV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IrohaQueryDefinitionV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IrohaQueryDefinitionV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("params") != null && !jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaQueryDefinitionV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaQueryDefinitionV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaQueryDefinitionV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaQueryDefinitionV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IrohaQueryDefinitionV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaQueryDefinitionV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaQueryDefinitionV1 + * @throws IOException if the JSON string is invalid with respect to IrohaQueryDefinitionV1 + */ + public static IrohaQueryDefinitionV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaQueryDefinitionV1.class); + } + + /** + * Convert an instance of IrohaQueryDefinitionV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1.java new file mode 100644 index 00000000000..49cd8668c98 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1.java @@ -0,0 +1,246 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaQuery; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Iroha V2 signed query definition + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaSignedQueryDefinitionV1 { + public static final String SERIALIZED_NAME_QUERY = "query"; + @SerializedName(SERIALIZED_NAME_QUERY) + private IrohaQuery query = null; + + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private String payload; + + public IrohaSignedQueryDefinitionV1() { + } + + public IrohaSignedQueryDefinitionV1 query(IrohaQuery query) { + + this.query = query; + return this; + } + + /** + * Name of the query to be executed. + * @return query + **/ + @javax.annotation.Nonnull + public IrohaQuery getQuery() { + return query; + } + + + public void setQuery(IrohaQuery query) { + this.query = query; + } + + + public IrohaSignedQueryDefinitionV1 payload(String payload) { + + this.payload = payload; + return this; + } + + /** + * Signed query transaction binary data received from generate-transaction endpoint. + * @return payload + **/ + @javax.annotation.Nonnull + public String getPayload() { + return payload; + } + + + public void setPayload(String payload) { + this.payload = payload; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaSignedQueryDefinitionV1 irohaSignedQueryDefinitionV1 = (IrohaSignedQueryDefinitionV1) o; + return Objects.equals(this.query, irohaSignedQueryDefinitionV1.query) && + Objects.equals(this.payload, irohaSignedQueryDefinitionV1.payload); + } + + @Override + public int hashCode() { + return Objects.hash(query, payload); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaSignedQueryDefinitionV1 {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("query"); + openapiFields.add("payload"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("query"); + openapiRequiredFields.add("payload"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaSignedQueryDefinitionV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaSignedQueryDefinitionV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaSignedQueryDefinitionV1 is not found in the empty JSON string", IrohaSignedQueryDefinitionV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IrohaSignedQueryDefinitionV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IrohaSignedQueryDefinitionV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IrohaSignedQueryDefinitionV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("payload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payload").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaSignedQueryDefinitionV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaSignedQueryDefinitionV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaSignedQueryDefinitionV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaSignedQueryDefinitionV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IrohaSignedQueryDefinitionV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaSignedQueryDefinitionV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaSignedQueryDefinitionV1 + * @throws IOException if the JSON string is invalid with respect to IrohaSignedQueryDefinitionV1 + */ + public static IrohaSignedQueryDefinitionV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaSignedQueryDefinitionV1.class); + } + + /** + * Convert an instance of IrohaSignedQueryDefinitionV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1.java new file mode 100644 index 00000000000..06df56aa732 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1.java @@ -0,0 +1,245 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.IrohaTransactionDefinitionV1Instruction; +import org.openapitools.client.model.IrohaTransactionParametersV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Iroha V2 transaction definition + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaTransactionDefinitionV1 { + public static final String SERIALIZED_NAME_INSTRUCTION = "instruction"; + @SerializedName(SERIALIZED_NAME_INSTRUCTION) + private IrohaTransactionDefinitionV1Instruction instruction; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private IrohaTransactionParametersV1 params; + + public IrohaTransactionDefinitionV1() { + } + + public IrohaTransactionDefinitionV1 instruction(IrohaTransactionDefinitionV1Instruction instruction) { + + this.instruction = instruction; + return this; + } + + /** + * Get instruction + * @return instruction + **/ + @javax.annotation.Nonnull + public IrohaTransactionDefinitionV1Instruction getInstruction() { + return instruction; + } + + + public void setInstruction(IrohaTransactionDefinitionV1Instruction instruction) { + this.instruction = instruction; + } + + + public IrohaTransactionDefinitionV1 params(IrohaTransactionParametersV1 params) { + + this.params = params; + return this; + } + + /** + * Get params + * @return params + **/ + @javax.annotation.Nullable + public IrohaTransactionParametersV1 getParams() { + return params; + } + + + public void setParams(IrohaTransactionParametersV1 params) { + this.params = params; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaTransactionDefinitionV1 irohaTransactionDefinitionV1 = (IrohaTransactionDefinitionV1) o; + return Objects.equals(this.instruction, irohaTransactionDefinitionV1.instruction) && + Objects.equals(this.params, irohaTransactionDefinitionV1.params); + } + + @Override + public int hashCode() { + return Objects.hash(instruction, params); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaTransactionDefinitionV1 {\n"); + sb.append(" instruction: ").append(toIndentedString(instruction)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("instruction"); + openapiFields.add("params"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("instruction"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaTransactionDefinitionV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaTransactionDefinitionV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaTransactionDefinitionV1 is not found in the empty JSON string", IrohaTransactionDefinitionV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IrohaTransactionDefinitionV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IrohaTransactionDefinitionV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IrohaTransactionDefinitionV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `instruction` + IrohaTransactionDefinitionV1Instruction.validateJsonObject(jsonObj.getAsJsonObject("instruction")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaTransactionDefinitionV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaTransactionDefinitionV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaTransactionDefinitionV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaTransactionDefinitionV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IrohaTransactionDefinitionV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaTransactionDefinitionV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaTransactionDefinitionV1 + * @throws IOException if the JSON string is invalid with respect to IrohaTransactionDefinitionV1 + */ + public static IrohaTransactionDefinitionV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaTransactionDefinitionV1.class); + } + + /** + * Convert an instance of IrohaTransactionDefinitionV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Instruction.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Instruction.java new file mode 100644 index 00000000000..852e7dacc90 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Instruction.java @@ -0,0 +1,286 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.IrohaInstruction; +import org.openapitools.client.model.IrohaInstructionRequestV1; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaTransactionDefinitionV1Instruction extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(IrohaTransactionDefinitionV1Instruction.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaTransactionDefinitionV1Instruction.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaTransactionDefinitionV1Instruction' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterIrohaInstructionRequestV1 = gson.getDelegateAdapter(this, TypeToken.get(IrohaInstructionRequestV1.class)); + final TypeAdapter adapterList<IrohaInstructionRequestV1> = gson.getDelegateAdapter(this, TypeToken.get(List<IrohaInstructionRequestV1>.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaTransactionDefinitionV1Instruction value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `IrohaInstructionRequestV1` + if (value.getActualInstance() instanceof IrohaInstructionRequestV1) { + JsonObject obj = adapterIrohaInstructionRequestV1.toJsonTree((IrohaInstructionRequestV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `List<IrohaInstructionRequestV1>` + if (value.getActualInstance() instanceof List<IrohaInstructionRequestV1>) { + JsonObject obj = adapterList<IrohaInstructionRequestV1>.toJsonTree((List<IrohaInstructionRequestV1>)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: IrohaInstructionRequestV1, List"); + } + + @Override + public IrohaTransactionDefinitionV1Instruction read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize IrohaInstructionRequestV1 + try { + // validate the JSON object to see if any exception is thrown + IrohaInstructionRequestV1.validateJsonObject(jsonObject); + actualAdapter = adapterIrohaInstructionRequestV1; + match++; + log.log(Level.FINER, "Input data matches schema 'IrohaInstructionRequestV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IrohaInstructionRequestV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IrohaInstructionRequestV1'", e); + } + + // deserialize List + try { + // validate the JSON object to see if any exception is thrown + List<IrohaInstructionRequestV1>.validateJsonObject(jsonObject); + actualAdapter = adapterList<IrohaInstructionRequestV1>; + match++; + log.log(Level.FINER, "Input data matches schema 'List'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List'", e); + } + + if (match == 1) { + IrohaTransactionDefinitionV1Instruction ret = new IrohaTransactionDefinitionV1Instruction(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for IrohaTransactionDefinitionV1Instruction: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public IrohaTransactionDefinitionV1Instruction() { + super("oneOf", Boolean.FALSE); + } + + public IrohaTransactionDefinitionV1Instruction(IrohaInstructionRequestV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public IrohaTransactionDefinitionV1Instruction(List o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("IrohaInstructionRequestV1", new GenericType() { + }); + schemas.put("List", new GenericType>() { + }); + } + + @Override + public Map getSchemas() { + return IrohaTransactionDefinitionV1Instruction.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * IrohaInstructionRequestV1, List + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof IrohaInstructionRequestV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof List) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be IrohaInstructionRequestV1, List"); + } + + /** + * Get the actual instance, which can be the following: + * IrohaInstructionRequestV1, List + * + * @return The actual instance (IrohaInstructionRequestV1, List) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `IrohaInstructionRequestV1`. If the actual instance is not `IrohaInstructionRequestV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IrohaInstructionRequestV1` + * @throws ClassCastException if the instance is not `IrohaInstructionRequestV1` + */ + public IrohaInstructionRequestV1 getIrohaInstructionRequestV1() throws ClassCastException { + return (IrohaInstructionRequestV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `List`. If the actual instance is not `List`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List` + * @throws ClassCastException if the instance is not `List` + */ + public List getList() throws ClassCastException { + return (List)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaTransactionDefinitionV1Instruction + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with IrohaInstructionRequestV1 + try { + IrohaInstructionRequestV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IrohaInstructionRequestV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with List + try { + List.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for IrohaTransactionDefinitionV1Instruction with oneOf schemas: IrohaInstructionRequestV1, List. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of IrohaTransactionDefinitionV1Instruction given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaTransactionDefinitionV1Instruction + * @throws IOException if the JSON string is invalid with respect to IrohaTransactionDefinitionV1Instruction + */ + public static IrohaTransactionDefinitionV1Instruction fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaTransactionDefinitionV1Instruction.class); + } + + /** + * Convert an instance of IrohaTransactionDefinitionV1Instruction to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionParametersV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionParametersV1.java new file mode 100644 index 00000000000..a63e0428336 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/IrohaTransactionParametersV1.java @@ -0,0 +1,343 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Iroha V2 transaction payload parameters + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class IrohaTransactionParametersV1 { + public static final String SERIALIZED_NAME_TTL = "ttl"; + @SerializedName(SERIALIZED_NAME_TTL) + private String ttl; + + public static final String SERIALIZED_NAME_CREATION_TIME = "creationTime"; + @SerializedName(SERIALIZED_NAME_CREATION_TIME) + private String creationTime; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public IrohaTransactionParametersV1() { + } + + public IrohaTransactionParametersV1 ttl(String ttl) { + + this.ttl = ttl; + return this; + } + + /** + * BigInt time to live. + * @return ttl + **/ + @javax.annotation.Nullable + public String getTtl() { + return ttl; + } + + + public void setTtl(String ttl) { + this.ttl = ttl; + } + + + public IrohaTransactionParametersV1 creationTime(String creationTime) { + + this.creationTime = creationTime; + return this; + } + + /** + * BigInt creation time + * @return creationTime + **/ + @javax.annotation.Nullable + public String getCreationTime() { + return creationTime; + } + + + public void setCreationTime(String creationTime) { + this.creationTime = creationTime; + } + + + public IrohaTransactionParametersV1 nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Transaction nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IrohaTransactionParametersV1 instance itself + */ + public IrohaTransactionParametersV1 putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IrohaTransactionParametersV1 irohaTransactionParametersV1 = (IrohaTransactionParametersV1) o; + return Objects.equals(this.ttl, irohaTransactionParametersV1.ttl) && + Objects.equals(this.creationTime, irohaTransactionParametersV1.creationTime) && + Objects.equals(this.nonce, irohaTransactionParametersV1.nonce)&& + Objects.equals(this.additionalProperties, irohaTransactionParametersV1.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ttl, creationTime, nonce, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IrohaTransactionParametersV1 {\n"); + sb.append(" ttl: ").append(toIndentedString(ttl)).append("\n"); + sb.append(" creationTime: ").append(toIndentedString(creationTime)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ttl"); + openapiFields.add("creationTime"); + openapiFields.add("nonce"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IrohaTransactionParametersV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!IrohaTransactionParametersV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IrohaTransactionParametersV1 is not found in the empty JSON string", IrohaTransactionParametersV1.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("ttl") != null && !jsonObj.get("ttl").isJsonNull()) && !jsonObj.get("ttl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ttl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ttl").toString())); + } + if ((jsonObj.get("creationTime") != null && !jsonObj.get("creationTime").isJsonNull()) && !jsonObj.get("creationTime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `creationTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("creationTime").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IrohaTransactionParametersV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IrohaTransactionParametersV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IrohaTransactionParametersV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IrohaTransactionParametersV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IrohaTransactionParametersV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + IrohaTransactionParametersV1 instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IrohaTransactionParametersV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of IrohaTransactionParametersV1 + * @throws IOException if the JSON string is invalid with respect to IrohaTransactionParametersV1 + */ + public static IrohaTransactionParametersV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IrohaTransactionParametersV1.class); + } + + /** + * Convert an instance of IrohaTransactionParametersV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/KeychainReference.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/KeychainReference.java new file mode 100644 index 00000000000..b6044bad1ca --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/KeychainReference.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Reference to entry stored in Cactus keychain plugin. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class KeychainReference { + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_KEYCHAIN_REF = "keychainRef"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_REF) + private String keychainRef; + + public KeychainReference() { + } + + public KeychainReference keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * Keychain plugin ID. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public KeychainReference keychainRef(String keychainRef) { + + this.keychainRef = keychainRef; + return this; + } + + /** + * Key reference name. + * @return keychainRef + **/ + @javax.annotation.Nonnull + public String getKeychainRef() { + return keychainRef; + } + + + public void setKeychainRef(String keychainRef) { + this.keychainRef = keychainRef; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + KeychainReference keychainReference = (KeychainReference) o; + return Objects.equals(this.keychainId, keychainReference.keychainId) && + Objects.equals(this.keychainRef, keychainReference.keychainRef); + } + + @Override + public int hashCode() { + return Objects.hash(keychainId, keychainRef); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class KeychainReference {\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" keychainRef: ").append(toIndentedString(keychainRef)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("keychainId"); + openapiFields.add("keychainRef"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("keychainId"); + openapiRequiredFields.add("keychainRef"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to KeychainReference + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!KeychainReference.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in KeychainReference is not found in the empty JSON string", KeychainReference.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!KeychainReference.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `KeychainReference` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : KeychainReference.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + if (!jsonObj.get("keychainRef").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainRef` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainRef").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!KeychainReference.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'KeychainReference' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(KeychainReference.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, KeychainReference value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public KeychainReference read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of KeychainReference given an JSON string + * + * @param jsonString JSON string + * @return An instance of KeychainReference + * @throws IOException if the JSON string is invalid with respect to KeychainReference + */ + public static KeychainReference fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, KeychainReference.class); + } + + /** + * Convert an instance of KeychainReference to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QueryRequestV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QueryRequestV1.java new file mode 100644 index 00000000000..0330faac380 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QueryRequestV1.java @@ -0,0 +1,276 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Iroha2BaseConfig; +import org.openapitools.client.model.IrohaQueryDefinitionV1; +import org.openapitools.client.model.IrohaSignedQueryDefinitionV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Request to query endpoint. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class QueryRequestV1 { + public static final String SERIALIZED_NAME_QUERY = "query"; + @SerializedName(SERIALIZED_NAME_QUERY) + private IrohaQueryDefinitionV1 query; + + public static final String SERIALIZED_NAME_SIGNED_QUERY = "signedQuery"; + @SerializedName(SERIALIZED_NAME_SIGNED_QUERY) + private IrohaSignedQueryDefinitionV1 signedQuery; + + public static final String SERIALIZED_NAME_BASE_CONFIG = "baseConfig"; + @SerializedName(SERIALIZED_NAME_BASE_CONFIG) + private Iroha2BaseConfig baseConfig; + + public QueryRequestV1() { + } + + public QueryRequestV1 query(IrohaQueryDefinitionV1 query) { + + this.query = query; + return this; + } + + /** + * Get query + * @return query + **/ + @javax.annotation.Nullable + public IrohaQueryDefinitionV1 getQuery() { + return query; + } + + + public void setQuery(IrohaQueryDefinitionV1 query) { + this.query = query; + } + + + public QueryRequestV1 signedQuery(IrohaSignedQueryDefinitionV1 signedQuery) { + + this.signedQuery = signedQuery; + return this; + } + + /** + * Get signedQuery + * @return signedQuery + **/ + @javax.annotation.Nullable + public IrohaSignedQueryDefinitionV1 getSignedQuery() { + return signedQuery; + } + + + public void setSignedQuery(IrohaSignedQueryDefinitionV1 signedQuery) { + this.signedQuery = signedQuery; + } + + + public QueryRequestV1 baseConfig(Iroha2BaseConfig baseConfig) { + + this.baseConfig = baseConfig; + return this; + } + + /** + * Get baseConfig + * @return baseConfig + **/ + @javax.annotation.Nullable + public Iroha2BaseConfig getBaseConfig() { + return baseConfig; + } + + + public void setBaseConfig(Iroha2BaseConfig baseConfig) { + this.baseConfig = baseConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryRequestV1 queryRequestV1 = (QueryRequestV1) o; + return Objects.equals(this.query, queryRequestV1.query) && + Objects.equals(this.signedQuery, queryRequestV1.signedQuery) && + Objects.equals(this.baseConfig, queryRequestV1.baseConfig); + } + + @Override + public int hashCode() { + return Objects.hash(query, signedQuery, baseConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryRequestV1 {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" signedQuery: ").append(toIndentedString(signedQuery)).append("\n"); + sb.append(" baseConfig: ").append(toIndentedString(baseConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("query"); + openapiFields.add("signedQuery"); + openapiFields.add("baseConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QueryRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!QueryRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in QueryRequestV1 is not found in the empty JSON string", QueryRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!QueryRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `QueryRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `query` + if (jsonObj.get("query") != null && !jsonObj.get("query").isJsonNull()) { + IrohaQueryDefinitionV1.validateJsonObject(jsonObj.getAsJsonObject("query")); + } + // validate the optional field `signedQuery` + if (jsonObj.get("signedQuery") != null && !jsonObj.get("signedQuery").isJsonNull()) { + IrohaSignedQueryDefinitionV1.validateJsonObject(jsonObj.getAsJsonObject("signedQuery")); + } + // validate the optional field `baseConfig` + if (jsonObj.get("baseConfig") != null && !jsonObj.get("baseConfig").isJsonNull()) { + Iroha2BaseConfig.validateJsonObject(jsonObj.getAsJsonObject("baseConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QueryRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QueryRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QueryRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QueryRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryRequestV1 + * @throws IOException if the JSON string is invalid with respect to QueryRequestV1 + */ + public static QueryRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueryRequestV1.class); + } + + /** + * Convert an instance of QueryRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QueryResponseV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QueryResponseV1.java new file mode 100644 index 00000000000..898112d05fa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QueryResponseV1.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Response with the query results. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class QueryResponseV1 { + public static final String SERIALIZED_NAME_RESPONSE = "response"; + @SerializedName(SERIALIZED_NAME_RESPONSE) + private Object response = null; + + public QueryResponseV1() { + } + + public QueryResponseV1 response(Object response) { + + this.response = response; + return this; + } + + /** + * Query response data that varies between different queries. + * @return response + **/ + @javax.annotation.Nullable + public Object getResponse() { + return response; + } + + + public void setResponse(Object response) { + this.response = response; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryResponseV1 queryResponseV1 = (QueryResponseV1) o; + return Objects.equals(this.response, queryResponseV1.response); + } + + @Override + public int hashCode() { + return Objects.hash(response); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryResponseV1 {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("response"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("response"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QueryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!QueryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in QueryResponseV1 is not found in the empty JSON string", QueryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!QueryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `QueryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : QueryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QueryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QueryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QueryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QueryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryResponseV1 + * @throws IOException if the JSON string is invalid with respect to QueryResponseV1 + */ + public static QueryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueryResponseV1.class); + } + + /** + * Convert an instance of QueryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactRequestV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactRequestV1.java new file mode 100644 index 00000000000..719e1fd4a57 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactRequestV1.java @@ -0,0 +1,302 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Iroha2BaseConfig; +import org.openapitools.client.model.IrohaTransactionDefinitionV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Request to transact endpoint. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransactRequestV1 { + public static final String SERIALIZED_NAME_SIGNED_TRANSACTION = "signedTransaction"; + @SerializedName(SERIALIZED_NAME_SIGNED_TRANSACTION) + private String signedTransaction; + + public static final String SERIALIZED_NAME_TRANSACTION = "transaction"; + @SerializedName(SERIALIZED_NAME_TRANSACTION) + private IrohaTransactionDefinitionV1 transaction; + + public static final String SERIALIZED_NAME_WAIT_FOR_COMMIT = "waitForCommit"; + @SerializedName(SERIALIZED_NAME_WAIT_FOR_COMMIT) + private Boolean waitForCommit = false; + + public static final String SERIALIZED_NAME_BASE_CONFIG = "baseConfig"; + @SerializedName(SERIALIZED_NAME_BASE_CONFIG) + private Iroha2BaseConfig baseConfig; + + public TransactRequestV1() { + } + + public TransactRequestV1 signedTransaction(String signedTransaction) { + + this.signedTransaction = signedTransaction; + return this; + } + + /** + * Signed transaction binary data received from generate-transaction endpoint. + * @return signedTransaction + **/ + @javax.annotation.Nullable + public String getSignedTransaction() { + return signedTransaction; + } + + + public void setSignedTransaction(String signedTransaction) { + this.signedTransaction = signedTransaction; + } + + + public TransactRequestV1 transaction(IrohaTransactionDefinitionV1 transaction) { + + this.transaction = transaction; + return this; + } + + /** + * Get transaction + * @return transaction + **/ + @javax.annotation.Nullable + public IrohaTransactionDefinitionV1 getTransaction() { + return transaction; + } + + + public void setTransaction(IrohaTransactionDefinitionV1 transaction) { + this.transaction = transaction; + } + + + public TransactRequestV1 waitForCommit(Boolean waitForCommit) { + + this.waitForCommit = waitForCommit; + return this; + } + + /** + * Wait unitl transaction is sent and return the final status (committed / rejected) + * @return waitForCommit + **/ + @javax.annotation.Nullable + public Boolean getWaitForCommit() { + return waitForCommit; + } + + + public void setWaitForCommit(Boolean waitForCommit) { + this.waitForCommit = waitForCommit; + } + + + public TransactRequestV1 baseConfig(Iroha2BaseConfig baseConfig) { + + this.baseConfig = baseConfig; + return this; + } + + /** + * Get baseConfig + * @return baseConfig + **/ + @javax.annotation.Nullable + public Iroha2BaseConfig getBaseConfig() { + return baseConfig; + } + + + public void setBaseConfig(Iroha2BaseConfig baseConfig) { + this.baseConfig = baseConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactRequestV1 transactRequestV1 = (TransactRequestV1) o; + return Objects.equals(this.signedTransaction, transactRequestV1.signedTransaction) && + Objects.equals(this.transaction, transactRequestV1.transaction) && + Objects.equals(this.waitForCommit, transactRequestV1.waitForCommit) && + Objects.equals(this.baseConfig, transactRequestV1.baseConfig); + } + + @Override + public int hashCode() { + return Objects.hash(signedTransaction, transaction, waitForCommit, baseConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactRequestV1 {\n"); + sb.append(" signedTransaction: ").append(toIndentedString(signedTransaction)).append("\n"); + sb.append(" transaction: ").append(toIndentedString(transaction)).append("\n"); + sb.append(" waitForCommit: ").append(toIndentedString(waitForCommit)).append("\n"); + sb.append(" baseConfig: ").append(toIndentedString(baseConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("signedTransaction"); + openapiFields.add("transaction"); + openapiFields.add("waitForCommit"); + openapiFields.add("baseConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransactRequestV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransactRequestV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransactRequestV1 is not found in the empty JSON string", TransactRequestV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransactRequestV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactRequestV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("signedTransaction") != null && !jsonObj.get("signedTransaction").isJsonNull()) && !jsonObj.get("signedTransaction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signedTransaction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signedTransaction").toString())); + } + // validate the optional field `transaction` + if (jsonObj.get("transaction") != null && !jsonObj.get("transaction").isJsonNull()) { + IrohaTransactionDefinitionV1.validateJsonObject(jsonObj.getAsJsonObject("transaction")); + } + // validate the optional field `baseConfig` + if (jsonObj.get("baseConfig") != null && !jsonObj.get("baseConfig").isJsonNull()) { + Iroha2BaseConfig.validateJsonObject(jsonObj.getAsJsonObject("baseConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactRequestV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactRequestV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactRequestV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactRequestV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactRequestV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactRequestV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactRequestV1 + * @throws IOException if the JSON string is invalid with respect to TransactRequestV1 + */ + public static TransactRequestV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactRequestV1.class); + } + + /** + * Convert an instance of TransactRequestV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactResponseV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactResponseV1.java new file mode 100644 index 00000000000..d65281c61a5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactResponseV1.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.TransactionStatusV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Response from transaction endpoint with operation status. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransactResponseV1 { + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private TransactionStatusV1 status; + + public static final String SERIALIZED_NAME_REJECT_REASON = "rejectReason"; + @SerializedName(SERIALIZED_NAME_REJECT_REASON) + private String rejectReason; + + public TransactResponseV1() { + } + + public TransactResponseV1 hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Hexadecimal hash of the transaction sent to the ledger. + * @return hash + **/ + @javax.annotation.Nonnull + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public TransactResponseV1 status(TransactionStatusV1 status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public TransactionStatusV1 getStatus() { + return status; + } + + + public void setStatus(TransactionStatusV1 status) { + this.status = status; + } + + + public TransactResponseV1 rejectReason(String rejectReason) { + + this.rejectReason = rejectReason; + return this; + } + + /** + * When waitForCommit was suplied and the transaction was rejected, contains the reason of the rejection. + * @return rejectReason + **/ + @javax.annotation.Nullable + public String getRejectReason() { + return rejectReason; + } + + + public void setRejectReason(String rejectReason) { + this.rejectReason = rejectReason; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactResponseV1 transactResponseV1 = (TransactResponseV1) o; + return Objects.equals(this.hash, transactResponseV1.hash) && + Objects.equals(this.status, transactResponseV1.status) && + Objects.equals(this.rejectReason, transactResponseV1.rejectReason); + } + + @Override + public int hashCode() { + return Objects.hash(hash, status, rejectReason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactResponseV1 {\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" rejectReason: ").append(toIndentedString(rejectReason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hash"); + openapiFields.add("status"); + openapiFields.add("rejectReason"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("hash"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransactResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransactResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransactResponseV1 is not found in the empty JSON string", TransactResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransactResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransactResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if ((jsonObj.get("rejectReason") != null && !jsonObj.get("rejectReason").isJsonNull()) && !jsonObj.get("rejectReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rejectReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rejectReason").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactResponseV1 + * @throws IOException if the JSON string is invalid with respect to TransactResponseV1 + */ + public static TransactResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactResponseV1.class); + } + + /** + * Convert an instance of TransactResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactionStatusV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactionStatusV1.java new file mode 100644 index 00000000000..34155447569 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransactionStatusV1.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Status of Iroha V2 transaction. + */ +@JsonAdapter(TransactionStatusV1.Adapter.class) +public enum TransactionStatusV1 { + + /** + * Transaction was submitted to the ledger - use other tools to check if it was accepted and committed. + */ + Submitted("submitted"), + + /** + * Transaction was committed to the ledger. + */ + Committed("committed"), + + /** + * Transaction was rejected. + */ + Rejected("rejected"); + + private String value; + + TransactionStatusV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TransactionStatusV1 fromValue(String value) { + for (TransactionStatusV1 b : TransactionStatusV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TransactionStatusV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TransactionStatusV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TransactionStatusV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1.java new file mode 100644 index 00000000000..680d8ee098a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Binary encoded response of block data. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksBinaryResponseV1 { + public static final String SERIALIZED_NAME_BINARY_BLOCK = "binaryBlock"; + @SerializedName(SERIALIZED_NAME_BINARY_BLOCK) + private String binaryBlock; + + public WatchBlocksBinaryResponseV1() { + } + + public WatchBlocksBinaryResponseV1 binaryBlock(String binaryBlock) { + + this.binaryBlock = binaryBlock; + return this; + } + + /** + * Get binaryBlock + * @return binaryBlock + **/ + @javax.annotation.Nonnull + public String getBinaryBlock() { + return binaryBlock; + } + + + public void setBinaryBlock(String binaryBlock) { + this.binaryBlock = binaryBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksBinaryResponseV1 watchBlocksBinaryResponseV1 = (WatchBlocksBinaryResponseV1) o; + return Objects.equals(this.binaryBlock, watchBlocksBinaryResponseV1.binaryBlock); + } + + @Override + public int hashCode() { + return Objects.hash(binaryBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksBinaryResponseV1 {\n"); + sb.append(" binaryBlock: ").append(toIndentedString(binaryBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("binaryBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("binaryBlock"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksBinaryResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksBinaryResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksBinaryResponseV1 is not found in the empty JSON string", WatchBlocksBinaryResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksBinaryResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksBinaryResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksBinaryResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("binaryBlock").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `binaryBlock` to be a primitive type in the JSON string but got `%s`", jsonObj.get("binaryBlock").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksBinaryResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksBinaryResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksBinaryResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksBinaryResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksBinaryResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksBinaryResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksBinaryResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksBinaryResponseV1 + */ + public static WatchBlocksBinaryResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksBinaryResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksBinaryResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java new file mode 100644 index 00000000000..114b2f8f94e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksOptionsV1.java @@ -0,0 +1,270 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.BlockTypeV1; +import org.openapitools.client.model.Iroha2BaseConfig; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Options passed when subscribing to block monitoring. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksOptionsV1 { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private BlockTypeV1 type; + + public static final String SERIALIZED_NAME_START_BLOCK = "startBlock"; + @SerializedName(SERIALIZED_NAME_START_BLOCK) + private String startBlock; + + public static final String SERIALIZED_NAME_BASE_CONFIG = "baseConfig"; + @SerializedName(SERIALIZED_NAME_BASE_CONFIG) + private Iroha2BaseConfig baseConfig; + + public WatchBlocksOptionsV1() { + } + + public WatchBlocksOptionsV1 type(BlockTypeV1 type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + public BlockTypeV1 getType() { + return type; + } + + + public void setType(BlockTypeV1 type) { + this.type = type; + } + + + public WatchBlocksOptionsV1 startBlock(String startBlock) { + + this.startBlock = startBlock; + return this; + } + + /** + * Number of block to start monitoring from. + * @return startBlock + **/ + @javax.annotation.Nullable + public String getStartBlock() { + return startBlock; + } + + + public void setStartBlock(String startBlock) { + this.startBlock = startBlock; + } + + + public WatchBlocksOptionsV1 baseConfig(Iroha2BaseConfig baseConfig) { + + this.baseConfig = baseConfig; + return this; + } + + /** + * Get baseConfig + * @return baseConfig + **/ + @javax.annotation.Nullable + public Iroha2BaseConfig getBaseConfig() { + return baseConfig; + } + + + public void setBaseConfig(Iroha2BaseConfig baseConfig) { + this.baseConfig = baseConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksOptionsV1 watchBlocksOptionsV1 = (WatchBlocksOptionsV1) o; + return Objects.equals(this.type, watchBlocksOptionsV1.type) && + Objects.equals(this.startBlock, watchBlocksOptionsV1.startBlock) && + Objects.equals(this.baseConfig, watchBlocksOptionsV1.baseConfig); + } + + @Override + public int hashCode() { + return Objects.hash(type, startBlock, baseConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksOptionsV1 {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" startBlock: ").append(toIndentedString(startBlock)).append("\n"); + sb.append(" baseConfig: ").append(toIndentedString(baseConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("startBlock"); + openapiFields.add("baseConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksOptionsV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksOptionsV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksOptionsV1 is not found in the empty JSON string", WatchBlocksOptionsV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksOptionsV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksOptionsV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("startBlock") != null && !jsonObj.get("startBlock").isJsonNull()) && !jsonObj.get("startBlock").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `startBlock` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startBlock").toString())); + } + // validate the optional field `baseConfig` + if (jsonObj.get("baseConfig") != null && !jsonObj.get("baseConfig").isJsonNull()) { + Iroha2BaseConfig.validateJsonObject(jsonObj.getAsJsonObject("baseConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksOptionsV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksOptionsV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksOptionsV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksOptionsV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksOptionsV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksOptionsV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksOptionsV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksOptionsV1 + */ + public static WatchBlocksOptionsV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksOptionsV1.class); + } + + /** + * Convert an instance of WatchBlocksOptionsV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksRawResponseV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksRawResponseV1.java new file mode 100644 index 00000000000..3ed82a335f5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksRawResponseV1.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Default JSON-encoded string full block data. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksRawResponseV1 { + public static final String SERIALIZED_NAME_BLOCK_DATA = "blockData"; + @SerializedName(SERIALIZED_NAME_BLOCK_DATA) + private String blockData; + + public WatchBlocksRawResponseV1() { + } + + public WatchBlocksRawResponseV1 blockData(String blockData) { + + this.blockData = blockData; + return this; + } + + /** + * Get blockData + * @return blockData + **/ + @javax.annotation.Nonnull + public String getBlockData() { + return blockData; + } + + + public void setBlockData(String blockData) { + this.blockData = blockData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksRawResponseV1 watchBlocksRawResponseV1 = (WatchBlocksRawResponseV1) o; + return Objects.equals(this.blockData, watchBlocksRawResponseV1.blockData); + } + + @Override + public int hashCode() { + return Objects.hash(blockData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksRawResponseV1 {\n"); + sb.append(" blockData: ").append(toIndentedString(blockData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("blockData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("blockData"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksRawResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksRawResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksRawResponseV1 is not found in the empty JSON string", WatchBlocksRawResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksRawResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksRawResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksRawResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("blockData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockData").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksRawResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksRawResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksRawResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksRawResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksRawResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksRawResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksRawResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksRawResponseV1 + */ + public static WatchBlocksRawResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksRawResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksRawResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java new file mode 100644 index 00000000000..f1cc0393e19 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksResponseV1.java @@ -0,0 +1,337 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.WatchBlocksBinaryResponseV1; +import org.openapitools.client.model.WatchBlocksRawResponseV1; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksResponseV1 extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(WatchBlocksResponseV1.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterErrorExceptionResponseV1 = gson.getDelegateAdapter(this, TypeToken.get(ErrorExceptionResponseV1.class)); + final TypeAdapter adapterWatchBlocksBinaryResponseV1 = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksBinaryResponseV1.class)); + final TypeAdapter adapterWatchBlocksRawResponseV1 = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksRawResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksResponseV1 value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `ErrorExceptionResponseV1` + if (value.getActualInstance() instanceof ErrorExceptionResponseV1) { + JsonObject obj = adapterErrorExceptionResponseV1.toJsonTree((ErrorExceptionResponseV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `WatchBlocksBinaryResponseV1` + if (value.getActualInstance() instanceof WatchBlocksBinaryResponseV1) { + JsonObject obj = adapterWatchBlocksBinaryResponseV1.toJsonTree((WatchBlocksBinaryResponseV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `WatchBlocksRawResponseV1` + if (value.getActualInstance() instanceof WatchBlocksRawResponseV1) { + JsonObject obj = adapterWatchBlocksRawResponseV1.toJsonTree((WatchBlocksRawResponseV1)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ErrorExceptionResponseV1, WatchBlocksBinaryResponseV1, WatchBlocksRawResponseV1"); + } + + @Override + public WatchBlocksResponseV1 read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ErrorExceptionResponseV1 + try { + // validate the JSON object to see if any exception is thrown + ErrorExceptionResponseV1.validateJsonObject(jsonObject); + actualAdapter = adapterErrorExceptionResponseV1; + match++; + log.log(Level.FINER, "Input data matches schema 'ErrorExceptionResponseV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ErrorExceptionResponseV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ErrorExceptionResponseV1'", e); + } + + // deserialize WatchBlocksBinaryResponseV1 + try { + // validate the JSON object to see if any exception is thrown + WatchBlocksBinaryResponseV1.validateJsonObject(jsonObject); + actualAdapter = adapterWatchBlocksBinaryResponseV1; + match++; + log.log(Level.FINER, "Input data matches schema 'WatchBlocksBinaryResponseV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for WatchBlocksBinaryResponseV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'WatchBlocksBinaryResponseV1'", e); + } + + // deserialize WatchBlocksRawResponseV1 + try { + // validate the JSON object to see if any exception is thrown + WatchBlocksRawResponseV1.validateJsonObject(jsonObject); + actualAdapter = adapterWatchBlocksRawResponseV1; + match++; + log.log(Level.FINER, "Input data matches schema 'WatchBlocksRawResponseV1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for WatchBlocksRawResponseV1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'WatchBlocksRawResponseV1'", e); + } + + if (match == 1) { + WatchBlocksResponseV1 ret = new WatchBlocksResponseV1(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for WatchBlocksResponseV1: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public WatchBlocksResponseV1() { + super("oneOf", Boolean.FALSE); + } + + public WatchBlocksResponseV1(ErrorExceptionResponseV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public WatchBlocksResponseV1(WatchBlocksBinaryResponseV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public WatchBlocksResponseV1(WatchBlocksRawResponseV1 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ErrorExceptionResponseV1", new GenericType() { + }); + schemas.put("WatchBlocksBinaryResponseV1", new GenericType() { + }); + schemas.put("WatchBlocksRawResponseV1", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return WatchBlocksResponseV1.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * ErrorExceptionResponseV1, WatchBlocksBinaryResponseV1, WatchBlocksRawResponseV1 + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ErrorExceptionResponseV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof WatchBlocksBinaryResponseV1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof WatchBlocksRawResponseV1) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be ErrorExceptionResponseV1, WatchBlocksBinaryResponseV1, WatchBlocksRawResponseV1"); + } + + /** + * Get the actual instance, which can be the following: + * ErrorExceptionResponseV1, WatchBlocksBinaryResponseV1, WatchBlocksRawResponseV1 + * + * @return The actual instance (ErrorExceptionResponseV1, WatchBlocksBinaryResponseV1, WatchBlocksRawResponseV1) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ErrorExceptionResponseV1`. If the actual instance is not `ErrorExceptionResponseV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ErrorExceptionResponseV1` + * @throws ClassCastException if the instance is not `ErrorExceptionResponseV1` + */ + public ErrorExceptionResponseV1 getErrorExceptionResponseV1() throws ClassCastException { + return (ErrorExceptionResponseV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `WatchBlocksBinaryResponseV1`. If the actual instance is not `WatchBlocksBinaryResponseV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `WatchBlocksBinaryResponseV1` + * @throws ClassCastException if the instance is not `WatchBlocksBinaryResponseV1` + */ + public WatchBlocksBinaryResponseV1 getWatchBlocksBinaryResponseV1() throws ClassCastException { + return (WatchBlocksBinaryResponseV1)super.getActualInstance(); + } + + /** + * Get the actual instance of `WatchBlocksRawResponseV1`. If the actual instance is not `WatchBlocksRawResponseV1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `WatchBlocksRawResponseV1` + * @throws ClassCastException if the instance is not `WatchBlocksRawResponseV1` + */ + public WatchBlocksRawResponseV1 getWatchBlocksRawResponseV1() throws ClassCastException { + return (WatchBlocksRawResponseV1)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with ErrorExceptionResponseV1 + try { + ErrorExceptionResponseV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ErrorExceptionResponseV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with WatchBlocksBinaryResponseV1 + try { + WatchBlocksBinaryResponseV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for WatchBlocksBinaryResponseV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with WatchBlocksRawResponseV1 + try { + WatchBlocksRawResponseV1.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for WatchBlocksRawResponseV1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for WatchBlocksResponseV1 with oneOf schemas: ErrorExceptionResponseV1, WatchBlocksBinaryResponseV1, WatchBlocksRawResponseV1. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of WatchBlocksResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksResponseV1 + * @throws IOException if the JSON string is invalid with respect to WatchBlocksResponseV1 + */ + public static WatchBlocksResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksResponseV1.class); + } + + /** + * Convert an instance of WatchBlocksResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java new file mode 100644 index 00000000000..dc24dab1e70 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Websocket requests for monitoring new blocks. + */ +@JsonAdapter(WatchBlocksV1.Adapter.class) +public enum WatchBlocksV1 { + + Subscribe("org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Subscribe"), + + Next("org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Next"), + + Unsubscribe("org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Unsubscribe"), + + Error("org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Error"), + + Complete("org.hyperledger.cactus.api.async.hliroha2.WatchBlocksV1.Complete"); + + private String value; + + WatchBlocksV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchBlocksV1 fromValue(String value) { + for (WatchBlocksV1 b : WatchBlocksV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchBlocksV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchBlocksV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchBlocksV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..94703ec6acd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.ErrorExceptionResponseV1; +import org.openapitools.client.model.GenerateTransactionRequestV1; +import org.openapitools.client.model.QueryRequestV1; +import org.openapitools.client.model.QueryResponseV1; +import org.openapitools.client.model.TransactRequestV1; +import org.openapitools.client.model.TransactResponseV1; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Generate transaction that can be signed locally. + * + * @throws ApiException if the Api call fails + */ + @Test + public void generateTransactionV1Test() throws ApiException { + GenerateTransactionRequestV1 generateTransactionRequestV1 = null; + String response = api.generateTransactionV1(generateTransactionRequestV1); + // TODO: test validations + } + + /** + * Executes a query on a Iroha V2 ledger and returns it's results. + * + * @throws ApiException if the Api call fails + */ + @Test + public void queryV1Test() throws ApiException { + QueryRequestV1 queryRequestV1 = null; + QueryResponseV1 response = api.queryV1(queryRequestV1); + // TODO: test validations + } + + /** + * Executes a transaction on a Iroha V2 ledger (by sending some instructions) + * + * @throws ApiException if the Api call fails + */ + @Test + public void transactV1Test() throws ApiException { + TransactRequestV1 transactRequestV1 = null; + TransactResponseV1 response = api.transactV1(transactRequestV1); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BlockTypeV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BlockTypeV1Test.java new file mode 100644 index 00000000000..c27c40b851c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/BlockTypeV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for BlockTypeV1 + */ +public class BlockTypeV1Test { + /** + * Model tests for BlockTypeV1 + */ + @Test + public void testBlockTypeV1() { + // TODO: test BlockTypeV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java new file mode 100644 index 00000000000..1a57a6ccd0c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ErrorExceptionResponseV1 + */ +public class ErrorExceptionResponseV1Test { + private final ErrorExceptionResponseV1 model = new ErrorExceptionResponseV1(); + + /** + * Model tests for ErrorExceptionResponseV1 + */ + @Test + public void testErrorExceptionResponseV1() { + // TODO: test ErrorExceptionResponseV1 + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1RequestTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1RequestTest.java new file mode 100644 index 00000000000..92c1eaee659 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1RequestTest.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.IrohaQuery; +import org.openapitools.client.model.IrohaQueryDefinitionV1; +import org.openapitools.client.model.IrohaTransactionDefinitionV1; +import org.openapitools.client.model.IrohaTransactionDefinitionV1Instruction; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GenerateTransactionRequestV1Request + */ +public class GenerateTransactionRequestV1RequestTest { + private final GenerateTransactionRequestV1Request model = new GenerateTransactionRequestV1Request(); + + /** + * Model tests for GenerateTransactionRequestV1Request + */ + @Test + public void testGenerateTransactionRequestV1Request() { + // TODO: test GenerateTransactionRequestV1Request + } + + /** + * Test the property 'instruction' + */ + @Test + public void instructionTest() { + // TODO: test instruction + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'query' + */ + @Test + public void queryTest() { + // TODO: test query + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1Test.java new file mode 100644 index 00000000000..6985d61985e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GenerateTransactionRequestV1Test.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.GenerateTransactionRequestV1Request; +import org.openapitools.client.model.Iroha2BaseConfig; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GenerateTransactionRequestV1 + */ +public class GenerateTransactionRequestV1Test { + private final GenerateTransactionRequestV1 model = new GenerateTransactionRequestV1(); + + /** + * Model tests for GenerateTransactionRequestV1 + */ + @Test + public void testGenerateTransactionRequestV1() { + // TODO: test GenerateTransactionRequestV1 + } + + /** + * Test the property 'request' + */ + @Test + public void requestTest() { + // TODO: test request + } + + /** + * Test the property 'baseConfig' + */ + @Test + public void baseConfigTest() { + // TODO: test baseConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2AccountIdTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2AccountIdTest.java new file mode 100644 index 00000000000..340fa9bbf90 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2AccountIdTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Iroha2AccountId + */ +public class Iroha2AccountIdTest { + private final Iroha2AccountId model = new Iroha2AccountId(); + + /** + * Model tests for Iroha2AccountId + */ + @Test + public void testIroha2AccountId() { + // TODO: test Iroha2AccountId + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'domainId' + */ + @Test + public void domainIdTest() { + // TODO: test domainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredentialTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredentialTest.java new file mode 100644 index 00000000000..339e45ffc23 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigSigningCredentialTest.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Iroha2KeyJson; +import org.openapitools.client.model.Iroha2KeyPair; +import org.openapitools.client.model.KeychainReference; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Iroha2BaseConfigSigningCredential + */ +public class Iroha2BaseConfigSigningCredentialTest { + private final Iroha2BaseConfigSigningCredential model = new Iroha2BaseConfigSigningCredential(); + + /** + * Model tests for Iroha2BaseConfigSigningCredential + */ + @Test + public void testIroha2BaseConfigSigningCredential() { + // TODO: test Iroha2BaseConfigSigningCredential + } + + /** + * Test the property 'privateKey' + */ + @Test + public void privateKeyTest() { + // TODO: test privateKey + } + + /** + * Test the property 'publicKey' + */ + @Test + public void publicKeyTest() { + // TODO: test publicKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'keychainRef' + */ + @Test + public void keychainRefTest() { + // TODO: test keychainRef + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigTest.java new file mode 100644 index 00000000000..19ca16c6aee --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigTest.java @@ -0,0 +1,67 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Iroha2AccountId; +import org.openapitools.client.model.Iroha2BaseConfigSigningCredential; +import org.openapitools.client.model.Iroha2BaseConfigTorii; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Iroha2BaseConfig + */ +public class Iroha2BaseConfigTest { + private final Iroha2BaseConfig model = new Iroha2BaseConfig(); + + /** + * Model tests for Iroha2BaseConfig + */ + @Test + public void testIroha2BaseConfig() { + // TODO: test Iroha2BaseConfig + } + + /** + * Test the property 'torii' + */ + @Test + public void toriiTest() { + // TODO: test torii + } + + /** + * Test the property 'accountId' + */ + @Test + public void accountIdTest() { + // TODO: test accountId + } + + /** + * Test the property 'signingCredential' + */ + @Test + public void signingCredentialTest() { + // TODO: test signingCredential + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigToriiTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigToriiTest.java new file mode 100644 index 00000000000..c9d8c0571d9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2BaseConfigToriiTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Iroha2BaseConfigTorii + */ +public class Iroha2BaseConfigToriiTest { + private final Iroha2BaseConfigTorii model = new Iroha2BaseConfigTorii(); + + /** + * Model tests for Iroha2BaseConfigTorii + */ + @Test + public void testIroha2BaseConfigTorii() { + // TODO: test Iroha2BaseConfigTorii + } + + /** + * Test the property 'apiURL' + */ + @Test + public void apiURLTest() { + // TODO: test apiURL + } + + /** + * Test the property 'telemetryURL' + */ + @Test + public void telemetryURLTest() { + // TODO: test telemetryURL + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2KeyJsonTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2KeyJsonTest.java new file mode 100644 index 00000000000..05c67ced033 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2KeyJsonTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Iroha2KeyJson + */ +public class Iroha2KeyJsonTest { + private final Iroha2KeyJson model = new Iroha2KeyJson(); + + /** + * Model tests for Iroha2KeyJson + */ + @Test + public void testIroha2KeyJson() { + // TODO: test Iroha2KeyJson + } + + /** + * Test the property 'digestFunction' + */ + @Test + public void digestFunctionTest() { + // TODO: test digestFunction + } + + /** + * Test the property 'payload' + */ + @Test + public void payloadTest() { + // TODO: test payload + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2KeyPairTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2KeyPairTest.java new file mode 100644 index 00000000000..90e37eaea36 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Iroha2KeyPairTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Iroha2KeyJson; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Iroha2KeyPair + */ +public class Iroha2KeyPairTest { + private final Iroha2KeyPair model = new Iroha2KeyPair(); + + /** + * Model tests for Iroha2KeyPair + */ + @Test + public void testIroha2KeyPair() { + // TODO: test Iroha2KeyPair + } + + /** + * Test the property 'privateKey' + */ + @Test + public void privateKeyTest() { + // TODO: test privateKey + } + + /** + * Test the property 'publicKey' + */ + @Test + public void publicKeyTest() { + // TODO: test publicKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaInstructionRequestV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaInstructionRequestV1Test.java new file mode 100644 index 00000000000..5870e4a3ea9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaInstructionRequestV1Test.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.IrohaInstruction; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaInstructionRequestV1 + */ +public class IrohaInstructionRequestV1Test { + private final IrohaInstructionRequestV1 model = new IrohaInstructionRequestV1(); + + /** + * Model tests for IrohaInstructionRequestV1 + */ + @Test + public void testIrohaInstructionRequestV1() { + // TODO: test IrohaInstructionRequestV1 + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaInstructionTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaInstructionTest.java new file mode 100644 index 00000000000..8ba30447c2a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaInstructionTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaInstruction + */ +public class IrohaInstructionTest { + /** + * Model tests for IrohaInstruction + */ + @Test + public void testIrohaInstruction() { + // TODO: test IrohaInstruction + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryDefinitionV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryDefinitionV1Test.java new file mode 100644 index 00000000000..853ae592bca --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryDefinitionV1Test.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.IrohaQuery; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaQueryDefinitionV1 + */ +public class IrohaQueryDefinitionV1Test { + private final IrohaQueryDefinitionV1 model = new IrohaQueryDefinitionV1(); + + /** + * Model tests for IrohaQueryDefinitionV1 + */ + @Test + public void testIrohaQueryDefinitionV1() { + // TODO: test IrohaQueryDefinitionV1 + } + + /** + * Test the property 'query' + */ + @Test + public void queryTest() { + // TODO: test query + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryTest.java new file mode 100644 index 00000000000..b7dc5fa7b76 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaQueryTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaQuery + */ +public class IrohaQueryTest { + /** + * Model tests for IrohaQuery + */ + @Test + public void testIrohaQuery() { + // TODO: test IrohaQuery + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1Test.java new file mode 100644 index 00000000000..5c5eb16b1ad --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaSignedQueryDefinitionV1Test.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.IrohaQuery; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaSignedQueryDefinitionV1 + */ +public class IrohaSignedQueryDefinitionV1Test { + private final IrohaSignedQueryDefinitionV1 model = new IrohaSignedQueryDefinitionV1(); + + /** + * Model tests for IrohaSignedQueryDefinitionV1 + */ + @Test + public void testIrohaSignedQueryDefinitionV1() { + // TODO: test IrohaSignedQueryDefinitionV1 + } + + /** + * Test the property 'query' + */ + @Test + public void queryTest() { + // TODO: test query + } + + /** + * Test the property 'payload' + */ + @Test + public void payloadTest() { + // TODO: test payload + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionDefinitionV1InstructionTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionDefinitionV1InstructionTest.java new file mode 100644 index 00000000000..fad09ba762b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionDefinitionV1InstructionTest.java @@ -0,0 +1,60 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.IrohaInstruction; +import org.openapitools.client.model.IrohaInstructionRequestV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaTransactionDefinitionV1Instruction + */ +public class IrohaTransactionDefinitionV1InstructionTest { + private final IrohaTransactionDefinitionV1Instruction model = new IrohaTransactionDefinitionV1Instruction(); + + /** + * Model tests for IrohaTransactionDefinitionV1Instruction + */ + @Test + public void testIrohaTransactionDefinitionV1Instruction() { + // TODO: test IrohaTransactionDefinitionV1Instruction + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Test.java new file mode 100644 index 00000000000..32e775d8257 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionDefinitionV1Test.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.IrohaTransactionDefinitionV1Instruction; +import org.openapitools.client.model.IrohaTransactionParametersV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaTransactionDefinitionV1 + */ +public class IrohaTransactionDefinitionV1Test { + private final IrohaTransactionDefinitionV1 model = new IrohaTransactionDefinitionV1(); + + /** + * Model tests for IrohaTransactionDefinitionV1 + */ + @Test + public void testIrohaTransactionDefinitionV1() { + // TODO: test IrohaTransactionDefinitionV1 + } + + /** + * Test the property 'instruction' + */ + @Test + public void instructionTest() { + // TODO: test instruction + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionParametersV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionParametersV1Test.java new file mode 100644 index 00000000000..5e4d41c9107 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/IrohaTransactionParametersV1Test.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for IrohaTransactionParametersV1 + */ +public class IrohaTransactionParametersV1Test { + private final IrohaTransactionParametersV1 model = new IrohaTransactionParametersV1(); + + /** + * Model tests for IrohaTransactionParametersV1 + */ + @Test + public void testIrohaTransactionParametersV1() { + // TODO: test IrohaTransactionParametersV1 + } + + /** + * Test the property 'ttl' + */ + @Test + public void ttlTest() { + // TODO: test ttl + } + + /** + * Test the property 'creationTime' + */ + @Test + public void creationTimeTest() { + // TODO: test creationTime + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/KeychainReferenceTest.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/KeychainReferenceTest.java new file mode 100644 index 00000000000..8f814f4dd8d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/KeychainReferenceTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for KeychainReference + */ +public class KeychainReferenceTest { + private final KeychainReference model = new KeychainReference(); + + /** + * Model tests for KeychainReference + */ + @Test + public void testKeychainReference() { + // TODO: test KeychainReference + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'keychainRef' + */ + @Test + public void keychainRefTest() { + // TODO: test keychainRef + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QueryRequestV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QueryRequestV1Test.java new file mode 100644 index 00000000000..0b2eb2d8dd6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QueryRequestV1Test.java @@ -0,0 +1,67 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Iroha2BaseConfig; +import org.openapitools.client.model.IrohaQueryDefinitionV1; +import org.openapitools.client.model.IrohaSignedQueryDefinitionV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for QueryRequestV1 + */ +public class QueryRequestV1Test { + private final QueryRequestV1 model = new QueryRequestV1(); + + /** + * Model tests for QueryRequestV1 + */ + @Test + public void testQueryRequestV1() { + // TODO: test QueryRequestV1 + } + + /** + * Test the property 'query' + */ + @Test + public void queryTest() { + // TODO: test query + } + + /** + * Test the property 'signedQuery' + */ + @Test + public void signedQueryTest() { + // TODO: test signedQuery + } + + /** + * Test the property 'baseConfig' + */ + @Test + public void baseConfigTest() { + // TODO: test baseConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QueryResponseV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QueryResponseV1Test.java new file mode 100644 index 00000000000..73c008c5871 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QueryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for QueryResponseV1 + */ +public class QueryResponseV1Test { + private final QueryResponseV1 model = new QueryResponseV1(); + + /** + * Model tests for QueryResponseV1 + */ + @Test + public void testQueryResponseV1() { + // TODO: test QueryResponseV1 + } + + /** + * Test the property 'response' + */ + @Test + public void responseTest() { + // TODO: test response + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactRequestV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactRequestV1Test.java new file mode 100644 index 00000000000..c55bb91b0be --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactRequestV1Test.java @@ -0,0 +1,74 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Iroha2BaseConfig; +import org.openapitools.client.model.IrohaTransactionDefinitionV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransactRequestV1 + */ +public class TransactRequestV1Test { + private final TransactRequestV1 model = new TransactRequestV1(); + + /** + * Model tests for TransactRequestV1 + */ + @Test + public void testTransactRequestV1() { + // TODO: test TransactRequestV1 + } + + /** + * Test the property 'signedTransaction' + */ + @Test + public void signedTransactionTest() { + // TODO: test signedTransaction + } + + /** + * Test the property 'transaction' + */ + @Test + public void transactionTest() { + // TODO: test transaction + } + + /** + * Test the property 'waitForCommit' + */ + @Test + public void waitForCommitTest() { + // TODO: test waitForCommit + } + + /** + * Test the property 'baseConfig' + */ + @Test + public void baseConfigTest() { + // TODO: test baseConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactResponseV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactResponseV1Test.java new file mode 100644 index 00000000000..92488201f0a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactResponseV1Test.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.TransactionStatusV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransactResponseV1 + */ +public class TransactResponseV1Test { + private final TransactResponseV1 model = new TransactResponseV1(); + + /** + * Model tests for TransactResponseV1 + */ + @Test + public void testTransactResponseV1() { + // TODO: test TransactResponseV1 + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'rejectReason' + */ + @Test + public void rejectReasonTest() { + // TODO: test rejectReason + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactionStatusV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactionStatusV1Test.java new file mode 100644 index 00000000000..e53672739c1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransactionStatusV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransactionStatusV1 + */ +public class TransactionStatusV1Test { + /** + * Model tests for TransactionStatusV1 + */ + @Test + public void testTransactionStatusV1() { + // TODO: test TransactionStatusV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1Test.java new file mode 100644 index 00000000000..9265a305249 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksBinaryResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksBinaryResponseV1 + */ +public class WatchBlocksBinaryResponseV1Test { + private final WatchBlocksBinaryResponseV1 model = new WatchBlocksBinaryResponseV1(); + + /** + * Model tests for WatchBlocksBinaryResponseV1 + */ + @Test + public void testWatchBlocksBinaryResponseV1() { + // TODO: test WatchBlocksBinaryResponseV1 + } + + /** + * Test the property 'binaryBlock' + */ + @Test + public void binaryBlockTest() { + // TODO: test binaryBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksOptionsV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksOptionsV1Test.java new file mode 100644 index 00000000000..c25b084ccfc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksOptionsV1Test.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.BlockTypeV1; +import org.openapitools.client.model.Iroha2BaseConfig; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksOptionsV1 + */ +public class WatchBlocksOptionsV1Test { + private final WatchBlocksOptionsV1 model = new WatchBlocksOptionsV1(); + + /** + * Model tests for WatchBlocksOptionsV1 + */ + @Test + public void testWatchBlocksOptionsV1() { + // TODO: test WatchBlocksOptionsV1 + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'startBlock' + */ + @Test + public void startBlockTest() { + // TODO: test startBlock + } + + /** + * Test the property 'baseConfig' + */ + @Test + public void baseConfigTest() { + // TODO: test baseConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksRawResponseV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksRawResponseV1Test.java new file mode 100644 index 00000000000..956193d1b23 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksRawResponseV1Test.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksRawResponseV1 + */ +public class WatchBlocksRawResponseV1Test { + private final WatchBlocksRawResponseV1 model = new WatchBlocksRawResponseV1(); + + /** + * Model tests for WatchBlocksRawResponseV1 + */ + @Test + public void testWatchBlocksRawResponseV1() { + // TODO: test WatchBlocksRawResponseV1 + } + + /** + * Test the property 'blockData' + */ + @Test + public void blockDataTest() { + // TODO: test blockData + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksResponseV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksResponseV1Test.java new file mode 100644 index 00000000000..aa2f23adcf4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksResponseV1Test.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.ErrorExceptionResponseV1; +import org.openapitools.client.model.WatchBlocksBinaryResponseV1; +import org.openapitools.client.model.WatchBlocksRawResponseV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksResponseV1 + */ +public class WatchBlocksResponseV1Test { + private final WatchBlocksResponseV1 model = new WatchBlocksResponseV1(); + + /** + * Model tests for WatchBlocksResponseV1 + */ + @Test + public void testWatchBlocksResponseV1() { + // TODO: test WatchBlocksResponseV1 + } + + /** + * Test the property 'blockData' + */ + @Test + public void blockDataTest() { + // TODO: test blockData + } + + /** + * Test the property 'binaryBlock' + */ + @Test + public void binaryBlockTest() { + // TODO: test binaryBlock + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + +} diff --git a/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java new file mode 100644 index 00000000000..614973f9c14 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Iroha V2 + * Can perform basic tasks on a Iroha V2 ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1 + */ +public class WatchBlocksV1Test { + /** + * Model tests for WatchBlocksV1 + */ + @Test + public void testWatchBlocksV1() { + // TODO: test WatchBlocksV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/package.json b/packages/cactus-plugin-ledger-connector-quorum/package.json index add11121de7..8517765190a 100644 --- a/packages/cactus-plugin-ledger-connector-quorum/package.json +++ b/packages/cactus-plugin-ledger-connector-quorum/package.json @@ -50,6 +50,8 @@ "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..8ba584608eb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,47 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_contract_json.go +model_deploy_contract_solidity_bytecode_json_object_v1_request.go +model_deploy_contract_solidity_bytecode_v1_request.go +model_deploy_contract_solidity_bytecode_v1_response.go +model_eth_contract_invocation_type.go +model_eth_contract_invocation_web3_method.go +model_invoke_contract_json_object_v1_request.go +model_invoke_contract_v1_request.go +model_invoke_contract_v1_response.go +model_invoke_raw_web3_eth_contract_v1_request.go +model_invoke_raw_web3_eth_contract_v1_response.go +model_invoke_raw_web3_eth_method_v1_request.go +model_invoke_raw_web3_eth_method_v1_response.go +model_quorum_private_transaction_config.go +model_quorum_transaction_config.go +model_quorum_transaction_config_from.go +model_quorum_transaction_config_to.go +model_run_transaction_request.go +model_run_transaction_response.go +model_solidity_contract_json_artifact.go +model_solidity_contract_json_artifact_compiler.go +model_solidity_contract_json_artifact_gas_estimates.go +model_solidity_contract_json_artifact_gas_estimates_creation.go +model_watch_blocks_v1.go +model_watch_blocks_v1_block_data.go +model_watch_blocks_v1_options.go +model_watch_blocks_v1_progress.go +model_web3_block_header.go +model_web3_signing_credential.go +model_web3_signing_credential_cactus_keychain_ref.go +model_web3_signing_credential_geth_keychain_password.go +model_web3_signing_credential_none.go +model_web3_signing_credential_private_key_hex.go +model_web3_signing_credential_type.go +model_web3_transaction.go +model_web3_transaction_receipt.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..33bfffb80ac --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,154 @@ +# Go API client for cactus-plugin-ledger-connector-quorum + +Can perform basic tasks on a Quorum ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-quorum "github.com/hyperledger/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-quorum.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-quorum.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-quorum.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-quorum.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeployContractSolBytecodeJsonObjectV1**](docs/DefaultApi.md#deploycontractsolbytecodejsonobjectv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**DeployContractSolBytecodeV1**](docs/DefaultApi.md#deploycontractsolbytecodev1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**InvokeContractV1**](docs/DefaultApi.md#invokecontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract | Invokes a contract on a besu ledger +*DefaultApi* | [**InvokeContractV1NoKeychain**](docs/DefaultApi.md#invokecontractv1nokeychain) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object | Invokes a contract on a besu ledger +*DefaultApi* | [**InvokeRawWeb3EthContractV1**](docs/DefaultApi.md#invokerawweb3ethcontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract | Low-level endpoint to invoke a method on deployed contract. +*DefaultApi* | [**InvokeWeb3EthMethodV1**](docs/DefaultApi.md#invokeweb3ethmethodv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method | Invoke any method from web3.eth (low-level) +*DefaultApi* | [**RunTransactionV1**](docs/DefaultApi.md#runtransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction | Executes a transaction on a quorum ledger + + +## Documentation For Models + + - [ContractJSON](docs/ContractJSON.md) + - [DeployContractSolidityBytecodeJsonObjectV1Request](docs/DeployContractSolidityBytecodeJsonObjectV1Request.md) + - [DeployContractSolidityBytecodeV1Request](docs/DeployContractSolidityBytecodeV1Request.md) + - [DeployContractSolidityBytecodeV1Response](docs/DeployContractSolidityBytecodeV1Response.md) + - [EthContractInvocationType](docs/EthContractInvocationType.md) + - [EthContractInvocationWeb3Method](docs/EthContractInvocationWeb3Method.md) + - [InvokeContractJsonObjectV1Request](docs/InvokeContractJsonObjectV1Request.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [InvokeRawWeb3EthContractV1Request](docs/InvokeRawWeb3EthContractV1Request.md) + - [InvokeRawWeb3EthContractV1Response](docs/InvokeRawWeb3EthContractV1Response.md) + - [InvokeRawWeb3EthMethodV1Request](docs/InvokeRawWeb3EthMethodV1Request.md) + - [InvokeRawWeb3EthMethodV1Response](docs/InvokeRawWeb3EthMethodV1Response.md) + - [QuorumPrivateTransactionConfig](docs/QuorumPrivateTransactionConfig.md) + - [QuorumTransactionConfig](docs/QuorumTransactionConfig.md) + - [QuorumTransactionConfigFrom](docs/QuorumTransactionConfigFrom.md) + - [QuorumTransactionConfigTo](docs/QuorumTransactionConfigTo.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [SolidityContractJsonArtifact](docs/SolidityContractJsonArtifact.md) + - [SolidityContractJsonArtifactCompiler](docs/SolidityContractJsonArtifactCompiler.md) + - [SolidityContractJsonArtifactGasEstimates](docs/SolidityContractJsonArtifactGasEstimates.md) + - [SolidityContractJsonArtifactGasEstimatesCreation](docs/SolidityContractJsonArtifactGasEstimatesCreation.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WatchBlocksV1BlockData](docs/WatchBlocksV1BlockData.md) + - [WatchBlocksV1Options](docs/WatchBlocksV1Options.md) + - [WatchBlocksV1Progress](docs/WatchBlocksV1Progress.md) + - [Web3BlockHeader](docs/Web3BlockHeader.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialGethKeychainPassword](docs/Web3SigningCredentialGethKeychainPassword.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3Transaction](docs/Web3Transaction.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..bc80f287e6b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,1288 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Quorum ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Quorum + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode: + post: + operationId: deployContractSolBytecodeV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object: + post: + operationId: deployContractSolBytecodeJsonObjectV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + summary: Executes a transaction on a quorum ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a besu ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object: + post: + operationId: invokeContractV1NoKeychain + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a besu ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method: + post: + operationId: invokeWeb3EthMethodV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthMethodV1Request' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthMethodV1Response' + description: OK + summary: Invoke any method from web3.eth (low-level) + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract: + post: + operationId: invokeRawWeb3EthContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthContractV1Request' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthContractV1Response' + description: OK + summary: Low-level endpoint to invoke a method on deployed contract. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract +components: + schemas: + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialGethKeychainPassword' + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialGethKeychainPassword: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + secret: + description: A geth keychain unlock password. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - type + type: object + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + EthContractInvocationType: + enum: + - SEND + - CALL + type: string + EthContractInvocationWeb3Method: + enum: + - send + - call + - encodeABI + - estimateGas + type: string + SolidityContractJsonArtifact: + properties: + contractName: + nullable: false + type: string + metadata: + nullable: false + type: string + bytecode: + nullable: false + type: string + deployedBytecode: + nullable: false + type: string + sourceMap: + nullable: false + type: string + deployedSourceMap: + nullable: false + type: string + sourcePath: + type: string + compiler: + $ref: '#/components/schemas/SolidityContractJsonArtifact_compiler' + functionHashes: + additionalProperties: true + type: object + gasEstimates: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates' + required: + - contractName + type: object + QuorumTransactionConfig: + additionalProperties: true + example: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + rawTransaction: + nullable: false + type: string + from: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + to: + $ref: '#/components/schemas/QuorumTransactionConfig_to' + value: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gas: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + nonce: + type: number + data: + $ref: '#/components/schemas/QuorumTransactionConfig_to' + type: object + QuorumPrivateTransactionConfig: + example: + gasLimit: 7.061401241503109 + privateKey: privateKey + privateFrom: privateFrom + privacyGroupId: privacyGroupId + privateFor: + - "" + - "" + isPrivate: false + gasPrice: 2.3021358869347655 + properties: + privateFrom: + nullable: false + type: string + privateFor: + default: [] + items: {} + nullable: false + type: array + isPrivate: + default: false + nullable: false + type: boolean + gasPrice: + nullable: false + type: number + gasLimit: + nullable: false + type: number + privateKey: + nullable: false + type: string + privacyGroupId: + nullable: false + type: string + required: + - privateFor + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + commitmentHash: commitmentHash + transactionHash: transactionHash + output: output + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + cumulativeGasUSed: 5.962133916683182 + from: from + to: to + revertReason: revertReason + logs: + - "" + - "" + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + logs: + default: [] + items: {} + nullable: false + type: array + logsBloom: + nullable: false + type: string + revertReason: + nullable: false + type: string + output: + nullable: false + type: string + commitmentHash: + nullable: false + type: string + cumulativeGasUSed: + nullable: false + type: number + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + ContractJSON: + additionalProperties: true + example: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + contractName: + nullable: false + type: string + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + abi: + description: "The application binary interface of the solidity contract,\ + \ optional parameter" + items: {} + nullable: false + type: array + metadata: + type: string + deployedBytecode: + type: string + sourceMap: + type: string + deployedSourceMap: + type: string + sourcePath: + type: string + compiler: + type: object + networks: + type: object + ast: + type: object + functionHashes: + type: object + gasEstimates: + type: object + required: + - bytecode + - contractName + type: object + RunTransactionRequest: + additionalProperties: false + example: + privateTransactionConfig: + gasLimit: 7.061401241503109 + privateKey: privateKey + privateFrom: privateFrom + privacyGroupId: privacyGroupId + privateFor: + - "" + - "" + isPrivate: false + gasPrice: 2.3021358869347655 + timeoutMs: 0.6027456183070403 + transactionConfig: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + web3SigningCredential: + type: null + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + transactionConfig: + $ref: '#/components/schemas/QuorumTransactionConfig' + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with thehash of the transaction(which indicates successful execution) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + privateTransactionConfig: + $ref: '#/components/schemas/QuorumPrivateTransactionConfig' + required: + - transactionConfig + - web3SigningCredential + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + commitmentHash: commitmentHash + transactionHash: transactionHash + output: output + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + cumulativeGasUSed: 5.962133916683182 + from: from + to: to + revertReason: revertReason + logs: + - "" + - "" + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractSolidityBytecodeV1Request: + additionalProperties: false + example: + bytecode: bytecode + privateTransactionConfig: + gasLimit: 7.061401241503109 + privateKey: privateKey + privateFrom: privateFrom + privacyGroupId: privacyGroupId + privateFor: + - "" + - "" + isPrivate: false + gasPrice: 2.3021358869347655 + constructorArgs: + - "" + - "" + nonce: 1.4658129805029452 + keychainId: keychainId + timeoutMs: 0.5637376656633328 + contractAbi: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + contractName: contractName + value: 5.962133916683182 + gasPrice: 6.027456183070403 + contractJSON: "{}" + properties: + contractName: + description: The contract name for retrieve the contracts json on the keychain. + maxLength: 100 + minLength: 1 + nullable: false + type: string + contractAbi: + description: The application binary interface of the solidity contract + items: {} + nullable: false + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: number + nonce: + nullable: false + type: number + value: + nullable: false + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + contractJSON: + description: "For use when not using keychain, pass the contract in as this\ + \ variable" + nullable: false + type: object + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + privateTransactionConfig: + $ref: '#/components/schemas/QuorumPrivateTransactionConfig' + required: + - contractName + - keychainId + - web3SigningCredential + type: object + DeployContractSolidityBytecodeV1Response: + example: + transactionReceipt: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + commitmentHash: commitmentHash + transactionHash: transactionHash + output: output + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + cumulativeGasUSed: 5.962133916683182 + from: from + to: to + revertReason: revertReason + logs: + - "" + - "" + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractSolidityBytecodeJsonObjectV1Request: + additionalProperties: false + example: + timeoutMs: 0.6027456183070403 + constructorArgs: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + gasPrice: gasPrice + contractJSON: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: string + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + required: + - contractJSON + - web3SigningCredential + type: object + InvokeContractV1Request: + additionalProperties: false + example: + invocationType: null + keychainId: keychainId + timeoutMs: 0.6027456183070403 + gas: null + web3SigningCredential: + type: null + methodName: methodName + contractName: contractName + params: + - "" + - "" + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + contractName: + description: The contract name to find it in the keychain plugin + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + value: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gas: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + type: string + required: + - contractName + - invocationType + - keychainId + - methodName + - params + - web3SigningCredential + type: object + InvokeContractJsonObjectV1Request: + additionalProperties: false + example: + invocationType: null + privateTransactionConfig: + gasLimit: 7.061401241503109 + privateKey: privateKey + privateFrom: privateFrom + privacyGroupId: privacyGroupId + privateFor: + - "" + - "" + isPrivate: false + gasPrice: 2.3021358869347655 + timeoutMs: 0.6027456183070403 + gas: null + web3SigningCredential: + type: null + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + value: null + nonce: 0.8008281904610115 + gasPrice: null + contractJSON: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + contractAddress: + description: Address of the solidity contract + nullable: false + type: string + value: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gas: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + privateTransactionConfig: + $ref: '#/components/schemas/QuorumPrivateTransactionConfig' + required: + - contractAddress + - contractJSON + - invocationType + - methodName + - params + - web3SigningCredential + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + commitmentHash: commitmentHash + transactionHash: transactionHash + output: output + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + cumulativeGasUSed: 5.962133916683182 + from: from + to: to + revertReason: revertReason + logs: + - "" + - "" + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + InvokeRawWeb3EthMethodV1Request: + additionalProperties: false + example: + methodName: methodName + params: + - "" + - "" + properties: + methodName: + description: The name of the web3.eth method to invoke + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass to web3.eth method specified + in methodName + items: {} + type: array + required: + - methodName + type: object + InvokeRawWeb3EthMethodV1Response: + additionalProperties: false + properties: + status: + description: Status code of the operation + nullable: false + type: number + data: + description: Output of requested web3.eth method + errorDetail: + description: Error details + nullable: false + type: string + required: + - status + type: object + InvokeRawWeb3EthContractV1Request: + additionalProperties: false + example: + invocationType: null + address: address + abi: + - "" + - "" + contractMethodArgs: + - "" + - "" + contractMethod: contractMethod + invocationParams: "{}" + properties: + abi: + description: The application binary interface of the solidity contract + items: {} + type: array + address: + description: Deployed solidity contract address + type: string + invocationType: + $ref: '#/components/schemas/EthContractInvocationWeb3Method' + invocationParams: + default: {} + description: "The list of arguments for contract invocation method (send,\ + \ call, etc...)" + type: object + contractMethod: + description: Method of deployed solidity contract to execute + type: string + contractMethodArgs: + default: [] + description: The list of arguments for deployed solidity contract method + items: {} + type: array + required: + - abi + - address + - contractMethod + - invocationType + type: object + InvokeRawWeb3EthContractV1Response: + additionalProperties: false + properties: + status: + description: Status code of the operation + type: number + data: + description: Output of contract invocation method + errorDetail: + description: Error details + type: string + required: + - status + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + WatchBlocksV1: + enum: + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + WatchBlocksV1Options: + properties: + getBlockData: + type: boolean + type: object + Web3BlockHeader: + properties: + number: + type: number + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionsRoot: + type: string + stateRoot: + type: string + receiptsRoot: + type: string + difficulty: + type: string + mixHash: + type: string + miner: + type: string + extraData: + type: string + gasLimit: + type: integer + gasUsed: + type: integer + timestamp: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + required: + - extraData + - gasLimit + - gasUsed + - hash + - logsBloom + - miner + - nonce + - number + - parentHash + - receiptRoot + - sha3Uncles + - stateRoot + - timestamp + - transactionRoot + type: object + Web3Transaction: + properties: + hash: + type: string + nonce: + type: number + blockHash: + nullable: true + type: string + blockNumber: + nullable: true + type: number + transactionIndex: + nullable: true + type: number + from: + type: string + to: + nullable: true + type: string + value: + type: string + gasPrice: + type: string + gas: + type: number + input: + type: string + v: + type: string + r: + type: string + s: + type: string + required: + - blockHash + - blockNumber + - from + - gas + - gasPrice + - hash + - input + - nonce + - to + - transactionIndex + - value + type: object + WatchBlocksV1BlockData: + properties: + number: + type: number + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionsRoot: + type: string + stateRoot: + type: string + receiptsRoot: + type: string + difficulty: + type: string + mixHash: + type: string + miner: + type: string + extraData: + type: string + gasLimit: + type: integer + gasUsed: + type: integer + timestamp: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + size: + type: number + totalDifficulty: + type: string + uncles: + items: + type: string + type: array + transactions: + items: + $ref: '#/components/schemas/Web3Transaction' + type: array + required: + - extraData + - gasLimit + - gasUsed + - hash + - logsBloom + - miner + - nonce + - number + - parentHash + - receiptRoot + - sha3Uncles + - size + - stateRoot + - timestamp + - totalDifficulty + - transactionRoot + - transactions + - uncles + type: object + WatchBlocksV1Progress: + properties: + blockHeader: + $ref: '#/components/schemas/Web3BlockHeader' + blockData: + $ref: '#/components/schemas/WatchBlocksV1BlockData' + type: object + SolidityContractJsonArtifact_compiler: + additionalProperties: true + properties: + name: + type: string + version: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates_creation: + properties: + codeDepositCost: + type: string + executionCost: + type: string + totalCost: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates: + properties: + creation: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates_creation' + external: + additionalProperties: true + type: object + QuorumTransactionConfig_from: + oneOf: + - type: string + - type: number + QuorumTransactionConfig_to: + oneOf: + - type: string diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..5a83ce23c4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,855 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeployContractSolBytecodeJsonObjectV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractSolidityBytecodeJsonObjectV1Request *DeployContractSolidityBytecodeJsonObjectV1Request +} + +func (r ApiDeployContractSolBytecodeJsonObjectV1Request) DeployContractSolidityBytecodeJsonObjectV1Request(deployContractSolidityBytecodeJsonObjectV1Request DeployContractSolidityBytecodeJsonObjectV1Request) ApiDeployContractSolBytecodeJsonObjectV1Request { + r.deployContractSolidityBytecodeJsonObjectV1Request = &deployContractSolidityBytecodeJsonObjectV1Request + return r +} + +func (r ApiDeployContractSolBytecodeJsonObjectV1Request) Execute() (*DeployContractSolidityBytecodeV1Response, *http.Response, error) { + return r.ApiService.DeployContractSolBytecodeJsonObjectV1Execute(r) +} + +/* +DeployContractSolBytecodeJsonObjectV1 Deploys the bytecode of a Solidity contract. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractSolBytecodeJsonObjectV1Request +*/ +func (a *DefaultApiService) DeployContractSolBytecodeJsonObjectV1(ctx context.Context) ApiDeployContractSolBytecodeJsonObjectV1Request { + return ApiDeployContractSolBytecodeJsonObjectV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractSolidityBytecodeV1Response +func (a *DefaultApiService) DeployContractSolBytecodeJsonObjectV1Execute(r ApiDeployContractSolBytecodeJsonObjectV1Request) (*DeployContractSolidityBytecodeV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractSolidityBytecodeV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractSolBytecodeJsonObjectV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractSolidityBytecodeJsonObjectV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeployContractSolBytecodeV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractSolidityBytecodeV1Request *DeployContractSolidityBytecodeV1Request +} + +func (r ApiDeployContractSolBytecodeV1Request) DeployContractSolidityBytecodeV1Request(deployContractSolidityBytecodeV1Request DeployContractSolidityBytecodeV1Request) ApiDeployContractSolBytecodeV1Request { + r.deployContractSolidityBytecodeV1Request = &deployContractSolidityBytecodeV1Request + return r +} + +func (r ApiDeployContractSolBytecodeV1Request) Execute() (*DeployContractSolidityBytecodeV1Response, *http.Response, error) { + return r.ApiService.DeployContractSolBytecodeV1Execute(r) +} + +/* +DeployContractSolBytecodeV1 Deploys the bytecode of a Solidity contract. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractSolBytecodeV1Request +*/ +func (a *DefaultApiService) DeployContractSolBytecodeV1(ctx context.Context) ApiDeployContractSolBytecodeV1Request { + return ApiDeployContractSolBytecodeV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractSolidityBytecodeV1Response +func (a *DefaultApiService) DeployContractSolBytecodeV1Execute(r ApiDeployContractSolBytecodeV1Request) (*DeployContractSolidityBytecodeV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractSolidityBytecodeV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractSolBytecodeV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractSolidityBytecodeV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + invokeContractV1Request *InvokeContractV1Request +} + +func (r ApiInvokeContractV1Request) InvokeContractV1Request(invokeContractV1Request InvokeContractV1Request) ApiInvokeContractV1Request { + r.invokeContractV1Request = &invokeContractV1Request + return r +} + +func (r ApiInvokeContractV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.InvokeContractV1Execute(r) +} + +/* +InvokeContractV1 Invokes a contract on a besu ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeContractV1Request +*/ +func (a *DefaultApiService) InvokeContractV1(ctx context.Context) ApiInvokeContractV1Request { + return ApiInvokeContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) InvokeContractV1Execute(r ApiInvokeContractV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeContractV1NoKeychainRequest struct { + ctx context.Context + ApiService *DefaultApiService + invokeContractJsonObjectV1Request *InvokeContractJsonObjectV1Request +} + +func (r ApiInvokeContractV1NoKeychainRequest) InvokeContractJsonObjectV1Request(invokeContractJsonObjectV1Request InvokeContractJsonObjectV1Request) ApiInvokeContractV1NoKeychainRequest { + r.invokeContractJsonObjectV1Request = &invokeContractJsonObjectV1Request + return r +} + +func (r ApiInvokeContractV1NoKeychainRequest) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.InvokeContractV1NoKeychainExecute(r) +} + +/* +InvokeContractV1NoKeychain Invokes a contract on a besu ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeContractV1NoKeychainRequest +*/ +func (a *DefaultApiService) InvokeContractV1NoKeychain(ctx context.Context) ApiInvokeContractV1NoKeychainRequest { + return ApiInvokeContractV1NoKeychainRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) InvokeContractV1NoKeychainExecute(r ApiInvokeContractV1NoKeychainRequest) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeContractV1NoKeychain") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeContractJsonObjectV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeRawWeb3EthContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + invokeRawWeb3EthContractV1Request *InvokeRawWeb3EthContractV1Request +} + +func (r ApiInvokeRawWeb3EthContractV1Request) InvokeRawWeb3EthContractV1Request(invokeRawWeb3EthContractV1Request InvokeRawWeb3EthContractV1Request) ApiInvokeRawWeb3EthContractV1Request { + r.invokeRawWeb3EthContractV1Request = &invokeRawWeb3EthContractV1Request + return r +} + +func (r ApiInvokeRawWeb3EthContractV1Request) Execute() (*InvokeRawWeb3EthContractV1Response, *http.Response, error) { + return r.ApiService.InvokeRawWeb3EthContractV1Execute(r) +} + +/* +InvokeRawWeb3EthContractV1 Low-level endpoint to invoke a method on deployed contract. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeRawWeb3EthContractV1Request +*/ +func (a *DefaultApiService) InvokeRawWeb3EthContractV1(ctx context.Context) ApiInvokeRawWeb3EthContractV1Request { + return ApiInvokeRawWeb3EthContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeRawWeb3EthContractV1Response +func (a *DefaultApiService) InvokeRawWeb3EthContractV1Execute(r ApiInvokeRawWeb3EthContractV1Request) (*InvokeRawWeb3EthContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeRawWeb3EthContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeRawWeb3EthContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeRawWeb3EthContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeWeb3EthMethodV1Request struct { + ctx context.Context + ApiService *DefaultApiService + invokeRawWeb3EthMethodV1Request *InvokeRawWeb3EthMethodV1Request +} + +func (r ApiInvokeWeb3EthMethodV1Request) InvokeRawWeb3EthMethodV1Request(invokeRawWeb3EthMethodV1Request InvokeRawWeb3EthMethodV1Request) ApiInvokeWeb3EthMethodV1Request { + r.invokeRawWeb3EthMethodV1Request = &invokeRawWeb3EthMethodV1Request + return r +} + +func (r ApiInvokeWeb3EthMethodV1Request) Execute() (*InvokeRawWeb3EthMethodV1Response, *http.Response, error) { + return r.ApiService.InvokeWeb3EthMethodV1Execute(r) +} + +/* +InvokeWeb3EthMethodV1 Invoke any method from web3.eth (low-level) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeWeb3EthMethodV1Request +*/ +func (a *DefaultApiService) InvokeWeb3EthMethodV1(ctx context.Context) ApiInvokeWeb3EthMethodV1Request { + return ApiInvokeWeb3EthMethodV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeRawWeb3EthMethodV1Response +func (a *DefaultApiService) InvokeWeb3EthMethodV1Execute(r ApiInvokeWeb3EthMethodV1Request) (*InvokeRawWeb3EthMethodV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeRawWeb3EthMethodV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeWeb3EthMethodV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeRawWeb3EthMethodV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRunTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + runTransactionRequest *RunTransactionRequest +} + +func (r ApiRunTransactionV1Request) RunTransactionRequest(runTransactionRequest RunTransactionRequest) ApiRunTransactionV1Request { + r.runTransactionRequest = &runTransactionRequest + return r +} + +func (r ApiRunTransactionV1Request) Execute() (*RunTransactionResponse, *http.Response, error) { + return r.ApiService.RunTransactionV1Execute(r) +} + +/* +RunTransactionV1 Executes a transaction on a quorum ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRunTransactionV1Request +*/ +func (a *DefaultApiService) RunTransactionV1(ctx context.Context) ApiRunTransactionV1Request { + return ApiRunTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionResponse +func (a *DefaultApiService) RunTransactionV1Execute(r ApiRunTransactionV1Request) (*RunTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RunTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.runTransactionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..1a7130bda09 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Connector Quorum API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..d34a234cafa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..3ef9e31df21 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_contract_json.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_contract_json.go new file mode 100644 index 00000000000..6518e2fcc8e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_contract_json.go @@ -0,0 +1,579 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the ContractJSON type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContractJSON{} + +// ContractJSON struct for ContractJSON +type ContractJSON struct { + ContractName string `json:"contractName"` + // See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + Bytecode string `json:"bytecode"` + // The application binary interface of the solidity contract, optional parameter + Abi []interface{} `json:"abi,omitempty"` + Metadata *string `json:"metadata,omitempty"` + DeployedBytecode *string `json:"deployedBytecode,omitempty"` + SourceMap *string `json:"sourceMap,omitempty"` + DeployedSourceMap *string `json:"deployedSourceMap,omitempty"` + SourcePath *string `json:"sourcePath,omitempty"` + Compiler map[string]interface{} `json:"compiler,omitempty"` + Networks map[string]interface{} `json:"networks,omitempty"` + Ast map[string]interface{} `json:"ast,omitempty"` + FunctionHashes map[string]interface{} `json:"functionHashes,omitempty"` + GasEstimates map[string]interface{} `json:"gasEstimates,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ContractJSON ContractJSON + +// NewContractJSON instantiates a new ContractJSON 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 +// will change when the set of required properties is changed +func NewContractJSON(contractName string, bytecode string) *ContractJSON { + this := ContractJSON{} + this.ContractName = contractName + this.Bytecode = bytecode + return &this +} + +// NewContractJSONWithDefaults instantiates a new ContractJSON object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContractJSONWithDefaults() *ContractJSON { + this := ContractJSON{} + return &this +} + +// GetContractName returns the ContractName field value +func (o *ContractJSON) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *ContractJSON) SetContractName(v string) { + o.ContractName = v +} + +// GetBytecode returns the Bytecode field value +func (o *ContractJSON) GetBytecode() string { + if o == nil { + var ret string + return ret + } + + return o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetBytecodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bytecode, true +} + +// SetBytecode sets field value +func (o *ContractJSON) SetBytecode(v string) { + o.Bytecode = v +} + +// GetAbi returns the Abi field value if set, zero value otherwise. +func (o *ContractJSON) GetAbi() []interface{} { + if o == nil || IsNil(o.Abi) { + var ret []interface{} + return ret + } + return o.Abi +} + +// GetAbiOk returns a tuple with the Abi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetAbiOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Abi) { + return nil, false + } + return o.Abi, true +} + +// HasAbi returns a boolean if a field has been set. +func (o *ContractJSON) HasAbi() bool { + if o != nil && !IsNil(o.Abi) { + return true + } + + return false +} + +// SetAbi gets a reference to the given []interface{} and assigns it to the Abi field. +func (o *ContractJSON) SetAbi(v []interface{}) { + o.Abi = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *ContractJSON) GetMetadata() string { + if o == nil || IsNil(o.Metadata) { + var ret string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetMetadataOk() (*string, bool) { + if o == nil || IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *ContractJSON) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given string and assigns it to the Metadata field. +func (o *ContractJSON) SetMetadata(v string) { + o.Metadata = &v +} + +// GetDeployedBytecode returns the DeployedBytecode field value if set, zero value otherwise. +func (o *ContractJSON) GetDeployedBytecode() string { + if o == nil || IsNil(o.DeployedBytecode) { + var ret string + return ret + } + return *o.DeployedBytecode +} + +// GetDeployedBytecodeOk returns a tuple with the DeployedBytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetDeployedBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.DeployedBytecode) { + return nil, false + } + return o.DeployedBytecode, true +} + +// HasDeployedBytecode returns a boolean if a field has been set. +func (o *ContractJSON) HasDeployedBytecode() bool { + if o != nil && !IsNil(o.DeployedBytecode) { + return true + } + + return false +} + +// SetDeployedBytecode gets a reference to the given string and assigns it to the DeployedBytecode field. +func (o *ContractJSON) SetDeployedBytecode(v string) { + o.DeployedBytecode = &v +} + +// GetSourceMap returns the SourceMap field value if set, zero value otherwise. +func (o *ContractJSON) GetSourceMap() string { + if o == nil || IsNil(o.SourceMap) { + var ret string + return ret + } + return *o.SourceMap +} + +// GetSourceMapOk returns a tuple with the SourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.SourceMap) { + return nil, false + } + return o.SourceMap, true +} + +// HasSourceMap returns a boolean if a field has been set. +func (o *ContractJSON) HasSourceMap() bool { + if o != nil && !IsNil(o.SourceMap) { + return true + } + + return false +} + +// SetSourceMap gets a reference to the given string and assigns it to the SourceMap field. +func (o *ContractJSON) SetSourceMap(v string) { + o.SourceMap = &v +} + +// GetDeployedSourceMap returns the DeployedSourceMap field value if set, zero value otherwise. +func (o *ContractJSON) GetDeployedSourceMap() string { + if o == nil || IsNil(o.DeployedSourceMap) { + var ret string + return ret + } + return *o.DeployedSourceMap +} + +// GetDeployedSourceMapOk returns a tuple with the DeployedSourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetDeployedSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.DeployedSourceMap) { + return nil, false + } + return o.DeployedSourceMap, true +} + +// HasDeployedSourceMap returns a boolean if a field has been set. +func (o *ContractJSON) HasDeployedSourceMap() bool { + if o != nil && !IsNil(o.DeployedSourceMap) { + return true + } + + return false +} + +// SetDeployedSourceMap gets a reference to the given string and assigns it to the DeployedSourceMap field. +func (o *ContractJSON) SetDeployedSourceMap(v string) { + o.DeployedSourceMap = &v +} + +// GetSourcePath returns the SourcePath field value if set, zero value otherwise. +func (o *ContractJSON) GetSourcePath() string { + if o == nil || IsNil(o.SourcePath) { + var ret string + return ret + } + return *o.SourcePath +} + +// GetSourcePathOk returns a tuple with the SourcePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetSourcePathOk() (*string, bool) { + if o == nil || IsNil(o.SourcePath) { + return nil, false + } + return o.SourcePath, true +} + +// HasSourcePath returns a boolean if a field has been set. +func (o *ContractJSON) HasSourcePath() bool { + if o != nil && !IsNil(o.SourcePath) { + return true + } + + return false +} + +// SetSourcePath gets a reference to the given string and assigns it to the SourcePath field. +func (o *ContractJSON) SetSourcePath(v string) { + o.SourcePath = &v +} + +// GetCompiler returns the Compiler field value if set, zero value otherwise. +func (o *ContractJSON) GetCompiler() map[string]interface{} { + if o == nil || IsNil(o.Compiler) { + var ret map[string]interface{} + return ret + } + return o.Compiler +} + +// GetCompilerOk returns a tuple with the Compiler field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetCompilerOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Compiler) { + return map[string]interface{}{}, false + } + return o.Compiler, true +} + +// HasCompiler returns a boolean if a field has been set. +func (o *ContractJSON) HasCompiler() bool { + if o != nil && !IsNil(o.Compiler) { + return true + } + + return false +} + +// SetCompiler gets a reference to the given map[string]interface{} and assigns it to the Compiler field. +func (o *ContractJSON) SetCompiler(v map[string]interface{}) { + o.Compiler = v +} + +// GetNetworks returns the Networks field value if set, zero value otherwise. +func (o *ContractJSON) GetNetworks() map[string]interface{} { + if o == nil || IsNil(o.Networks) { + var ret map[string]interface{} + return ret + } + return o.Networks +} + +// GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetNetworksOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Networks) { + return map[string]interface{}{}, false + } + return o.Networks, true +} + +// HasNetworks returns a boolean if a field has been set. +func (o *ContractJSON) HasNetworks() bool { + if o != nil && !IsNil(o.Networks) { + return true + } + + return false +} + +// SetNetworks gets a reference to the given map[string]interface{} and assigns it to the Networks field. +func (o *ContractJSON) SetNetworks(v map[string]interface{}) { + o.Networks = v +} + +// GetAst returns the Ast field value if set, zero value otherwise. +func (o *ContractJSON) GetAst() map[string]interface{} { + if o == nil || IsNil(o.Ast) { + var ret map[string]interface{} + return ret + } + return o.Ast +} + +// GetAstOk returns a tuple with the Ast field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetAstOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Ast) { + return map[string]interface{}{}, false + } + return o.Ast, true +} + +// HasAst returns a boolean if a field has been set. +func (o *ContractJSON) HasAst() bool { + if o != nil && !IsNil(o.Ast) { + return true + } + + return false +} + +// SetAst gets a reference to the given map[string]interface{} and assigns it to the Ast field. +func (o *ContractJSON) SetAst(v map[string]interface{}) { + o.Ast = v +} + +// GetFunctionHashes returns the FunctionHashes field value if set, zero value otherwise. +func (o *ContractJSON) GetFunctionHashes() map[string]interface{} { + if o == nil || IsNil(o.FunctionHashes) { + var ret map[string]interface{} + return ret + } + return o.FunctionHashes +} + +// GetFunctionHashesOk returns a tuple with the FunctionHashes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetFunctionHashesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FunctionHashes) { + return map[string]interface{}{}, false + } + return o.FunctionHashes, true +} + +// HasFunctionHashes returns a boolean if a field has been set. +func (o *ContractJSON) HasFunctionHashes() bool { + if o != nil && !IsNil(o.FunctionHashes) { + return true + } + + return false +} + +// SetFunctionHashes gets a reference to the given map[string]interface{} and assigns it to the FunctionHashes field. +func (o *ContractJSON) SetFunctionHashes(v map[string]interface{}) { + o.FunctionHashes = v +} + +// GetGasEstimates returns the GasEstimates field value if set, zero value otherwise. +func (o *ContractJSON) GetGasEstimates() map[string]interface{} { + if o == nil || IsNil(o.GasEstimates) { + var ret map[string]interface{} + return ret + } + return o.GasEstimates +} + +// GetGasEstimatesOk returns a tuple with the GasEstimates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetGasEstimatesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.GasEstimates) { + return map[string]interface{}{}, false + } + return o.GasEstimates, true +} + +// HasGasEstimates returns a boolean if a field has been set. +func (o *ContractJSON) HasGasEstimates() bool { + if o != nil && !IsNil(o.GasEstimates) { + return true + } + + return false +} + +// SetGasEstimates gets a reference to the given map[string]interface{} and assigns it to the GasEstimates field. +func (o *ContractJSON) SetGasEstimates(v map[string]interface{}) { + o.GasEstimates = v +} + +func (o ContractJSON) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContractJSON) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + toSerialize["bytecode"] = o.Bytecode + if !IsNil(o.Abi) { + toSerialize["abi"] = o.Abi + } + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !IsNil(o.DeployedBytecode) { + toSerialize["deployedBytecode"] = o.DeployedBytecode + } + if !IsNil(o.SourceMap) { + toSerialize["sourceMap"] = o.SourceMap + } + if !IsNil(o.DeployedSourceMap) { + toSerialize["deployedSourceMap"] = o.DeployedSourceMap + } + if !IsNil(o.SourcePath) { + toSerialize["sourcePath"] = o.SourcePath + } + if !IsNil(o.Compiler) { + toSerialize["compiler"] = o.Compiler + } + if !IsNil(o.Networks) { + toSerialize["networks"] = o.Networks + } + if !IsNil(o.Ast) { + toSerialize["ast"] = o.Ast + } + if !IsNil(o.FunctionHashes) { + toSerialize["functionHashes"] = o.FunctionHashes + } + if !IsNil(o.GasEstimates) { + toSerialize["gasEstimates"] = o.GasEstimates + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContractJSON) UnmarshalJSON(bytes []byte) (err error) { + varContractJSON := _ContractJSON{} + + if err = json.Unmarshal(bytes, &varContractJSON); err == nil { + *o = ContractJSON(varContractJSON) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "contractName") + delete(additionalProperties, "bytecode") + delete(additionalProperties, "abi") + delete(additionalProperties, "metadata") + delete(additionalProperties, "deployedBytecode") + delete(additionalProperties, "sourceMap") + delete(additionalProperties, "deployedSourceMap") + delete(additionalProperties, "sourcePath") + delete(additionalProperties, "compiler") + delete(additionalProperties, "networks") + delete(additionalProperties, "ast") + delete(additionalProperties, "functionHashes") + delete(additionalProperties, "gasEstimates") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContractJSON struct { + value *ContractJSON + isSet bool +} + +func (v NullableContractJSON) Get() *ContractJSON { + return v.value +} + +func (v *NullableContractJSON) Set(val *ContractJSON) { + v.value = val + v.isSet = true +} + +func (v NullableContractJSON) IsSet() bool { + return v.isSet +} + +func (v *NullableContractJSON) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContractJSON(val *ContractJSON) *NullableContractJSON { + return &NullableContractJSON{value: val, isSet: true} +} + +func (v NullableContractJSON) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContractJSON) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_json_object_v1_request.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_json_object_v1_request.go new file mode 100644 index 00000000000..283fa9981af --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_json_object_v1_request.go @@ -0,0 +1,294 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the DeployContractSolidityBytecodeJsonObjectV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractSolidityBytecodeJsonObjectV1Request{} + +// DeployContractSolidityBytecodeJsonObjectV1Request struct for DeployContractSolidityBytecodeJsonObjectV1Request +type DeployContractSolidityBytecodeJsonObjectV1Request struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + Gas *float32 `json:"gas,omitempty"` + GasPrice *string `json:"gasPrice,omitempty"` + // The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + ContractJSON ContractJSON `json:"contractJSON"` + // The list of arguments to pass in to the constructor of the contract being deployed. + ConstructorArgs []interface{} `json:"constructorArgs,omitempty"` +} + +// NewDeployContractSolidityBytecodeJsonObjectV1Request instantiates a new DeployContractSolidityBytecodeJsonObjectV1Request 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 +// will change when the set of required properties is changed +func NewDeployContractSolidityBytecodeJsonObjectV1Request(web3SigningCredential Web3SigningCredential, contractJSON ContractJSON) *DeployContractSolidityBytecodeJsonObjectV1Request { + this := DeployContractSolidityBytecodeJsonObjectV1Request{} + this.Web3SigningCredential = web3SigningCredential + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + this.ContractJSON = contractJSON + return &this +} + +// NewDeployContractSolidityBytecodeJsonObjectV1RequestWithDefaults instantiates a new DeployContractSolidityBytecodeJsonObjectV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractSolidityBytecodeJsonObjectV1RequestWithDefaults() *DeployContractSolidityBytecodeJsonObjectV1Request { + this := DeployContractSolidityBytecodeJsonObjectV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) SetGas(v float32) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetGasPrice() string { + if o == nil || IsNil(o.GasPrice) { + var ret string + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetGasPriceOk() (*string, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given string and assigns it to the GasPrice field. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) SetGasPrice(v string) { + o.GasPrice = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetContractJSON returns the ContractJSON field value +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetContractJSON() ContractJSON { + if o == nil { + var ret ContractJSON + return ret + } + + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetContractJSONOk() (*ContractJSON, bool) { + if o == nil { + return nil, false + } + return &o.ContractJSON, true +} + +// SetContractJSON sets field value +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) SetContractJSON(v ContractJSON) { + o.ContractJSON = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetConstructorArgs() []interface{} { + if o == nil || IsNil(o.ConstructorArgs) { + var ret []interface{} + return ret + } + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) HasConstructorArgs() bool { + if o != nil && !IsNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given []interface{} and assigns it to the ConstructorArgs field. +func (o *DeployContractSolidityBytecodeJsonObjectV1Request) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +func (o DeployContractSolidityBytecodeJsonObjectV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractSolidityBytecodeJsonObjectV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["contractJSON"] = o.ContractJSON + if !IsNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + return toSerialize, nil +} + +type NullableDeployContractSolidityBytecodeJsonObjectV1Request struct { + value *DeployContractSolidityBytecodeJsonObjectV1Request + isSet bool +} + +func (v NullableDeployContractSolidityBytecodeJsonObjectV1Request) Get() *DeployContractSolidityBytecodeJsonObjectV1Request { + return v.value +} + +func (v *NullableDeployContractSolidityBytecodeJsonObjectV1Request) Set(val *DeployContractSolidityBytecodeJsonObjectV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractSolidityBytecodeJsonObjectV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractSolidityBytecodeJsonObjectV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractSolidityBytecodeJsonObjectV1Request(val *DeployContractSolidityBytecodeJsonObjectV1Request) *NullableDeployContractSolidityBytecodeJsonObjectV1Request { + return &NullableDeployContractSolidityBytecodeJsonObjectV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractSolidityBytecodeJsonObjectV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractSolidityBytecodeJsonObjectV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go new file mode 100644 index 00000000000..a0c5b1865c5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_request.go @@ -0,0 +1,542 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the DeployContractSolidityBytecodeV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractSolidityBytecodeV1Request{} + +// DeployContractSolidityBytecodeV1Request struct for DeployContractSolidityBytecodeV1Request +type DeployContractSolidityBytecodeV1Request struct { + // The contract name for retrieve the contracts json on the keychain. + ContractName string `json:"contractName"` + // The application binary interface of the solidity contract + ContractAbi []interface{} `json:"contractAbi,omitempty"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + Bytecode *string `json:"bytecode,omitempty"` + // The keychainId for retrieve the contracts json. + KeychainId string `json:"keychainId"` + Gas *float32 `json:"gas,omitempty"` + GasPrice *float32 `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + Value *float32 `json:"value,omitempty"` + // The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + // For use when not using keychain, pass the contract in as this variable + ContractJSON map[string]interface{} `json:"contractJSON,omitempty"` + // The list of arguments to pass in to the constructor of the contract being deployed. + ConstructorArgs []interface{} `json:"constructorArgs,omitempty"` + PrivateTransactionConfig *QuorumPrivateTransactionConfig `json:"privateTransactionConfig,omitempty"` +} + +// NewDeployContractSolidityBytecodeV1Request instantiates a new DeployContractSolidityBytecodeV1Request 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 +// will change when the set of required properties is changed +func NewDeployContractSolidityBytecodeV1Request(contractName string, web3SigningCredential Web3SigningCredential, keychainId string) *DeployContractSolidityBytecodeV1Request { + this := DeployContractSolidityBytecodeV1Request{} + this.ContractName = contractName + this.Web3SigningCredential = web3SigningCredential + this.KeychainId = keychainId + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewDeployContractSolidityBytecodeV1RequestWithDefaults instantiates a new DeployContractSolidityBytecodeV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractSolidityBytecodeV1RequestWithDefaults() *DeployContractSolidityBytecodeV1Request { + this := DeployContractSolidityBytecodeV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractName returns the ContractName field value +func (o *DeployContractSolidityBytecodeV1Request) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetContractName(v string) { + o.ContractName = v +} + +// GetContractAbi returns the ContractAbi field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetContractAbi() []interface{} { + if o == nil || IsNil(o.ContractAbi) { + var ret []interface{} + return ret + } + return o.ContractAbi +} + +// GetContractAbiOk returns a tuple with the ContractAbi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetContractAbiOk() ([]interface{}, bool) { + if o == nil || IsNil(o.ContractAbi) { + return nil, false + } + return o.ContractAbi, true +} + +// HasContractAbi returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasContractAbi() bool { + if o != nil && !IsNil(o.ContractAbi) { + return true + } + + return false +} + +// SetContractAbi gets a reference to the given []interface{} and assigns it to the ContractAbi field. +func (o *DeployContractSolidityBytecodeV1Request) SetContractAbi(v []interface{}) { + o.ContractAbi = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployContractSolidityBytecodeV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetBytecode returns the Bytecode field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetBytecode() string { + if o == nil || IsNil(o.Bytecode) { + var ret string + return ret + } + return *o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.Bytecode) { + return nil, false + } + return o.Bytecode, true +} + +// HasBytecode returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasBytecode() bool { + if o != nil && !IsNil(o.Bytecode) { + return true + } + + return false +} + +// SetBytecode gets a reference to the given string and assigns it to the Bytecode field. +func (o *DeployContractSolidityBytecodeV1Request) SetBytecode(v string) { + o.Bytecode = &v +} + +// GetKeychainId returns the KeychainId field value +func (o *DeployContractSolidityBytecodeV1Request) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *DeployContractSolidityBytecodeV1Request) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *DeployContractSolidityBytecodeV1Request) SetGas(v float32) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetGasPrice() float32 { + if o == nil || IsNil(o.GasPrice) { + var ret float32 + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetGasPriceOk() (*float32, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given float32 and assigns it to the GasPrice field. +func (o *DeployContractSolidityBytecodeV1Request) SetGasPrice(v float32) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *DeployContractSolidityBytecodeV1Request) SetNonce(v float32) { + o.Nonce = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetValue() float32 { + if o == nil || IsNil(o.Value) { + var ret float32 + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetValueOk() (*float32, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given float32 and assigns it to the Value field. +func (o *DeployContractSolidityBytecodeV1Request) SetValue(v float32) { + o.Value = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *DeployContractSolidityBytecodeV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetContractJSON returns the ContractJSON field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetContractJSON() map[string]interface{} { + if o == nil || IsNil(o.ContractJSON) { + var ret map[string]interface{} + return ret + } + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetContractJSONOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.ContractJSON) { + return map[string]interface{}{}, false + } + return o.ContractJSON, true +} + +// HasContractJSON returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasContractJSON() bool { + if o != nil && !IsNil(o.ContractJSON) { + return true + } + + return false +} + +// SetContractJSON gets a reference to the given map[string]interface{} and assigns it to the ContractJSON field. +func (o *DeployContractSolidityBytecodeV1Request) SetContractJSON(v map[string]interface{}) { + o.ContractJSON = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetConstructorArgs() []interface{} { + if o == nil || IsNil(o.ConstructorArgs) { + var ret []interface{} + return ret + } + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasConstructorArgs() bool { + if o != nil && !IsNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given []interface{} and assigns it to the ConstructorArgs field. +func (o *DeployContractSolidityBytecodeV1Request) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +// GetPrivateTransactionConfig returns the PrivateTransactionConfig field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeV1Request) GetPrivateTransactionConfig() QuorumPrivateTransactionConfig { + if o == nil || IsNil(o.PrivateTransactionConfig) { + var ret QuorumPrivateTransactionConfig + return ret + } + return *o.PrivateTransactionConfig +} + +// GetPrivateTransactionConfigOk returns a tuple with the PrivateTransactionConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Request) GetPrivateTransactionConfigOk() (*QuorumPrivateTransactionConfig, bool) { + if o == nil || IsNil(o.PrivateTransactionConfig) { + return nil, false + } + return o.PrivateTransactionConfig, true +} + +// HasPrivateTransactionConfig returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeV1Request) HasPrivateTransactionConfig() bool { + if o != nil && !IsNil(o.PrivateTransactionConfig) { + return true + } + + return false +} + +// SetPrivateTransactionConfig gets a reference to the given QuorumPrivateTransactionConfig and assigns it to the PrivateTransactionConfig field. +func (o *DeployContractSolidityBytecodeV1Request) SetPrivateTransactionConfig(v QuorumPrivateTransactionConfig) { + o.PrivateTransactionConfig = &v +} + +func (o DeployContractSolidityBytecodeV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractSolidityBytecodeV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + if !IsNil(o.ContractAbi) { + toSerialize["contractAbi"] = o.ContractAbi + } + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + if !IsNil(o.Bytecode) { + toSerialize["bytecode"] = o.Bytecode + } + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + if !IsNil(o.ContractJSON) { + toSerialize["contractJSON"] = o.ContractJSON + } + if !IsNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + if !IsNil(o.PrivateTransactionConfig) { + toSerialize["privateTransactionConfig"] = o.PrivateTransactionConfig + } + return toSerialize, nil +} + +type NullableDeployContractSolidityBytecodeV1Request struct { + value *DeployContractSolidityBytecodeV1Request + isSet bool +} + +func (v NullableDeployContractSolidityBytecodeV1Request) Get() *DeployContractSolidityBytecodeV1Request { + return v.value +} + +func (v *NullableDeployContractSolidityBytecodeV1Request) Set(val *DeployContractSolidityBytecodeV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractSolidityBytecodeV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractSolidityBytecodeV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractSolidityBytecodeV1Request(val *DeployContractSolidityBytecodeV1Request) *NullableDeployContractSolidityBytecodeV1Request { + return &NullableDeployContractSolidityBytecodeV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractSolidityBytecodeV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractSolidityBytecodeV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go new file mode 100644 index 00000000000..ca5a15d9a5f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the DeployContractSolidityBytecodeV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractSolidityBytecodeV1Response{} + +// DeployContractSolidityBytecodeV1Response struct for DeployContractSolidityBytecodeV1Response +type DeployContractSolidityBytecodeV1Response struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewDeployContractSolidityBytecodeV1Response instantiates a new DeployContractSolidityBytecodeV1Response 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 +// will change when the set of required properties is changed +func NewDeployContractSolidityBytecodeV1Response(transactionReceipt Web3TransactionReceipt) *DeployContractSolidityBytecodeV1Response { + this := DeployContractSolidityBytecodeV1Response{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewDeployContractSolidityBytecodeV1ResponseWithDefaults instantiates a new DeployContractSolidityBytecodeV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractSolidityBytecodeV1ResponseWithDefaults() *DeployContractSolidityBytecodeV1Response { + this := DeployContractSolidityBytecodeV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *DeployContractSolidityBytecodeV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *DeployContractSolidityBytecodeV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o DeployContractSolidityBytecodeV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractSolidityBytecodeV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableDeployContractSolidityBytecodeV1Response struct { + value *DeployContractSolidityBytecodeV1Response + isSet bool +} + +func (v NullableDeployContractSolidityBytecodeV1Response) Get() *DeployContractSolidityBytecodeV1Response { + return v.value +} + +func (v *NullableDeployContractSolidityBytecodeV1Response) Set(val *DeployContractSolidityBytecodeV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractSolidityBytecodeV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractSolidityBytecodeV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractSolidityBytecodeV1Response(val *DeployContractSolidityBytecodeV1Response) *NullableDeployContractSolidityBytecodeV1Response { + return &NullableDeployContractSolidityBytecodeV1Response{value: val, isSet: true} +} + +func (v NullableDeployContractSolidityBytecodeV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractSolidityBytecodeV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go new file mode 100644 index 00000000000..d32f2f3630f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" + "fmt" +) + +// EthContractInvocationType the model 'EthContractInvocationType' +type EthContractInvocationType string + +// List of EthContractInvocationType +const ( + SEND EthContractInvocationType = "SEND" + CALL EthContractInvocationType = "CALL" +) + +// All allowed values of EthContractInvocationType enum +var AllowedEthContractInvocationTypeEnumValues = []EthContractInvocationType{ + "SEND", + "CALL", +} + +func (v *EthContractInvocationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EthContractInvocationType(value) + for _, existing := range AllowedEthContractInvocationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EthContractInvocationType", value) +} + +// NewEthContractInvocationTypeFromValue returns a pointer to a valid EthContractInvocationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEthContractInvocationTypeFromValue(v string) (*EthContractInvocationType, error) { + ev := EthContractInvocationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EthContractInvocationType: valid values are %v", v, AllowedEthContractInvocationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EthContractInvocationType) IsValid() bool { + for _, existing := range AllowedEthContractInvocationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EthContractInvocationType value +func (v EthContractInvocationType) Ptr() *EthContractInvocationType { + return &v +} + +type NullableEthContractInvocationType struct { + value *EthContractInvocationType + isSet bool +} + +func (v NullableEthContractInvocationType) Get() *EthContractInvocationType { + return v.value +} + +func (v *NullableEthContractInvocationType) Set(val *EthContractInvocationType) { + v.value = val + v.isSet = true +} + +func (v NullableEthContractInvocationType) IsSet() bool { + return v.isSet +} + +func (v *NullableEthContractInvocationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEthContractInvocationType(val *EthContractInvocationType) *NullableEthContractInvocationType { + return &NullableEthContractInvocationType{value: val, isSet: true} +} + +func (v NullableEthContractInvocationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEthContractInvocationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_web3_method.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_web3_method.go new file mode 100644 index 00000000000..a981452e94a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_web3_method.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" + "fmt" +) + +// EthContractInvocationWeb3Method the model 'EthContractInvocationWeb3Method' +type EthContractInvocationWeb3Method string + +// List of EthContractInvocationWeb3Method +const ( + SEND EthContractInvocationWeb3Method = "send" + CALL EthContractInvocationWeb3Method = "call" + ENCODE_ABI EthContractInvocationWeb3Method = "encodeABI" + ESTIMATE_GAS EthContractInvocationWeb3Method = "estimateGas" +) + +// All allowed values of EthContractInvocationWeb3Method enum +var AllowedEthContractInvocationWeb3MethodEnumValues = []EthContractInvocationWeb3Method{ + "send", + "call", + "encodeABI", + "estimateGas", +} + +func (v *EthContractInvocationWeb3Method) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EthContractInvocationWeb3Method(value) + for _, existing := range AllowedEthContractInvocationWeb3MethodEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EthContractInvocationWeb3Method", value) +} + +// NewEthContractInvocationWeb3MethodFromValue returns a pointer to a valid EthContractInvocationWeb3Method +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEthContractInvocationWeb3MethodFromValue(v string) (*EthContractInvocationWeb3Method, error) { + ev := EthContractInvocationWeb3Method(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EthContractInvocationWeb3Method: valid values are %v", v, AllowedEthContractInvocationWeb3MethodEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EthContractInvocationWeb3Method) IsValid() bool { + for _, existing := range AllowedEthContractInvocationWeb3MethodEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EthContractInvocationWeb3Method value +func (v EthContractInvocationWeb3Method) Ptr() *EthContractInvocationWeb3Method { + return &v +} + +type NullableEthContractInvocationWeb3Method struct { + value *EthContractInvocationWeb3Method + isSet bool +} + +func (v NullableEthContractInvocationWeb3Method) Get() *EthContractInvocationWeb3Method { + return v.value +} + +func (v *NullableEthContractInvocationWeb3Method) Set(val *EthContractInvocationWeb3Method) { + v.value = val + v.isSet = true +} + +func (v NullableEthContractInvocationWeb3Method) IsSet() bool { + return v.isSet +} + +func (v *NullableEthContractInvocationWeb3Method) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEthContractInvocationWeb3Method(val *EthContractInvocationWeb3Method) *NullableEthContractInvocationWeb3Method { + return &NullableEthContractInvocationWeb3Method{value: val, isSet: true} +} + +func (v NullableEthContractInvocationWeb3Method) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEthContractInvocationWeb3Method) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go new file mode 100644 index 00000000000..dafe15c7a90 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go @@ -0,0 +1,476 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the InvokeContractJsonObjectV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractJsonObjectV1Request{} + +// InvokeContractJsonObjectV1Request struct for InvokeContractJsonObjectV1Request +type InvokeContractJsonObjectV1Request struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + InvocationType EthContractInvocationType `json:"invocationType"` + // The name of the contract method to invoke. + MethodName string `json:"methodName"` + // The list of arguments to pass in to the contract method being invoked. + Params []interface{} `json:"params"` + // Address of the solidity contract + ContractAddress string `json:"contractAddress"` + Value *QuorumTransactionConfigFrom `json:"value,omitempty"` + Gas *QuorumTransactionConfigFrom `json:"gas,omitempty"` + GasPrice *QuorumTransactionConfigFrom `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + // The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + ContractJSON ContractJSON `json:"contractJSON"` + PrivateTransactionConfig *QuorumPrivateTransactionConfig `json:"privateTransactionConfig,omitempty"` +} + +// NewInvokeContractJsonObjectV1Request instantiates a new InvokeContractJsonObjectV1Request 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 +// will change when the set of required properties is changed +func NewInvokeContractJsonObjectV1Request(web3SigningCredential Web3SigningCredential, invocationType EthContractInvocationType, methodName string, params []interface{}, contractAddress string, contractJSON ContractJSON) *InvokeContractJsonObjectV1Request { + this := InvokeContractJsonObjectV1Request{} + this.Web3SigningCredential = web3SigningCredential + this.InvocationType = invocationType + this.MethodName = methodName + this.Params = params + this.ContractAddress = contractAddress + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + this.ContractJSON = contractJSON + return &this +} + +// NewInvokeContractJsonObjectV1RequestWithDefaults instantiates a new InvokeContractJsonObjectV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractJsonObjectV1RequestWithDefaults() *InvokeContractJsonObjectV1Request { + this := InvokeContractJsonObjectV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *InvokeContractJsonObjectV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *InvokeContractJsonObjectV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeContractJsonObjectV1Request) GetInvocationType() EthContractInvocationType { + if o == nil { + var ret EthContractInvocationType + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetInvocationTypeOk() (*EthContractInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeContractJsonObjectV1Request) SetInvocationType(v EthContractInvocationType) { + o.InvocationType = v +} + +// GetMethodName returns the MethodName field value +func (o *InvokeContractJsonObjectV1Request) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeContractJsonObjectV1Request) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value +func (o *InvokeContractJsonObjectV1Request) GetParams() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetParamsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *InvokeContractJsonObjectV1Request) SetParams(v []interface{}) { + o.Params = v +} + +// GetContractAddress returns the ContractAddress field value +func (o *InvokeContractJsonObjectV1Request) GetContractAddress() string { + if o == nil { + var ret string + return ret + } + + return o.ContractAddress +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractAddress, true +} + +// SetContractAddress sets field value +func (o *InvokeContractJsonObjectV1Request) SetContractAddress(v string) { + o.ContractAddress = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetValue() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.Value) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetValueOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given QuorumTransactionConfigFrom and assigns it to the Value field. +func (o *InvokeContractJsonObjectV1Request) SetValue(v QuorumTransactionConfigFrom) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetGas() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.Gas) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetGasOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given QuorumTransactionConfigFrom and assigns it to the Gas field. +func (o *InvokeContractJsonObjectV1Request) SetGas(v QuorumTransactionConfigFrom) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetGasPrice() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.GasPrice) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetGasPriceOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given QuorumTransactionConfigFrom and assigns it to the GasPrice field. +func (o *InvokeContractJsonObjectV1Request) SetGasPrice(v QuorumTransactionConfigFrom) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *InvokeContractJsonObjectV1Request) SetNonce(v float32) { + o.Nonce = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *InvokeContractJsonObjectV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetContractJSON returns the ContractJSON field value +func (o *InvokeContractJsonObjectV1Request) GetContractJSON() ContractJSON { + if o == nil { + var ret ContractJSON + return ret + } + + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetContractJSONOk() (*ContractJSON, bool) { + if o == nil { + return nil, false + } + return &o.ContractJSON, true +} + +// SetContractJSON sets field value +func (o *InvokeContractJsonObjectV1Request) SetContractJSON(v ContractJSON) { + o.ContractJSON = v +} + +// GetPrivateTransactionConfig returns the PrivateTransactionConfig field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetPrivateTransactionConfig() QuorumPrivateTransactionConfig { + if o == nil || IsNil(o.PrivateTransactionConfig) { + var ret QuorumPrivateTransactionConfig + return ret + } + return *o.PrivateTransactionConfig +} + +// GetPrivateTransactionConfigOk returns a tuple with the PrivateTransactionConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetPrivateTransactionConfigOk() (*QuorumPrivateTransactionConfig, bool) { + if o == nil || IsNil(o.PrivateTransactionConfig) { + return nil, false + } + return o.PrivateTransactionConfig, true +} + +// HasPrivateTransactionConfig returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasPrivateTransactionConfig() bool { + if o != nil && !IsNil(o.PrivateTransactionConfig) { + return true + } + + return false +} + +// SetPrivateTransactionConfig gets a reference to the given QuorumPrivateTransactionConfig and assigns it to the PrivateTransactionConfig field. +func (o *InvokeContractJsonObjectV1Request) SetPrivateTransactionConfig(v QuorumPrivateTransactionConfig) { + o.PrivateTransactionConfig = &v +} + +func (o InvokeContractJsonObjectV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractJsonObjectV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["invocationType"] = o.InvocationType + toSerialize["methodName"] = o.MethodName + toSerialize["params"] = o.Params + toSerialize["contractAddress"] = o.ContractAddress + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["contractJSON"] = o.ContractJSON + if !IsNil(o.PrivateTransactionConfig) { + toSerialize["privateTransactionConfig"] = o.PrivateTransactionConfig + } + return toSerialize, nil +} + +type NullableInvokeContractJsonObjectV1Request struct { + value *InvokeContractJsonObjectV1Request + isSet bool +} + +func (v NullableInvokeContractJsonObjectV1Request) Get() *InvokeContractJsonObjectV1Request { + return v.value +} + +func (v *NullableInvokeContractJsonObjectV1Request) Set(val *InvokeContractJsonObjectV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractJsonObjectV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractJsonObjectV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractJsonObjectV1Request(val *InvokeContractJsonObjectV1Request) *NullableInvokeContractJsonObjectV1Request { + return &NullableInvokeContractJsonObjectV1Request{value: val, isSet: true} +} + +func (v NullableInvokeContractJsonObjectV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractJsonObjectV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go new file mode 100644 index 00000000000..c9fcfb6aea1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go @@ -0,0 +1,441 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Request{} + +// InvokeContractV1Request struct for InvokeContractV1Request +type InvokeContractV1Request struct { + // The contract name to find it in the keychain plugin + ContractName string `json:"contractName"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + InvocationType EthContractInvocationType `json:"invocationType"` + // The name of the contract method to invoke. + MethodName string `json:"methodName"` + // The list of arguments to pass in to the contract method being invoked. + Params []interface{} `json:"params"` + Value *QuorumTransactionConfigFrom `json:"value,omitempty"` + Gas *QuorumTransactionConfigFrom `json:"gas,omitempty"` + GasPrice *QuorumTransactionConfigFrom `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + // The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + // The keychainId for retrieve the contracts json. + KeychainId string `json:"keychainId"` +} + +// NewInvokeContractV1Request instantiates a new InvokeContractV1Request 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 +// will change when the set of required properties is changed +func NewInvokeContractV1Request(contractName string, web3SigningCredential Web3SigningCredential, invocationType EthContractInvocationType, methodName string, params []interface{}, keychainId string) *InvokeContractV1Request { + this := InvokeContractV1Request{} + this.ContractName = contractName + this.Web3SigningCredential = web3SigningCredential + this.InvocationType = invocationType + this.MethodName = methodName + this.Params = params + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + this.KeychainId = keychainId + return &this +} + +// NewInvokeContractV1RequestWithDefaults instantiates a new InvokeContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1RequestWithDefaults() *InvokeContractV1Request { + this := InvokeContractV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractName returns the ContractName field value +func (o *InvokeContractV1Request) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *InvokeContractV1Request) SetContractName(v string) { + o.ContractName = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *InvokeContractV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *InvokeContractV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeContractV1Request) GetInvocationType() EthContractInvocationType { + if o == nil { + var ret EthContractInvocationType + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetInvocationTypeOk() (*EthContractInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeContractV1Request) SetInvocationType(v EthContractInvocationType) { + o.InvocationType = v +} + +// GetMethodName returns the MethodName field value +func (o *InvokeContractV1Request) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeContractV1Request) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value +func (o *InvokeContractV1Request) GetParams() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetParamsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *InvokeContractV1Request) SetParams(v []interface{}) { + o.Params = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetValue() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.Value) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetValueOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given QuorumTransactionConfigFrom and assigns it to the Value field. +func (o *InvokeContractV1Request) SetValue(v QuorumTransactionConfigFrom) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetGas() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.Gas) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetGasOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given QuorumTransactionConfigFrom and assigns it to the Gas field. +func (o *InvokeContractV1Request) SetGas(v QuorumTransactionConfigFrom) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetGasPrice() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.GasPrice) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetGasPriceOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given QuorumTransactionConfigFrom and assigns it to the GasPrice field. +func (o *InvokeContractV1Request) SetGasPrice(v QuorumTransactionConfigFrom) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *InvokeContractV1Request) SetNonce(v float32) { + o.Nonce = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *InvokeContractV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetKeychainId returns the KeychainId field value +func (o *InvokeContractV1Request) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *InvokeContractV1Request) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o InvokeContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["invocationType"] = o.InvocationType + toSerialize["methodName"] = o.MethodName + toSerialize["params"] = o.Params + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableInvokeContractV1Request struct { + value *InvokeContractV1Request + isSet bool +} + +func (v NullableInvokeContractV1Request) Get() *InvokeContractV1Request { + return v.value +} + +func (v *NullableInvokeContractV1Request) Set(val *InvokeContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Request(val *InvokeContractV1Request) *NullableInvokeContractV1Request { + return &NullableInvokeContractV1Request{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go new file mode 100644 index 00000000000..1306faa0b8c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go @@ -0,0 +1,190 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Response{} + +// InvokeContractV1Response struct for InvokeContractV1Response +type InvokeContractV1Response struct { + TransactionReceipt *Web3TransactionReceipt `json:"transactionReceipt,omitempty"` + CallOutput interface{} `json:"callOutput,omitempty"` + Success bool `json:"success"` +} + +// NewInvokeContractV1Response instantiates a new InvokeContractV1Response 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 +// will change when the set of required properties is changed +func NewInvokeContractV1Response(success bool) *InvokeContractV1Response { + this := InvokeContractV1Response{} + this.Success = success + return &this +} + +// NewInvokeContractV1ResponseWithDefaults instantiates a new InvokeContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1ResponseWithDefaults() *InvokeContractV1Response { + this := InvokeContractV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value if set, zero value otherwise. +func (o *InvokeContractV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil || IsNil(o.TransactionReceipt) { + var ret Web3TransactionReceipt + return ret + } + return *o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil || IsNil(o.TransactionReceipt) { + return nil, false + } + return o.TransactionReceipt, true +} + +// HasTransactionReceipt returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasTransactionReceipt() bool { + if o != nil && !IsNil(o.TransactionReceipt) { + return true + } + + return false +} + +// SetTransactionReceipt gets a reference to the given Web3TransactionReceipt and assigns it to the TransactionReceipt field. +func (o *InvokeContractV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = &v +} + +// GetCallOutput returns the CallOutput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeContractV1Response) GetCallOutput() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.CallOutput +} + +// GetCallOutputOk returns a tuple with the CallOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeContractV1Response) GetCallOutputOk() (*interface{}, bool) { + if o == nil || IsNil(o.CallOutput) { + return nil, false + } + return &o.CallOutput, true +} + +// HasCallOutput returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasCallOutput() bool { + if o != nil && IsNil(o.CallOutput) { + return true + } + + return false +} + +// SetCallOutput gets a reference to the given interface{} and assigns it to the CallOutput field. +func (o *InvokeContractV1Response) SetCallOutput(v interface{}) { + o.CallOutput = v +} + +// GetSuccess returns the Success field value +func (o *InvokeContractV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *InvokeContractV1Response) SetSuccess(v bool) { + o.Success = v +} + +func (o InvokeContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TransactionReceipt) { + toSerialize["transactionReceipt"] = o.TransactionReceipt + } + if o.CallOutput != nil { + toSerialize["callOutput"] = o.CallOutput + } + toSerialize["success"] = o.Success + return toSerialize, nil +} + +type NullableInvokeContractV1Response struct { + value *InvokeContractV1Response + isSet bool +} + +func (v NullableInvokeContractV1Response) Get() *InvokeContractV1Response { + return v.value +} + +func (v *NullableInvokeContractV1Response) Set(val *InvokeContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Response(val *InvokeContractV1Response) *NullableInvokeContractV1Response { + return &NullableInvokeContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_request.go new file mode 100644 index 00000000000..9593bfda04a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_request.go @@ -0,0 +1,275 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the InvokeRawWeb3EthContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRawWeb3EthContractV1Request{} + +// InvokeRawWeb3EthContractV1Request struct for InvokeRawWeb3EthContractV1Request +type InvokeRawWeb3EthContractV1Request struct { + // The application binary interface of the solidity contract + Abi []interface{} `json:"abi"` + // Deployed solidity contract address + Address string `json:"address"` + InvocationType EthContractInvocationWeb3Method `json:"invocationType"` + // The list of arguments for contract invocation method (send, call, etc...) + InvocationParams map[string]interface{} `json:"invocationParams,omitempty"` + // Method of deployed solidity contract to execute + ContractMethod string `json:"contractMethod"` + // The list of arguments for deployed solidity contract method + ContractMethodArgs []interface{} `json:"contractMethodArgs,omitempty"` +} + +// NewInvokeRawWeb3EthContractV1Request instantiates a new InvokeRawWeb3EthContractV1Request 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 +// will change when the set of required properties is changed +func NewInvokeRawWeb3EthContractV1Request(abi []interface{}, address string, invocationType EthContractInvocationWeb3Method, contractMethod string) *InvokeRawWeb3EthContractV1Request { + this := InvokeRawWeb3EthContractV1Request{} + this.Abi = abi + this.Address = address + this.InvocationType = invocationType + this.ContractMethod = contractMethod + return &this +} + +// NewInvokeRawWeb3EthContractV1RequestWithDefaults instantiates a new InvokeRawWeb3EthContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRawWeb3EthContractV1RequestWithDefaults() *InvokeRawWeb3EthContractV1Request { + this := InvokeRawWeb3EthContractV1Request{} + return &this +} + +// GetAbi returns the Abi field value +func (o *InvokeRawWeb3EthContractV1Request) GetAbi() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Abi +} + +// GetAbiOk returns a tuple with the Abi field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetAbiOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Abi, true +} + +// SetAbi sets field value +func (o *InvokeRawWeb3EthContractV1Request) SetAbi(v []interface{}) { + o.Abi = v +} + +// GetAddress returns the Address field value +func (o *InvokeRawWeb3EthContractV1Request) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *InvokeRawWeb3EthContractV1Request) SetAddress(v string) { + o.Address = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeRawWeb3EthContractV1Request) GetInvocationType() EthContractInvocationWeb3Method { + if o == nil { + var ret EthContractInvocationWeb3Method + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetInvocationTypeOk() (*EthContractInvocationWeb3Method, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeRawWeb3EthContractV1Request) SetInvocationType(v EthContractInvocationWeb3Method) { + o.InvocationType = v +} + +// GetInvocationParams returns the InvocationParams field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthContractV1Request) GetInvocationParams() map[string]interface{} { + if o == nil || IsNil(o.InvocationParams) { + var ret map[string]interface{} + return ret + } + return o.InvocationParams +} + +// GetInvocationParamsOk returns a tuple with the InvocationParams field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetInvocationParamsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.InvocationParams) { + return map[string]interface{}{}, false + } + return o.InvocationParams, true +} + +// HasInvocationParams returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthContractV1Request) HasInvocationParams() bool { + if o != nil && !IsNil(o.InvocationParams) { + return true + } + + return false +} + +// SetInvocationParams gets a reference to the given map[string]interface{} and assigns it to the InvocationParams field. +func (o *InvokeRawWeb3EthContractV1Request) SetInvocationParams(v map[string]interface{}) { + o.InvocationParams = v +} + +// GetContractMethod returns the ContractMethod field value +func (o *InvokeRawWeb3EthContractV1Request) GetContractMethod() string { + if o == nil { + var ret string + return ret + } + + return o.ContractMethod +} + +// GetContractMethodOk returns a tuple with the ContractMethod field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetContractMethodOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractMethod, true +} + +// SetContractMethod sets field value +func (o *InvokeRawWeb3EthContractV1Request) SetContractMethod(v string) { + o.ContractMethod = v +} + +// GetContractMethodArgs returns the ContractMethodArgs field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthContractV1Request) GetContractMethodArgs() []interface{} { + if o == nil || IsNil(o.ContractMethodArgs) { + var ret []interface{} + return ret + } + return o.ContractMethodArgs +} + +// GetContractMethodArgsOk returns a tuple with the ContractMethodArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Request) GetContractMethodArgsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.ContractMethodArgs) { + return nil, false + } + return o.ContractMethodArgs, true +} + +// HasContractMethodArgs returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthContractV1Request) HasContractMethodArgs() bool { + if o != nil && !IsNil(o.ContractMethodArgs) { + return true + } + + return false +} + +// SetContractMethodArgs gets a reference to the given []interface{} and assigns it to the ContractMethodArgs field. +func (o *InvokeRawWeb3EthContractV1Request) SetContractMethodArgs(v []interface{}) { + o.ContractMethodArgs = v +} + +func (o InvokeRawWeb3EthContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRawWeb3EthContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["abi"] = o.Abi + toSerialize["address"] = o.Address + toSerialize["invocationType"] = o.InvocationType + if !IsNil(o.InvocationParams) { + toSerialize["invocationParams"] = o.InvocationParams + } + toSerialize["contractMethod"] = o.ContractMethod + if !IsNil(o.ContractMethodArgs) { + toSerialize["contractMethodArgs"] = o.ContractMethodArgs + } + return toSerialize, nil +} + +type NullableInvokeRawWeb3EthContractV1Request struct { + value *InvokeRawWeb3EthContractV1Request + isSet bool +} + +func (v NullableInvokeRawWeb3EthContractV1Request) Get() *InvokeRawWeb3EthContractV1Request { + return v.value +} + +func (v *NullableInvokeRawWeb3EthContractV1Request) Set(val *InvokeRawWeb3EthContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRawWeb3EthContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRawWeb3EthContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRawWeb3EthContractV1Request(val *InvokeRawWeb3EthContractV1Request) *NullableInvokeRawWeb3EthContractV1Request { + return &NullableInvokeRawWeb3EthContractV1Request{value: val, isSet: true} +} + +func (v NullableInvokeRawWeb3EthContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRawWeb3EthContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_response.go new file mode 100644 index 00000000000..e2d1dfc54df --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_contract_v1_response.go @@ -0,0 +1,193 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the InvokeRawWeb3EthContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRawWeb3EthContractV1Response{} + +// InvokeRawWeb3EthContractV1Response struct for InvokeRawWeb3EthContractV1Response +type InvokeRawWeb3EthContractV1Response struct { + // Status code of the operation + Status float32 `json:"status"` + // Output of contract invocation method + Data interface{} `json:"data,omitempty"` + // Error details + ErrorDetail *string `json:"errorDetail,omitempty"` +} + +// NewInvokeRawWeb3EthContractV1Response instantiates a new InvokeRawWeb3EthContractV1Response 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 +// will change when the set of required properties is changed +func NewInvokeRawWeb3EthContractV1Response(status float32) *InvokeRawWeb3EthContractV1Response { + this := InvokeRawWeb3EthContractV1Response{} + this.Status = status + return &this +} + +// NewInvokeRawWeb3EthContractV1ResponseWithDefaults instantiates a new InvokeRawWeb3EthContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRawWeb3EthContractV1ResponseWithDefaults() *InvokeRawWeb3EthContractV1Response { + this := InvokeRawWeb3EthContractV1Response{} + return &this +} + +// GetStatus returns the Status field value +func (o *InvokeRawWeb3EthContractV1Response) GetStatus() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Response) GetStatusOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *InvokeRawWeb3EthContractV1Response) SetStatus(v float32) { + o.Status = v +} + +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeRawWeb3EthContractV1Response) GetData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeRawWeb3EthContractV1Response) GetDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthContractV1Response) HasData() bool { + if o != nil && IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *InvokeRawWeb3EthContractV1Response) SetData(v interface{}) { + o.Data = v +} + +// GetErrorDetail returns the ErrorDetail field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthContractV1Response) GetErrorDetail() string { + if o == nil || IsNil(o.ErrorDetail) { + var ret string + return ret + } + return *o.ErrorDetail +} + +// GetErrorDetailOk returns a tuple with the ErrorDetail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthContractV1Response) GetErrorDetailOk() (*string, bool) { + if o == nil || IsNil(o.ErrorDetail) { + return nil, false + } + return o.ErrorDetail, true +} + +// HasErrorDetail returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthContractV1Response) HasErrorDetail() bool { + if o != nil && !IsNil(o.ErrorDetail) { + return true + } + + return false +} + +// SetErrorDetail gets a reference to the given string and assigns it to the ErrorDetail field. +func (o *InvokeRawWeb3EthContractV1Response) SetErrorDetail(v string) { + o.ErrorDetail = &v +} + +func (o InvokeRawWeb3EthContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRawWeb3EthContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + if o.Data != nil { + toSerialize["data"] = o.Data + } + if !IsNil(o.ErrorDetail) { + toSerialize["errorDetail"] = o.ErrorDetail + } + return toSerialize, nil +} + +type NullableInvokeRawWeb3EthContractV1Response struct { + value *InvokeRawWeb3EthContractV1Response + isSet bool +} + +func (v NullableInvokeRawWeb3EthContractV1Response) Get() *InvokeRawWeb3EthContractV1Response { + return v.value +} + +func (v *NullableInvokeRawWeb3EthContractV1Response) Set(val *InvokeRawWeb3EthContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRawWeb3EthContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRawWeb3EthContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRawWeb3EthContractV1Response(val *InvokeRawWeb3EthContractV1Response) *NullableInvokeRawWeb3EthContractV1Response { + return &NullableInvokeRawWeb3EthContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeRawWeb3EthContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRawWeb3EthContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_request.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_request.go new file mode 100644 index 00000000000..9d9aaebfcba --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_request.go @@ -0,0 +1,155 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the InvokeRawWeb3EthMethodV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRawWeb3EthMethodV1Request{} + +// InvokeRawWeb3EthMethodV1Request struct for InvokeRawWeb3EthMethodV1Request +type InvokeRawWeb3EthMethodV1Request struct { + // The name of the web3.eth method to invoke + MethodName string `json:"methodName"` + // The list of arguments to pass to web3.eth method specified in methodName + Params []interface{} `json:"params,omitempty"` +} + +// NewInvokeRawWeb3EthMethodV1Request instantiates a new InvokeRawWeb3EthMethodV1Request 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 +// will change when the set of required properties is changed +func NewInvokeRawWeb3EthMethodV1Request(methodName string) *InvokeRawWeb3EthMethodV1Request { + this := InvokeRawWeb3EthMethodV1Request{} + this.MethodName = methodName + return &this +} + +// NewInvokeRawWeb3EthMethodV1RequestWithDefaults instantiates a new InvokeRawWeb3EthMethodV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRawWeb3EthMethodV1RequestWithDefaults() *InvokeRawWeb3EthMethodV1Request { + this := InvokeRawWeb3EthMethodV1Request{} + return &this +} + +// GetMethodName returns the MethodName field value +func (o *InvokeRawWeb3EthMethodV1Request) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthMethodV1Request) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeRawWeb3EthMethodV1Request) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthMethodV1Request) GetParams() []interface{} { + if o == nil || IsNil(o.Params) { + var ret []interface{} + return ret + } + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthMethodV1Request) GetParamsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Params) { + return nil, false + } + return o.Params, true +} + +// HasParams returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthMethodV1Request) HasParams() bool { + if o != nil && !IsNil(o.Params) { + return true + } + + return false +} + +// SetParams gets a reference to the given []interface{} and assigns it to the Params field. +func (o *InvokeRawWeb3EthMethodV1Request) SetParams(v []interface{}) { + o.Params = v +} + +func (o InvokeRawWeb3EthMethodV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRawWeb3EthMethodV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["methodName"] = o.MethodName + if !IsNil(o.Params) { + toSerialize["params"] = o.Params + } + return toSerialize, nil +} + +type NullableInvokeRawWeb3EthMethodV1Request struct { + value *InvokeRawWeb3EthMethodV1Request + isSet bool +} + +func (v NullableInvokeRawWeb3EthMethodV1Request) Get() *InvokeRawWeb3EthMethodV1Request { + return v.value +} + +func (v *NullableInvokeRawWeb3EthMethodV1Request) Set(val *InvokeRawWeb3EthMethodV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRawWeb3EthMethodV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRawWeb3EthMethodV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRawWeb3EthMethodV1Request(val *InvokeRawWeb3EthMethodV1Request) *NullableInvokeRawWeb3EthMethodV1Request { + return &NullableInvokeRawWeb3EthMethodV1Request{value: val, isSet: true} +} + +func (v NullableInvokeRawWeb3EthMethodV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRawWeb3EthMethodV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_response.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_response.go new file mode 100644 index 00000000000..2376afaef43 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_invoke_raw_web3_eth_method_v1_response.go @@ -0,0 +1,193 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the InvokeRawWeb3EthMethodV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRawWeb3EthMethodV1Response{} + +// InvokeRawWeb3EthMethodV1Response struct for InvokeRawWeb3EthMethodV1Response +type InvokeRawWeb3EthMethodV1Response struct { + // Status code of the operation + Status float32 `json:"status"` + // Output of requested web3.eth method + Data interface{} `json:"data,omitempty"` + // Error details + ErrorDetail *string `json:"errorDetail,omitempty"` +} + +// NewInvokeRawWeb3EthMethodV1Response instantiates a new InvokeRawWeb3EthMethodV1Response 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 +// will change when the set of required properties is changed +func NewInvokeRawWeb3EthMethodV1Response(status float32) *InvokeRawWeb3EthMethodV1Response { + this := InvokeRawWeb3EthMethodV1Response{} + this.Status = status + return &this +} + +// NewInvokeRawWeb3EthMethodV1ResponseWithDefaults instantiates a new InvokeRawWeb3EthMethodV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRawWeb3EthMethodV1ResponseWithDefaults() *InvokeRawWeb3EthMethodV1Response { + this := InvokeRawWeb3EthMethodV1Response{} + return &this +} + +// GetStatus returns the Status field value +func (o *InvokeRawWeb3EthMethodV1Response) GetStatus() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthMethodV1Response) GetStatusOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *InvokeRawWeb3EthMethodV1Response) SetStatus(v float32) { + o.Status = v +} + +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeRawWeb3EthMethodV1Response) GetData() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeRawWeb3EthMethodV1Response) GetDataOk() (*interface{}, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthMethodV1Response) HasData() bool { + if o != nil && IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *InvokeRawWeb3EthMethodV1Response) SetData(v interface{}) { + o.Data = v +} + +// GetErrorDetail returns the ErrorDetail field value if set, zero value otherwise. +func (o *InvokeRawWeb3EthMethodV1Response) GetErrorDetail() string { + if o == nil || IsNil(o.ErrorDetail) { + var ret string + return ret + } + return *o.ErrorDetail +} + +// GetErrorDetailOk returns a tuple with the ErrorDetail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRawWeb3EthMethodV1Response) GetErrorDetailOk() (*string, bool) { + if o == nil || IsNil(o.ErrorDetail) { + return nil, false + } + return o.ErrorDetail, true +} + +// HasErrorDetail returns a boolean if a field has been set. +func (o *InvokeRawWeb3EthMethodV1Response) HasErrorDetail() bool { + if o != nil && !IsNil(o.ErrorDetail) { + return true + } + + return false +} + +// SetErrorDetail gets a reference to the given string and assigns it to the ErrorDetail field. +func (o *InvokeRawWeb3EthMethodV1Response) SetErrorDetail(v string) { + o.ErrorDetail = &v +} + +func (o InvokeRawWeb3EthMethodV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRawWeb3EthMethodV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + if o.Data != nil { + toSerialize["data"] = o.Data + } + if !IsNil(o.ErrorDetail) { + toSerialize["errorDetail"] = o.ErrorDetail + } + return toSerialize, nil +} + +type NullableInvokeRawWeb3EthMethodV1Response struct { + value *InvokeRawWeb3EthMethodV1Response + isSet bool +} + +func (v NullableInvokeRawWeb3EthMethodV1Response) Get() *InvokeRawWeb3EthMethodV1Response { + return v.value +} + +func (v *NullableInvokeRawWeb3EthMethodV1Response) Set(val *InvokeRawWeb3EthMethodV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRawWeb3EthMethodV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRawWeb3EthMethodV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRawWeb3EthMethodV1Response(val *InvokeRawWeb3EthMethodV1Response) *NullableInvokeRawWeb3EthMethodV1Response { + return &NullableInvokeRawWeb3EthMethodV1Response{value: val, isSet: true} +} + +func (v NullableInvokeRawWeb3EthMethodV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRawWeb3EthMethodV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_private_transaction_config.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_private_transaction_config.go new file mode 100644 index 00000000000..193542cc2ba --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_private_transaction_config.go @@ -0,0 +1,337 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the QuorumPrivateTransactionConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuorumPrivateTransactionConfig{} + +// QuorumPrivateTransactionConfig struct for QuorumPrivateTransactionConfig +type QuorumPrivateTransactionConfig struct { + PrivateFrom *string `json:"privateFrom,omitempty"` + PrivateFor []interface{} `json:"privateFor"` + IsPrivate *bool `json:"isPrivate,omitempty"` + GasPrice *float32 `json:"gasPrice,omitempty"` + GasLimit *float32 `json:"gasLimit,omitempty"` + PrivateKey *string `json:"privateKey,omitempty"` + PrivacyGroupId *string `json:"privacyGroupId,omitempty"` +} + +// NewQuorumPrivateTransactionConfig instantiates a new QuorumPrivateTransactionConfig 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 +// will change when the set of required properties is changed +func NewQuorumPrivateTransactionConfig(privateFor []interface{}) *QuorumPrivateTransactionConfig { + this := QuorumPrivateTransactionConfig{} + this.PrivateFor = privateFor + var isPrivate bool = false + this.IsPrivate = &isPrivate + return &this +} + +// NewQuorumPrivateTransactionConfigWithDefaults instantiates a new QuorumPrivateTransactionConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQuorumPrivateTransactionConfigWithDefaults() *QuorumPrivateTransactionConfig { + this := QuorumPrivateTransactionConfig{} + var isPrivate bool = false + this.IsPrivate = &isPrivate + return &this +} + +// GetPrivateFrom returns the PrivateFrom field value if set, zero value otherwise. +func (o *QuorumPrivateTransactionConfig) GetPrivateFrom() string { + if o == nil || IsNil(o.PrivateFrom) { + var ret string + return ret + } + return *o.PrivateFrom +} + +// GetPrivateFromOk returns a tuple with the PrivateFrom field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumPrivateTransactionConfig) GetPrivateFromOk() (*string, bool) { + if o == nil || IsNil(o.PrivateFrom) { + return nil, false + } + return o.PrivateFrom, true +} + +// HasPrivateFrom returns a boolean if a field has been set. +func (o *QuorumPrivateTransactionConfig) HasPrivateFrom() bool { + if o != nil && !IsNil(o.PrivateFrom) { + return true + } + + return false +} + +// SetPrivateFrom gets a reference to the given string and assigns it to the PrivateFrom field. +func (o *QuorumPrivateTransactionConfig) SetPrivateFrom(v string) { + o.PrivateFrom = &v +} + +// GetPrivateFor returns the PrivateFor field value +func (o *QuorumPrivateTransactionConfig) GetPrivateFor() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.PrivateFor +} + +// GetPrivateForOk returns a tuple with the PrivateFor field value +// and a boolean to check if the value has been set. +func (o *QuorumPrivateTransactionConfig) GetPrivateForOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.PrivateFor, true +} + +// SetPrivateFor sets field value +func (o *QuorumPrivateTransactionConfig) SetPrivateFor(v []interface{}) { + o.PrivateFor = v +} + +// GetIsPrivate returns the IsPrivate field value if set, zero value otherwise. +func (o *QuorumPrivateTransactionConfig) GetIsPrivate() bool { + if o == nil || IsNil(o.IsPrivate) { + var ret bool + return ret + } + return *o.IsPrivate +} + +// GetIsPrivateOk returns a tuple with the IsPrivate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumPrivateTransactionConfig) GetIsPrivateOk() (*bool, bool) { + if o == nil || IsNil(o.IsPrivate) { + return nil, false + } + return o.IsPrivate, true +} + +// HasIsPrivate returns a boolean if a field has been set. +func (o *QuorumPrivateTransactionConfig) HasIsPrivate() bool { + if o != nil && !IsNil(o.IsPrivate) { + return true + } + + return false +} + +// SetIsPrivate gets a reference to the given bool and assigns it to the IsPrivate field. +func (o *QuorumPrivateTransactionConfig) SetIsPrivate(v bool) { + o.IsPrivate = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *QuorumPrivateTransactionConfig) GetGasPrice() float32 { + if o == nil || IsNil(o.GasPrice) { + var ret float32 + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumPrivateTransactionConfig) GetGasPriceOk() (*float32, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *QuorumPrivateTransactionConfig) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given float32 and assigns it to the GasPrice field. +func (o *QuorumPrivateTransactionConfig) SetGasPrice(v float32) { + o.GasPrice = &v +} + +// GetGasLimit returns the GasLimit field value if set, zero value otherwise. +func (o *QuorumPrivateTransactionConfig) GetGasLimit() float32 { + if o == nil || IsNil(o.GasLimit) { + var ret float32 + return ret + } + return *o.GasLimit +} + +// GetGasLimitOk returns a tuple with the GasLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumPrivateTransactionConfig) GetGasLimitOk() (*float32, bool) { + if o == nil || IsNil(o.GasLimit) { + return nil, false + } + return o.GasLimit, true +} + +// HasGasLimit returns a boolean if a field has been set. +func (o *QuorumPrivateTransactionConfig) HasGasLimit() bool { + if o != nil && !IsNil(o.GasLimit) { + return true + } + + return false +} + +// SetGasLimit gets a reference to the given float32 and assigns it to the GasLimit field. +func (o *QuorumPrivateTransactionConfig) SetGasLimit(v float32) { + o.GasLimit = &v +} + +// GetPrivateKey returns the PrivateKey field value if set, zero value otherwise. +func (o *QuorumPrivateTransactionConfig) GetPrivateKey() string { + if o == nil || IsNil(o.PrivateKey) { + var ret string + return ret + } + return *o.PrivateKey +} + +// GetPrivateKeyOk returns a tuple with the PrivateKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumPrivateTransactionConfig) GetPrivateKeyOk() (*string, bool) { + if o == nil || IsNil(o.PrivateKey) { + return nil, false + } + return o.PrivateKey, true +} + +// HasPrivateKey returns a boolean if a field has been set. +func (o *QuorumPrivateTransactionConfig) HasPrivateKey() bool { + if o != nil && !IsNil(o.PrivateKey) { + return true + } + + return false +} + +// SetPrivateKey gets a reference to the given string and assigns it to the PrivateKey field. +func (o *QuorumPrivateTransactionConfig) SetPrivateKey(v string) { + o.PrivateKey = &v +} + +// GetPrivacyGroupId returns the PrivacyGroupId field value if set, zero value otherwise. +func (o *QuorumPrivateTransactionConfig) GetPrivacyGroupId() string { + if o == nil || IsNil(o.PrivacyGroupId) { + var ret string + return ret + } + return *o.PrivacyGroupId +} + +// GetPrivacyGroupIdOk returns a tuple with the PrivacyGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumPrivateTransactionConfig) GetPrivacyGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.PrivacyGroupId) { + return nil, false + } + return o.PrivacyGroupId, true +} + +// HasPrivacyGroupId returns a boolean if a field has been set. +func (o *QuorumPrivateTransactionConfig) HasPrivacyGroupId() bool { + if o != nil && !IsNil(o.PrivacyGroupId) { + return true + } + + return false +} + +// SetPrivacyGroupId gets a reference to the given string and assigns it to the PrivacyGroupId field. +func (o *QuorumPrivateTransactionConfig) SetPrivacyGroupId(v string) { + o.PrivacyGroupId = &v +} + +func (o QuorumPrivateTransactionConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QuorumPrivateTransactionConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.PrivateFrom) { + toSerialize["privateFrom"] = o.PrivateFrom + } + toSerialize["privateFor"] = o.PrivateFor + if !IsNil(o.IsPrivate) { + toSerialize["isPrivate"] = o.IsPrivate + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.GasLimit) { + toSerialize["gasLimit"] = o.GasLimit + } + if !IsNil(o.PrivateKey) { + toSerialize["privateKey"] = o.PrivateKey + } + if !IsNil(o.PrivacyGroupId) { + toSerialize["privacyGroupId"] = o.PrivacyGroupId + } + return toSerialize, nil +} + +type NullableQuorumPrivateTransactionConfig struct { + value *QuorumPrivateTransactionConfig + isSet bool +} + +func (v NullableQuorumPrivateTransactionConfig) Get() *QuorumPrivateTransactionConfig { + return v.value +} + +func (v *NullableQuorumPrivateTransactionConfig) Set(val *QuorumPrivateTransactionConfig) { + v.value = val + v.isSet = true +} + +func (v NullableQuorumPrivateTransactionConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableQuorumPrivateTransactionConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuorumPrivateTransactionConfig(val *QuorumPrivateTransactionConfig) *NullableQuorumPrivateTransactionConfig { + return &NullableQuorumPrivateTransactionConfig{value: val, isSet: true} +} + +func (v NullableQuorumPrivateTransactionConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuorumPrivateTransactionConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config.go new file mode 100644 index 00000000000..e9da61904e8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config.go @@ -0,0 +1,410 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the QuorumTransactionConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuorumTransactionConfig{} + +// QuorumTransactionConfig struct for QuorumTransactionConfig +type QuorumTransactionConfig struct { + RawTransaction *string `json:"rawTransaction,omitempty"` + From *QuorumTransactionConfigFrom `json:"from,omitempty"` + To *QuorumTransactionConfigTo `json:"to,omitempty"` + Value *QuorumTransactionConfigFrom `json:"value,omitempty"` + Gas *QuorumTransactionConfigFrom `json:"gas,omitempty"` + GasPrice *QuorumTransactionConfigFrom `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + Data *QuorumTransactionConfigTo `json:"data,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _QuorumTransactionConfig QuorumTransactionConfig + +// NewQuorumTransactionConfig instantiates a new QuorumTransactionConfig 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 +// will change when the set of required properties is changed +func NewQuorumTransactionConfig() *QuorumTransactionConfig { + this := QuorumTransactionConfig{} + return &this +} + +// NewQuorumTransactionConfigWithDefaults instantiates a new QuorumTransactionConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQuorumTransactionConfigWithDefaults() *QuorumTransactionConfig { + this := QuorumTransactionConfig{} + return &this +} + +// GetRawTransaction returns the RawTransaction field value if set, zero value otherwise. +func (o *QuorumTransactionConfig) GetRawTransaction() string { + if o == nil || IsNil(o.RawTransaction) { + var ret string + return ret + } + return *o.RawTransaction +} + +// GetRawTransactionOk returns a tuple with the RawTransaction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumTransactionConfig) GetRawTransactionOk() (*string, bool) { + if o == nil || IsNil(o.RawTransaction) { + return nil, false + } + return o.RawTransaction, true +} + +// HasRawTransaction returns a boolean if a field has been set. +func (o *QuorumTransactionConfig) HasRawTransaction() bool { + if o != nil && !IsNil(o.RawTransaction) { + return true + } + + return false +} + +// SetRawTransaction gets a reference to the given string and assigns it to the RawTransaction field. +func (o *QuorumTransactionConfig) SetRawTransaction(v string) { + o.RawTransaction = &v +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *QuorumTransactionConfig) GetFrom() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.From) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumTransactionConfig) GetFromOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.From) { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *QuorumTransactionConfig) HasFrom() bool { + if o != nil && !IsNil(o.From) { + return true + } + + return false +} + +// SetFrom gets a reference to the given QuorumTransactionConfigFrom and assigns it to the From field. +func (o *QuorumTransactionConfig) SetFrom(v QuorumTransactionConfigFrom) { + o.From = &v +} + +// GetTo returns the To field value if set, zero value otherwise. +func (o *QuorumTransactionConfig) GetTo() QuorumTransactionConfigTo { + if o == nil || IsNil(o.To) { + var ret QuorumTransactionConfigTo + return ret + } + return *o.To +} + +// GetToOk returns a tuple with the To field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumTransactionConfig) GetToOk() (*QuorumTransactionConfigTo, bool) { + if o == nil || IsNil(o.To) { + return nil, false + } + return o.To, true +} + +// HasTo returns a boolean if a field has been set. +func (o *QuorumTransactionConfig) HasTo() bool { + if o != nil && !IsNil(o.To) { + return true + } + + return false +} + +// SetTo gets a reference to the given QuorumTransactionConfigTo and assigns it to the To field. +func (o *QuorumTransactionConfig) SetTo(v QuorumTransactionConfigTo) { + o.To = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *QuorumTransactionConfig) GetValue() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.Value) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumTransactionConfig) GetValueOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *QuorumTransactionConfig) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given QuorumTransactionConfigFrom and assigns it to the Value field. +func (o *QuorumTransactionConfig) SetValue(v QuorumTransactionConfigFrom) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *QuorumTransactionConfig) GetGas() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.Gas) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumTransactionConfig) GetGasOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *QuorumTransactionConfig) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given QuorumTransactionConfigFrom and assigns it to the Gas field. +func (o *QuorumTransactionConfig) SetGas(v QuorumTransactionConfigFrom) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *QuorumTransactionConfig) GetGasPrice() QuorumTransactionConfigFrom { + if o == nil || IsNil(o.GasPrice) { + var ret QuorumTransactionConfigFrom + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumTransactionConfig) GetGasPriceOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *QuorumTransactionConfig) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given QuorumTransactionConfigFrom and assigns it to the GasPrice field. +func (o *QuorumTransactionConfig) SetGasPrice(v QuorumTransactionConfigFrom) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *QuorumTransactionConfig) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumTransactionConfig) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *QuorumTransactionConfig) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *QuorumTransactionConfig) SetNonce(v float32) { + o.Nonce = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *QuorumTransactionConfig) GetData() QuorumTransactionConfigTo { + if o == nil || IsNil(o.Data) { + var ret QuorumTransactionConfigTo + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QuorumTransactionConfig) GetDataOk() (*QuorumTransactionConfigTo, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *QuorumTransactionConfig) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given QuorumTransactionConfigTo and assigns it to the Data field. +func (o *QuorumTransactionConfig) SetData(v QuorumTransactionConfigTo) { + o.Data = &v +} + +func (o QuorumTransactionConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QuorumTransactionConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RawTransaction) { + toSerialize["rawTransaction"] = o.RawTransaction + } + if !IsNil(o.From) { + toSerialize["from"] = o.From + } + if !IsNil(o.To) { + toSerialize["to"] = o.To + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *QuorumTransactionConfig) UnmarshalJSON(bytes []byte) (err error) { + varQuorumTransactionConfig := _QuorumTransactionConfig{} + + if err = json.Unmarshal(bytes, &varQuorumTransactionConfig); err == nil { + *o = QuorumTransactionConfig(varQuorumTransactionConfig) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "rawTransaction") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + delete(additionalProperties, "value") + delete(additionalProperties, "gas") + delete(additionalProperties, "gasPrice") + delete(additionalProperties, "nonce") + delete(additionalProperties, "data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableQuorumTransactionConfig struct { + value *QuorumTransactionConfig + isSet bool +} + +func (v NullableQuorumTransactionConfig) Get() *QuorumTransactionConfig { + return v.value +} + +func (v *NullableQuorumTransactionConfig) Set(val *QuorumTransactionConfig) { + v.value = val + v.isSet = true +} + +func (v NullableQuorumTransactionConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableQuorumTransactionConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuorumTransactionConfig(val *QuorumTransactionConfig) *NullableQuorumTransactionConfig { + return &NullableQuorumTransactionConfig{value: val, isSet: true} +} + +func (v NullableQuorumTransactionConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuorumTransactionConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config_from.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config_from.go new file mode 100644 index 00000000000..06864869462 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config_from.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" + "fmt" +) + +// QuorumTransactionConfigFrom - struct for QuorumTransactionConfigFrom +type QuorumTransactionConfigFrom struct { + Float32 *float32 + String *string +} + +// float32AsQuorumTransactionConfigFrom is a convenience function that returns float32 wrapped in QuorumTransactionConfigFrom +func Float32AsQuorumTransactionConfigFrom(v *float32) QuorumTransactionConfigFrom { + return QuorumTransactionConfigFrom{ + Float32: v, + } +} + +// stringAsQuorumTransactionConfigFrom is a convenience function that returns string wrapped in QuorumTransactionConfigFrom +func StringAsQuorumTransactionConfigFrom(v *string) QuorumTransactionConfigFrom { + return QuorumTransactionConfigFrom{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *QuorumTransactionConfigFrom) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Float32 + err = newStrictDecoder(data).Decode(&dst.Float32) + if err == nil { + jsonFloat32, _ := json.Marshal(dst.Float32) + if string(jsonFloat32) == "{}" { // empty struct + dst.Float32 = nil + } else { + match++ + } + } else { + dst.Float32 = nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Float32 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(QuorumTransactionConfigFrom)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(QuorumTransactionConfigFrom)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src QuorumTransactionConfigFrom) MarshalJSON() ([]byte, error) { + if src.Float32 != nil { + return json.Marshal(&src.Float32) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *QuorumTransactionConfigFrom) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Float32 != nil { + return obj.Float32 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableQuorumTransactionConfigFrom struct { + value *QuorumTransactionConfigFrom + isSet bool +} + +func (v NullableQuorumTransactionConfigFrom) Get() *QuorumTransactionConfigFrom { + return v.value +} + +func (v *NullableQuorumTransactionConfigFrom) Set(val *QuorumTransactionConfigFrom) { + v.value = val + v.isSet = true +} + +func (v NullableQuorumTransactionConfigFrom) IsSet() bool { + return v.isSet +} + +func (v *NullableQuorumTransactionConfigFrom) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuorumTransactionConfigFrom(val *QuorumTransactionConfigFrom) *NullableQuorumTransactionConfigFrom { + return &NullableQuorumTransactionConfigFrom{value: val, isSet: true} +} + +func (v NullableQuorumTransactionConfigFrom) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuorumTransactionConfigFrom) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config_to.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config_to.go new file mode 100644 index 00000000000..aae309d712e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_quorum_transaction_config_to.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" + "fmt" +) + +// QuorumTransactionConfigTo - struct for QuorumTransactionConfigTo +type QuorumTransactionConfigTo struct { + String *string +} + +// stringAsQuorumTransactionConfigTo is a convenience function that returns string wrapped in QuorumTransactionConfigTo +func StringAsQuorumTransactionConfigTo(v *string) QuorumTransactionConfigTo { + return QuorumTransactionConfigTo{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *QuorumTransactionConfigTo) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(QuorumTransactionConfigTo)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(QuorumTransactionConfigTo)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src QuorumTransactionConfigTo) MarshalJSON() ([]byte, error) { + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *QuorumTransactionConfigTo) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableQuorumTransactionConfigTo struct { + value *QuorumTransactionConfigTo + isSet bool +} + +func (v NullableQuorumTransactionConfigTo) Get() *QuorumTransactionConfigTo { + return v.value +} + +func (v *NullableQuorumTransactionConfigTo) Set(val *QuorumTransactionConfigTo) { + v.value = val + v.isSet = true +} + +func (v NullableQuorumTransactionConfigTo) IsSet() bool { + return v.isSet +} + +func (v *NullableQuorumTransactionConfigTo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuorumTransactionConfigTo(val *QuorumTransactionConfigTo) *NullableQuorumTransactionConfigTo { + return &NullableQuorumTransactionConfigTo{value: val, isSet: true} +} + +func (v NullableQuorumTransactionConfigTo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuorumTransactionConfigTo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_run_transaction_request.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_run_transaction_request.go new file mode 100644 index 00000000000..b5e22355dba --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_run_transaction_request.go @@ -0,0 +1,221 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the RunTransactionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionRequest{} + +// RunTransactionRequest struct for RunTransactionRequest +type RunTransactionRequest struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + TransactionConfig QuorumTransactionConfig `json:"transactionConfig"` + // The amount of milliseconds to wait for a transaction receipt with thehash of the transaction(which indicates successful execution) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + PrivateTransactionConfig *QuorumPrivateTransactionConfig `json:"privateTransactionConfig,omitempty"` +} + +// NewRunTransactionRequest instantiates a new RunTransactionRequest 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 +// will change when the set of required properties is changed +func NewRunTransactionRequest(web3SigningCredential Web3SigningCredential, transactionConfig QuorumTransactionConfig) *RunTransactionRequest { + this := RunTransactionRequest{} + this.Web3SigningCredential = web3SigningCredential + this.TransactionConfig = transactionConfig + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewRunTransactionRequestWithDefaults instantiates a new RunTransactionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionRequestWithDefaults() *RunTransactionRequest { + this := RunTransactionRequest{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *RunTransactionRequest) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *RunTransactionRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetTransactionConfig returns the TransactionConfig field value +func (o *RunTransactionRequest) GetTransactionConfig() QuorumTransactionConfig { + if o == nil { + var ret QuorumTransactionConfig + return ret + } + + return o.TransactionConfig +} + +// GetTransactionConfigOk returns a tuple with the TransactionConfig field value +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetTransactionConfigOk() (*QuorumTransactionConfig, bool) { + if o == nil { + return nil, false + } + return &o.TransactionConfig, true +} + +// SetTransactionConfig sets field value +func (o *RunTransactionRequest) SetTransactionConfig(v QuorumTransactionConfig) { + o.TransactionConfig = v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *RunTransactionRequest) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *RunTransactionRequest) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *RunTransactionRequest) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetPrivateTransactionConfig returns the PrivateTransactionConfig field value if set, zero value otherwise. +func (o *RunTransactionRequest) GetPrivateTransactionConfig() QuorumPrivateTransactionConfig { + if o == nil || IsNil(o.PrivateTransactionConfig) { + var ret QuorumPrivateTransactionConfig + return ret + } + return *o.PrivateTransactionConfig +} + +// GetPrivateTransactionConfigOk returns a tuple with the PrivateTransactionConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTransactionRequest) GetPrivateTransactionConfigOk() (*QuorumPrivateTransactionConfig, bool) { + if o == nil || IsNil(o.PrivateTransactionConfig) { + return nil, false + } + return o.PrivateTransactionConfig, true +} + +// HasPrivateTransactionConfig returns a boolean if a field has been set. +func (o *RunTransactionRequest) HasPrivateTransactionConfig() bool { + if o != nil && !IsNil(o.PrivateTransactionConfig) { + return true + } + + return false +} + +// SetPrivateTransactionConfig gets a reference to the given QuorumPrivateTransactionConfig and assigns it to the PrivateTransactionConfig field. +func (o *RunTransactionRequest) SetPrivateTransactionConfig(v QuorumPrivateTransactionConfig) { + o.PrivateTransactionConfig = &v +} + +func (o RunTransactionRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["transactionConfig"] = o.TransactionConfig + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + if !IsNil(o.PrivateTransactionConfig) { + toSerialize["privateTransactionConfig"] = o.PrivateTransactionConfig + } + return toSerialize, nil +} + +type NullableRunTransactionRequest struct { + value *RunTransactionRequest + isSet bool +} + +func (v NullableRunTransactionRequest) Get() *RunTransactionRequest { + return v.value +} + +func (v *NullableRunTransactionRequest) Set(val *RunTransactionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionRequest(val *RunTransactionRequest) *NullableRunTransactionRequest { + return &NullableRunTransactionRequest{value: val, isSet: true} +} + +func (v NullableRunTransactionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_run_transaction_response.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_run_transaction_response.go new file mode 100644 index 00000000000..7739575a262 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_run_transaction_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the RunTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionResponse{} + +// RunTransactionResponse struct for RunTransactionResponse +type RunTransactionResponse struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewRunTransactionResponse instantiates a new RunTransactionResponse 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 +// will change when the set of required properties is changed +func NewRunTransactionResponse(transactionReceipt Web3TransactionReceipt) *RunTransactionResponse { + this := RunTransactionResponse{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewRunTransactionResponseWithDefaults instantiates a new RunTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionResponseWithDefaults() *RunTransactionResponse { + this := RunTransactionResponse{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *RunTransactionResponse) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *RunTransactionResponse) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *RunTransactionResponse) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o RunTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableRunTransactionResponse struct { + value *RunTransactionResponse + isSet bool +} + +func (v NullableRunTransactionResponse) Get() *RunTransactionResponse { + return v.value +} + +func (v *NullableRunTransactionResponse) Set(val *RunTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionResponse(val *RunTransactionResponse) *NullableRunTransactionResponse { + return &NullableRunTransactionResponse{value: val, isSet: true} +} + +func (v NullableRunTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go new file mode 100644 index 00000000000..4a5490d8198 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go @@ -0,0 +1,441 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifact type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifact{} + +// SolidityContractJsonArtifact struct for SolidityContractJsonArtifact +type SolidityContractJsonArtifact struct { + ContractName string `json:"contractName"` + Metadata *string `json:"metadata,omitempty"` + Bytecode *string `json:"bytecode,omitempty"` + DeployedBytecode *string `json:"deployedBytecode,omitempty"` + SourceMap *string `json:"sourceMap,omitempty"` + DeployedSourceMap *string `json:"deployedSourceMap,omitempty"` + SourcePath *string `json:"sourcePath,omitempty"` + Compiler *SolidityContractJsonArtifactCompiler `json:"compiler,omitempty"` + FunctionHashes map[string]interface{} `json:"functionHashes,omitempty"` + GasEstimates *SolidityContractJsonArtifactGasEstimates `json:"gasEstimates,omitempty"` +} + +// NewSolidityContractJsonArtifact instantiates a new SolidityContractJsonArtifact 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 +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifact(contractName string) *SolidityContractJsonArtifact { + this := SolidityContractJsonArtifact{} + this.ContractName = contractName + return &this +} + +// NewSolidityContractJsonArtifactWithDefaults instantiates a new SolidityContractJsonArtifact object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactWithDefaults() *SolidityContractJsonArtifact { + this := SolidityContractJsonArtifact{} + return &this +} + +// GetContractName returns the ContractName field value +func (o *SolidityContractJsonArtifact) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *SolidityContractJsonArtifact) SetContractName(v string) { + o.ContractName = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetMetadata() string { + if o == nil || IsNil(o.Metadata) { + var ret string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetMetadataOk() (*string, bool) { + if o == nil || IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given string and assigns it to the Metadata field. +func (o *SolidityContractJsonArtifact) SetMetadata(v string) { + o.Metadata = &v +} + +// GetBytecode returns the Bytecode field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetBytecode() string { + if o == nil || IsNil(o.Bytecode) { + var ret string + return ret + } + return *o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.Bytecode) { + return nil, false + } + return o.Bytecode, true +} + +// HasBytecode returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasBytecode() bool { + if o != nil && !IsNil(o.Bytecode) { + return true + } + + return false +} + +// SetBytecode gets a reference to the given string and assigns it to the Bytecode field. +func (o *SolidityContractJsonArtifact) SetBytecode(v string) { + o.Bytecode = &v +} + +// GetDeployedBytecode returns the DeployedBytecode field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetDeployedBytecode() string { + if o == nil || IsNil(o.DeployedBytecode) { + var ret string + return ret + } + return *o.DeployedBytecode +} + +// GetDeployedBytecodeOk returns a tuple with the DeployedBytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetDeployedBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.DeployedBytecode) { + return nil, false + } + return o.DeployedBytecode, true +} + +// HasDeployedBytecode returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasDeployedBytecode() bool { + if o != nil && !IsNil(o.DeployedBytecode) { + return true + } + + return false +} + +// SetDeployedBytecode gets a reference to the given string and assigns it to the DeployedBytecode field. +func (o *SolidityContractJsonArtifact) SetDeployedBytecode(v string) { + o.DeployedBytecode = &v +} + +// GetSourceMap returns the SourceMap field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetSourceMap() string { + if o == nil || IsNil(o.SourceMap) { + var ret string + return ret + } + return *o.SourceMap +} + +// GetSourceMapOk returns a tuple with the SourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.SourceMap) { + return nil, false + } + return o.SourceMap, true +} + +// HasSourceMap returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasSourceMap() bool { + if o != nil && !IsNil(o.SourceMap) { + return true + } + + return false +} + +// SetSourceMap gets a reference to the given string and assigns it to the SourceMap field. +func (o *SolidityContractJsonArtifact) SetSourceMap(v string) { + o.SourceMap = &v +} + +// GetDeployedSourceMap returns the DeployedSourceMap field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetDeployedSourceMap() string { + if o == nil || IsNil(o.DeployedSourceMap) { + var ret string + return ret + } + return *o.DeployedSourceMap +} + +// GetDeployedSourceMapOk returns a tuple with the DeployedSourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetDeployedSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.DeployedSourceMap) { + return nil, false + } + return o.DeployedSourceMap, true +} + +// HasDeployedSourceMap returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasDeployedSourceMap() bool { + if o != nil && !IsNil(o.DeployedSourceMap) { + return true + } + + return false +} + +// SetDeployedSourceMap gets a reference to the given string and assigns it to the DeployedSourceMap field. +func (o *SolidityContractJsonArtifact) SetDeployedSourceMap(v string) { + o.DeployedSourceMap = &v +} + +// GetSourcePath returns the SourcePath field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetSourcePath() string { + if o == nil || IsNil(o.SourcePath) { + var ret string + return ret + } + return *o.SourcePath +} + +// GetSourcePathOk returns a tuple with the SourcePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetSourcePathOk() (*string, bool) { + if o == nil || IsNil(o.SourcePath) { + return nil, false + } + return o.SourcePath, true +} + +// HasSourcePath returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasSourcePath() bool { + if o != nil && !IsNil(o.SourcePath) { + return true + } + + return false +} + +// SetSourcePath gets a reference to the given string and assigns it to the SourcePath field. +func (o *SolidityContractJsonArtifact) SetSourcePath(v string) { + o.SourcePath = &v +} + +// GetCompiler returns the Compiler field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetCompiler() SolidityContractJsonArtifactCompiler { + if o == nil || IsNil(o.Compiler) { + var ret SolidityContractJsonArtifactCompiler + return ret + } + return *o.Compiler +} + +// GetCompilerOk returns a tuple with the Compiler field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetCompilerOk() (*SolidityContractJsonArtifactCompiler, bool) { + if o == nil || IsNil(o.Compiler) { + return nil, false + } + return o.Compiler, true +} + +// HasCompiler returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasCompiler() bool { + if o != nil && !IsNil(o.Compiler) { + return true + } + + return false +} + +// SetCompiler gets a reference to the given SolidityContractJsonArtifactCompiler and assigns it to the Compiler field. +func (o *SolidityContractJsonArtifact) SetCompiler(v SolidityContractJsonArtifactCompiler) { + o.Compiler = &v +} + +// GetFunctionHashes returns the FunctionHashes field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetFunctionHashes() map[string]interface{} { + if o == nil || IsNil(o.FunctionHashes) { + var ret map[string]interface{} + return ret + } + return o.FunctionHashes +} + +// GetFunctionHashesOk returns a tuple with the FunctionHashes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetFunctionHashesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FunctionHashes) { + return map[string]interface{}{}, false + } + return o.FunctionHashes, true +} + +// HasFunctionHashes returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasFunctionHashes() bool { + if o != nil && !IsNil(o.FunctionHashes) { + return true + } + + return false +} + +// SetFunctionHashes gets a reference to the given map[string]interface{} and assigns it to the FunctionHashes field. +func (o *SolidityContractJsonArtifact) SetFunctionHashes(v map[string]interface{}) { + o.FunctionHashes = v +} + +// GetGasEstimates returns the GasEstimates field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetGasEstimates() SolidityContractJsonArtifactGasEstimates { + if o == nil || IsNil(o.GasEstimates) { + var ret SolidityContractJsonArtifactGasEstimates + return ret + } + return *o.GasEstimates +} + +// GetGasEstimatesOk returns a tuple with the GasEstimates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetGasEstimatesOk() (*SolidityContractJsonArtifactGasEstimates, bool) { + if o == nil || IsNil(o.GasEstimates) { + return nil, false + } + return o.GasEstimates, true +} + +// HasGasEstimates returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasGasEstimates() bool { + if o != nil && !IsNil(o.GasEstimates) { + return true + } + + return false +} + +// SetGasEstimates gets a reference to the given SolidityContractJsonArtifactGasEstimates and assigns it to the GasEstimates field. +func (o *SolidityContractJsonArtifact) SetGasEstimates(v SolidityContractJsonArtifactGasEstimates) { + o.GasEstimates = &v +} + +func (o SolidityContractJsonArtifact) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifact) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !IsNil(o.Bytecode) { + toSerialize["bytecode"] = o.Bytecode + } + if !IsNil(o.DeployedBytecode) { + toSerialize["deployedBytecode"] = o.DeployedBytecode + } + if !IsNil(o.SourceMap) { + toSerialize["sourceMap"] = o.SourceMap + } + if !IsNil(o.DeployedSourceMap) { + toSerialize["deployedSourceMap"] = o.DeployedSourceMap + } + if !IsNil(o.SourcePath) { + toSerialize["sourcePath"] = o.SourcePath + } + if !IsNil(o.Compiler) { + toSerialize["compiler"] = o.Compiler + } + if !IsNil(o.FunctionHashes) { + toSerialize["functionHashes"] = o.FunctionHashes + } + if !IsNil(o.GasEstimates) { + toSerialize["gasEstimates"] = o.GasEstimates + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifact struct { + value *SolidityContractJsonArtifact + isSet bool +} + +func (v NullableSolidityContractJsonArtifact) Get() *SolidityContractJsonArtifact { + return v.value +} + +func (v *NullableSolidityContractJsonArtifact) Set(val *SolidityContractJsonArtifact) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifact) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifact) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifact(val *SolidityContractJsonArtifact) *NullableSolidityContractJsonArtifact { + return &NullableSolidityContractJsonArtifact{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifact) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifact) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go new file mode 100644 index 00000000000..9797c8b82ef --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go @@ -0,0 +1,188 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactCompiler type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactCompiler{} + +// SolidityContractJsonArtifactCompiler struct for SolidityContractJsonArtifactCompiler +type SolidityContractJsonArtifactCompiler struct { + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SolidityContractJsonArtifactCompiler SolidityContractJsonArtifactCompiler + +// NewSolidityContractJsonArtifactCompiler instantiates a new SolidityContractJsonArtifactCompiler 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 +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactCompiler() *SolidityContractJsonArtifactCompiler { + this := SolidityContractJsonArtifactCompiler{} + return &this +} + +// NewSolidityContractJsonArtifactCompilerWithDefaults instantiates a new SolidityContractJsonArtifactCompiler object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactCompilerWithDefaults() *SolidityContractJsonArtifactCompiler { + this := SolidityContractJsonArtifactCompiler{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactCompiler) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactCompiler) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactCompiler) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SolidityContractJsonArtifactCompiler) SetName(v string) { + o.Name = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactCompiler) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactCompiler) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactCompiler) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *SolidityContractJsonArtifactCompiler) SetVersion(v string) { + o.Version = &v +} + +func (o SolidityContractJsonArtifactCompiler) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactCompiler) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SolidityContractJsonArtifactCompiler) UnmarshalJSON(bytes []byte) (err error) { + varSolidityContractJsonArtifactCompiler := _SolidityContractJsonArtifactCompiler{} + + if err = json.Unmarshal(bytes, &varSolidityContractJsonArtifactCompiler); err == nil { + *o = SolidityContractJsonArtifactCompiler(varSolidityContractJsonArtifactCompiler) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSolidityContractJsonArtifactCompiler struct { + value *SolidityContractJsonArtifactCompiler + isSet bool +} + +func (v NullableSolidityContractJsonArtifactCompiler) Get() *SolidityContractJsonArtifactCompiler { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactCompiler) Set(val *SolidityContractJsonArtifactCompiler) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactCompiler) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactCompiler) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactCompiler(val *SolidityContractJsonArtifactCompiler) *NullableSolidityContractJsonArtifactCompiler { + return &NullableSolidityContractJsonArtifactCompiler{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactCompiler) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactCompiler) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go new file mode 100644 index 00000000000..d5329301482 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactGasEstimates type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactGasEstimates{} + +// SolidityContractJsonArtifactGasEstimates struct for SolidityContractJsonArtifactGasEstimates +type SolidityContractJsonArtifactGasEstimates struct { + Creation *SolidityContractJsonArtifactGasEstimatesCreation `json:"creation,omitempty"` + External map[string]interface{} `json:"external,omitempty"` +} + +// NewSolidityContractJsonArtifactGasEstimates instantiates a new SolidityContractJsonArtifactGasEstimates 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 +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactGasEstimates() *SolidityContractJsonArtifactGasEstimates { + this := SolidityContractJsonArtifactGasEstimates{} + return &this +} + +// NewSolidityContractJsonArtifactGasEstimatesWithDefaults instantiates a new SolidityContractJsonArtifactGasEstimates object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactGasEstimatesWithDefaults() *SolidityContractJsonArtifactGasEstimates { + this := SolidityContractJsonArtifactGasEstimates{} + return &this +} + +// GetCreation returns the Creation field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimates) GetCreation() SolidityContractJsonArtifactGasEstimatesCreation { + if o == nil || IsNil(o.Creation) { + var ret SolidityContractJsonArtifactGasEstimatesCreation + return ret + } + return *o.Creation +} + +// GetCreationOk returns a tuple with the Creation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimates) GetCreationOk() (*SolidityContractJsonArtifactGasEstimatesCreation, bool) { + if o == nil || IsNil(o.Creation) { + return nil, false + } + return o.Creation, true +} + +// HasCreation returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimates) HasCreation() bool { + if o != nil && !IsNil(o.Creation) { + return true + } + + return false +} + +// SetCreation gets a reference to the given SolidityContractJsonArtifactGasEstimatesCreation and assigns it to the Creation field. +func (o *SolidityContractJsonArtifactGasEstimates) SetCreation(v SolidityContractJsonArtifactGasEstimatesCreation) { + o.Creation = &v +} + +// GetExternal returns the External field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimates) GetExternal() map[string]interface{} { + if o == nil || IsNil(o.External) { + var ret map[string]interface{} + return ret + } + return o.External +} + +// GetExternalOk returns a tuple with the External field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimates) GetExternalOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.External) { + return map[string]interface{}{}, false + } + return o.External, true +} + +// HasExternal returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimates) HasExternal() bool { + if o != nil && !IsNil(o.External) { + return true + } + + return false +} + +// SetExternal gets a reference to the given map[string]interface{} and assigns it to the External field. +func (o *SolidityContractJsonArtifactGasEstimates) SetExternal(v map[string]interface{}) { + o.External = v +} + +func (o SolidityContractJsonArtifactGasEstimates) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactGasEstimates) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Creation) { + toSerialize["creation"] = o.Creation + } + if !IsNil(o.External) { + toSerialize["external"] = o.External + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifactGasEstimates struct { + value *SolidityContractJsonArtifactGasEstimates + isSet bool +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) Get() *SolidityContractJsonArtifactGasEstimates { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) Set(val *SolidityContractJsonArtifactGasEstimates) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactGasEstimates(val *SolidityContractJsonArtifactGasEstimates) *NullableSolidityContractJsonArtifactGasEstimates { + return &NullableSolidityContractJsonArtifactGasEstimates{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go new file mode 100644 index 00000000000..548c46bfaa6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactGasEstimatesCreation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactGasEstimatesCreation{} + +// SolidityContractJsonArtifactGasEstimatesCreation struct for SolidityContractJsonArtifactGasEstimatesCreation +type SolidityContractJsonArtifactGasEstimatesCreation struct { + CodeDepositCost *string `json:"codeDepositCost,omitempty"` + ExecutionCost *string `json:"executionCost,omitempty"` + TotalCost *string `json:"totalCost,omitempty"` +} + +// NewSolidityContractJsonArtifactGasEstimatesCreation instantiates a new SolidityContractJsonArtifactGasEstimatesCreation 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 +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactGasEstimatesCreation() *SolidityContractJsonArtifactGasEstimatesCreation { + this := SolidityContractJsonArtifactGasEstimatesCreation{} + return &this +} + +// NewSolidityContractJsonArtifactGasEstimatesCreationWithDefaults instantiates a new SolidityContractJsonArtifactGasEstimatesCreation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactGasEstimatesCreationWithDefaults() *SolidityContractJsonArtifactGasEstimatesCreation { + this := SolidityContractJsonArtifactGasEstimatesCreation{} + return &this +} + +// GetCodeDepositCost returns the CodeDepositCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetCodeDepositCost() string { + if o == nil || IsNil(o.CodeDepositCost) { + var ret string + return ret + } + return *o.CodeDepositCost +} + +// GetCodeDepositCostOk returns a tuple with the CodeDepositCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetCodeDepositCostOk() (*string, bool) { + if o == nil || IsNil(o.CodeDepositCost) { + return nil, false + } + return o.CodeDepositCost, true +} + +// HasCodeDepositCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasCodeDepositCost() bool { + if o != nil && !IsNil(o.CodeDepositCost) { + return true + } + + return false +} + +// SetCodeDepositCost gets a reference to the given string and assigns it to the CodeDepositCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetCodeDepositCost(v string) { + o.CodeDepositCost = &v +} + +// GetExecutionCost returns the ExecutionCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetExecutionCost() string { + if o == nil || IsNil(o.ExecutionCost) { + var ret string + return ret + } + return *o.ExecutionCost +} + +// GetExecutionCostOk returns a tuple with the ExecutionCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetExecutionCostOk() (*string, bool) { + if o == nil || IsNil(o.ExecutionCost) { + return nil, false + } + return o.ExecutionCost, true +} + +// HasExecutionCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasExecutionCost() bool { + if o != nil && !IsNil(o.ExecutionCost) { + return true + } + + return false +} + +// SetExecutionCost gets a reference to the given string and assigns it to the ExecutionCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetExecutionCost(v string) { + o.ExecutionCost = &v +} + +// GetTotalCost returns the TotalCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetTotalCost() string { + if o == nil || IsNil(o.TotalCost) { + var ret string + return ret + } + return *o.TotalCost +} + +// GetTotalCostOk returns a tuple with the TotalCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetTotalCostOk() (*string, bool) { + if o == nil || IsNil(o.TotalCost) { + return nil, false + } + return o.TotalCost, true +} + +// HasTotalCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasTotalCost() bool { + if o != nil && !IsNil(o.TotalCost) { + return true + } + + return false +} + +// SetTotalCost gets a reference to the given string and assigns it to the TotalCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetTotalCost(v string) { + o.TotalCost = &v +} + +func (o SolidityContractJsonArtifactGasEstimatesCreation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactGasEstimatesCreation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CodeDepositCost) { + toSerialize["codeDepositCost"] = o.CodeDepositCost + } + if !IsNil(o.ExecutionCost) { + toSerialize["executionCost"] = o.ExecutionCost + } + if !IsNil(o.TotalCost) { + toSerialize["totalCost"] = o.TotalCost + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifactGasEstimatesCreation struct { + value *SolidityContractJsonArtifactGasEstimatesCreation + isSet bool +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) Get() *SolidityContractJsonArtifactGasEstimatesCreation { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) Set(val *SolidityContractJsonArtifactGasEstimatesCreation) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactGasEstimatesCreation(val *SolidityContractJsonArtifactGasEstimatesCreation) *NullableSolidityContractJsonArtifactGasEstimatesCreation { + return &NullableSolidityContractJsonArtifactGasEstimatesCreation{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go new file mode 100644 index 00000000000..77d8b220f69 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksV1 the model 'WatchBlocksV1' +type WatchBlocksV1 string + +// List of WatchBlocksV1 +const ( + Subscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Subscribe" + Next WatchBlocksV1 = "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Next" + Unsubscribe WatchBlocksV1 = "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Unsubscribe" + Error WatchBlocksV1 = "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Error" + Complete WatchBlocksV1 = "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Complete" +) + +// All allowed values of WatchBlocksV1 enum +var AllowedWatchBlocksV1EnumValues = []WatchBlocksV1{ + "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Subscribe", + "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Next", + "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Unsubscribe", + "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Error", + "org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Complete", +} + +func (v *WatchBlocksV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchBlocksV1(value) + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchBlocksV1", value) +} + +// NewWatchBlocksV1FromValue returns a pointer to a valid WatchBlocksV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchBlocksV1FromValue(v string) (*WatchBlocksV1, error) { + ev := WatchBlocksV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchBlocksV1: valid values are %v", v, AllowedWatchBlocksV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchBlocksV1) IsValid() bool { + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchBlocksV1 value +func (v WatchBlocksV1) Ptr() *WatchBlocksV1 { + return &v +} + +type NullableWatchBlocksV1 struct { + value *WatchBlocksV1 + isSet bool +} + +func (v NullableWatchBlocksV1) Get() *WatchBlocksV1 { + return v.value +} + +func (v *NullableWatchBlocksV1) Set(val *WatchBlocksV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1(val *WatchBlocksV1) *NullableWatchBlocksV1 { + return &NullableWatchBlocksV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data.go new file mode 100644 index 00000000000..cb55086dc00 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_block_data.go @@ -0,0 +1,666 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1BlockData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1BlockData{} + +// WatchBlocksV1BlockData struct for WatchBlocksV1BlockData +type WatchBlocksV1BlockData struct { + Number float32 `json:"number"` + Hash string `json:"hash"` + ParentHash string `json:"parentHash"` + Nonce string `json:"nonce"` + Sha3Uncles string `json:"sha3Uncles"` + LogsBloom string `json:"logsBloom"` + TransactionsRoot *string `json:"transactionsRoot,omitempty"` + StateRoot string `json:"stateRoot"` + ReceiptsRoot *string `json:"receiptsRoot,omitempty"` + Difficulty *string `json:"difficulty,omitempty"` + MixHash *string `json:"mixHash,omitempty"` + Miner string `json:"miner"` + ExtraData string `json:"extraData"` + GasLimit int32 `json:"gasLimit"` + GasUsed int32 `json:"gasUsed"` + Timestamp QuorumTransactionConfigFrom `json:"timestamp"` + Size float32 `json:"size"` + TotalDifficulty string `json:"totalDifficulty"` + Uncles []string `json:"uncles"` + Transactions []Web3Transaction `json:"transactions"` +} + +// NewWatchBlocksV1BlockData instantiates a new WatchBlocksV1BlockData 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 +// will change when the set of required properties is changed +func NewWatchBlocksV1BlockData(number float32, hash string, parentHash string, nonce string, sha3Uncles string, logsBloom string, stateRoot string, miner string, extraData string, gasLimit int32, gasUsed int32, timestamp QuorumTransactionConfigFrom, size float32, totalDifficulty string, uncles []string, transactions []Web3Transaction) *WatchBlocksV1BlockData { + this := WatchBlocksV1BlockData{} + this.Number = number + this.Hash = hash + this.ParentHash = parentHash + this.Nonce = nonce + this.Sha3Uncles = sha3Uncles + this.LogsBloom = logsBloom + this.StateRoot = stateRoot + this.Miner = miner + this.ExtraData = extraData + this.GasLimit = gasLimit + this.GasUsed = gasUsed + this.Timestamp = timestamp + this.Size = size + this.TotalDifficulty = totalDifficulty + this.Uncles = uncles + this.Transactions = transactions + return &this +} + +// NewWatchBlocksV1BlockDataWithDefaults instantiates a new WatchBlocksV1BlockData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1BlockDataWithDefaults() *WatchBlocksV1BlockData { + this := WatchBlocksV1BlockData{} + return &this +} + +// GetNumber returns the Number field value +func (o *WatchBlocksV1BlockData) GetNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Number +} + +// GetNumberOk returns a tuple with the Number field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Number, true +} + +// SetNumber sets field value +func (o *WatchBlocksV1BlockData) SetNumber(v float32) { + o.Number = v +} + +// GetHash returns the Hash field value +func (o *WatchBlocksV1BlockData) GetHash() string { + if o == nil { + var ret string + return ret + } + + return o.Hash +} + +// GetHashOk returns a tuple with the Hash field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *WatchBlocksV1BlockData) SetHash(v string) { + o.Hash = v +} + +// GetParentHash returns the ParentHash field value +func (o *WatchBlocksV1BlockData) GetParentHash() string { + if o == nil { + var ret string + return ret + } + + return o.ParentHash +} + +// GetParentHashOk returns a tuple with the ParentHash field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetParentHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ParentHash, true +} + +// SetParentHash sets field value +func (o *WatchBlocksV1BlockData) SetParentHash(v string) { + o.ParentHash = v +} + +// GetNonce returns the Nonce field value +func (o *WatchBlocksV1BlockData) GetNonce() string { + if o == nil { + var ret string + return ret + } + + return o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetNonceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Nonce, true +} + +// SetNonce sets field value +func (o *WatchBlocksV1BlockData) SetNonce(v string) { + o.Nonce = v +} + +// GetSha3Uncles returns the Sha3Uncles field value +func (o *WatchBlocksV1BlockData) GetSha3Uncles() string { + if o == nil { + var ret string + return ret + } + + return o.Sha3Uncles +} + +// GetSha3UnclesOk returns a tuple with the Sha3Uncles field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetSha3UnclesOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Sha3Uncles, true +} + +// SetSha3Uncles sets field value +func (o *WatchBlocksV1BlockData) SetSha3Uncles(v string) { + o.Sha3Uncles = v +} + +// GetLogsBloom returns the LogsBloom field value +func (o *WatchBlocksV1BlockData) GetLogsBloom() string { + if o == nil { + var ret string + return ret + } + + return o.LogsBloom +} + +// GetLogsBloomOk returns a tuple with the LogsBloom field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetLogsBloomOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LogsBloom, true +} + +// SetLogsBloom sets field value +func (o *WatchBlocksV1BlockData) SetLogsBloom(v string) { + o.LogsBloom = v +} + +// GetTransactionsRoot returns the TransactionsRoot field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetTransactionsRoot() string { + if o == nil || IsNil(o.TransactionsRoot) { + var ret string + return ret + } + return *o.TransactionsRoot +} + +// GetTransactionsRootOk returns a tuple with the TransactionsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetTransactionsRootOk() (*string, bool) { + if o == nil || IsNil(o.TransactionsRoot) { + return nil, false + } + return o.TransactionsRoot, true +} + +// HasTransactionsRoot returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasTransactionsRoot() bool { + if o != nil && !IsNil(o.TransactionsRoot) { + return true + } + + return false +} + +// SetTransactionsRoot gets a reference to the given string and assigns it to the TransactionsRoot field. +func (o *WatchBlocksV1BlockData) SetTransactionsRoot(v string) { + o.TransactionsRoot = &v +} + +// GetStateRoot returns the StateRoot field value +func (o *WatchBlocksV1BlockData) GetStateRoot() string { + if o == nil { + var ret string + return ret + } + + return o.StateRoot +} + +// GetStateRootOk returns a tuple with the StateRoot field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetStateRootOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateRoot, true +} + +// SetStateRoot sets field value +func (o *WatchBlocksV1BlockData) SetStateRoot(v string) { + o.StateRoot = v +} + +// GetReceiptsRoot returns the ReceiptsRoot field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetReceiptsRoot() string { + if o == nil || IsNil(o.ReceiptsRoot) { + var ret string + return ret + } + return *o.ReceiptsRoot +} + +// GetReceiptsRootOk returns a tuple with the ReceiptsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetReceiptsRootOk() (*string, bool) { + if o == nil || IsNil(o.ReceiptsRoot) { + return nil, false + } + return o.ReceiptsRoot, true +} + +// HasReceiptsRoot returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasReceiptsRoot() bool { + if o != nil && !IsNil(o.ReceiptsRoot) { + return true + } + + return false +} + +// SetReceiptsRoot gets a reference to the given string and assigns it to the ReceiptsRoot field. +func (o *WatchBlocksV1BlockData) SetReceiptsRoot(v string) { + o.ReceiptsRoot = &v +} + +// GetDifficulty returns the Difficulty field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetDifficulty() string { + if o == nil || IsNil(o.Difficulty) { + var ret string + return ret + } + return *o.Difficulty +} + +// GetDifficultyOk returns a tuple with the Difficulty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetDifficultyOk() (*string, bool) { + if o == nil || IsNil(o.Difficulty) { + return nil, false + } + return o.Difficulty, true +} + +// HasDifficulty returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasDifficulty() bool { + if o != nil && !IsNil(o.Difficulty) { + return true + } + + return false +} + +// SetDifficulty gets a reference to the given string and assigns it to the Difficulty field. +func (o *WatchBlocksV1BlockData) SetDifficulty(v string) { + o.Difficulty = &v +} + +// GetMixHash returns the MixHash field value if set, zero value otherwise. +func (o *WatchBlocksV1BlockData) GetMixHash() string { + if o == nil || IsNil(o.MixHash) { + var ret string + return ret + } + return *o.MixHash +} + +// GetMixHashOk returns a tuple with the MixHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetMixHashOk() (*string, bool) { + if o == nil || IsNil(o.MixHash) { + return nil, false + } + return o.MixHash, true +} + +// HasMixHash returns a boolean if a field has been set. +func (o *WatchBlocksV1BlockData) HasMixHash() bool { + if o != nil && !IsNil(o.MixHash) { + return true + } + + return false +} + +// SetMixHash gets a reference to the given string and assigns it to the MixHash field. +func (o *WatchBlocksV1BlockData) SetMixHash(v string) { + o.MixHash = &v +} + +// GetMiner returns the Miner field value +func (o *WatchBlocksV1BlockData) GetMiner() string { + if o == nil { + var ret string + return ret + } + + return o.Miner +} + +// GetMinerOk returns a tuple with the Miner field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetMinerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Miner, true +} + +// SetMiner sets field value +func (o *WatchBlocksV1BlockData) SetMiner(v string) { + o.Miner = v +} + +// GetExtraData returns the ExtraData field value +func (o *WatchBlocksV1BlockData) GetExtraData() string { + if o == nil { + var ret string + return ret + } + + return o.ExtraData +} + +// GetExtraDataOk returns a tuple with the ExtraData field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetExtraDataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExtraData, true +} + +// SetExtraData sets field value +func (o *WatchBlocksV1BlockData) SetExtraData(v string) { + o.ExtraData = v +} + +// GetGasLimit returns the GasLimit field value +func (o *WatchBlocksV1BlockData) GetGasLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.GasLimit +} + +// GetGasLimitOk returns a tuple with the GasLimit field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetGasLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.GasLimit, true +} + +// SetGasLimit sets field value +func (o *WatchBlocksV1BlockData) SetGasLimit(v int32) { + o.GasLimit = v +} + +// GetGasUsed returns the GasUsed field value +func (o *WatchBlocksV1BlockData) GetGasUsed() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetGasUsedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *WatchBlocksV1BlockData) SetGasUsed(v int32) { + o.GasUsed = v +} + +// GetTimestamp returns the Timestamp field value +func (o *WatchBlocksV1BlockData) GetTimestamp() QuorumTransactionConfigFrom { + if o == nil { + var ret QuorumTransactionConfigFrom + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetTimestampOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *WatchBlocksV1BlockData) SetTimestamp(v QuorumTransactionConfigFrom) { + o.Timestamp = v +} + +// GetSize returns the Size field value +func (o *WatchBlocksV1BlockData) GetSize() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetSizeOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *WatchBlocksV1BlockData) SetSize(v float32) { + o.Size = v +} + +// GetTotalDifficulty returns the TotalDifficulty field value +func (o *WatchBlocksV1BlockData) GetTotalDifficulty() string { + if o == nil { + var ret string + return ret + } + + return o.TotalDifficulty +} + +// GetTotalDifficultyOk returns a tuple with the TotalDifficulty field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetTotalDifficultyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TotalDifficulty, true +} + +// SetTotalDifficulty sets field value +func (o *WatchBlocksV1BlockData) SetTotalDifficulty(v string) { + o.TotalDifficulty = v +} + +// GetUncles returns the Uncles field value +func (o *WatchBlocksV1BlockData) GetUncles() []string { + if o == nil { + var ret []string + return ret + } + + return o.Uncles +} + +// GetUnclesOk returns a tuple with the Uncles field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetUnclesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Uncles, true +} + +// SetUncles sets field value +func (o *WatchBlocksV1BlockData) SetUncles(v []string) { + o.Uncles = v +} + +// GetTransactions returns the Transactions field value +func (o *WatchBlocksV1BlockData) GetTransactions() []Web3Transaction { + if o == nil { + var ret []Web3Transaction + return ret + } + + return o.Transactions +} + +// GetTransactionsOk returns a tuple with the Transactions field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1BlockData) GetTransactionsOk() ([]Web3Transaction, bool) { + if o == nil { + return nil, false + } + return o.Transactions, true +} + +// SetTransactions sets field value +func (o *WatchBlocksV1BlockData) SetTransactions(v []Web3Transaction) { + o.Transactions = v +} + +func (o WatchBlocksV1BlockData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1BlockData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["number"] = o.Number + toSerialize["hash"] = o.Hash + toSerialize["parentHash"] = o.ParentHash + toSerialize["nonce"] = o.Nonce + toSerialize["sha3Uncles"] = o.Sha3Uncles + toSerialize["logsBloom"] = o.LogsBloom + if !IsNil(o.TransactionsRoot) { + toSerialize["transactionsRoot"] = o.TransactionsRoot + } + toSerialize["stateRoot"] = o.StateRoot + if !IsNil(o.ReceiptsRoot) { + toSerialize["receiptsRoot"] = o.ReceiptsRoot + } + if !IsNil(o.Difficulty) { + toSerialize["difficulty"] = o.Difficulty + } + if !IsNil(o.MixHash) { + toSerialize["mixHash"] = o.MixHash + } + toSerialize["miner"] = o.Miner + toSerialize["extraData"] = o.ExtraData + toSerialize["gasLimit"] = o.GasLimit + toSerialize["gasUsed"] = o.GasUsed + toSerialize["timestamp"] = o.Timestamp + toSerialize["size"] = o.Size + toSerialize["totalDifficulty"] = o.TotalDifficulty + toSerialize["uncles"] = o.Uncles + toSerialize["transactions"] = o.Transactions + return toSerialize, nil +} + +type NullableWatchBlocksV1BlockData struct { + value *WatchBlocksV1BlockData + isSet bool +} + +func (v NullableWatchBlocksV1BlockData) Get() *WatchBlocksV1BlockData { + return v.value +} + +func (v *NullableWatchBlocksV1BlockData) Set(val *WatchBlocksV1BlockData) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1BlockData) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1BlockData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1BlockData(val *WatchBlocksV1BlockData) *NullableWatchBlocksV1BlockData { + return &NullableWatchBlocksV1BlockData{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1BlockData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1BlockData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go new file mode 100644 index 00000000000..97ea6a597fa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go @@ -0,0 +1,126 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1Options type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1Options{} + +// WatchBlocksV1Options struct for WatchBlocksV1Options +type WatchBlocksV1Options struct { + GetBlockData *bool `json:"getBlockData,omitempty"` +} + +// NewWatchBlocksV1Options instantiates a new WatchBlocksV1Options 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 +// will change when the set of required properties is changed +func NewWatchBlocksV1Options() *WatchBlocksV1Options { + this := WatchBlocksV1Options{} + return &this +} + +// NewWatchBlocksV1OptionsWithDefaults instantiates a new WatchBlocksV1Options object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1OptionsWithDefaults() *WatchBlocksV1Options { + this := WatchBlocksV1Options{} + return &this +} + +// GetGetBlockData returns the GetBlockData field value if set, zero value otherwise. +func (o *WatchBlocksV1Options) GetGetBlockData() bool { + if o == nil || IsNil(o.GetBlockData) { + var ret bool + return ret + } + return *o.GetBlockData +} + +// GetGetBlockDataOk returns a tuple with the GetBlockData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Options) GetGetBlockDataOk() (*bool, bool) { + if o == nil || IsNil(o.GetBlockData) { + return nil, false + } + return o.GetBlockData, true +} + +// HasGetBlockData returns a boolean if a field has been set. +func (o *WatchBlocksV1Options) HasGetBlockData() bool { + if o != nil && !IsNil(o.GetBlockData) { + return true + } + + return false +} + +// SetGetBlockData gets a reference to the given bool and assigns it to the GetBlockData field. +func (o *WatchBlocksV1Options) SetGetBlockData(v bool) { + o.GetBlockData = &v +} + +func (o WatchBlocksV1Options) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1Options) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.GetBlockData) { + toSerialize["getBlockData"] = o.GetBlockData + } + return toSerialize, nil +} + +type NullableWatchBlocksV1Options struct { + value *WatchBlocksV1Options + isSet bool +} + +func (v NullableWatchBlocksV1Options) Get() *WatchBlocksV1Options { + return v.value +} + +func (v *NullableWatchBlocksV1Options) Set(val *WatchBlocksV1Options) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1Options) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1Options) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1Options(val *WatchBlocksV1Options) *NullableWatchBlocksV1Options { + return &NullableWatchBlocksV1Options{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1Options) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1Options) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go new file mode 100644 index 00000000000..ed90467fbc6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1Progress type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1Progress{} + +// WatchBlocksV1Progress struct for WatchBlocksV1Progress +type WatchBlocksV1Progress struct { + BlockHeader *Web3BlockHeader `json:"blockHeader,omitempty"` + BlockData *WatchBlocksV1BlockData `json:"blockData,omitempty"` +} + +// NewWatchBlocksV1Progress instantiates a new WatchBlocksV1Progress 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 +// will change when the set of required properties is changed +func NewWatchBlocksV1Progress() *WatchBlocksV1Progress { + this := WatchBlocksV1Progress{} + return &this +} + +// NewWatchBlocksV1ProgressWithDefaults instantiates a new WatchBlocksV1Progress object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1ProgressWithDefaults() *WatchBlocksV1Progress { + this := WatchBlocksV1Progress{} + return &this +} + +// GetBlockHeader returns the BlockHeader field value if set, zero value otherwise. +func (o *WatchBlocksV1Progress) GetBlockHeader() Web3BlockHeader { + if o == nil || IsNil(o.BlockHeader) { + var ret Web3BlockHeader + return ret + } + return *o.BlockHeader +} + +// GetBlockHeaderOk returns a tuple with the BlockHeader field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Progress) GetBlockHeaderOk() (*Web3BlockHeader, bool) { + if o == nil || IsNil(o.BlockHeader) { + return nil, false + } + return o.BlockHeader, true +} + +// HasBlockHeader returns a boolean if a field has been set. +func (o *WatchBlocksV1Progress) HasBlockHeader() bool { + if o != nil && !IsNil(o.BlockHeader) { + return true + } + + return false +} + +// SetBlockHeader gets a reference to the given Web3BlockHeader and assigns it to the BlockHeader field. +func (o *WatchBlocksV1Progress) SetBlockHeader(v Web3BlockHeader) { + o.BlockHeader = &v +} + +// GetBlockData returns the BlockData field value if set, zero value otherwise. +func (o *WatchBlocksV1Progress) GetBlockData() WatchBlocksV1BlockData { + if o == nil || IsNil(o.BlockData) { + var ret WatchBlocksV1BlockData + return ret + } + return *o.BlockData +} + +// GetBlockDataOk returns a tuple with the BlockData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Progress) GetBlockDataOk() (*WatchBlocksV1BlockData, bool) { + if o == nil || IsNil(o.BlockData) { + return nil, false + } + return o.BlockData, true +} + +// HasBlockData returns a boolean if a field has been set. +func (o *WatchBlocksV1Progress) HasBlockData() bool { + if o != nil && !IsNil(o.BlockData) { + return true + } + + return false +} + +// SetBlockData gets a reference to the given WatchBlocksV1BlockData and assigns it to the BlockData field. +func (o *WatchBlocksV1Progress) SetBlockData(v WatchBlocksV1BlockData) { + o.BlockData = &v +} + +func (o WatchBlocksV1Progress) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1Progress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BlockHeader) { + toSerialize["blockHeader"] = o.BlockHeader + } + if !IsNil(o.BlockData) { + toSerialize["blockData"] = o.BlockData + } + return toSerialize, nil +} + +type NullableWatchBlocksV1Progress struct { + value *WatchBlocksV1Progress + isSet bool +} + +func (v NullableWatchBlocksV1Progress) Get() *WatchBlocksV1Progress { + return v.value +} + +func (v *NullableWatchBlocksV1Progress) Set(val *WatchBlocksV1Progress) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1Progress) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1Progress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1Progress(val *WatchBlocksV1Progress) *NullableWatchBlocksV1Progress { + return &NullableWatchBlocksV1Progress{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1Progress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1Progress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_block_header.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_block_header.go new file mode 100644 index 00000000000..afd2ad82809 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_block_header.go @@ -0,0 +1,558 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the Web3BlockHeader type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3BlockHeader{} + +// Web3BlockHeader struct for Web3BlockHeader +type Web3BlockHeader struct { + Number float32 `json:"number"` + Hash string `json:"hash"` + ParentHash string `json:"parentHash"` + Nonce string `json:"nonce"` + Sha3Uncles string `json:"sha3Uncles"` + LogsBloom string `json:"logsBloom"` + TransactionsRoot *string `json:"transactionsRoot,omitempty"` + StateRoot string `json:"stateRoot"` + ReceiptsRoot *string `json:"receiptsRoot,omitempty"` + Difficulty *string `json:"difficulty,omitempty"` + MixHash *string `json:"mixHash,omitempty"` + Miner string `json:"miner"` + ExtraData string `json:"extraData"` + GasLimit int32 `json:"gasLimit"` + GasUsed int32 `json:"gasUsed"` + Timestamp QuorumTransactionConfigFrom `json:"timestamp"` +} + +// NewWeb3BlockHeader instantiates a new Web3BlockHeader 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 +// will change when the set of required properties is changed +func NewWeb3BlockHeader(number float32, hash string, parentHash string, nonce string, sha3Uncles string, logsBloom string, stateRoot string, miner string, extraData string, gasLimit int32, gasUsed int32, timestamp QuorumTransactionConfigFrom) *Web3BlockHeader { + this := Web3BlockHeader{} + this.Number = number + this.Hash = hash + this.ParentHash = parentHash + this.Nonce = nonce + this.Sha3Uncles = sha3Uncles + this.LogsBloom = logsBloom + this.StateRoot = stateRoot + this.Miner = miner + this.ExtraData = extraData + this.GasLimit = gasLimit + this.GasUsed = gasUsed + this.Timestamp = timestamp + return &this +} + +// NewWeb3BlockHeaderWithDefaults instantiates a new Web3BlockHeader object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3BlockHeaderWithDefaults() *Web3BlockHeader { + this := Web3BlockHeader{} + return &this +} + +// GetNumber returns the Number field value +func (o *Web3BlockHeader) GetNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Number +} + +// GetNumberOk returns a tuple with the Number field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Number, true +} + +// SetNumber sets field value +func (o *Web3BlockHeader) SetNumber(v float32) { + o.Number = v +} + +// GetHash returns the Hash field value +func (o *Web3BlockHeader) GetHash() string { + if o == nil { + var ret string + return ret + } + + return o.Hash +} + +// GetHashOk returns a tuple with the Hash field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *Web3BlockHeader) SetHash(v string) { + o.Hash = v +} + +// GetParentHash returns the ParentHash field value +func (o *Web3BlockHeader) GetParentHash() string { + if o == nil { + var ret string + return ret + } + + return o.ParentHash +} + +// GetParentHashOk returns a tuple with the ParentHash field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetParentHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ParentHash, true +} + +// SetParentHash sets field value +func (o *Web3BlockHeader) SetParentHash(v string) { + o.ParentHash = v +} + +// GetNonce returns the Nonce field value +func (o *Web3BlockHeader) GetNonce() string { + if o == nil { + var ret string + return ret + } + + return o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetNonceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Nonce, true +} + +// SetNonce sets field value +func (o *Web3BlockHeader) SetNonce(v string) { + o.Nonce = v +} + +// GetSha3Uncles returns the Sha3Uncles field value +func (o *Web3BlockHeader) GetSha3Uncles() string { + if o == nil { + var ret string + return ret + } + + return o.Sha3Uncles +} + +// GetSha3UnclesOk returns a tuple with the Sha3Uncles field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetSha3UnclesOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Sha3Uncles, true +} + +// SetSha3Uncles sets field value +func (o *Web3BlockHeader) SetSha3Uncles(v string) { + o.Sha3Uncles = v +} + +// GetLogsBloom returns the LogsBloom field value +func (o *Web3BlockHeader) GetLogsBloom() string { + if o == nil { + var ret string + return ret + } + + return o.LogsBloom +} + +// GetLogsBloomOk returns a tuple with the LogsBloom field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetLogsBloomOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LogsBloom, true +} + +// SetLogsBloom sets field value +func (o *Web3BlockHeader) SetLogsBloom(v string) { + o.LogsBloom = v +} + +// GetTransactionsRoot returns the TransactionsRoot field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetTransactionsRoot() string { + if o == nil || IsNil(o.TransactionsRoot) { + var ret string + return ret + } + return *o.TransactionsRoot +} + +// GetTransactionsRootOk returns a tuple with the TransactionsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetTransactionsRootOk() (*string, bool) { + if o == nil || IsNil(o.TransactionsRoot) { + return nil, false + } + return o.TransactionsRoot, true +} + +// HasTransactionsRoot returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasTransactionsRoot() bool { + if o != nil && !IsNil(o.TransactionsRoot) { + return true + } + + return false +} + +// SetTransactionsRoot gets a reference to the given string and assigns it to the TransactionsRoot field. +func (o *Web3BlockHeader) SetTransactionsRoot(v string) { + o.TransactionsRoot = &v +} + +// GetStateRoot returns the StateRoot field value +func (o *Web3BlockHeader) GetStateRoot() string { + if o == nil { + var ret string + return ret + } + + return o.StateRoot +} + +// GetStateRootOk returns a tuple with the StateRoot field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetStateRootOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateRoot, true +} + +// SetStateRoot sets field value +func (o *Web3BlockHeader) SetStateRoot(v string) { + o.StateRoot = v +} + +// GetReceiptsRoot returns the ReceiptsRoot field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetReceiptsRoot() string { + if o == nil || IsNil(o.ReceiptsRoot) { + var ret string + return ret + } + return *o.ReceiptsRoot +} + +// GetReceiptsRootOk returns a tuple with the ReceiptsRoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetReceiptsRootOk() (*string, bool) { + if o == nil || IsNil(o.ReceiptsRoot) { + return nil, false + } + return o.ReceiptsRoot, true +} + +// HasReceiptsRoot returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasReceiptsRoot() bool { + if o != nil && !IsNil(o.ReceiptsRoot) { + return true + } + + return false +} + +// SetReceiptsRoot gets a reference to the given string and assigns it to the ReceiptsRoot field. +func (o *Web3BlockHeader) SetReceiptsRoot(v string) { + o.ReceiptsRoot = &v +} + +// GetDifficulty returns the Difficulty field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetDifficulty() string { + if o == nil || IsNil(o.Difficulty) { + var ret string + return ret + } + return *o.Difficulty +} + +// GetDifficultyOk returns a tuple with the Difficulty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetDifficultyOk() (*string, bool) { + if o == nil || IsNil(o.Difficulty) { + return nil, false + } + return o.Difficulty, true +} + +// HasDifficulty returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasDifficulty() bool { + if o != nil && !IsNil(o.Difficulty) { + return true + } + + return false +} + +// SetDifficulty gets a reference to the given string and assigns it to the Difficulty field. +func (o *Web3BlockHeader) SetDifficulty(v string) { + o.Difficulty = &v +} + +// GetMixHash returns the MixHash field value if set, zero value otherwise. +func (o *Web3BlockHeader) GetMixHash() string { + if o == nil || IsNil(o.MixHash) { + var ret string + return ret + } + return *o.MixHash +} + +// GetMixHashOk returns a tuple with the MixHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetMixHashOk() (*string, bool) { + if o == nil || IsNil(o.MixHash) { + return nil, false + } + return o.MixHash, true +} + +// HasMixHash returns a boolean if a field has been set. +func (o *Web3BlockHeader) HasMixHash() bool { + if o != nil && !IsNil(o.MixHash) { + return true + } + + return false +} + +// SetMixHash gets a reference to the given string and assigns it to the MixHash field. +func (o *Web3BlockHeader) SetMixHash(v string) { + o.MixHash = &v +} + +// GetMiner returns the Miner field value +func (o *Web3BlockHeader) GetMiner() string { + if o == nil { + var ret string + return ret + } + + return o.Miner +} + +// GetMinerOk returns a tuple with the Miner field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetMinerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Miner, true +} + +// SetMiner sets field value +func (o *Web3BlockHeader) SetMiner(v string) { + o.Miner = v +} + +// GetExtraData returns the ExtraData field value +func (o *Web3BlockHeader) GetExtraData() string { + if o == nil { + var ret string + return ret + } + + return o.ExtraData +} + +// GetExtraDataOk returns a tuple with the ExtraData field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetExtraDataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExtraData, true +} + +// SetExtraData sets field value +func (o *Web3BlockHeader) SetExtraData(v string) { + o.ExtraData = v +} + +// GetGasLimit returns the GasLimit field value +func (o *Web3BlockHeader) GetGasLimit() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.GasLimit +} + +// GetGasLimitOk returns a tuple with the GasLimit field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetGasLimitOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.GasLimit, true +} + +// SetGasLimit sets field value +func (o *Web3BlockHeader) SetGasLimit(v int32) { + o.GasLimit = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3BlockHeader) GetGasUsed() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetGasUsedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3BlockHeader) SetGasUsed(v int32) { + o.GasUsed = v +} + +// GetTimestamp returns the Timestamp field value +func (o *Web3BlockHeader) GetTimestamp() QuorumTransactionConfigFrom { + if o == nil { + var ret QuorumTransactionConfigFrom + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *Web3BlockHeader) GetTimestampOk() (*QuorumTransactionConfigFrom, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *Web3BlockHeader) SetTimestamp(v QuorumTransactionConfigFrom) { + o.Timestamp = v +} + +func (o Web3BlockHeader) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3BlockHeader) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["number"] = o.Number + toSerialize["hash"] = o.Hash + toSerialize["parentHash"] = o.ParentHash + toSerialize["nonce"] = o.Nonce + toSerialize["sha3Uncles"] = o.Sha3Uncles + toSerialize["logsBloom"] = o.LogsBloom + if !IsNil(o.TransactionsRoot) { + toSerialize["transactionsRoot"] = o.TransactionsRoot + } + toSerialize["stateRoot"] = o.StateRoot + if !IsNil(o.ReceiptsRoot) { + toSerialize["receiptsRoot"] = o.ReceiptsRoot + } + if !IsNil(o.Difficulty) { + toSerialize["difficulty"] = o.Difficulty + } + if !IsNil(o.MixHash) { + toSerialize["mixHash"] = o.MixHash + } + toSerialize["miner"] = o.Miner + toSerialize["extraData"] = o.ExtraData + toSerialize["gasLimit"] = o.GasLimit + toSerialize["gasUsed"] = o.GasUsed + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + +type NullableWeb3BlockHeader struct { + value *Web3BlockHeader + isSet bool +} + +func (v NullableWeb3BlockHeader) Get() *Web3BlockHeader { + return v.value +} + +func (v *NullableWeb3BlockHeader) Set(val *Web3BlockHeader) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3BlockHeader) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3BlockHeader) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3BlockHeader(val *Web3BlockHeader) *NullableWeb3BlockHeader { + return &NullableWeb3BlockHeader{value: val, isSet: true} +} + +func (v NullableWeb3BlockHeader) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3BlockHeader) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go new file mode 100644 index 00000000000..79b838d0373 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go @@ -0,0 +1,208 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredential - struct for Web3SigningCredential +type Web3SigningCredential struct { + Web3SigningCredentialCactusKeychainRef *Web3SigningCredentialCactusKeychainRef + Web3SigningCredentialGethKeychainPassword *Web3SigningCredentialGethKeychainPassword + Web3SigningCredentialNone *Web3SigningCredentialNone + Web3SigningCredentialPrivateKeyHex *Web3SigningCredentialPrivateKeyHex +} + +// Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialCactusKeychainRef wrapped in Web3SigningCredential +func Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential(v *Web3SigningCredentialCactusKeychainRef) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialCactusKeychainRef: v, + } +} + +// Web3SigningCredentialGethKeychainPasswordAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialGethKeychainPassword wrapped in Web3SigningCredential +func Web3SigningCredentialGethKeychainPasswordAsWeb3SigningCredential(v *Web3SigningCredentialGethKeychainPassword) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialGethKeychainPassword: v, + } +} + +// Web3SigningCredentialNoneAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialNone wrapped in Web3SigningCredential +func Web3SigningCredentialNoneAsWeb3SigningCredential(v *Web3SigningCredentialNone) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialNone: v, + } +} + +// Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialPrivateKeyHex wrapped in Web3SigningCredential +func Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential(v *Web3SigningCredentialPrivateKeyHex) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialPrivateKeyHex: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Web3SigningCredential) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Web3SigningCredentialCactusKeychainRef + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialCactusKeychainRef) + if err == nil { + jsonWeb3SigningCredentialCactusKeychainRef, _ := json.Marshal(dst.Web3SigningCredentialCactusKeychainRef) + if string(jsonWeb3SigningCredentialCactusKeychainRef) == "{}" { // empty struct + dst.Web3SigningCredentialCactusKeychainRef = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialCactusKeychainRef = nil + } + + // try to unmarshal data into Web3SigningCredentialGethKeychainPassword + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialGethKeychainPassword) + if err == nil { + jsonWeb3SigningCredentialGethKeychainPassword, _ := json.Marshal(dst.Web3SigningCredentialGethKeychainPassword) + if string(jsonWeb3SigningCredentialGethKeychainPassword) == "{}" { // empty struct + dst.Web3SigningCredentialGethKeychainPassword = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialGethKeychainPassword = nil + } + + // try to unmarshal data into Web3SigningCredentialNone + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialNone) + if err == nil { + jsonWeb3SigningCredentialNone, _ := json.Marshal(dst.Web3SigningCredentialNone) + if string(jsonWeb3SigningCredentialNone) == "{}" { // empty struct + dst.Web3SigningCredentialNone = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialNone = nil + } + + // try to unmarshal data into Web3SigningCredentialPrivateKeyHex + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialPrivateKeyHex) + if err == nil { + jsonWeb3SigningCredentialPrivateKeyHex, _ := json.Marshal(dst.Web3SigningCredentialPrivateKeyHex) + if string(jsonWeb3SigningCredentialPrivateKeyHex) == "{}" { // empty struct + dst.Web3SigningCredentialPrivateKeyHex = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialPrivateKeyHex = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Web3SigningCredentialCactusKeychainRef = nil + dst.Web3SigningCredentialGethKeychainPassword = nil + dst.Web3SigningCredentialNone = nil + dst.Web3SigningCredentialPrivateKeyHex = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Web3SigningCredential)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Web3SigningCredential)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Web3SigningCredential) MarshalJSON() ([]byte, error) { + if src.Web3SigningCredentialCactusKeychainRef != nil { + return json.Marshal(&src.Web3SigningCredentialCactusKeychainRef) + } + + if src.Web3SigningCredentialGethKeychainPassword != nil { + return json.Marshal(&src.Web3SigningCredentialGethKeychainPassword) + } + + if src.Web3SigningCredentialNone != nil { + return json.Marshal(&src.Web3SigningCredentialNone) + } + + if src.Web3SigningCredentialPrivateKeyHex != nil { + return json.Marshal(&src.Web3SigningCredentialPrivateKeyHex) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Web3SigningCredential) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Web3SigningCredentialCactusKeychainRef != nil { + return obj.Web3SigningCredentialCactusKeychainRef + } + + if obj.Web3SigningCredentialGethKeychainPassword != nil { + return obj.Web3SigningCredentialGethKeychainPassword + } + + if obj.Web3SigningCredentialNone != nil { + return obj.Web3SigningCredentialNone + } + + if obj.Web3SigningCredentialPrivateKeyHex != nil { + return obj.Web3SigningCredentialPrivateKeyHex + } + + // all schemas are nil + return nil +} + +type NullableWeb3SigningCredential struct { + value *Web3SigningCredential + isSet bool +} + +func (v NullableWeb3SigningCredential) Get() *Web3SigningCredential { + return v.value +} + +func (v *NullableWeb3SigningCredential) Set(val *Web3SigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredential(val *Web3SigningCredential) *NullableWeb3SigningCredential { + return &NullableWeb3SigningCredential{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go new file mode 100644 index 00000000000..32a3b4bd194 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go @@ -0,0 +1,210 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialCactusKeychainRef type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialCactusKeychainRef{} + +// Web3SigningCredentialCactusKeychainRef struct for Web3SigningCredentialCactusKeychainRef +type Web3SigningCredentialCactusKeychainRef struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + KeychainEntryKey string `json:"keychainEntryKey"` + // The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + KeychainId *string `json:"keychainId,omitempty"` +} + +// NewWeb3SigningCredentialCactusKeychainRef instantiates a new Web3SigningCredentialCactusKeychainRef 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialCactusKeychainRef(type_ Web3SigningCredentialType, ethAccount string, keychainEntryKey string) *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + this.Type = type_ + this.EthAccount = ethAccount + this.KeychainEntryKey = keychainEntryKey + return &this +} + +// NewWeb3SigningCredentialCactusKeychainRefWithDefaults instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialCactusKeychainRefWithDefaults() *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialCactusKeychainRef) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetKeychainEntryKey returns the KeychainEntryKey field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKey() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainEntryKey +} + +// GetKeychainEntryKeyOk returns a tuple with the KeychainEntryKey field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainEntryKey, true +} + +// SetKeychainEntryKey sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainEntryKey(v string) { + o.KeychainEntryKey = v +} + +// GetKeychainId returns the KeychainId field value if set, zero value otherwise. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainId() string { + if o == nil || IsNil(o.KeychainId) { + var ret string + return ret + } + return *o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainIdOk() (*string, bool) { + if o == nil || IsNil(o.KeychainId) { + return nil, false + } + return o.KeychainId, true +} + +// HasKeychainId returns a boolean if a field has been set. +func (o *Web3SigningCredentialCactusKeychainRef) HasKeychainId() bool { + if o != nil && !IsNil(o.KeychainId) { + return true + } + + return false +} + +// SetKeychainId gets a reference to the given string and assigns it to the KeychainId field. +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainId(v string) { + o.KeychainId = &v +} + +func (o Web3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialCactusKeychainRef) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["keychainEntryKey"] = o.KeychainEntryKey + if !IsNil(o.KeychainId) { + toSerialize["keychainId"] = o.KeychainId + } + return toSerialize, nil +} + +type NullableWeb3SigningCredentialCactusKeychainRef struct { + value *Web3SigningCredentialCactusKeychainRef + isSet bool +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) Get() *Web3SigningCredentialCactusKeychainRef { + return v.value +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Set(val *Web3SigningCredentialCactusKeychainRef) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialCactusKeychainRef(val *Web3SigningCredentialCactusKeychainRef) *NullableWeb3SigningCredentialCactusKeychainRef { + return &NullableWeb3SigningCredentialCactusKeychainRef{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_geth_keychain_password.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_geth_keychain_password.go new file mode 100644 index 00000000000..2f05b637a26 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_geth_keychain_password.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialGethKeychainPassword type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialGethKeychainPassword{} + +// Web3SigningCredentialGethKeychainPassword struct for Web3SigningCredentialGethKeychainPassword +type Web3SigningCredentialGethKeychainPassword struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // A geth keychain unlock password. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialGethKeychainPassword instantiates a new Web3SigningCredentialGethKeychainPassword 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialGethKeychainPassword(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialGethKeychainPassword { + this := Web3SigningCredentialGethKeychainPassword{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialGethKeychainPasswordWithDefaults instantiates a new Web3SigningCredentialGethKeychainPassword object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialGethKeychainPasswordWithDefaults() *Web3SigningCredentialGethKeychainPassword { + this := Web3SigningCredentialGethKeychainPassword{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialGethKeychainPassword) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialGethKeychainPassword) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialGethKeychainPassword) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialGethKeychainPassword) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialGethKeychainPassword) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialGethKeychainPassword) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialGethKeychainPassword) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialGethKeychainPassword) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialGethKeychainPassword) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialGethKeychainPassword) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialGethKeychainPassword) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialGethKeychainPassword struct { + value *Web3SigningCredentialGethKeychainPassword + isSet bool +} + +func (v NullableWeb3SigningCredentialGethKeychainPassword) Get() *Web3SigningCredentialGethKeychainPassword { + return v.value +} + +func (v *NullableWeb3SigningCredentialGethKeychainPassword) Set(val *Web3SigningCredentialGethKeychainPassword) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialGethKeychainPassword) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialGethKeychainPassword) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialGethKeychainPassword(val *Web3SigningCredentialGethKeychainPassword) *NullableWeb3SigningCredentialGethKeychainPassword { + return &NullableWeb3SigningCredentialGethKeychainPassword{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialGethKeychainPassword) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialGethKeychainPassword) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go new file mode 100644 index 00000000000..d2ac4508351 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialNone type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialNone{} + +// Web3SigningCredentialNone Using this denotes that there is no signing required because the transaction is pre-signed. +type Web3SigningCredentialNone struct { + Type Web3SigningCredentialType `json:"type"` +} + +// NewWeb3SigningCredentialNone instantiates a new Web3SigningCredentialNone 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialNone(type_ Web3SigningCredentialType) *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + this.Type = type_ + return &this +} + +// NewWeb3SigningCredentialNoneWithDefaults instantiates a new Web3SigningCredentialNone object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialNoneWithDefaults() *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialNone) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialNone) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialNone) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +func (o Web3SigningCredentialNone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialNone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableWeb3SigningCredentialNone struct { + value *Web3SigningCredentialNone + isSet bool +} + +func (v NullableWeb3SigningCredentialNone) Get() *Web3SigningCredentialNone { + return v.value +} + +func (v *NullableWeb3SigningCredentialNone) Set(val *Web3SigningCredentialNone) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialNone) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialNone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialNone(val *Web3SigningCredentialNone) *NullableWeb3SigningCredentialNone { + return &NullableWeb3SigningCredentialNone{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialNone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialNone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go new file mode 100644 index 00000000000..e5aa433dcd0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialPrivateKeyHex type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialPrivateKeyHex{} + +// Web3SigningCredentialPrivateKeyHex struct for Web3SigningCredentialPrivateKeyHex +type Web3SigningCredentialPrivateKeyHex struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The HEX encoded private key of an eth account. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialPrivateKeyHex instantiates a new Web3SigningCredentialPrivateKeyHex 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialPrivateKeyHex(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialPrivateKeyHexWithDefaults instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialPrivateKeyHexWithDefaults() *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialPrivateKeyHex) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialPrivateKeyHex) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialPrivateKeyHex) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialPrivateKeyHex struct { + value *Web3SigningCredentialPrivateKeyHex + isSet bool +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) Get() *Web3SigningCredentialPrivateKeyHex { + return v.value +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Set(val *Web3SigningCredentialPrivateKeyHex) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialPrivateKeyHex(val *Web3SigningCredentialPrivateKeyHex) *NullableWeb3SigningCredentialPrivateKeyHex { + return &NullableWeb3SigningCredentialPrivateKeyHex{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go new file mode 100644 index 00000000000..26814bc9c5b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredentialType the model 'Web3SigningCredentialType' +type Web3SigningCredentialType string + +// List of Web3SigningCredentialType +const ( + CACTUS_KEYCHAIN_REF Web3SigningCredentialType = "CACTUS_KEYCHAIN_REF" + GETH_KEYCHAIN_PASSWORD Web3SigningCredentialType = "GETH_KEYCHAIN_PASSWORD" + PRIVATE_KEY_HEX Web3SigningCredentialType = "PRIVATE_KEY_HEX" + NONE Web3SigningCredentialType = "NONE" +) + +// All allowed values of Web3SigningCredentialType enum +var AllowedWeb3SigningCredentialTypeEnumValues = []Web3SigningCredentialType{ + "CACTUS_KEYCHAIN_REF", + "GETH_KEYCHAIN_PASSWORD", + "PRIVATE_KEY_HEX", + "NONE", +} + +func (v *Web3SigningCredentialType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Web3SigningCredentialType(value) + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Web3SigningCredentialType", value) +} + +// NewWeb3SigningCredentialTypeFromValue returns a pointer to a valid Web3SigningCredentialType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWeb3SigningCredentialTypeFromValue(v string) (*Web3SigningCredentialType, error) { + ev := Web3SigningCredentialType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Web3SigningCredentialType: valid values are %v", v, AllowedWeb3SigningCredentialTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Web3SigningCredentialType) IsValid() bool { + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Web3SigningCredentialType value +func (v Web3SigningCredentialType) Ptr() *Web3SigningCredentialType { + return &v +} + +type NullableWeb3SigningCredentialType struct { + value *Web3SigningCredentialType + isSet bool +} + +func (v NullableWeb3SigningCredentialType) Get() *Web3SigningCredentialType { + return v.value +} + +func (v *NullableWeb3SigningCredentialType) Set(val *Web3SigningCredentialType) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialType) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialType(val *Web3SigningCredentialType) *NullableWeb3SigningCredentialType { + return &NullableWeb3SigningCredentialType{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_transaction.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_transaction.go new file mode 100644 index 00000000000..5366ab06224 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_transaction.go @@ -0,0 +1,503 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the Web3Transaction type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3Transaction{} + +// Web3Transaction struct for Web3Transaction +type Web3Transaction struct { + Hash string `json:"hash"` + Nonce float32 `json:"nonce"` + BlockHash NullableString `json:"blockHash"` + BlockNumber NullableFloat32 `json:"blockNumber"` + TransactionIndex NullableFloat32 `json:"transactionIndex"` + From string `json:"from"` + To NullableString `json:"to"` + Value string `json:"value"` + GasPrice string `json:"gasPrice"` + Gas float32 `json:"gas"` + Input string `json:"input"` + V *string `json:"v,omitempty"` + R *string `json:"r,omitempty"` + S *string `json:"s,omitempty"` +} + +// NewWeb3Transaction instantiates a new Web3Transaction 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 +// will change when the set of required properties is changed +func NewWeb3Transaction(hash string, nonce float32, blockHash NullableString, blockNumber NullableFloat32, transactionIndex NullableFloat32, from string, to NullableString, value string, gasPrice string, gas float32, input string) *Web3Transaction { + this := Web3Transaction{} + this.Hash = hash + this.Nonce = nonce + this.BlockHash = blockHash + this.BlockNumber = blockNumber + this.TransactionIndex = transactionIndex + this.From = from + this.To = to + this.Value = value + this.GasPrice = gasPrice + this.Gas = gas + this.Input = input + return &this +} + +// NewWeb3TransactionWithDefaults instantiates a new Web3Transaction object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3TransactionWithDefaults() *Web3Transaction { + this := Web3Transaction{} + return &this +} + +// GetHash returns the Hash field value +func (o *Web3Transaction) GetHash() string { + if o == nil { + var ret string + return ret + } + + return o.Hash +} + +// GetHashOk returns a tuple with the Hash field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *Web3Transaction) SetHash(v string) { + o.Hash = v +} + +// GetNonce returns the Nonce field value +func (o *Web3Transaction) GetNonce() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetNonceOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Nonce, true +} + +// SetNonce sets field value +func (o *Web3Transaction) SetNonce(v float32) { + o.Nonce = v +} + +// GetBlockHash returns the BlockHash field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Web3Transaction) GetBlockHash() string { + if o == nil || o.BlockHash.Get() == nil { + var ret string + return ret + } + + return *o.BlockHash.Get() +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3Transaction) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.BlockHash.Get(), o.BlockHash.IsSet() +} + +// SetBlockHash sets field value +func (o *Web3Transaction) SetBlockHash(v string) { + o.BlockHash.Set(&v) +} + +// GetBlockNumber returns the BlockNumber field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Web3Transaction) GetBlockNumber() float32 { + if o == nil || o.BlockNumber.Get() == nil { + var ret float32 + return ret + } + + return *o.BlockNumber.Get() +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3Transaction) GetBlockNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.BlockNumber.Get(), o.BlockNumber.IsSet() +} + +// SetBlockNumber sets field value +func (o *Web3Transaction) SetBlockNumber(v float32) { + o.BlockNumber.Set(&v) +} + +// GetTransactionIndex returns the TransactionIndex field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *Web3Transaction) GetTransactionIndex() float32 { + if o == nil || o.TransactionIndex.Get() == nil { + var ret float32 + return ret + } + + return *o.TransactionIndex.Get() +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3Transaction) GetTransactionIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.TransactionIndex.Get(), o.TransactionIndex.IsSet() +} + +// SetTransactionIndex sets field value +func (o *Web3Transaction) SetTransactionIndex(v float32) { + o.TransactionIndex.Set(&v) +} + +// GetFrom returns the From field value +func (o *Web3Transaction) GetFrom() string { + if o == nil { + var ret string + return ret + } + + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value +func (o *Web3Transaction) SetFrom(v string) { + o.From = v +} + +// GetTo returns the To field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Web3Transaction) GetTo() string { + if o == nil || o.To.Get() == nil { + var ret string + return ret + } + + return *o.To.Get() +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3Transaction) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.To.Get(), o.To.IsSet() +} + +// SetTo sets field value +func (o *Web3Transaction) SetTo(v string) { + o.To.Set(&v) +} + +// GetValue returns the Value field value +func (o *Web3Transaction) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *Web3Transaction) SetValue(v string) { + o.Value = v +} + +// GetGasPrice returns the GasPrice field value +func (o *Web3Transaction) GetGasPrice() string { + if o == nil { + var ret string + return ret + } + + return o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetGasPriceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GasPrice, true +} + +// SetGasPrice sets field value +func (o *Web3Transaction) SetGasPrice(v string) { + o.GasPrice = v +} + +// GetGas returns the Gas field value +func (o *Web3Transaction) GetGas() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Gas +} + +// GetGasOk returns a tuple with the Gas field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetGasOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Gas, true +} + +// SetGas sets field value +func (o *Web3Transaction) SetGas(v float32) { + o.Gas = v +} + +// GetInput returns the Input field value +func (o *Web3Transaction) GetInput() string { + if o == nil { + var ret string + return ret + } + + return o.Input +} + +// GetInputOk returns a tuple with the Input field value +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetInputOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Input, true +} + +// SetInput sets field value +func (o *Web3Transaction) SetInput(v string) { + o.Input = v +} + +// GetV returns the V field value if set, zero value otherwise. +func (o *Web3Transaction) GetV() string { + if o == nil || IsNil(o.V) { + var ret string + return ret + } + return *o.V +} + +// GetVOk returns a tuple with the V field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetVOk() (*string, bool) { + if o == nil || IsNil(o.V) { + return nil, false + } + return o.V, true +} + +// HasV returns a boolean if a field has been set. +func (o *Web3Transaction) HasV() bool { + if o != nil && !IsNil(o.V) { + return true + } + + return false +} + +// SetV gets a reference to the given string and assigns it to the V field. +func (o *Web3Transaction) SetV(v string) { + o.V = &v +} + +// GetR returns the R field value if set, zero value otherwise. +func (o *Web3Transaction) GetR() string { + if o == nil || IsNil(o.R) { + var ret string + return ret + } + return *o.R +} + +// GetROk returns a tuple with the R field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetROk() (*string, bool) { + if o == nil || IsNil(o.R) { + return nil, false + } + return o.R, true +} + +// HasR returns a boolean if a field has been set. +func (o *Web3Transaction) HasR() bool { + if o != nil && !IsNil(o.R) { + return true + } + + return false +} + +// SetR gets a reference to the given string and assigns it to the R field. +func (o *Web3Transaction) SetR(v string) { + o.R = &v +} + +// GetS returns the S field value if set, zero value otherwise. +func (o *Web3Transaction) GetS() string { + if o == nil || IsNil(o.S) { + var ret string + return ret + } + return *o.S +} + +// GetSOk returns a tuple with the S field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3Transaction) GetSOk() (*string, bool) { + if o == nil || IsNil(o.S) { + return nil, false + } + return o.S, true +} + +// HasS returns a boolean if a field has been set. +func (o *Web3Transaction) HasS() bool { + if o != nil && !IsNil(o.S) { + return true + } + + return false +} + +// SetS gets a reference to the given string and assigns it to the S field. +func (o *Web3Transaction) SetS(v string) { + o.S = &v +} + +func (o Web3Transaction) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3Transaction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["hash"] = o.Hash + toSerialize["nonce"] = o.Nonce + toSerialize["blockHash"] = o.BlockHash.Get() + toSerialize["blockNumber"] = o.BlockNumber.Get() + toSerialize["transactionIndex"] = o.TransactionIndex.Get() + toSerialize["from"] = o.From + toSerialize["to"] = o.To.Get() + toSerialize["value"] = o.Value + toSerialize["gasPrice"] = o.GasPrice + toSerialize["gas"] = o.Gas + toSerialize["input"] = o.Input + if !IsNil(o.V) { + toSerialize["v"] = o.V + } + if !IsNil(o.R) { + toSerialize["r"] = o.R + } + if !IsNil(o.S) { + toSerialize["s"] = o.S + } + return toSerialize, nil +} + +type NullableWeb3Transaction struct { + value *Web3Transaction + isSet bool +} + +func (v NullableWeb3Transaction) Get() *Web3Transaction { + return v.value +} + +func (v *NullableWeb3Transaction) Set(val *Web3Transaction) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3Transaction) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3Transaction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3Transaction(val *Web3Transaction) *NullableWeb3Transaction { + return &NullableWeb3Transaction{value: val, isSet: true} +} + +func (v NullableWeb3Transaction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3Transaction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go new file mode 100644 index 00000000000..5a18ae675ec --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go @@ -0,0 +1,607 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" +) + +// checks if the Web3TransactionReceipt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3TransactionReceipt{} + +// Web3TransactionReceipt struct for Web3TransactionReceipt +type Web3TransactionReceipt struct { + Status bool `json:"status"` + TransactionHash string `json:"transactionHash"` + TransactionIndex float32 `json:"transactionIndex"` + BlockHash string `json:"blockHash"` + BlockNumber float32 `json:"blockNumber"` + GasUsed float32 `json:"gasUsed"` + ContractAddress NullableString `json:"contractAddress,omitempty"` + From string `json:"from"` + To string `json:"to"` + Logs []interface{} `json:"logs,omitempty"` + LogsBloom *string `json:"logsBloom,omitempty"` + RevertReason *string `json:"revertReason,omitempty"` + Output *string `json:"output,omitempty"` + CommitmentHash *string `json:"commitmentHash,omitempty"` + CumulativeGasUSed *float32 `json:"cumulativeGasUSed,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Web3TransactionReceipt Web3TransactionReceipt + +// NewWeb3TransactionReceipt instantiates a new Web3TransactionReceipt 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 +// will change when the set of required properties is changed +func NewWeb3TransactionReceipt(status bool, transactionHash string, transactionIndex float32, blockHash string, blockNumber float32, gasUsed float32, from string, to string) *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + this.Status = status + this.TransactionHash = transactionHash + this.TransactionIndex = transactionIndex + this.BlockHash = blockHash + this.BlockNumber = blockNumber + this.GasUsed = gasUsed + this.From = from + this.To = to + return &this +} + +// NewWeb3TransactionReceiptWithDefaults instantiates a new Web3TransactionReceipt object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3TransactionReceiptWithDefaults() *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + return &this +} + +// GetStatus returns the Status field value +func (o *Web3TransactionReceipt) GetStatus() bool { + if o == nil { + var ret bool + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetStatusOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Web3TransactionReceipt) SetStatus(v bool) { + o.Status = v +} + +// GetTransactionHash returns the TransactionHash field value +func (o *Web3TransactionReceipt) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *Web3TransactionReceipt) SetTransactionHash(v string) { + o.TransactionHash = v +} + +// GetTransactionIndex returns the TransactionIndex field value +func (o *Web3TransactionReceipt) GetTransactionIndex() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TransactionIndex, true +} + +// SetTransactionIndex sets field value +func (o *Web3TransactionReceipt) SetTransactionIndex(v float32) { + o.TransactionIndex = v +} + +// GetBlockHash returns the BlockHash field value +func (o *Web3TransactionReceipt) GetBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *Web3TransactionReceipt) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetBlockNumber returns the BlockNumber field value +func (o *Web3TransactionReceipt) GetBlockNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *Web3TransactionReceipt) SetBlockNumber(v float32) { + o.BlockNumber = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3TransactionReceipt) GetGasUsed() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetGasUsedOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3TransactionReceipt) SetGasUsed(v float32) { + o.GasUsed = v +} + +// GetContractAddress returns the ContractAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Web3TransactionReceipt) GetContractAddress() string { + if o == nil || IsNil(o.ContractAddress.Get()) { + var ret string + return ret + } + return *o.ContractAddress.Get() +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3TransactionReceipt) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ContractAddress.Get(), o.ContractAddress.IsSet() +} + +// HasContractAddress returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasContractAddress() bool { + if o != nil && o.ContractAddress.IsSet() { + return true + } + + return false +} + +// SetContractAddress gets a reference to the given NullableString and assigns it to the ContractAddress field. +func (o *Web3TransactionReceipt) SetContractAddress(v string) { + o.ContractAddress.Set(&v) +} +// SetContractAddressNil sets the value for ContractAddress to be an explicit nil +func (o *Web3TransactionReceipt) SetContractAddressNil() { + o.ContractAddress.Set(nil) +} + +// UnsetContractAddress ensures that no value is present for ContractAddress, not even an explicit nil +func (o *Web3TransactionReceipt) UnsetContractAddress() { + o.ContractAddress.Unset() +} + +// GetFrom returns the From field value +func (o *Web3TransactionReceipt) GetFrom() string { + if o == nil { + var ret string + return ret + } + + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value +func (o *Web3TransactionReceipt) SetFrom(v string) { + o.From = v +} + +// GetTo returns the To field value +func (o *Web3TransactionReceipt) GetTo() string { + if o == nil { + var ret string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *Web3TransactionReceipt) SetTo(v string) { + o.To = v +} + +// GetLogs returns the Logs field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetLogs() []interface{} { + if o == nil || IsNil(o.Logs) { + var ret []interface{} + return ret + } + return o.Logs +} + +// GetLogsOk returns a tuple with the Logs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetLogsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Logs) { + return nil, false + } + return o.Logs, true +} + +// HasLogs returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasLogs() bool { + if o != nil && !IsNil(o.Logs) { + return true + } + + return false +} + +// SetLogs gets a reference to the given []interface{} and assigns it to the Logs field. +func (o *Web3TransactionReceipt) SetLogs(v []interface{}) { + o.Logs = v +} + +// GetLogsBloom returns the LogsBloom field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetLogsBloom() string { + if o == nil || IsNil(o.LogsBloom) { + var ret string + return ret + } + return *o.LogsBloom +} + +// GetLogsBloomOk returns a tuple with the LogsBloom field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetLogsBloomOk() (*string, bool) { + if o == nil || IsNil(o.LogsBloom) { + return nil, false + } + return o.LogsBloom, true +} + +// HasLogsBloom returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasLogsBloom() bool { + if o != nil && !IsNil(o.LogsBloom) { + return true + } + + return false +} + +// SetLogsBloom gets a reference to the given string and assigns it to the LogsBloom field. +func (o *Web3TransactionReceipt) SetLogsBloom(v string) { + o.LogsBloom = &v +} + +// GetRevertReason returns the RevertReason field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetRevertReason() string { + if o == nil || IsNil(o.RevertReason) { + var ret string + return ret + } + return *o.RevertReason +} + +// GetRevertReasonOk returns a tuple with the RevertReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetRevertReasonOk() (*string, bool) { + if o == nil || IsNil(o.RevertReason) { + return nil, false + } + return o.RevertReason, true +} + +// HasRevertReason returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasRevertReason() bool { + if o != nil && !IsNil(o.RevertReason) { + return true + } + + return false +} + +// SetRevertReason gets a reference to the given string and assigns it to the RevertReason field. +func (o *Web3TransactionReceipt) SetRevertReason(v string) { + o.RevertReason = &v +} + +// GetOutput returns the Output field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetOutput() string { + if o == nil || IsNil(o.Output) { + var ret string + return ret + } + return *o.Output +} + +// GetOutputOk returns a tuple with the Output field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetOutputOk() (*string, bool) { + if o == nil || IsNil(o.Output) { + return nil, false + } + return o.Output, true +} + +// HasOutput returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasOutput() bool { + if o != nil && !IsNil(o.Output) { + return true + } + + return false +} + +// SetOutput gets a reference to the given string and assigns it to the Output field. +func (o *Web3TransactionReceipt) SetOutput(v string) { + o.Output = &v +} + +// GetCommitmentHash returns the CommitmentHash field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetCommitmentHash() string { + if o == nil || IsNil(o.CommitmentHash) { + var ret string + return ret + } + return *o.CommitmentHash +} + +// GetCommitmentHashOk returns a tuple with the CommitmentHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetCommitmentHashOk() (*string, bool) { + if o == nil || IsNil(o.CommitmentHash) { + return nil, false + } + return o.CommitmentHash, true +} + +// HasCommitmentHash returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasCommitmentHash() bool { + if o != nil && !IsNil(o.CommitmentHash) { + return true + } + + return false +} + +// SetCommitmentHash gets a reference to the given string and assigns it to the CommitmentHash field. +func (o *Web3TransactionReceipt) SetCommitmentHash(v string) { + o.CommitmentHash = &v +} + +// GetCumulativeGasUSed returns the CumulativeGasUSed field value if set, zero value otherwise. +func (o *Web3TransactionReceipt) GetCumulativeGasUSed() float32 { + if o == nil || IsNil(o.CumulativeGasUSed) { + var ret float32 + return ret + } + return *o.CumulativeGasUSed +} + +// GetCumulativeGasUSedOk returns a tuple with the CumulativeGasUSed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetCumulativeGasUSedOk() (*float32, bool) { + if o == nil || IsNil(o.CumulativeGasUSed) { + return nil, false + } + return o.CumulativeGasUSed, true +} + +// HasCumulativeGasUSed returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasCumulativeGasUSed() bool { + if o != nil && !IsNil(o.CumulativeGasUSed) { + return true + } + + return false +} + +// SetCumulativeGasUSed gets a reference to the given float32 and assigns it to the CumulativeGasUSed field. +func (o *Web3TransactionReceipt) SetCumulativeGasUSed(v float32) { + o.CumulativeGasUSed = &v +} + +func (o Web3TransactionReceipt) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3TransactionReceipt) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + toSerialize["transactionHash"] = o.TransactionHash + toSerialize["transactionIndex"] = o.TransactionIndex + toSerialize["blockHash"] = o.BlockHash + toSerialize["blockNumber"] = o.BlockNumber + toSerialize["gasUsed"] = o.GasUsed + if o.ContractAddress.IsSet() { + toSerialize["contractAddress"] = o.ContractAddress.Get() + } + toSerialize["from"] = o.From + toSerialize["to"] = o.To + if !IsNil(o.Logs) { + toSerialize["logs"] = o.Logs + } + if !IsNil(o.LogsBloom) { + toSerialize["logsBloom"] = o.LogsBloom + } + if !IsNil(o.RevertReason) { + toSerialize["revertReason"] = o.RevertReason + } + if !IsNil(o.Output) { + toSerialize["output"] = o.Output + } + if !IsNil(o.CommitmentHash) { + toSerialize["commitmentHash"] = o.CommitmentHash + } + if !IsNil(o.CumulativeGasUSed) { + toSerialize["cumulativeGasUSed"] = o.CumulativeGasUSed + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Web3TransactionReceipt) UnmarshalJSON(bytes []byte) (err error) { + varWeb3TransactionReceipt := _Web3TransactionReceipt{} + + if err = json.Unmarshal(bytes, &varWeb3TransactionReceipt); err == nil { + *o = Web3TransactionReceipt(varWeb3TransactionReceipt) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "status") + delete(additionalProperties, "transactionHash") + delete(additionalProperties, "transactionIndex") + delete(additionalProperties, "blockHash") + delete(additionalProperties, "blockNumber") + delete(additionalProperties, "gasUsed") + delete(additionalProperties, "contractAddress") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + delete(additionalProperties, "logs") + delete(additionalProperties, "logsBloom") + delete(additionalProperties, "revertReason") + delete(additionalProperties, "output") + delete(additionalProperties, "commitmentHash") + delete(additionalProperties, "cumulativeGasUSed") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWeb3TransactionReceipt struct { + value *Web3TransactionReceipt + isSet bool +} + +func (v NullableWeb3TransactionReceipt) Get() *Web3TransactionReceipt { + return v.value +} + +func (v *NullableWeb3TransactionReceipt) Set(val *Web3TransactionReceipt) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3TransactionReceipt) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3TransactionReceipt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3TransactionReceipt(val *Web3TransactionReceipt) *NullableWeb3TransactionReceipt { + return &NullableWeb3TransactionReceipt{value: val, isSet: true} +} + +func (v NullableWeb3TransactionReceipt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3TransactionReceipt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..e96a29d7965 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..9d17e9739f5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,121 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-ledger-connector-quorum + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-ledger-connector-quorum_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService DeployContractSolBytecodeJsonObjectV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeployContractSolBytecodeJsonObjectV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService DeployContractSolBytecodeV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeployContractSolBytecodeV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPrometheusMetricsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPrometheusMetricsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeContractV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeContractV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeContractV1NoKeychain", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeContractV1NoKeychain(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeRawWeb3EthContractV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeRawWeb3EthContractV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeWeb3EthMethodV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeWeb3EthMethodV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RunTransactionV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.RunTransactionV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..277f3183f6e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Connector Quorum + +Can perform basic tasks on a Quorum ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-quorum + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..f67a3cab33f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - Connector Quorum + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..bb355ad0207 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,104 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/ContractJSON.java +src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1Request.java +src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java +src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java +src/main/java/org/openapitools/client/model/EthContractInvocationType.java +src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java +src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java +src/main/java/org/openapitools/client/model/InvokeContractV1Request.java +src/main/java/org/openapitools/client/model/InvokeContractV1Response.java +src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java +src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java +src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java +src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java +src/main/java/org/openapitools/client/model/QuorumPrivateTransactionConfig.java +src/main/java/org/openapitools/client/model/QuorumTransactionConfig.java +src/main/java/org/openapitools/client/model/QuorumTransactionConfigFrom.java +src/main/java/org/openapitools/client/model/QuorumTransactionConfigTo.java +src/main/java/org/openapitools/client/model/RunTransactionRequest.java +src/main/java/org/openapitools/client/model/RunTransactionResponse.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java +src/main/java/org/openapitools/client/model/WatchBlocksV1.java +src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java +src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java +src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java +src/main/java/org/openapitools/client/model/Web3BlockHeader.java +src/main/java/org/openapitools/client/model/Web3SigningCredential.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java +src/main/java/org/openapitools/client/model/Web3Transaction.java +src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/ContractJSONTest.java +src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1RequestTest.java +src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java +src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java +src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java +src/test/java/org/openapitools/client/model/EthContractInvocationWeb3MethodTest.java +src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java +src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java +src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java +src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1RequestTest.java +src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1ResponseTest.java +src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1RequestTest.java +src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1ResponseTest.java +src/test/java/org/openapitools/client/model/QuorumPrivateTransactionConfigTest.java +src/test/java/org/openapitools/client/model/QuorumTransactionConfigFromTest.java +src/test/java/org/openapitools/client/model/QuorumTransactionConfigTest.java +src/test/java/org/openapitools/client/model/QuorumTransactionConfigToTest.java +src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java +src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java +src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java +src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java +src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java +src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java +src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPasswordTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java +src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java +src/test/java/org/openapitools/client/model/Web3TransactionTest.java diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..4fca79b01d6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,179 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Connector Quorum +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a Quorum ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request = new DeployContractSolidityBytecodeJsonObjectV1Request(); // DeployContractSolidityBytecodeJsonObjectV1Request | + try { + DeployContractSolidityBytecodeV1Response result = apiInstance.deployContractSolBytecodeJsonObjectV1(deployContractSolidityBytecodeJsonObjectV1Request); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deployContractSolBytecodeJsonObjectV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deployContractSolBytecodeJsonObjectV1**](docs/DefaultApi.md#deployContractSolBytecodeJsonObjectV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**deployContractSolBytecodeV1**](docs/DefaultApi.md#deployContractSolBytecodeV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**invokeContractV1**](docs/DefaultApi.md#invokeContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract | Invokes a contract on a besu ledger +*DefaultApi* | [**invokeContractV1NoKeychain**](docs/DefaultApi.md#invokeContractV1NoKeychain) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object | Invokes a contract on a besu ledger +*DefaultApi* | [**invokeRawWeb3EthContractV1**](docs/DefaultApi.md#invokeRawWeb3EthContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract | Low-level endpoint to invoke a method on deployed contract. +*DefaultApi* | [**invokeWeb3EthMethodV1**](docs/DefaultApi.md#invokeWeb3EthMethodV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method | Invoke any method from web3.eth (low-level) +*DefaultApi* | [**runTransactionV1**](docs/DefaultApi.md#runTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction | Executes a transaction on a quorum ledger + + +## Documentation for Models + + - [ContractJSON](docs/ContractJSON.md) + - [DeployContractSolidityBytecodeJsonObjectV1Request](docs/DeployContractSolidityBytecodeJsonObjectV1Request.md) + - [DeployContractSolidityBytecodeV1Request](docs/DeployContractSolidityBytecodeV1Request.md) + - [DeployContractSolidityBytecodeV1Response](docs/DeployContractSolidityBytecodeV1Response.md) + - [EthContractInvocationType](docs/EthContractInvocationType.md) + - [EthContractInvocationWeb3Method](docs/EthContractInvocationWeb3Method.md) + - [InvokeContractJsonObjectV1Request](docs/InvokeContractJsonObjectV1Request.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [InvokeRawWeb3EthContractV1Request](docs/InvokeRawWeb3EthContractV1Request.md) + - [InvokeRawWeb3EthContractV1Response](docs/InvokeRawWeb3EthContractV1Response.md) + - [InvokeRawWeb3EthMethodV1Request](docs/InvokeRawWeb3EthMethodV1Request.md) + - [InvokeRawWeb3EthMethodV1Response](docs/InvokeRawWeb3EthMethodV1Response.md) + - [QuorumPrivateTransactionConfig](docs/QuorumPrivateTransactionConfig.md) + - [QuorumTransactionConfig](docs/QuorumTransactionConfig.md) + - [QuorumTransactionConfigFrom](docs/QuorumTransactionConfigFrom.md) + - [QuorumTransactionConfigTo](docs/QuorumTransactionConfigTo.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [SolidityContractJsonArtifact](docs/SolidityContractJsonArtifact.md) + - [SolidityContractJsonArtifactCompiler](docs/SolidityContractJsonArtifactCompiler.md) + - [SolidityContractJsonArtifactGasEstimates](docs/SolidityContractJsonArtifactGasEstimates.md) + - [SolidityContractJsonArtifactGasEstimatesCreation](docs/SolidityContractJsonArtifactGasEstimatesCreation.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WatchBlocksV1BlockData](docs/WatchBlocksV1BlockData.md) + - [WatchBlocksV1Options](docs/WatchBlocksV1Options.md) + - [WatchBlocksV1Progress](docs/WatchBlocksV1Progress.md) + - [Web3BlockHeader](docs/Web3BlockHeader.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialGethKeychainPassword](docs/Web3SigningCredentialGethKeychainPassword.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3Transaction](docs/Web3Transaction.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..c13afcd575a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,1304 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Quorum ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Quorum + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode: + post: + operationId: deployContractSolBytecodeV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object: + post: + operationId: deployContractSolBytecodeJsonObjectV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionResponse' + description: OK + summary: Executes a transaction on a quorum ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a besu ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object: + post: + operationId: invokeContractV1NoKeychain + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a besu ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics + x-accepts: text/plain + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method: + post: + operationId: invokeWeb3EthMethodV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthMethodV1Request' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthMethodV1Response' + description: OK + summary: Invoke any method from web3.eth (low-level) + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method + x-content-type: application/json + x-accepts: text/plain + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract: + post: + operationId: invokeRawWeb3EthContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthContractV1Request' + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/InvokeRawWeb3EthContractV1Response' + description: OK + summary: Low-level endpoint to invoke a method on deployed contract. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract + x-content-type: application/json + x-accepts: text/plain +components: + schemas: + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialGethKeychainPassword' + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialGethKeychainPassword: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + secret: + description: A geth keychain unlock password. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - type + type: object + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 66 + minLength: 66 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + EthContractInvocationType: + enum: + - SEND + - CALL + type: string + EthContractInvocationWeb3Method: + enum: + - send + - call + - encodeABI + - estimateGas + type: string + SolidityContractJsonArtifact: + properties: + contractName: + nullable: false + type: string + metadata: + nullable: false + type: string + bytecode: + nullable: false + type: string + deployedBytecode: + nullable: false + type: string + sourceMap: + nullable: false + type: string + deployedSourceMap: + nullable: false + type: string + sourcePath: + type: string + compiler: + $ref: '#/components/schemas/SolidityContractJsonArtifact_compiler' + functionHashes: + additionalProperties: true + type: object + gasEstimates: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates' + required: + - contractName + type: object + QuorumTransactionConfig: + additionalProperties: true + example: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + rawTransaction: + nullable: false + type: string + from: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + to: + $ref: '#/components/schemas/QuorumTransactionConfig_to' + value: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gas: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + nonce: + type: number + data: + $ref: '#/components/schemas/QuorumTransactionConfig_to' + type: object + QuorumPrivateTransactionConfig: + example: + gasLimit: 7.061401241503109 + privateKey: privateKey + privateFrom: privateFrom + privacyGroupId: privacyGroupId + privateFor: + - "" + - "" + isPrivate: false + gasPrice: 2.3021358869347655 + properties: + privateFrom: + nullable: false + type: string + privateFor: + default: [] + items: {} + nullable: false + type: array + isPrivate: + default: false + nullable: false + type: boolean + gasPrice: + nullable: false + type: number + gasLimit: + nullable: false + type: number + privateKey: + nullable: false + type: string + privacyGroupId: + nullable: false + type: string + required: + - privateFor + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + commitmentHash: commitmentHash + transactionHash: transactionHash + output: output + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + cumulativeGasUSed: 5.962133916683182 + from: from + to: to + revertReason: revertReason + logs: + - "" + - "" + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + logs: + default: [] + items: {} + nullable: false + type: array + logsBloom: + nullable: false + type: string + revertReason: + nullable: false + type: string + output: + nullable: false + type: string + commitmentHash: + nullable: false + type: string + cumulativeGasUSed: + nullable: false + type: number + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + ContractJSON: + additionalProperties: true + example: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + contractName: + nullable: false + type: string + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + abi: + description: "The application binary interface of the solidity contract,\ + \ optional parameter" + items: {} + nullable: false + type: array + metadata: + type: string + deployedBytecode: + type: string + sourceMap: + type: string + deployedSourceMap: + type: string + sourcePath: + type: string + compiler: + type: object + networks: + type: object + ast: + type: object + functionHashes: + type: object + gasEstimates: + type: object + required: + - bytecode + - contractName + type: object + RunTransactionRequest: + additionalProperties: false + example: + privateTransactionConfig: + gasLimit: 7.061401241503109 + privateKey: privateKey + privateFrom: privateFrom + privacyGroupId: privacyGroupId + privateFor: + - "" + - "" + isPrivate: false + gasPrice: 2.3021358869347655 + timeoutMs: 0.6027456183070403 + transactionConfig: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + web3SigningCredential: + type: null + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + transactionConfig: + $ref: '#/components/schemas/QuorumTransactionConfig' + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with thehash of the transaction(which indicates successful execution) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + privateTransactionConfig: + $ref: '#/components/schemas/QuorumPrivateTransactionConfig' + required: + - transactionConfig + - web3SigningCredential + type: object + RunTransactionResponse: + example: + transactionReceipt: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + commitmentHash: commitmentHash + transactionHash: transactionHash + output: output + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + cumulativeGasUSed: 5.962133916683182 + from: from + to: to + revertReason: revertReason + logs: + - "" + - "" + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractSolidityBytecodeV1Request: + additionalProperties: false + example: + bytecode: bytecode + privateTransactionConfig: + gasLimit: 7.061401241503109 + privateKey: privateKey + privateFrom: privateFrom + privacyGroupId: privacyGroupId + privateFor: + - "" + - "" + isPrivate: false + gasPrice: 2.3021358869347655 + constructorArgs: + - "" + - "" + nonce: 1.4658129805029452 + keychainId: keychainId + timeoutMs: 0.5637376656633328 + contractAbi: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + contractName: contractName + value: 5.962133916683182 + gasPrice: 6.027456183070403 + contractJSON: "{}" + properties: + contractName: + description: The contract name for retrieve the contracts json on the keychain. + maxLength: 100 + minLength: 1 + nullable: false + type: string + contractAbi: + description: The application binary interface of the solidity contract + items: {} + nullable: false + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: number + nonce: + nullable: false + type: number + value: + nullable: false + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + contractJSON: + description: "For use when not using keychain, pass the contract in as this\ + \ variable" + nullable: false + type: object + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + privateTransactionConfig: + $ref: '#/components/schemas/QuorumPrivateTransactionConfig' + required: + - contractName + - keychainId + - web3SigningCredential + type: object + DeployContractSolidityBytecodeV1Response: + example: + transactionReceipt: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + commitmentHash: commitmentHash + transactionHash: transactionHash + output: output + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + cumulativeGasUSed: 5.962133916683182 + from: from + to: to + revertReason: revertReason + logs: + - "" + - "" + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractSolidityBytecodeJsonObjectV1Request: + additionalProperties: false + example: + timeoutMs: 0.6027456183070403 + constructorArgs: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + gasPrice: gasPrice + contractJSON: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: string + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + required: + - contractJSON + - web3SigningCredential + type: object + InvokeContractV1Request: + additionalProperties: false + example: + invocationType: null + keychainId: keychainId + timeoutMs: 0.6027456183070403 + gas: null + web3SigningCredential: + type: null + methodName: methodName + contractName: contractName + params: + - "" + - "" + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + contractName: + description: The contract name to find it in the keychain plugin + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + value: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gas: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + type: string + required: + - contractName + - invocationType + - keychainId + - methodName + - params + - web3SigningCredential + type: object + InvokeContractJsonObjectV1Request: + additionalProperties: false + example: + invocationType: null + privateTransactionConfig: + gasLimit: 7.061401241503109 + privateKey: privateKey + privateFrom: privateFrom + privacyGroupId: privacyGroupId + privateFor: + - "" + - "" + isPrivate: false + gasPrice: 2.3021358869347655 + timeoutMs: 0.6027456183070403 + gas: null + web3SigningCredential: + type: null + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + value: null + nonce: 0.8008281904610115 + gasPrice: null + contractJSON: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + contractAddress: + description: Address of the solidity contract + nullable: false + type: string + value: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gas: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + privateTransactionConfig: + $ref: '#/components/schemas/QuorumPrivateTransactionConfig' + required: + - contractAddress + - contractJSON + - invocationType + - methodName + - params + - web3SigningCredential + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + logsBloom: logsBloom + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + commitmentHash: commitmentHash + transactionHash: transactionHash + output: output + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + cumulativeGasUSed: 5.962133916683182 + from: from + to: to + revertReason: revertReason + logs: + - "" + - "" + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + InvokeRawWeb3EthMethodV1Request: + additionalProperties: false + example: + methodName: methodName + params: + - "" + - "" + properties: + methodName: + description: The name of the web3.eth method to invoke + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass to web3.eth method specified + in methodName + items: {} + type: array + required: + - methodName + type: object + InvokeRawWeb3EthMethodV1Response: + additionalProperties: false + properties: + status: + description: Status code of the operation + nullable: false + type: number + data: + description: Output of requested web3.eth method + errorDetail: + description: Error details + nullable: false + type: string + required: + - status + type: object + InvokeRawWeb3EthContractV1Request: + additionalProperties: false + example: + invocationType: null + address: address + abi: + - "" + - "" + contractMethodArgs: + - "" + - "" + contractMethod: contractMethod + invocationParams: "{}" + properties: + abi: + description: The application binary interface of the solidity contract + items: {} + type: array + address: + description: Deployed solidity contract address + type: string + invocationType: + $ref: '#/components/schemas/EthContractInvocationWeb3Method' + invocationParams: + default: {} + description: "The list of arguments for contract invocation method (send,\ + \ call, etc...)" + type: object + contractMethod: + description: Method of deployed solidity contract to execute + type: string + contractMethodArgs: + default: [] + description: The list of arguments for deployed solidity contract method + items: {} + type: array + required: + - abi + - address + - contractMethod + - invocationType + type: object + InvokeRawWeb3EthContractV1Response: + additionalProperties: false + properties: + status: + description: Status code of the operation + type: number + data: + description: Output of contract invocation method + errorDetail: + description: Error details + type: string + required: + - status + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + WatchBlocksV1: + enum: + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Subscribe + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Next + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Unsubscribe + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Error + - org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + WatchBlocksV1Options: + properties: + getBlockData: + type: boolean + type: object + Web3BlockHeader: + properties: + number: + type: number + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionsRoot: + type: string + stateRoot: + type: string + receiptsRoot: + type: string + difficulty: + type: string + mixHash: + type: string + miner: + type: string + extraData: + type: string + gasLimit: + type: integer + gasUsed: + type: integer + timestamp: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + required: + - extraData + - gasLimit + - gasUsed + - hash + - logsBloom + - miner + - nonce + - number + - parentHash + - receiptRoot + - sha3Uncles + - stateRoot + - timestamp + - transactionRoot + type: object + Web3Transaction: + properties: + hash: + type: string + nonce: + type: number + blockHash: + nullable: true + type: string + blockNumber: + nullable: true + type: number + transactionIndex: + nullable: true + type: number + from: + type: string + to: + nullable: true + type: string + value: + type: string + gasPrice: + type: string + gas: + type: number + input: + type: string + v: + type: string + r: + type: string + s: + type: string + required: + - blockHash + - blockNumber + - from + - gas + - gasPrice + - hash + - input + - nonce + - to + - transactionIndex + - value + type: object + WatchBlocksV1BlockData: + properties: + number: + type: number + hash: + type: string + parentHash: + type: string + nonce: + type: string + sha3Uncles: + type: string + logsBloom: + type: string + transactionsRoot: + type: string + stateRoot: + type: string + receiptsRoot: + type: string + difficulty: + type: string + mixHash: + type: string + miner: + type: string + extraData: + type: string + gasLimit: + type: integer + gasUsed: + type: integer + timestamp: + $ref: '#/components/schemas/QuorumTransactionConfig_from' + size: + type: number + totalDifficulty: + type: string + uncles: + items: + type: string + type: array + transactions: + items: + $ref: '#/components/schemas/Web3Transaction' + type: array + required: + - extraData + - gasLimit + - gasUsed + - hash + - logsBloom + - miner + - nonce + - number + - parentHash + - receiptRoot + - sha3Uncles + - size + - stateRoot + - timestamp + - totalDifficulty + - transactionRoot + - transactions + - uncles + type: object + WatchBlocksV1Progress: + properties: + blockHeader: + $ref: '#/components/schemas/Web3BlockHeader' + blockData: + $ref: '#/components/schemas/WatchBlocksV1BlockData' + type: object + SolidityContractJsonArtifact_compiler: + additionalProperties: true + properties: + name: + type: string + version: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates_creation: + properties: + codeDepositCost: + type: string + executionCost: + type: string + totalCost: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates: + properties: + creation: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates_creation' + external: + additionalProperties: true + type: object + QuorumTransactionConfig_from: + oneOf: + - type: string + - type: number + QuorumTransactionConfig_to: + oneOf: + - type: string + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..f2dfad48005 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..bd3e523d949 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..a6a18ca1abc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..918f0cd5f5d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..e41eab4f231 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..6bce8e29764 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..21c8b47f185 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,445 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(org.openapitools.client.model.Web3SigningCredential.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Web3SigningCredentialCactusKeychainRef", org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.class); + classByDiscriminatorValue.put("Web3SigningCredentialGethKeychainPassword", org.openapitools.client.model.Web3SigningCredentialGethKeychainPassword.class); + classByDiscriminatorValue.put("Web3SigningCredentialNone", org.openapitools.client.model.Web3SigningCredentialNone.class); + classByDiscriminatorValue.put("Web3SigningCredentialPrivateKeyHex", org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.class); + classByDiscriminatorValue.put("Web3SigningCredential", org.openapitools.client.model.Web3SigningCredential.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) + ; + 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; + } + + { + 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.ContractJSON.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractSolidityBytecodeJsonObjectV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractSolidityBytecodeV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractSolidityBytecodeV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractJsonObjectV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRawWeb3EthContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRawWeb3EthContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRawWeb3EthMethodV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRawWeb3EthMethodV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.QuorumPrivateTransactionConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.QuorumTransactionConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.QuorumTransactionConfigFrom.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.QuorumTransactionConfigTo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifact.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactCompiler.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1BlockData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1Options.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1Progress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3BlockHeader.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialGethKeychainPassword.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialNone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3Transaction.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3TransactionReceipt.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); + } + } + } + + /** + * 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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..f7d877ad2b9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..9b9f84d5403 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..24314903bf7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..64d87d20aec --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..2c8909609ae --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,1026 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeployContractSolidityBytecodeJsonObjectV1Request; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Request; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Response; +import org.openapitools.client.model.InvokeContractJsonObjectV1Request; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.InvokeRawWeb3EthContractV1Request; +import org.openapitools.client.model.InvokeRawWeb3EthContractV1Response; +import org.openapitools.client.model.InvokeRawWeb3EthMethodV1Request; +import org.openapitools.client.model.InvokeRawWeb3EthMethodV1Response; +import org.openapitools.client.model.RunTransactionRequest; +import org.openapitools.client.model.RunTransactionResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 deployContractSolBytecodeJsonObjectV1 + * @param deployContractSolidityBytecodeJsonObjectV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractSolBytecodeJsonObjectV1Call(DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractSolidityBytecodeJsonObjectV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode-json-object"; + + 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 deployContractSolBytecodeJsonObjectV1ValidateBeforeCall(DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + return deployContractSolBytecodeJsonObjectV1Call(deployContractSolidityBytecodeJsonObjectV1Request, _callback); + + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractSolidityBytecodeJsonObjectV1Request (optional) + * @return DeployContractSolidityBytecodeV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DeployContractSolidityBytecodeV1Response deployContractSolBytecodeJsonObjectV1(DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request) throws ApiException { + ApiResponse localVarResp = deployContractSolBytecodeJsonObjectV1WithHttpInfo(deployContractSolidityBytecodeJsonObjectV1Request); + return localVarResp.getData(); + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractSolidityBytecodeJsonObjectV1Request (optional) + * @return ApiResponse<DeployContractSolidityBytecodeV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse deployContractSolBytecodeJsonObjectV1WithHttpInfo(DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractSolBytecodeJsonObjectV1ValidateBeforeCall(deployContractSolidityBytecodeJsonObjectV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys the bytecode of a Solidity contract. (asynchronously) + * + * @param deployContractSolidityBytecodeJsonObjectV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractSolBytecodeJsonObjectV1Async(DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractSolBytecodeJsonObjectV1ValidateBeforeCall(deployContractSolidityBytecodeJsonObjectV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deployContractSolBytecodeV1 + * @param deployContractSolidityBytecodeV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractSolBytecodeV1Call(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractSolidityBytecodeV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/deploy-contract-solidity-bytecode"; + + 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 deployContractSolBytecodeV1ValidateBeforeCall(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request, final ApiCallback _callback) throws ApiException { + return deployContractSolBytecodeV1Call(deployContractSolidityBytecodeV1Request, _callback); + + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractSolidityBytecodeV1Request (optional) + * @return DeployContractSolidityBytecodeV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DeployContractSolidityBytecodeV1Response deployContractSolBytecodeV1(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request) throws ApiException { + ApiResponse localVarResp = deployContractSolBytecodeV1WithHttpInfo(deployContractSolidityBytecodeV1Request); + return localVarResp.getData(); + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractSolidityBytecodeV1Request (optional) + * @return ApiResponse<DeployContractSolidityBytecodeV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse deployContractSolBytecodeV1WithHttpInfo(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractSolBytecodeV1ValidateBeforeCall(deployContractSolidityBytecodeV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys the bytecode of a Solidity contract. (asynchronously) + * + * @param deployContractSolidityBytecodeV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractSolBytecodeV1Async(DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractSolBytecodeV1ValidateBeforeCall(deployContractSolidityBytecodeV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + 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 getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeContractV1 + * @param invokeContractV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Call(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract"; + + 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 invokeContractV1ValidateBeforeCall(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + return invokeContractV1Call(invokeContractV1Request, _callback); + + } + + /** + * Invokes a contract on a besu ledger + * + * @param invokeContractV1Request (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response invokeContractV1(InvokeContractV1Request invokeContractV1Request) throws ApiException { + ApiResponse localVarResp = invokeContractV1WithHttpInfo(invokeContractV1Request); + return localVarResp.getData(); + } + + /** + * Invokes a contract on a besu ledger + * + * @param invokeContractV1Request (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeContractV1WithHttpInfo(InvokeContractV1Request invokeContractV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invokes a contract on a besu ledger (asynchronously) + * + * @param invokeContractV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Async(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeContractV1NoKeychain + * @param invokeContractJsonObjectV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1NoKeychainCall(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeContractJsonObjectV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-contract-json-object"; + + 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 invokeContractV1NoKeychainValidateBeforeCall(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + return invokeContractV1NoKeychainCall(invokeContractJsonObjectV1Request, _callback); + + } + + /** + * Invokes a contract on a besu ledger + * + * @param invokeContractJsonObjectV1Request (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response invokeContractV1NoKeychain(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request) throws ApiException { + ApiResponse localVarResp = invokeContractV1NoKeychainWithHttpInfo(invokeContractJsonObjectV1Request); + return localVarResp.getData(); + } + + /** + * Invokes a contract on a besu ledger + * + * @param invokeContractJsonObjectV1Request (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeContractV1NoKeychainWithHttpInfo(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeContractV1NoKeychainValidateBeforeCall(invokeContractJsonObjectV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invokes a contract on a besu ledger (asynchronously) + * + * @param invokeContractJsonObjectV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1NoKeychainAsync(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeContractV1NoKeychainValidateBeforeCall(invokeContractJsonObjectV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeRawWeb3EthContractV1 + * @param invokeRawWeb3EthContractV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeRawWeb3EthContractV1Call(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeRawWeb3EthContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-contract"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + 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 invokeRawWeb3EthContractV1ValidateBeforeCall(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request, final ApiCallback _callback) throws ApiException { + return invokeRawWeb3EthContractV1Call(invokeRawWeb3EthContractV1Request, _callback); + + } + + /** + * Low-level endpoint to invoke a method on deployed contract. + * + * @param invokeRawWeb3EthContractV1Request (optional) + * @return InvokeRawWeb3EthContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeRawWeb3EthContractV1Response invokeRawWeb3EthContractV1(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request) throws ApiException { + ApiResponse localVarResp = invokeRawWeb3EthContractV1WithHttpInfo(invokeRawWeb3EthContractV1Request); + return localVarResp.getData(); + } + + /** + * Low-level endpoint to invoke a method on deployed contract. + * + * @param invokeRawWeb3EthContractV1Request (optional) + * @return ApiResponse<InvokeRawWeb3EthContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeRawWeb3EthContractV1WithHttpInfo(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeRawWeb3EthContractV1ValidateBeforeCall(invokeRawWeb3EthContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Low-level endpoint to invoke a method on deployed contract. (asynchronously) + * + * @param invokeRawWeb3EthContractV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeRawWeb3EthContractV1Async(InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeRawWeb3EthContractV1ValidateBeforeCall(invokeRawWeb3EthContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeWeb3EthMethodV1 + * @param invokeRawWeb3EthMethodV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeWeb3EthMethodV1Call(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeRawWeb3EthMethodV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/invoke-raw-web3eth-method"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + 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 invokeWeb3EthMethodV1ValidateBeforeCall(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request, final ApiCallback _callback) throws ApiException { + return invokeWeb3EthMethodV1Call(invokeRawWeb3EthMethodV1Request, _callback); + + } + + /** + * Invoke any method from web3.eth (low-level) + * + * @param invokeRawWeb3EthMethodV1Request (optional) + * @return InvokeRawWeb3EthMethodV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeRawWeb3EthMethodV1Response invokeWeb3EthMethodV1(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request) throws ApiException { + ApiResponse localVarResp = invokeWeb3EthMethodV1WithHttpInfo(invokeRawWeb3EthMethodV1Request); + return localVarResp.getData(); + } + + /** + * Invoke any method from web3.eth (low-level) + * + * @param invokeRawWeb3EthMethodV1Request (optional) + * @return ApiResponse<InvokeRawWeb3EthMethodV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeWeb3EthMethodV1WithHttpInfo(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeWeb3EthMethodV1ValidateBeforeCall(invokeRawWeb3EthMethodV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invoke any method from web3.eth (low-level) (asynchronously) + * + * @param invokeRawWeb3EthMethodV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeWeb3EthMethodV1Async(InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeWeb3EthMethodV1ValidateBeforeCall(invokeRawWeb3EthMethodV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for runTransactionV1 + * @param runTransactionRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call runTransactionV1Call(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = runTransactionRequest; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-quorum/run-transaction"; + + 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 runTransactionV1ValidateBeforeCall(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + return runTransactionV1Call(runTransactionRequest, _callback); + + } + + /** + * Executes a transaction on a quorum ledger + * + * @param runTransactionRequest (optional) + * @return RunTransactionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public RunTransactionResponse runTransactionV1(RunTransactionRequest runTransactionRequest) throws ApiException { + ApiResponse localVarResp = runTransactionV1WithHttpInfo(runTransactionRequest); + return localVarResp.getData(); + } + + /** + * Executes a transaction on a quorum ledger + * + * @param runTransactionRequest (optional) + * @return ApiResponse<RunTransactionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse runTransactionV1WithHttpInfo(RunTransactionRequest runTransactionRequest) throws ApiException { + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Executes a transaction on a quorum ledger (asynchronously) + * + * @param runTransactionRequest (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call runTransactionV1Async(RunTransactionRequest runTransactionRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..f47f36f5f7f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..542e3547779 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..82590a49ca8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..b95239fa549 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..53df15cd6ad --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java new file mode 100644 index 00000000000..a34177acf49 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java @@ -0,0 +1,660 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ContractJSON + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ContractJSON { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_ABI = "abi"; + @SerializedName(SERIALIZED_NAME_ABI) + private List abi; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private String metadata; + + public static final String SERIALIZED_NAME_DEPLOYED_BYTECODE = "deployedBytecode"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_BYTECODE) + private String deployedBytecode; + + public static final String SERIALIZED_NAME_SOURCE_MAP = "sourceMap"; + @SerializedName(SERIALIZED_NAME_SOURCE_MAP) + private String sourceMap; + + public static final String SERIALIZED_NAME_DEPLOYED_SOURCE_MAP = "deployedSourceMap"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_SOURCE_MAP) + private String deployedSourceMap; + + public static final String SERIALIZED_NAME_SOURCE_PATH = "sourcePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_PATH) + private String sourcePath; + + public static final String SERIALIZED_NAME_COMPILER = "compiler"; + @SerializedName(SERIALIZED_NAME_COMPILER) + private Object compiler; + + public static final String SERIALIZED_NAME_NETWORKS = "networks"; + @SerializedName(SERIALIZED_NAME_NETWORKS) + private Object networks; + + public static final String SERIALIZED_NAME_AST = "ast"; + @SerializedName(SERIALIZED_NAME_AST) + private Object ast; + + public static final String SERIALIZED_NAME_FUNCTION_HASHES = "functionHashes"; + @SerializedName(SERIALIZED_NAME_FUNCTION_HASHES) + private Object functionHashes; + + public static final String SERIALIZED_NAME_GAS_ESTIMATES = "gasEstimates"; + @SerializedName(SERIALIZED_NAME_GAS_ESTIMATES) + private Object gasEstimates; + + public ContractJSON() { + } + + public ContractJSON contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public ContractJSON bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + * @return bytecode + **/ + @javax.annotation.Nonnull + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public ContractJSON abi(List abi) { + + this.abi = abi; + return this; + } + + public ContractJSON addAbiItem(Object abiItem) { + if (this.abi == null) { + this.abi = new ArrayList<>(); + } + this.abi.add(abiItem); + return this; + } + + /** + * The application binary interface of the solidity contract, optional parameter + * @return abi + **/ + @javax.annotation.Nullable + public List getAbi() { + return abi; + } + + + public void setAbi(List abi) { + this.abi = abi; + } + + + public ContractJSON metadata(String metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + public String getMetadata() { + return metadata; + } + + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + + public ContractJSON deployedBytecode(String deployedBytecode) { + + this.deployedBytecode = deployedBytecode; + return this; + } + + /** + * Get deployedBytecode + * @return deployedBytecode + **/ + @javax.annotation.Nullable + public String getDeployedBytecode() { + return deployedBytecode; + } + + + public void setDeployedBytecode(String deployedBytecode) { + this.deployedBytecode = deployedBytecode; + } + + + public ContractJSON sourceMap(String sourceMap) { + + this.sourceMap = sourceMap; + return this; + } + + /** + * Get sourceMap + * @return sourceMap + **/ + @javax.annotation.Nullable + public String getSourceMap() { + return sourceMap; + } + + + public void setSourceMap(String sourceMap) { + this.sourceMap = sourceMap; + } + + + public ContractJSON deployedSourceMap(String deployedSourceMap) { + + this.deployedSourceMap = deployedSourceMap; + return this; + } + + /** + * Get deployedSourceMap + * @return deployedSourceMap + **/ + @javax.annotation.Nullable + public String getDeployedSourceMap() { + return deployedSourceMap; + } + + + public void setDeployedSourceMap(String deployedSourceMap) { + this.deployedSourceMap = deployedSourceMap; + } + + + public ContractJSON sourcePath(String sourcePath) { + + this.sourcePath = sourcePath; + return this; + } + + /** + * Get sourcePath + * @return sourcePath + **/ + @javax.annotation.Nullable + public String getSourcePath() { + return sourcePath; + } + + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + } + + + public ContractJSON compiler(Object compiler) { + + this.compiler = compiler; + return this; + } + + /** + * Get compiler + * @return compiler + **/ + @javax.annotation.Nullable + public Object getCompiler() { + return compiler; + } + + + public void setCompiler(Object compiler) { + this.compiler = compiler; + } + + + public ContractJSON networks(Object networks) { + + this.networks = networks; + return this; + } + + /** + * Get networks + * @return networks + **/ + @javax.annotation.Nullable + public Object getNetworks() { + return networks; + } + + + public void setNetworks(Object networks) { + this.networks = networks; + } + + + public ContractJSON ast(Object ast) { + + this.ast = ast; + return this; + } + + /** + * Get ast + * @return ast + **/ + @javax.annotation.Nullable + public Object getAst() { + return ast; + } + + + public void setAst(Object ast) { + this.ast = ast; + } + + + public ContractJSON functionHashes(Object functionHashes) { + + this.functionHashes = functionHashes; + return this; + } + + /** + * Get functionHashes + * @return functionHashes + **/ + @javax.annotation.Nullable + public Object getFunctionHashes() { + return functionHashes; + } + + + public void setFunctionHashes(Object functionHashes) { + this.functionHashes = functionHashes; + } + + + public ContractJSON gasEstimates(Object gasEstimates) { + + this.gasEstimates = gasEstimates; + return this; + } + + /** + * Get gasEstimates + * @return gasEstimates + **/ + @javax.annotation.Nullable + public Object getGasEstimates() { + return gasEstimates; + } + + + public void setGasEstimates(Object gasEstimates) { + this.gasEstimates = gasEstimates; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ContractJSON instance itself + */ + public ContractJSON putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContractJSON contractJSON = (ContractJSON) o; + return Objects.equals(this.contractName, contractJSON.contractName) && + Objects.equals(this.bytecode, contractJSON.bytecode) && + Objects.equals(this.abi, contractJSON.abi) && + Objects.equals(this.metadata, contractJSON.metadata) && + Objects.equals(this.deployedBytecode, contractJSON.deployedBytecode) && + Objects.equals(this.sourceMap, contractJSON.sourceMap) && + Objects.equals(this.deployedSourceMap, contractJSON.deployedSourceMap) && + Objects.equals(this.sourcePath, contractJSON.sourcePath) && + Objects.equals(this.compiler, contractJSON.compiler) && + Objects.equals(this.networks, contractJSON.networks) && + Objects.equals(this.ast, contractJSON.ast) && + Objects.equals(this.functionHashes, contractJSON.functionHashes) && + Objects.equals(this.gasEstimates, contractJSON.gasEstimates)&& + Objects.equals(this.additionalProperties, contractJSON.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, bytecode, abi, metadata, deployedBytecode, sourceMap, deployedSourceMap, sourcePath, compiler, networks, ast, functionHashes, gasEstimates, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContractJSON {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" abi: ").append(toIndentedString(abi)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" deployedBytecode: ").append(toIndentedString(deployedBytecode)).append("\n"); + sb.append(" sourceMap: ").append(toIndentedString(sourceMap)).append("\n"); + sb.append(" deployedSourceMap: ").append(toIndentedString(deployedSourceMap)).append("\n"); + sb.append(" sourcePath: ").append(toIndentedString(sourcePath)).append("\n"); + sb.append(" compiler: ").append(toIndentedString(compiler)).append("\n"); + sb.append(" networks: ").append(toIndentedString(networks)).append("\n"); + sb.append(" ast: ").append(toIndentedString(ast)).append("\n"); + sb.append(" functionHashes: ").append(toIndentedString(functionHashes)).append("\n"); + sb.append(" gasEstimates: ").append(toIndentedString(gasEstimates)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("bytecode"); + openapiFields.add("abi"); + openapiFields.add("metadata"); + openapiFields.add("deployedBytecode"); + openapiFields.add("sourceMap"); + openapiFields.add("deployedSourceMap"); + openapiFields.add("sourcePath"); + openapiFields.add("compiler"); + openapiFields.add("networks"); + openapiFields.add("ast"); + openapiFields.add("functionHashes"); + openapiFields.add("gasEstimates"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("bytecode"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ContractJSON + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ContractJSON.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ContractJSON is not found in the empty JSON string", ContractJSON.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ContractJSON.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if (!jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("abi") != null && !jsonObj.get("abi").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `abi` to be an array in the JSON string but got `%s`", jsonObj.get("abi").toString())); + } + if ((jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) && !jsonObj.get("metadata").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `metadata` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadata").toString())); + } + if ((jsonObj.get("deployedBytecode") != null && !jsonObj.get("deployedBytecode").isJsonNull()) && !jsonObj.get("deployedBytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedBytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedBytecode").toString())); + } + if ((jsonObj.get("sourceMap") != null && !jsonObj.get("sourceMap").isJsonNull()) && !jsonObj.get("sourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceMap").toString())); + } + if ((jsonObj.get("deployedSourceMap") != null && !jsonObj.get("deployedSourceMap").isJsonNull()) && !jsonObj.get("deployedSourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedSourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedSourceMap").toString())); + } + if ((jsonObj.get("sourcePath") != null && !jsonObj.get("sourcePath").isJsonNull()) && !jsonObj.get("sourcePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourcePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourcePath").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ContractJSON.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ContractJSON' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ContractJSON.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ContractJSON value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ContractJSON read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ContractJSON instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ContractJSON given an JSON string + * + * @param jsonString JSON string + * @return An instance of ContractJSON + * @throws IOException if the JSON string is invalid with respect to ContractJSON + */ + public static ContractJSON fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ContractJSON.class); + } + + /** + * Convert an instance of ContractJSON to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1Request.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1Request.java new file mode 100644 index 00000000000..54be6fc5d8e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1Request.java @@ -0,0 +1,377 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractSolidityBytecodeJsonObjectV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractSolidityBytecodeJsonObjectV1Request { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private String gasPrice; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private ContractJSON contractJSON; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public DeployContractSolidityBytecodeJsonObjectV1Request() { + } + + public DeployContractSolidityBytecodeJsonObjectV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public DeployContractSolidityBytecodeJsonObjectV1Request gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + public DeployContractSolidityBytecodeJsonObjectV1Request gasPrice(String gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public String getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(String gasPrice) { + this.gasPrice = gasPrice; + } + + + public DeployContractSolidityBytecodeJsonObjectV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public DeployContractSolidityBytecodeJsonObjectV1Request contractJSON(ContractJSON contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * Get contractJSON + * @return contractJSON + **/ + @javax.annotation.Nonnull + public ContractJSON getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(ContractJSON contractJSON) { + this.contractJSON = contractJSON; + } + + + public DeployContractSolidityBytecodeJsonObjectV1Request constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public DeployContractSolidityBytecodeJsonObjectV1Request addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * The list of arguments to pass in to the constructor of the contract being deployed. + * @return constructorArgs + **/ + @javax.annotation.Nullable + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request = (DeployContractSolidityBytecodeJsonObjectV1Request) o; + return Objects.equals(this.web3SigningCredential, deployContractSolidityBytecodeJsonObjectV1Request.web3SigningCredential) && + Objects.equals(this.gas, deployContractSolidityBytecodeJsonObjectV1Request.gas) && + Objects.equals(this.gasPrice, deployContractSolidityBytecodeJsonObjectV1Request.gasPrice) && + Objects.equals(this.timeoutMs, deployContractSolidityBytecodeJsonObjectV1Request.timeoutMs) && + Objects.equals(this.contractJSON, deployContractSolidityBytecodeJsonObjectV1Request.contractJSON) && + Objects.equals(this.constructorArgs, deployContractSolidityBytecodeJsonObjectV1Request.constructorArgs); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, gas, gasPrice, timeoutMs, contractJSON, constructorArgs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractSolidityBytecodeJsonObjectV1Request {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("timeoutMs"); + openapiFields.add("contractJSON"); + openapiFields.add("constructorArgs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("contractJSON"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractSolidityBytecodeJsonObjectV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractSolidityBytecodeJsonObjectV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractSolidityBytecodeJsonObjectV1Request is not found in the empty JSON string", DeployContractSolidityBytecodeJsonObjectV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractSolidityBytecodeJsonObjectV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractSolidityBytecodeJsonObjectV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractSolidityBytecodeJsonObjectV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if ((jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) && !jsonObj.get("gasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasPrice").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractSolidityBytecodeJsonObjectV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractSolidityBytecodeJsonObjectV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractSolidityBytecodeJsonObjectV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractSolidityBytecodeJsonObjectV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractSolidityBytecodeJsonObjectV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractSolidityBytecodeJsonObjectV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractSolidityBytecodeJsonObjectV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractSolidityBytecodeJsonObjectV1Request + */ + public static DeployContractSolidityBytecodeJsonObjectV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractSolidityBytecodeJsonObjectV1Request.class); + } + + /** + * Convert an instance of DeployContractSolidityBytecodeJsonObjectV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java new file mode 100644 index 00000000000..31acb0e5e3c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Request.java @@ -0,0 +1,596 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.QuorumPrivateTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractSolidityBytecodeV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractSolidityBytecodeV1Request { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_CONTRACT_ABI = "contractAbi"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ABI) + private List contractAbi; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private BigDecimal gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private BigDecimal value; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private Object contractJSON; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public static final String SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG = "privateTransactionConfig"; + @SerializedName(SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG) + private QuorumPrivateTransactionConfig privateTransactionConfig; + + public DeployContractSolidityBytecodeV1Request() { + } + + public DeployContractSolidityBytecodeV1Request contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * The contract name for retrieve the contracts json on the keychain. + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public DeployContractSolidityBytecodeV1Request contractAbi(List contractAbi) { + + this.contractAbi = contractAbi; + return this; + } + + public DeployContractSolidityBytecodeV1Request addContractAbiItem(Object contractAbiItem) { + if (this.contractAbi == null) { + this.contractAbi = new ArrayList<>(); + } + this.contractAbi.add(contractAbiItem); + return this; + } + + /** + * The application binary interface of the solidity contract + * @return contractAbi + **/ + @javax.annotation.Nullable + public List getContractAbi() { + return contractAbi; + } + + + public void setContractAbi(List contractAbi) { + this.contractAbi = contractAbi; + } + + + public DeployContractSolidityBytecodeV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public DeployContractSolidityBytecodeV1Request bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + * @return bytecode + **/ + @javax.annotation.Nullable + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public DeployContractSolidityBytecodeV1Request keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychainId for retrieve the contracts json. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public DeployContractSolidityBytecodeV1Request gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + public DeployContractSolidityBytecodeV1Request gasPrice(BigDecimal gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public BigDecimal getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(BigDecimal gasPrice) { + this.gasPrice = gasPrice; + } + + + public DeployContractSolidityBytecodeV1Request nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public DeployContractSolidityBytecodeV1Request value(BigDecimal value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public BigDecimal getValue() { + return value; + } + + + public void setValue(BigDecimal value) { + this.value = value; + } + + + public DeployContractSolidityBytecodeV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public DeployContractSolidityBytecodeV1Request contractJSON(Object contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * For use when not using keychain, pass the contract in as this variable + * @return contractJSON + **/ + @javax.annotation.Nullable + public Object getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(Object contractJSON) { + this.contractJSON = contractJSON; + } + + + public DeployContractSolidityBytecodeV1Request constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public DeployContractSolidityBytecodeV1Request addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * The list of arguments to pass in to the constructor of the contract being deployed. + * @return constructorArgs + **/ + @javax.annotation.Nullable + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public DeployContractSolidityBytecodeV1Request privateTransactionConfig(QuorumPrivateTransactionConfig privateTransactionConfig) { + + this.privateTransactionConfig = privateTransactionConfig; + return this; + } + + /** + * Get privateTransactionConfig + * @return privateTransactionConfig + **/ + @javax.annotation.Nullable + public QuorumPrivateTransactionConfig getPrivateTransactionConfig() { + return privateTransactionConfig; + } + + + public void setPrivateTransactionConfig(QuorumPrivateTransactionConfig privateTransactionConfig) { + this.privateTransactionConfig = privateTransactionConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request = (DeployContractSolidityBytecodeV1Request) o; + return Objects.equals(this.contractName, deployContractSolidityBytecodeV1Request.contractName) && + Objects.equals(this.contractAbi, deployContractSolidityBytecodeV1Request.contractAbi) && + Objects.equals(this.web3SigningCredential, deployContractSolidityBytecodeV1Request.web3SigningCredential) && + Objects.equals(this.bytecode, deployContractSolidityBytecodeV1Request.bytecode) && + Objects.equals(this.keychainId, deployContractSolidityBytecodeV1Request.keychainId) && + Objects.equals(this.gas, deployContractSolidityBytecodeV1Request.gas) && + Objects.equals(this.gasPrice, deployContractSolidityBytecodeV1Request.gasPrice) && + Objects.equals(this.nonce, deployContractSolidityBytecodeV1Request.nonce) && + Objects.equals(this.value, deployContractSolidityBytecodeV1Request.value) && + Objects.equals(this.timeoutMs, deployContractSolidityBytecodeV1Request.timeoutMs) && + Objects.equals(this.contractJSON, deployContractSolidityBytecodeV1Request.contractJSON) && + Objects.equals(this.constructorArgs, deployContractSolidityBytecodeV1Request.constructorArgs) && + Objects.equals(this.privateTransactionConfig, deployContractSolidityBytecodeV1Request.privateTransactionConfig); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, contractAbi, web3SigningCredential, bytecode, keychainId, gas, gasPrice, nonce, value, timeoutMs, contractJSON, constructorArgs, privateTransactionConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractSolidityBytecodeV1Request {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" contractAbi: ").append(toIndentedString(contractAbi)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" privateTransactionConfig: ").append(toIndentedString(privateTransactionConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("contractAbi"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("bytecode"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("value"); + openapiFields.add("timeoutMs"); + openapiFields.add("contractJSON"); + openapiFields.add("constructorArgs"); + openapiFields.add("privateTransactionConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractSolidityBytecodeV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractSolidityBytecodeV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractSolidityBytecodeV1Request is not found in the empty JSON string", DeployContractSolidityBytecodeV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractSolidityBytecodeV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractSolidityBytecodeV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractSolidityBytecodeV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("contractAbi") != null && !jsonObj.get("contractAbi").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAbi` to be an array in the JSON string but got `%s`", jsonObj.get("contractAbi").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if ((jsonObj.get("bytecode") != null && !jsonObj.get("bytecode").isJsonNull()) && !jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + // validate the optional field `privateTransactionConfig` + if (jsonObj.get("privateTransactionConfig") != null && !jsonObj.get("privateTransactionConfig").isJsonNull()) { + QuorumPrivateTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("privateTransactionConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractSolidityBytecodeV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractSolidityBytecodeV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractSolidityBytecodeV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractSolidityBytecodeV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractSolidityBytecodeV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractSolidityBytecodeV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractSolidityBytecodeV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractSolidityBytecodeV1Request + */ + public static DeployContractSolidityBytecodeV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractSolidityBytecodeV1Request.class); + } + + /** + * Convert an instance of DeployContractSolidityBytecodeV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java new file mode 100644 index 00000000000..038789d442c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1Response.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractSolidityBytecodeV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractSolidityBytecodeV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public DeployContractSolidityBytecodeV1Response() { + } + + public DeployContractSolidityBytecodeV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractSolidityBytecodeV1Response deployContractSolidityBytecodeV1Response = (DeployContractSolidityBytecodeV1Response) o; + return Objects.equals(this.transactionReceipt, deployContractSolidityBytecodeV1Response.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractSolidityBytecodeV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractSolidityBytecodeV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractSolidityBytecodeV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractSolidityBytecodeV1Response is not found in the empty JSON string", DeployContractSolidityBytecodeV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractSolidityBytecodeV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractSolidityBytecodeV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractSolidityBytecodeV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractSolidityBytecodeV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractSolidityBytecodeV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractSolidityBytecodeV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractSolidityBytecodeV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractSolidityBytecodeV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractSolidityBytecodeV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractSolidityBytecodeV1Response + * @throws IOException if the JSON string is invalid with respect to DeployContractSolidityBytecodeV1Response + */ + public static DeployContractSolidityBytecodeV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractSolidityBytecodeV1Response.class); + } + + /** + * Convert an instance of DeployContractSolidityBytecodeV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java new file mode 100644 index 00000000000..de41b53dd25 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets EthContractInvocationType + */ +@JsonAdapter(EthContractInvocationType.Adapter.class) +public enum EthContractInvocationType { + + SEND("SEND"), + + CALL("CALL"); + + private String value; + + EthContractInvocationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EthContractInvocationType fromValue(String value) { + for (EthContractInvocationType b : EthContractInvocationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EthContractInvocationType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EthContractInvocationType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EthContractInvocationType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java new file mode 100644 index 00000000000..46b63aebd51 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationWeb3Method.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets EthContractInvocationWeb3Method + */ +@JsonAdapter(EthContractInvocationWeb3Method.Adapter.class) +public enum EthContractInvocationWeb3Method { + + SEND("send"), + + CALL("call"), + + ENCODEABI("encodeABI"), + + ESTIMATEGAS("estimateGas"); + + private String value; + + EthContractInvocationWeb3Method(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EthContractInvocationWeb3Method fromValue(String value) { + for (EthContractInvocationWeb3Method b : EthContractInvocationWeb3Method.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EthContractInvocationWeb3Method enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EthContractInvocationWeb3Method read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EthContractInvocationWeb3Method.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java new file mode 100644 index 00000000000..a398999043c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java @@ -0,0 +1,573 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.QuorumPrivateTransactionConfig; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractJsonObjectV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractJsonObjectV1Request { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private QuorumTransactionConfigFrom value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private QuorumTransactionConfigFrom gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private QuorumTransactionConfigFrom gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private ContractJSON contractJSON; + + public static final String SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG = "privateTransactionConfig"; + @SerializedName(SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG) + private QuorumPrivateTransactionConfig privateTransactionConfig; + + public InvokeContractJsonObjectV1Request() { + } + + public InvokeContractJsonObjectV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InvokeContractJsonObjectV1Request invocationType(EthContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public EthContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public InvokeContractJsonObjectV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the contract method to invoke. + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeContractJsonObjectV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeContractJsonObjectV1Request addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeContractJsonObjectV1Request contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Address of the solidity contract + * @return contractAddress + **/ + @javax.annotation.Nonnull + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public InvokeContractJsonObjectV1Request value(QuorumTransactionConfigFrom value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getValue() { + return value; + } + + + public void setValue(QuorumTransactionConfigFrom value) { + this.value = value; + } + + + public InvokeContractJsonObjectV1Request gas(QuorumTransactionConfigFrom gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getGas() { + return gas; + } + + + public void setGas(QuorumTransactionConfigFrom gas) { + this.gas = gas; + } + + + public InvokeContractJsonObjectV1Request gasPrice(QuorumTransactionConfigFrom gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(QuorumTransactionConfigFrom gasPrice) { + this.gasPrice = gasPrice; + } + + + public InvokeContractJsonObjectV1Request nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public InvokeContractJsonObjectV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public InvokeContractJsonObjectV1Request contractJSON(ContractJSON contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * Get contractJSON + * @return contractJSON + **/ + @javax.annotation.Nonnull + public ContractJSON getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(ContractJSON contractJSON) { + this.contractJSON = contractJSON; + } + + + public InvokeContractJsonObjectV1Request privateTransactionConfig(QuorumPrivateTransactionConfig privateTransactionConfig) { + + this.privateTransactionConfig = privateTransactionConfig; + return this; + } + + /** + * Get privateTransactionConfig + * @return privateTransactionConfig + **/ + @javax.annotation.Nullable + public QuorumPrivateTransactionConfig getPrivateTransactionConfig() { + return privateTransactionConfig; + } + + + public void setPrivateTransactionConfig(QuorumPrivateTransactionConfig privateTransactionConfig) { + this.privateTransactionConfig = privateTransactionConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request = (InvokeContractJsonObjectV1Request) o; + return Objects.equals(this.web3SigningCredential, invokeContractJsonObjectV1Request.web3SigningCredential) && + Objects.equals(this.invocationType, invokeContractJsonObjectV1Request.invocationType) && + Objects.equals(this.methodName, invokeContractJsonObjectV1Request.methodName) && + Objects.equals(this.params, invokeContractJsonObjectV1Request.params) && + Objects.equals(this.contractAddress, invokeContractJsonObjectV1Request.contractAddress) && + Objects.equals(this.value, invokeContractJsonObjectV1Request.value) && + Objects.equals(this.gas, invokeContractJsonObjectV1Request.gas) && + Objects.equals(this.gasPrice, invokeContractJsonObjectV1Request.gasPrice) && + Objects.equals(this.nonce, invokeContractJsonObjectV1Request.nonce) && + Objects.equals(this.timeoutMs, invokeContractJsonObjectV1Request.timeoutMs) && + Objects.equals(this.contractJSON, invokeContractJsonObjectV1Request.contractJSON) && + Objects.equals(this.privateTransactionConfig, invokeContractJsonObjectV1Request.privateTransactionConfig); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, invocationType, methodName, params, contractAddress, value, gas, gasPrice, nonce, timeoutMs, contractJSON, privateTransactionConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractJsonObjectV1Request {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append(" privateTransactionConfig: ").append(toIndentedString(privateTransactionConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("contractAddress"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("timeoutMs"); + openapiFields.add("contractJSON"); + openapiFields.add("privateTransactionConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + openapiRequiredFields.add("contractAddress"); + openapiRequiredFields.add("contractJSON"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractJsonObjectV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractJsonObjectV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractJsonObjectV1Request is not found in the empty JSON string", InvokeContractJsonObjectV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractJsonObjectV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractJsonObjectV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractJsonObjectV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + if (!jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + // validate the optional field `privateTransactionConfig` + if (jsonObj.get("privateTransactionConfig") != null && !jsonObj.get("privateTransactionConfig").isJsonNull()) { + QuorumPrivateTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("privateTransactionConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractJsonObjectV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractJsonObjectV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractJsonObjectV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractJsonObjectV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractJsonObjectV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractJsonObjectV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractJsonObjectV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeContractJsonObjectV1Request + */ + public static InvokeContractJsonObjectV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractJsonObjectV1Request.class); + } + + /** + * Convert an instance of InvokeContractJsonObjectV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java new file mode 100644 index 00000000000..76fe3ae1e4f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java @@ -0,0 +1,542 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Request { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private QuorumTransactionConfigFrom value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private QuorumTransactionConfigFrom gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private QuorumTransactionConfigFrom gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public InvokeContractV1Request() { + } + + public InvokeContractV1Request contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * The contract name to find it in the keychain plugin + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public InvokeContractV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InvokeContractV1Request invocationType(EthContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public EthContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public InvokeContractV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the contract method to invoke. + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeContractV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeContractV1Request addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeContractV1Request value(QuorumTransactionConfigFrom value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getValue() { + return value; + } + + + public void setValue(QuorumTransactionConfigFrom value) { + this.value = value; + } + + + public InvokeContractV1Request gas(QuorumTransactionConfigFrom gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getGas() { + return gas; + } + + + public void setGas(QuorumTransactionConfigFrom gas) { + this.gas = gas; + } + + + public InvokeContractV1Request gasPrice(QuorumTransactionConfigFrom gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(QuorumTransactionConfigFrom gasPrice) { + this.gasPrice = gasPrice; + } + + + public InvokeContractV1Request nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public InvokeContractV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public InvokeContractV1Request keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychainId for retrieve the contracts json. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Request invokeContractV1Request = (InvokeContractV1Request) o; + return Objects.equals(this.contractName, invokeContractV1Request.contractName) && + Objects.equals(this.web3SigningCredential, invokeContractV1Request.web3SigningCredential) && + Objects.equals(this.invocationType, invokeContractV1Request.invocationType) && + Objects.equals(this.methodName, invokeContractV1Request.methodName) && + Objects.equals(this.params, invokeContractV1Request.params) && + Objects.equals(this.value, invokeContractV1Request.value) && + Objects.equals(this.gas, invokeContractV1Request.gas) && + Objects.equals(this.gasPrice, invokeContractV1Request.gasPrice) && + Objects.equals(this.nonce, invokeContractV1Request.nonce) && + Objects.equals(this.timeoutMs, invokeContractV1Request.timeoutMs) && + Objects.equals(this.keychainId, invokeContractV1Request.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, web3SigningCredential, invocationType, methodName, params, value, gas, gasPrice, nonce, timeoutMs, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Request {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("timeoutMs"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Request is not found in the empty JSON string", InvokeContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Request + */ + public static InvokeContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Request.class); + } + + /** + * Convert an instance of InvokeContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java new file mode 100644 index 00000000000..ba0b6d9b12e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java @@ -0,0 +1,282 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public static final String SERIALIZED_NAME_CALL_OUTPUT = "callOutput"; + @SerializedName(SERIALIZED_NAME_CALL_OUTPUT) + private Object callOutput = null; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public InvokeContractV1Response() { + } + + public InvokeContractV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nullable + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + public InvokeContractV1Response callOutput(Object callOutput) { + + this.callOutput = callOutput; + return this; + } + + /** + * Get callOutput + * @return callOutput + **/ + @javax.annotation.Nullable + public Object getCallOutput() { + return callOutput; + } + + + public void setCallOutput(Object callOutput) { + this.callOutput = callOutput; + } + + + public InvokeContractV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Response invokeContractV1Response = (InvokeContractV1Response) o; + return Objects.equals(this.transactionReceipt, invokeContractV1Response.transactionReceipt) && + Objects.equals(this.callOutput, invokeContractV1Response.callOutput) && + Objects.equals(this.success, invokeContractV1Response.success); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt, callOutput, success); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append(" callOutput: ").append(toIndentedString(callOutput)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + openapiFields.add("callOutput"); + openapiFields.add("success"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Response is not found in the empty JSON string", InvokeContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Response + */ + public static InvokeContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Response.class); + } + + /** + * Convert an instance of InvokeContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java new file mode 100644 index 00000000000..022ab644b97 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Request.java @@ -0,0 +1,391 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.EthContractInvocationWeb3Method; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRawWeb3EthContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRawWeb3EthContractV1Request { + public static final String SERIALIZED_NAME_ABI = "abi"; + @SerializedName(SERIALIZED_NAME_ABI) + private List abi = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationWeb3Method invocationType; + + public static final String SERIALIZED_NAME_INVOCATION_PARAMS = "invocationParams"; + @SerializedName(SERIALIZED_NAME_INVOCATION_PARAMS) + private Object invocationParams = {}; + + public static final String SERIALIZED_NAME_CONTRACT_METHOD = "contractMethod"; + @SerializedName(SERIALIZED_NAME_CONTRACT_METHOD) + private String contractMethod; + + public static final String SERIALIZED_NAME_CONTRACT_METHOD_ARGS = "contractMethodArgs"; + @SerializedName(SERIALIZED_NAME_CONTRACT_METHOD_ARGS) + private List contractMethodArgs = null; + + public InvokeRawWeb3EthContractV1Request() { + } + + public InvokeRawWeb3EthContractV1Request abi(List abi) { + + this.abi = abi; + return this; + } + + public InvokeRawWeb3EthContractV1Request addAbiItem(Object abiItem) { + if (this.abi == null) { + this.abi = new ArrayList<>(); + } + this.abi.add(abiItem); + return this; + } + + /** + * The application binary interface of the solidity contract + * @return abi + **/ + @javax.annotation.Nonnull + public List getAbi() { + return abi; + } + + + public void setAbi(List abi) { + this.abi = abi; + } + + + public InvokeRawWeb3EthContractV1Request address(String address) { + + this.address = address; + return this; + } + + /** + * Deployed solidity contract address + * @return address + **/ + @javax.annotation.Nonnull + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + public InvokeRawWeb3EthContractV1Request invocationType(EthContractInvocationWeb3Method invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public EthContractInvocationWeb3Method getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationWeb3Method invocationType) { + this.invocationType = invocationType; + } + + + public InvokeRawWeb3EthContractV1Request invocationParams(Object invocationParams) { + + this.invocationParams = invocationParams; + return this; + } + + /** + * The list of arguments for contract invocation method (send, call, etc...) + * @return invocationParams + **/ + @javax.annotation.Nullable + public Object getInvocationParams() { + return invocationParams; + } + + + public void setInvocationParams(Object invocationParams) { + this.invocationParams = invocationParams; + } + + + public InvokeRawWeb3EthContractV1Request contractMethod(String contractMethod) { + + this.contractMethod = contractMethod; + return this; + } + + /** + * Method of deployed solidity contract to execute + * @return contractMethod + **/ + @javax.annotation.Nonnull + public String getContractMethod() { + return contractMethod; + } + + + public void setContractMethod(String contractMethod) { + this.contractMethod = contractMethod; + } + + + public InvokeRawWeb3EthContractV1Request contractMethodArgs(List contractMethodArgs) { + + this.contractMethodArgs = contractMethodArgs; + return this; + } + + public InvokeRawWeb3EthContractV1Request addContractMethodArgsItem(Object contractMethodArgsItem) { + if (this.contractMethodArgs == null) { + this.contractMethodArgs = null; + } + this.contractMethodArgs.add(contractMethodArgsItem); + return this; + } + + /** + * The list of arguments for deployed solidity contract method + * @return contractMethodArgs + **/ + @javax.annotation.Nullable + public List getContractMethodArgs() { + return contractMethodArgs; + } + + + public void setContractMethodArgs(List contractMethodArgs) { + this.contractMethodArgs = contractMethodArgs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request = (InvokeRawWeb3EthContractV1Request) o; + return Objects.equals(this.abi, invokeRawWeb3EthContractV1Request.abi) && + Objects.equals(this.address, invokeRawWeb3EthContractV1Request.address) && + Objects.equals(this.invocationType, invokeRawWeb3EthContractV1Request.invocationType) && + Objects.equals(this.invocationParams, invokeRawWeb3EthContractV1Request.invocationParams) && + Objects.equals(this.contractMethod, invokeRawWeb3EthContractV1Request.contractMethod) && + Objects.equals(this.contractMethodArgs, invokeRawWeb3EthContractV1Request.contractMethodArgs); + } + + @Override + public int hashCode() { + return Objects.hash(abi, address, invocationType, invocationParams, contractMethod, contractMethodArgs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRawWeb3EthContractV1Request {\n"); + sb.append(" abi: ").append(toIndentedString(abi)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" invocationParams: ").append(toIndentedString(invocationParams)).append("\n"); + sb.append(" contractMethod: ").append(toIndentedString(contractMethod)).append("\n"); + sb.append(" contractMethodArgs: ").append(toIndentedString(contractMethodArgs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("abi"); + openapiFields.add("address"); + openapiFields.add("invocationType"); + openapiFields.add("invocationParams"); + openapiFields.add("contractMethod"); + openapiFields.add("contractMethodArgs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("abi"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("contractMethod"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRawWeb3EthContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRawWeb3EthContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRawWeb3EthContractV1Request is not found in the empty JSON string", InvokeRawWeb3EthContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRawWeb3EthContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRawWeb3EthContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRawWeb3EthContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the required json array is present + if (jsonObj.get("abi") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("abi").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `abi` to be an array in the JSON string but got `%s`", jsonObj.get("abi").toString())); + } + if (!jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if (!jsonObj.get("contractMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractMethod").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("contractMethodArgs") != null && !jsonObj.get("contractMethodArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `contractMethodArgs` to be an array in the JSON string but got `%s`", jsonObj.get("contractMethodArgs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRawWeb3EthContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRawWeb3EthContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRawWeb3EthContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRawWeb3EthContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRawWeb3EthContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRawWeb3EthContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRawWeb3EthContractV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeRawWeb3EthContractV1Request + */ + public static InvokeRawWeb3EthContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRawWeb3EthContractV1Request.class); + } + + /** + * Convert an instance of InvokeRawWeb3EthContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java new file mode 100644 index 00000000000..25e32182b30 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1Response.java @@ -0,0 +1,285 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRawWeb3EthContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRawWeb3EthContractV1Response { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private BigDecimal status; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private Object data = null; + + public static final String SERIALIZED_NAME_ERROR_DETAIL = "errorDetail"; + @SerializedName(SERIALIZED_NAME_ERROR_DETAIL) + private String errorDetail; + + public InvokeRawWeb3EthContractV1Response() { + } + + public InvokeRawWeb3EthContractV1Response status(BigDecimal status) { + + this.status = status; + return this; + } + + /** + * Status code of the operation + * @return status + **/ + @javax.annotation.Nonnull + public BigDecimal getStatus() { + return status; + } + + + public void setStatus(BigDecimal status) { + this.status = status; + } + + + public InvokeRawWeb3EthContractV1Response data(Object data) { + + this.data = data; + return this; + } + + /** + * Output of contract invocation method + * @return data + **/ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + + public void setData(Object data) { + this.data = data; + } + + + public InvokeRawWeb3EthContractV1Response errorDetail(String errorDetail) { + + this.errorDetail = errorDetail; + return this; + } + + /** + * Error details + * @return errorDetail + **/ + @javax.annotation.Nullable + public String getErrorDetail() { + return errorDetail; + } + + + public void setErrorDetail(String errorDetail) { + this.errorDetail = errorDetail; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRawWeb3EthContractV1Response invokeRawWeb3EthContractV1Response = (InvokeRawWeb3EthContractV1Response) o; + return Objects.equals(this.status, invokeRawWeb3EthContractV1Response.status) && + Objects.equals(this.data, invokeRawWeb3EthContractV1Response.data) && + Objects.equals(this.errorDetail, invokeRawWeb3EthContractV1Response.errorDetail); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, data, errorDetail); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRawWeb3EthContractV1Response {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" errorDetail: ").append(toIndentedString(errorDetail)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("data"); + openapiFields.add("errorDetail"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRawWeb3EthContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRawWeb3EthContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRawWeb3EthContractV1Response is not found in the empty JSON string", InvokeRawWeb3EthContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRawWeb3EthContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRawWeb3EthContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRawWeb3EthContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("errorDetail") != null && !jsonObj.get("errorDetail").isJsonNull()) && !jsonObj.get("errorDetail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorDetail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorDetail").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRawWeb3EthContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRawWeb3EthContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRawWeb3EthContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRawWeb3EthContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRawWeb3EthContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRawWeb3EthContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRawWeb3EthContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeRawWeb3EthContractV1Response + */ + public static InvokeRawWeb3EthContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRawWeb3EthContractV1Response.class); + } + + /** + * Convert an instance of InvokeRawWeb3EthContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java new file mode 100644 index 00000000000..17c9f20bcea --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Request.java @@ -0,0 +1,258 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRawWeb3EthMethodV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRawWeb3EthMethodV1Request { + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public InvokeRawWeb3EthMethodV1Request() { + } + + public InvokeRawWeb3EthMethodV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the web3.eth method to invoke + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeRawWeb3EthMethodV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeRawWeb3EthMethodV1Request addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass to web3.eth method specified in methodName + * @return params + **/ + @javax.annotation.Nullable + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request = (InvokeRawWeb3EthMethodV1Request) o; + return Objects.equals(this.methodName, invokeRawWeb3EthMethodV1Request.methodName) && + Objects.equals(this.params, invokeRawWeb3EthMethodV1Request.params); + } + + @Override + public int hashCode() { + return Objects.hash(methodName, params); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRawWeb3EthMethodV1Request {\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("methodName"); + openapiFields.add("params"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("methodName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRawWeb3EthMethodV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRawWeb3EthMethodV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRawWeb3EthMethodV1Request is not found in the empty JSON string", InvokeRawWeb3EthMethodV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRawWeb3EthMethodV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRawWeb3EthMethodV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRawWeb3EthMethodV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("params") != null && !jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRawWeb3EthMethodV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRawWeb3EthMethodV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRawWeb3EthMethodV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRawWeb3EthMethodV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRawWeb3EthMethodV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRawWeb3EthMethodV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRawWeb3EthMethodV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeRawWeb3EthMethodV1Request + */ + public static InvokeRawWeb3EthMethodV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRawWeb3EthMethodV1Request.class); + } + + /** + * Convert an instance of InvokeRawWeb3EthMethodV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java new file mode 100644 index 00000000000..f41027c07d5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1Response.java @@ -0,0 +1,285 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRawWeb3EthMethodV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRawWeb3EthMethodV1Response { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private BigDecimal status; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private Object data = null; + + public static final String SERIALIZED_NAME_ERROR_DETAIL = "errorDetail"; + @SerializedName(SERIALIZED_NAME_ERROR_DETAIL) + private String errorDetail; + + public InvokeRawWeb3EthMethodV1Response() { + } + + public InvokeRawWeb3EthMethodV1Response status(BigDecimal status) { + + this.status = status; + return this; + } + + /** + * Status code of the operation + * @return status + **/ + @javax.annotation.Nonnull + public BigDecimal getStatus() { + return status; + } + + + public void setStatus(BigDecimal status) { + this.status = status; + } + + + public InvokeRawWeb3EthMethodV1Response data(Object data) { + + this.data = data; + return this; + } + + /** + * Output of requested web3.eth method + * @return data + **/ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + + public void setData(Object data) { + this.data = data; + } + + + public InvokeRawWeb3EthMethodV1Response errorDetail(String errorDetail) { + + this.errorDetail = errorDetail; + return this; + } + + /** + * Error details + * @return errorDetail + **/ + @javax.annotation.Nullable + public String getErrorDetail() { + return errorDetail; + } + + + public void setErrorDetail(String errorDetail) { + this.errorDetail = errorDetail; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRawWeb3EthMethodV1Response invokeRawWeb3EthMethodV1Response = (InvokeRawWeb3EthMethodV1Response) o; + return Objects.equals(this.status, invokeRawWeb3EthMethodV1Response.status) && + Objects.equals(this.data, invokeRawWeb3EthMethodV1Response.data) && + Objects.equals(this.errorDetail, invokeRawWeb3EthMethodV1Response.errorDetail); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, data, errorDetail); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRawWeb3EthMethodV1Response {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" errorDetail: ").append(toIndentedString(errorDetail)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("data"); + openapiFields.add("errorDetail"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRawWeb3EthMethodV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRawWeb3EthMethodV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRawWeb3EthMethodV1Response is not found in the empty JSON string", InvokeRawWeb3EthMethodV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRawWeb3EthMethodV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRawWeb3EthMethodV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRawWeb3EthMethodV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("errorDetail") != null && !jsonObj.get("errorDetail").isJsonNull()) && !jsonObj.get("errorDetail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorDetail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorDetail").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRawWeb3EthMethodV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRawWeb3EthMethodV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRawWeb3EthMethodV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRawWeb3EthMethodV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRawWeb3EthMethodV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRawWeb3EthMethodV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRawWeb3EthMethodV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeRawWeb3EthMethodV1Response + */ + public static InvokeRawWeb3EthMethodV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRawWeb3EthMethodV1Response.class); + } + + /** + * Convert an instance of InvokeRawWeb3EthMethodV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumPrivateTransactionConfig.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumPrivateTransactionConfig.java new file mode 100644 index 00000000000..f7d402f9718 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumPrivateTransactionConfig.java @@ -0,0 +1,407 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * QuorumPrivateTransactionConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class QuorumPrivateTransactionConfig { + public static final String SERIALIZED_NAME_PRIVATE_FROM = "privateFrom"; + @SerializedName(SERIALIZED_NAME_PRIVATE_FROM) + private String privateFrom; + + public static final String SERIALIZED_NAME_PRIVATE_FOR = "privateFor"; + @SerializedName(SERIALIZED_NAME_PRIVATE_FOR) + private List privateFor = null; + + public static final String SERIALIZED_NAME_IS_PRIVATE = "isPrivate"; + @SerializedName(SERIALIZED_NAME_IS_PRIVATE) + private Boolean isPrivate = false; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private BigDecimal gasPrice; + + public static final String SERIALIZED_NAME_GAS_LIMIT = "gasLimit"; + @SerializedName(SERIALIZED_NAME_GAS_LIMIT) + private BigDecimal gasLimit; + + public static final String SERIALIZED_NAME_PRIVATE_KEY = "privateKey"; + @SerializedName(SERIALIZED_NAME_PRIVATE_KEY) + private String privateKey; + + public static final String SERIALIZED_NAME_PRIVACY_GROUP_ID = "privacyGroupId"; + @SerializedName(SERIALIZED_NAME_PRIVACY_GROUP_ID) + private String privacyGroupId; + + public QuorumPrivateTransactionConfig() { + } + + public QuorumPrivateTransactionConfig privateFrom(String privateFrom) { + + this.privateFrom = privateFrom; + return this; + } + + /** + * Get privateFrom + * @return privateFrom + **/ + @javax.annotation.Nullable + public String getPrivateFrom() { + return privateFrom; + } + + + public void setPrivateFrom(String privateFrom) { + this.privateFrom = privateFrom; + } + + + public QuorumPrivateTransactionConfig privateFor(List privateFor) { + + this.privateFor = privateFor; + return this; + } + + public QuorumPrivateTransactionConfig addPrivateForItem(Object privateForItem) { + if (this.privateFor == null) { + this.privateFor = null; + } + this.privateFor.add(privateForItem); + return this; + } + + /** + * Get privateFor + * @return privateFor + **/ + @javax.annotation.Nonnull + public List getPrivateFor() { + return privateFor; + } + + + public void setPrivateFor(List privateFor) { + this.privateFor = privateFor; + } + + + public QuorumPrivateTransactionConfig isPrivate(Boolean isPrivate) { + + this.isPrivate = isPrivate; + return this; + } + + /** + * Get isPrivate + * @return isPrivate + **/ + @javax.annotation.Nullable + public Boolean getIsPrivate() { + return isPrivate; + } + + + public void setIsPrivate(Boolean isPrivate) { + this.isPrivate = isPrivate; + } + + + public QuorumPrivateTransactionConfig gasPrice(BigDecimal gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public BigDecimal getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(BigDecimal gasPrice) { + this.gasPrice = gasPrice; + } + + + public QuorumPrivateTransactionConfig gasLimit(BigDecimal gasLimit) { + + this.gasLimit = gasLimit; + return this; + } + + /** + * Get gasLimit + * @return gasLimit + **/ + @javax.annotation.Nullable + public BigDecimal getGasLimit() { + return gasLimit; + } + + + public void setGasLimit(BigDecimal gasLimit) { + this.gasLimit = gasLimit; + } + + + public QuorumPrivateTransactionConfig privateKey(String privateKey) { + + this.privateKey = privateKey; + return this; + } + + /** + * Get privateKey + * @return privateKey + **/ + @javax.annotation.Nullable + public String getPrivateKey() { + return privateKey; + } + + + public void setPrivateKey(String privateKey) { + this.privateKey = privateKey; + } + + + public QuorumPrivateTransactionConfig privacyGroupId(String privacyGroupId) { + + this.privacyGroupId = privacyGroupId; + return this; + } + + /** + * Get privacyGroupId + * @return privacyGroupId + **/ + @javax.annotation.Nullable + public String getPrivacyGroupId() { + return privacyGroupId; + } + + + public void setPrivacyGroupId(String privacyGroupId) { + this.privacyGroupId = privacyGroupId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuorumPrivateTransactionConfig quorumPrivateTransactionConfig = (QuorumPrivateTransactionConfig) o; + return Objects.equals(this.privateFrom, quorumPrivateTransactionConfig.privateFrom) && + Objects.equals(this.privateFor, quorumPrivateTransactionConfig.privateFor) && + Objects.equals(this.isPrivate, quorumPrivateTransactionConfig.isPrivate) && + Objects.equals(this.gasPrice, quorumPrivateTransactionConfig.gasPrice) && + Objects.equals(this.gasLimit, quorumPrivateTransactionConfig.gasLimit) && + Objects.equals(this.privateKey, quorumPrivateTransactionConfig.privateKey) && + Objects.equals(this.privacyGroupId, quorumPrivateTransactionConfig.privacyGroupId); + } + + @Override + public int hashCode() { + return Objects.hash(privateFrom, privateFor, isPrivate, gasPrice, gasLimit, privateKey, privacyGroupId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuorumPrivateTransactionConfig {\n"); + sb.append(" privateFrom: ").append(toIndentedString(privateFrom)).append("\n"); + sb.append(" privateFor: ").append(toIndentedString(privateFor)).append("\n"); + sb.append(" isPrivate: ").append(toIndentedString(isPrivate)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n"); + sb.append(" privacyGroupId: ").append(toIndentedString(privacyGroupId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("privateFrom"); + openapiFields.add("privateFor"); + openapiFields.add("isPrivate"); + openapiFields.add("gasPrice"); + openapiFields.add("gasLimit"); + openapiFields.add("privateKey"); + openapiFields.add("privacyGroupId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("privateFor"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QuorumPrivateTransactionConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!QuorumPrivateTransactionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in QuorumPrivateTransactionConfig is not found in the empty JSON string", QuorumPrivateTransactionConfig.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!QuorumPrivateTransactionConfig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `QuorumPrivateTransactionConfig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : QuorumPrivateTransactionConfig.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("privateFrom") != null && !jsonObj.get("privateFrom").isJsonNull()) && !jsonObj.get("privateFrom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `privateFrom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("privateFrom").toString())); + } + // ensure the required json array is present + if (jsonObj.get("privateFor") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("privateFor").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `privateFor` to be an array in the JSON string but got `%s`", jsonObj.get("privateFor").toString())); + } + if ((jsonObj.get("privateKey") != null && !jsonObj.get("privateKey").isJsonNull()) && !jsonObj.get("privateKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `privateKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("privateKey").toString())); + } + if ((jsonObj.get("privacyGroupId") != null && !jsonObj.get("privacyGroupId").isJsonNull()) && !jsonObj.get("privacyGroupId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `privacyGroupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("privacyGroupId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QuorumPrivateTransactionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QuorumPrivateTransactionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QuorumPrivateTransactionConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QuorumPrivateTransactionConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QuorumPrivateTransactionConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QuorumPrivateTransactionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuorumPrivateTransactionConfig + * @throws IOException if the JSON string is invalid with respect to QuorumPrivateTransactionConfig + */ + public static QuorumPrivateTransactionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QuorumPrivateTransactionConfig.class); + } + + /** + * Convert an instance of QuorumPrivateTransactionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfig.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfig.java new file mode 100644 index 00000000000..927d10acbe9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfig.java @@ -0,0 +1,506 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.openapitools.client.model.QuorumTransactionConfigTo; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * QuorumTransactionConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class QuorumTransactionConfig { + public static final String SERIALIZED_NAME_RAW_TRANSACTION = "rawTransaction"; + @SerializedName(SERIALIZED_NAME_RAW_TRANSACTION) + private String rawTransaction; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private QuorumTransactionConfigFrom from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private QuorumTransactionConfigTo to; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private QuorumTransactionConfigFrom value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private QuorumTransactionConfigFrom gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private QuorumTransactionConfigFrom gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private QuorumTransactionConfigTo data; + + public QuorumTransactionConfig() { + } + + public QuorumTransactionConfig rawTransaction(String rawTransaction) { + + this.rawTransaction = rawTransaction; + return this; + } + + /** + * Get rawTransaction + * @return rawTransaction + **/ + @javax.annotation.Nullable + public String getRawTransaction() { + return rawTransaction; + } + + + public void setRawTransaction(String rawTransaction) { + this.rawTransaction = rawTransaction; + } + + + public QuorumTransactionConfig from(QuorumTransactionConfigFrom from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getFrom() { + return from; + } + + + public void setFrom(QuorumTransactionConfigFrom from) { + this.from = from; + } + + + public QuorumTransactionConfig to(QuorumTransactionConfigTo to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigTo getTo() { + return to; + } + + + public void setTo(QuorumTransactionConfigTo to) { + this.to = to; + } + + + public QuorumTransactionConfig value(QuorumTransactionConfigFrom value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getValue() { + return value; + } + + + public void setValue(QuorumTransactionConfigFrom value) { + this.value = value; + } + + + public QuorumTransactionConfig gas(QuorumTransactionConfigFrom gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getGas() { + return gas; + } + + + public void setGas(QuorumTransactionConfigFrom gas) { + this.gas = gas; + } + + + public QuorumTransactionConfig gasPrice(QuorumTransactionConfigFrom gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigFrom getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(QuorumTransactionConfigFrom gasPrice) { + this.gasPrice = gasPrice; + } + + + public QuorumTransactionConfig nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public QuorumTransactionConfig data(QuorumTransactionConfigTo data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + public QuorumTransactionConfigTo getData() { + return data; + } + + + public void setData(QuorumTransactionConfigTo data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the QuorumTransactionConfig instance itself + */ + public QuorumTransactionConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuorumTransactionConfig quorumTransactionConfig = (QuorumTransactionConfig) o; + return Objects.equals(this.rawTransaction, quorumTransactionConfig.rawTransaction) && + Objects.equals(this.from, quorumTransactionConfig.from) && + Objects.equals(this.to, quorumTransactionConfig.to) && + Objects.equals(this.value, quorumTransactionConfig.value) && + Objects.equals(this.gas, quorumTransactionConfig.gas) && + Objects.equals(this.gasPrice, quorumTransactionConfig.gasPrice) && + Objects.equals(this.nonce, quorumTransactionConfig.nonce) && + Objects.equals(this.data, quorumTransactionConfig.data)&& + Objects.equals(this.additionalProperties, quorumTransactionConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rawTransaction, from, to, value, gas, gasPrice, nonce, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuorumTransactionConfig {\n"); + sb.append(" rawTransaction: ").append(toIndentedString(rawTransaction)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rawTransaction"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QuorumTransactionConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!QuorumTransactionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in QuorumTransactionConfig is not found in the empty JSON string", QuorumTransactionConfig.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("rawTransaction") != null && !jsonObj.get("rawTransaction").isJsonNull()) && !jsonObj.get("rawTransaction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rawTransaction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawTransaction").toString())); + } + // validate the optional field `from` + if (jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("from")); + } + // validate the optional field `to` + if (jsonObj.get("to") != null && !jsonObj.get("to").isJsonNull()) { + QuorumTransactionConfigTo.validateJsonObject(jsonObj.getAsJsonObject("to")); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + QuorumTransactionConfigTo.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QuorumTransactionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QuorumTransactionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QuorumTransactionConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QuorumTransactionConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public QuorumTransactionConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + QuorumTransactionConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QuorumTransactionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuorumTransactionConfig + * @throws IOException if the JSON string is invalid with respect to QuorumTransactionConfig + */ + public static QuorumTransactionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QuorumTransactionConfig.class); + } + + /** + * Convert an instance of QuorumTransactionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfigFrom.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfigFrom.java new file mode 100644 index 00000000000..f6539d91598 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfigFrom.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import java.math.BigDecimal; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class QuorumTransactionConfigFrom extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(QuorumTransactionConfigFrom.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QuorumTransactionConfigFrom.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QuorumTransactionConfigFrom' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QuorumTransactionConfigFrom value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonObject obj = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, String"); + } + + @Override + public QuorumTransactionConfigFrom read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + BigDecimal.validateJsonObject(jsonObject); + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + QuorumTransactionConfigFrom ret = new QuorumTransactionConfigFrom(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for QuorumTransactionConfigFrom: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public QuorumTransactionConfigFrom() { + super("oneOf", Boolean.FALSE); + } + + public QuorumTransactionConfigFrom(BigDecimal o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public QuorumTransactionConfigFrom(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BigDecimal", new GenericType() { + }); + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return QuorumTransactionConfigFrom.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, String"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, String + * + * @return The actual instance (BigDecimal, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QuorumTransactionConfigFrom + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with BigDecimal + try { + BigDecimal.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for QuorumTransactionConfigFrom with oneOf schemas: BigDecimal, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of QuorumTransactionConfigFrom given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuorumTransactionConfigFrom + * @throws IOException if the JSON string is invalid with respect to QuorumTransactionConfigFrom + */ + public static QuorumTransactionConfigFrom fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QuorumTransactionConfigFrom.class); + } + + /** + * Convert an instance of QuorumTransactionConfigFrom to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfigTo.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfigTo.java new file mode 100644 index 00000000000..a60c21d665c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/QuorumTransactionConfigTo.java @@ -0,0 +1,224 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class QuorumTransactionConfigTo extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(QuorumTransactionConfigTo.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QuorumTransactionConfigTo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QuorumTransactionConfigTo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, QuorumTransactionConfigTo value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: String"); + } + + @Override + public QuorumTransactionConfigTo read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + QuorumTransactionConfigTo ret = new QuorumTransactionConfigTo(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for QuorumTransactionConfigTo: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public QuorumTransactionConfigTo() { + super("oneOf", Boolean.FALSE); + } + + public QuorumTransactionConfigTo(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return QuorumTransactionConfigTo.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be String"); + } + + /** + * Get the actual instance, which can be the following: + * String + * + * @return The actual instance (String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QuorumTransactionConfigTo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for QuorumTransactionConfigTo with oneOf schemas: String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of QuorumTransactionConfigTo given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuorumTransactionConfigTo + * @throws IOException if the JSON string is invalid with respect to QuorumTransactionConfigTo + */ + public static QuorumTransactionConfigTo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QuorumTransactionConfigTo.class); + } + + /** + * Convert an instance of QuorumTransactionConfigTo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java new file mode 100644 index 00000000000..f730d9f89a1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionRequest.java @@ -0,0 +1,309 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.QuorumPrivateTransactionConfig; +import org.openapitools.client.model.QuorumTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionRequest { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_TRANSACTION_CONFIG = "transactionConfig"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_CONFIG) + private QuorumTransactionConfig transactionConfig; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG = "privateTransactionConfig"; + @SerializedName(SERIALIZED_NAME_PRIVATE_TRANSACTION_CONFIG) + private QuorumPrivateTransactionConfig privateTransactionConfig; + + public RunTransactionRequest() { + } + + public RunTransactionRequest web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public RunTransactionRequest transactionConfig(QuorumTransactionConfig transactionConfig) { + + this.transactionConfig = transactionConfig; + return this; + } + + /** + * Get transactionConfig + * @return transactionConfig + **/ + @javax.annotation.Nonnull + public QuorumTransactionConfig getTransactionConfig() { + return transactionConfig; + } + + + public void setTransactionConfig(QuorumTransactionConfig transactionConfig) { + this.transactionConfig = transactionConfig; + } + + + public RunTransactionRequest timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with thehash of the transaction(which indicates successful execution) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public RunTransactionRequest privateTransactionConfig(QuorumPrivateTransactionConfig privateTransactionConfig) { + + this.privateTransactionConfig = privateTransactionConfig; + return this; + } + + /** + * Get privateTransactionConfig + * @return privateTransactionConfig + **/ + @javax.annotation.Nullable + public QuorumPrivateTransactionConfig getPrivateTransactionConfig() { + return privateTransactionConfig; + } + + + public void setPrivateTransactionConfig(QuorumPrivateTransactionConfig privateTransactionConfig) { + this.privateTransactionConfig = privateTransactionConfig; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionRequest runTransactionRequest = (RunTransactionRequest) o; + return Objects.equals(this.web3SigningCredential, runTransactionRequest.web3SigningCredential) && + Objects.equals(this.transactionConfig, runTransactionRequest.transactionConfig) && + Objects.equals(this.timeoutMs, runTransactionRequest.timeoutMs) && + Objects.equals(this.privateTransactionConfig, runTransactionRequest.privateTransactionConfig); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, transactionConfig, timeoutMs, privateTransactionConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionRequest {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" transactionConfig: ").append(toIndentedString(transactionConfig)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" privateTransactionConfig: ").append(toIndentedString(privateTransactionConfig)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("transactionConfig"); + openapiFields.add("timeoutMs"); + openapiFields.add("privateTransactionConfig"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("transactionConfig"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionRequest is not found in the empty JSON string", RunTransactionRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + // validate the optional field `privateTransactionConfig` + if (jsonObj.get("privateTransactionConfig") != null && !jsonObj.get("privateTransactionConfig").isJsonNull()) { + QuorumPrivateTransactionConfig.validateJsonObject(jsonObj.getAsJsonObject("privateTransactionConfig")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionRequest + * @throws IOException if the JSON string is invalid with respect to RunTransactionRequest + */ + public static RunTransactionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionRequest.class); + } + + /** + * Convert an instance of RunTransactionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java new file mode 100644 index 00000000000..a3e14223cc1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionResponse.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionResponse { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public RunTransactionResponse() { + } + + public RunTransactionResponse transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionResponse runTransactionResponse = (RunTransactionResponse) o; + return Objects.equals(this.transactionReceipt, runTransactionResponse.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionResponse {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionResponse is not found in the empty JSON string", RunTransactionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionResponse + * @throws IOException if the JSON string is invalid with respect to RunTransactionResponse + */ + public static RunTransactionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionResponse.class); + } + + /** + * Convert an instance of RunTransactionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java new file mode 100644 index 00000000000..d73b3676f22 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java @@ -0,0 +1,502 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactCompiler; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifact + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifact { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private String metadata; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_DEPLOYED_BYTECODE = "deployedBytecode"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_BYTECODE) + private String deployedBytecode; + + public static final String SERIALIZED_NAME_SOURCE_MAP = "sourceMap"; + @SerializedName(SERIALIZED_NAME_SOURCE_MAP) + private String sourceMap; + + public static final String SERIALIZED_NAME_DEPLOYED_SOURCE_MAP = "deployedSourceMap"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_SOURCE_MAP) + private String deployedSourceMap; + + public static final String SERIALIZED_NAME_SOURCE_PATH = "sourcePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_PATH) + private String sourcePath; + + public static final String SERIALIZED_NAME_COMPILER = "compiler"; + @SerializedName(SERIALIZED_NAME_COMPILER) + private SolidityContractJsonArtifactCompiler compiler; + + public static final String SERIALIZED_NAME_FUNCTION_HASHES = "functionHashes"; + @SerializedName(SERIALIZED_NAME_FUNCTION_HASHES) + private Map functionHashes = new HashMap<>(); + + public static final String SERIALIZED_NAME_GAS_ESTIMATES = "gasEstimates"; + @SerializedName(SERIALIZED_NAME_GAS_ESTIMATES) + private SolidityContractJsonArtifactGasEstimates gasEstimates; + + public SolidityContractJsonArtifact() { + } + + public SolidityContractJsonArtifact contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public SolidityContractJsonArtifact metadata(String metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + public String getMetadata() { + return metadata; + } + + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + + public SolidityContractJsonArtifact bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * Get bytecode + * @return bytecode + **/ + @javax.annotation.Nullable + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public SolidityContractJsonArtifact deployedBytecode(String deployedBytecode) { + + this.deployedBytecode = deployedBytecode; + return this; + } + + /** + * Get deployedBytecode + * @return deployedBytecode + **/ + @javax.annotation.Nullable + public String getDeployedBytecode() { + return deployedBytecode; + } + + + public void setDeployedBytecode(String deployedBytecode) { + this.deployedBytecode = deployedBytecode; + } + + + public SolidityContractJsonArtifact sourceMap(String sourceMap) { + + this.sourceMap = sourceMap; + return this; + } + + /** + * Get sourceMap + * @return sourceMap + **/ + @javax.annotation.Nullable + public String getSourceMap() { + return sourceMap; + } + + + public void setSourceMap(String sourceMap) { + this.sourceMap = sourceMap; + } + + + public SolidityContractJsonArtifact deployedSourceMap(String deployedSourceMap) { + + this.deployedSourceMap = deployedSourceMap; + return this; + } + + /** + * Get deployedSourceMap + * @return deployedSourceMap + **/ + @javax.annotation.Nullable + public String getDeployedSourceMap() { + return deployedSourceMap; + } + + + public void setDeployedSourceMap(String deployedSourceMap) { + this.deployedSourceMap = deployedSourceMap; + } + + + public SolidityContractJsonArtifact sourcePath(String sourcePath) { + + this.sourcePath = sourcePath; + return this; + } + + /** + * Get sourcePath + * @return sourcePath + **/ + @javax.annotation.Nullable + public String getSourcePath() { + return sourcePath; + } + + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + } + + + public SolidityContractJsonArtifact compiler(SolidityContractJsonArtifactCompiler compiler) { + + this.compiler = compiler; + return this; + } + + /** + * Get compiler + * @return compiler + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactCompiler getCompiler() { + return compiler; + } + + + public void setCompiler(SolidityContractJsonArtifactCompiler compiler) { + this.compiler = compiler; + } + + + public SolidityContractJsonArtifact functionHashes(Map functionHashes) { + + this.functionHashes = functionHashes; + return this; + } + + public SolidityContractJsonArtifact putFunctionHashesItem(String key, Object functionHashesItem) { + if (this.functionHashes == null) { + this.functionHashes = new HashMap<>(); + } + this.functionHashes.put(key, functionHashesItem); + return this; + } + + /** + * Get functionHashes + * @return functionHashes + **/ + @javax.annotation.Nullable + public Map getFunctionHashes() { + return functionHashes; + } + + + public void setFunctionHashes(Map functionHashes) { + this.functionHashes = functionHashes; + } + + + public SolidityContractJsonArtifact gasEstimates(SolidityContractJsonArtifactGasEstimates gasEstimates) { + + this.gasEstimates = gasEstimates; + return this; + } + + /** + * Get gasEstimates + * @return gasEstimates + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactGasEstimates getGasEstimates() { + return gasEstimates; + } + + + public void setGasEstimates(SolidityContractJsonArtifactGasEstimates gasEstimates) { + this.gasEstimates = gasEstimates; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifact solidityContractJsonArtifact = (SolidityContractJsonArtifact) o; + return Objects.equals(this.contractName, solidityContractJsonArtifact.contractName) && + Objects.equals(this.metadata, solidityContractJsonArtifact.metadata) && + Objects.equals(this.bytecode, solidityContractJsonArtifact.bytecode) && + Objects.equals(this.deployedBytecode, solidityContractJsonArtifact.deployedBytecode) && + Objects.equals(this.sourceMap, solidityContractJsonArtifact.sourceMap) && + Objects.equals(this.deployedSourceMap, solidityContractJsonArtifact.deployedSourceMap) && + Objects.equals(this.sourcePath, solidityContractJsonArtifact.sourcePath) && + Objects.equals(this.compiler, solidityContractJsonArtifact.compiler) && + Objects.equals(this.functionHashes, solidityContractJsonArtifact.functionHashes) && + Objects.equals(this.gasEstimates, solidityContractJsonArtifact.gasEstimates); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, metadata, bytecode, deployedBytecode, sourceMap, deployedSourceMap, sourcePath, compiler, functionHashes, gasEstimates); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifact {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" deployedBytecode: ").append(toIndentedString(deployedBytecode)).append("\n"); + sb.append(" sourceMap: ").append(toIndentedString(sourceMap)).append("\n"); + sb.append(" deployedSourceMap: ").append(toIndentedString(deployedSourceMap)).append("\n"); + sb.append(" sourcePath: ").append(toIndentedString(sourcePath)).append("\n"); + sb.append(" compiler: ").append(toIndentedString(compiler)).append("\n"); + sb.append(" functionHashes: ").append(toIndentedString(functionHashes)).append("\n"); + sb.append(" gasEstimates: ").append(toIndentedString(gasEstimates)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("metadata"); + openapiFields.add("bytecode"); + openapiFields.add("deployedBytecode"); + openapiFields.add("sourceMap"); + openapiFields.add("deployedSourceMap"); + openapiFields.add("sourcePath"); + openapiFields.add("compiler"); + openapiFields.add("functionHashes"); + openapiFields.add("gasEstimates"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifact + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifact.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifact is not found in the empty JSON string", SolidityContractJsonArtifact.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifact.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifact` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SolidityContractJsonArtifact.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if ((jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) && !jsonObj.get("metadata").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `metadata` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadata").toString())); + } + if ((jsonObj.get("bytecode") != null && !jsonObj.get("bytecode").isJsonNull()) && !jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + if ((jsonObj.get("deployedBytecode") != null && !jsonObj.get("deployedBytecode").isJsonNull()) && !jsonObj.get("deployedBytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedBytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedBytecode").toString())); + } + if ((jsonObj.get("sourceMap") != null && !jsonObj.get("sourceMap").isJsonNull()) && !jsonObj.get("sourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceMap").toString())); + } + if ((jsonObj.get("deployedSourceMap") != null && !jsonObj.get("deployedSourceMap").isJsonNull()) && !jsonObj.get("deployedSourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedSourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedSourceMap").toString())); + } + if ((jsonObj.get("sourcePath") != null && !jsonObj.get("sourcePath").isJsonNull()) && !jsonObj.get("sourcePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourcePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourcePath").toString())); + } + // validate the optional field `gasEstimates` + if (jsonObj.get("gasEstimates") != null && !jsonObj.get("gasEstimates").isJsonNull()) { + SolidityContractJsonArtifactGasEstimates.validateJsonObject(jsonObj.getAsJsonObject("gasEstimates")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifact.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifact' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifact.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifact value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifact read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifact given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifact + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifact + */ + public static SolidityContractJsonArtifact fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifact.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifact to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java new file mode 100644 index 00000000000..6948dd6557a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java @@ -0,0 +1,314 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactCompiler + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactCompiler { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public SolidityContractJsonArtifactCompiler() { + } + + public SolidityContractJsonArtifactCompiler name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public SolidityContractJsonArtifactCompiler version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SolidityContractJsonArtifactCompiler instance itself + */ + public SolidityContractJsonArtifactCompiler putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactCompiler solidityContractJsonArtifactCompiler = (SolidityContractJsonArtifactCompiler) o; + return Objects.equals(this.name, solidityContractJsonArtifactCompiler.name) && + Objects.equals(this.version, solidityContractJsonArtifactCompiler.version)&& + Objects.equals(this.additionalProperties, solidityContractJsonArtifactCompiler.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, version, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactCompiler {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactCompiler + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactCompiler.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactCompiler is not found in the empty JSON string", SolidityContractJsonArtifactCompiler.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactCompiler.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactCompiler' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactCompiler.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactCompiler value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactCompiler read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + SolidityContractJsonArtifactCompiler instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactCompiler given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactCompiler + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactCompiler + */ + public static SolidityContractJsonArtifactCompiler fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactCompiler.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactCompiler to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java new file mode 100644 index 00000000000..634757e1f14 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactGasEstimates + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactGasEstimates { + public static final String SERIALIZED_NAME_CREATION = "creation"; + @SerializedName(SERIALIZED_NAME_CREATION) + private SolidityContractJsonArtifactGasEstimatesCreation creation; + + public static final String SERIALIZED_NAME_EXTERNAL = "external"; + @SerializedName(SERIALIZED_NAME_EXTERNAL) + private Map external = new HashMap<>(); + + public SolidityContractJsonArtifactGasEstimates() { + } + + public SolidityContractJsonArtifactGasEstimates creation(SolidityContractJsonArtifactGasEstimatesCreation creation) { + + this.creation = creation; + return this; + } + + /** + * Get creation + * @return creation + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactGasEstimatesCreation getCreation() { + return creation; + } + + + public void setCreation(SolidityContractJsonArtifactGasEstimatesCreation creation) { + this.creation = creation; + } + + + public SolidityContractJsonArtifactGasEstimates external(Map external) { + + this.external = external; + return this; + } + + public SolidityContractJsonArtifactGasEstimates putExternalItem(String key, Object externalItem) { + if (this.external == null) { + this.external = new HashMap<>(); + } + this.external.put(key, externalItem); + return this; + } + + /** + * Get external + * @return external + **/ + @javax.annotation.Nullable + public Map getExternal() { + return external; + } + + + public void setExternal(Map external) { + this.external = external; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactGasEstimates solidityContractJsonArtifactGasEstimates = (SolidityContractJsonArtifactGasEstimates) o; + return Objects.equals(this.creation, solidityContractJsonArtifactGasEstimates.creation) && + Objects.equals(this.external, solidityContractJsonArtifactGasEstimates.external); + } + + @Override + public int hashCode() { + return Objects.hash(creation, external); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactGasEstimates {\n"); + sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); + sb.append(" external: ").append(toIndentedString(external)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("creation"); + openapiFields.add("external"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactGasEstimates + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactGasEstimates.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactGasEstimates is not found in the empty JSON string", SolidityContractJsonArtifactGasEstimates.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifactGasEstimates.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifactGasEstimates` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `creation` + if (jsonObj.get("creation") != null && !jsonObj.get("creation").isJsonNull()) { + SolidityContractJsonArtifactGasEstimatesCreation.validateJsonObject(jsonObj.getAsJsonObject("creation")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactGasEstimates.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactGasEstimates' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactGasEstimates.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactGasEstimates value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactGasEstimates read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactGasEstimates given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactGasEstimates + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactGasEstimates + */ + public static SolidityContractJsonArtifactGasEstimates fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactGasEstimates.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactGasEstimates to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java new file mode 100644 index 00000000000..6fd80df1cfb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java @@ -0,0 +1,270 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactGasEstimatesCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactGasEstimatesCreation { + public static final String SERIALIZED_NAME_CODE_DEPOSIT_COST = "codeDepositCost"; + @SerializedName(SERIALIZED_NAME_CODE_DEPOSIT_COST) + private String codeDepositCost; + + public static final String SERIALIZED_NAME_EXECUTION_COST = "executionCost"; + @SerializedName(SERIALIZED_NAME_EXECUTION_COST) + private String executionCost; + + public static final String SERIALIZED_NAME_TOTAL_COST = "totalCost"; + @SerializedName(SERIALIZED_NAME_TOTAL_COST) + private String totalCost; + + public SolidityContractJsonArtifactGasEstimatesCreation() { + } + + public SolidityContractJsonArtifactGasEstimatesCreation codeDepositCost(String codeDepositCost) { + + this.codeDepositCost = codeDepositCost; + return this; + } + + /** + * Get codeDepositCost + * @return codeDepositCost + **/ + @javax.annotation.Nullable + public String getCodeDepositCost() { + return codeDepositCost; + } + + + public void setCodeDepositCost(String codeDepositCost) { + this.codeDepositCost = codeDepositCost; + } + + + public SolidityContractJsonArtifactGasEstimatesCreation executionCost(String executionCost) { + + this.executionCost = executionCost; + return this; + } + + /** + * Get executionCost + * @return executionCost + **/ + @javax.annotation.Nullable + public String getExecutionCost() { + return executionCost; + } + + + public void setExecutionCost(String executionCost) { + this.executionCost = executionCost; + } + + + public SolidityContractJsonArtifactGasEstimatesCreation totalCost(String totalCost) { + + this.totalCost = totalCost; + return this; + } + + /** + * Get totalCost + * @return totalCost + **/ + @javax.annotation.Nullable + public String getTotalCost() { + return totalCost; + } + + + public void setTotalCost(String totalCost) { + this.totalCost = totalCost; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactGasEstimatesCreation solidityContractJsonArtifactGasEstimatesCreation = (SolidityContractJsonArtifactGasEstimatesCreation) o; + return Objects.equals(this.codeDepositCost, solidityContractJsonArtifactGasEstimatesCreation.codeDepositCost) && + Objects.equals(this.executionCost, solidityContractJsonArtifactGasEstimatesCreation.executionCost) && + Objects.equals(this.totalCost, solidityContractJsonArtifactGasEstimatesCreation.totalCost); + } + + @Override + public int hashCode() { + return Objects.hash(codeDepositCost, executionCost, totalCost); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactGasEstimatesCreation {\n"); + sb.append(" codeDepositCost: ").append(toIndentedString(codeDepositCost)).append("\n"); + sb.append(" executionCost: ").append(toIndentedString(executionCost)).append("\n"); + sb.append(" totalCost: ").append(toIndentedString(totalCost)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("codeDepositCost"); + openapiFields.add("executionCost"); + openapiFields.add("totalCost"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactGasEstimatesCreation + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactGasEstimatesCreation is not found in the empty JSON string", SolidityContractJsonArtifactGasEstimatesCreation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifactGasEstimatesCreation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("codeDepositCost") != null && !jsonObj.get("codeDepositCost").isJsonNull()) && !jsonObj.get("codeDepositCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `codeDepositCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("codeDepositCost").toString())); + } + if ((jsonObj.get("executionCost") != null && !jsonObj.get("executionCost").isJsonNull()) && !jsonObj.get("executionCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `executionCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("executionCost").toString())); + } + if ((jsonObj.get("totalCost") != null && !jsonObj.get("totalCost").isJsonNull()) && !jsonObj.get("totalCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `totalCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalCost").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactGasEstimatesCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactGasEstimatesCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactGasEstimatesCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactGasEstimatesCreation read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactGasEstimatesCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactGasEstimatesCreation + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactGasEstimatesCreation + */ + public static SolidityContractJsonArtifactGasEstimatesCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactGasEstimatesCreation.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactGasEstimatesCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java new file mode 100644 index 00000000000..89264fe9bed --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets WatchBlocksV1 + */ +@JsonAdapter(WatchBlocksV1.Adapter.class) +public enum WatchBlocksV1 { + + Subscribe("org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Subscribe"), + + Next("org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Next"), + + Unsubscribe("org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Unsubscribe"), + + Error("org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Error"), + + Complete("org.hyperledger.cactus.api.async.quorum.WatchBlocksV1.Complete"); + + private String value; + + WatchBlocksV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchBlocksV1 fromValue(String value) { + for (WatchBlocksV1 b : WatchBlocksV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchBlocksV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchBlocksV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchBlocksV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java new file mode 100644 index 00000000000..8b57ce386b9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1BlockData.java @@ -0,0 +1,838 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.openapitools.client.model.Web3Transaction; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WatchBlocksV1BlockData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1BlockData { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private BigDecimal number; + + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_PARENT_HASH = "parentHash"; + @SerializedName(SERIALIZED_NAME_PARENT_HASH) + private String parentHash; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_SHA3_UNCLES = "sha3Uncles"; + @SerializedName(SERIALIZED_NAME_SHA3_UNCLES) + private String sha3Uncles; + + public static final String SERIALIZED_NAME_LOGS_BLOOM = "logsBloom"; + @SerializedName(SERIALIZED_NAME_LOGS_BLOOM) + private String logsBloom; + + public static final String SERIALIZED_NAME_TRANSACTIONS_ROOT = "transactionsRoot"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS_ROOT) + private String transactionsRoot; + + public static final String SERIALIZED_NAME_STATE_ROOT = "stateRoot"; + @SerializedName(SERIALIZED_NAME_STATE_ROOT) + private String stateRoot; + + public static final String SERIALIZED_NAME_RECEIPTS_ROOT = "receiptsRoot"; + @SerializedName(SERIALIZED_NAME_RECEIPTS_ROOT) + private String receiptsRoot; + + public static final String SERIALIZED_NAME_DIFFICULTY = "difficulty"; + @SerializedName(SERIALIZED_NAME_DIFFICULTY) + private String difficulty; + + public static final String SERIALIZED_NAME_MIX_HASH = "mixHash"; + @SerializedName(SERIALIZED_NAME_MIX_HASH) + private String mixHash; + + public static final String SERIALIZED_NAME_MINER = "miner"; + @SerializedName(SERIALIZED_NAME_MINER) + private String miner; + + public static final String SERIALIZED_NAME_EXTRA_DATA = "extraData"; + @SerializedName(SERIALIZED_NAME_EXTRA_DATA) + private String extraData; + + public static final String SERIALIZED_NAME_GAS_LIMIT = "gasLimit"; + @SerializedName(SERIALIZED_NAME_GAS_LIMIT) + private Integer gasLimit; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private Integer gasUsed; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private QuorumTransactionConfigFrom timestamp; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + private BigDecimal size; + + public static final String SERIALIZED_NAME_TOTAL_DIFFICULTY = "totalDifficulty"; + @SerializedName(SERIALIZED_NAME_TOTAL_DIFFICULTY) + private String totalDifficulty; + + public static final String SERIALIZED_NAME_UNCLES = "uncles"; + @SerializedName(SERIALIZED_NAME_UNCLES) + private List uncles = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TRANSACTIONS = "transactions"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS) + private List transactions = new ArrayList<>(); + + public WatchBlocksV1BlockData() { + } + + public WatchBlocksV1BlockData number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @javax.annotation.Nonnull + public BigDecimal getNumber() { + return number; + } + + + public void setNumber(BigDecimal number) { + this.number = number; + } + + + public WatchBlocksV1BlockData hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + **/ + @javax.annotation.Nonnull + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public WatchBlocksV1BlockData parentHash(String parentHash) { + + this.parentHash = parentHash; + return this; + } + + /** + * Get parentHash + * @return parentHash + **/ + @javax.annotation.Nonnull + public String getParentHash() { + return parentHash; + } + + + public void setParentHash(String parentHash) { + this.parentHash = parentHash; + } + + + public WatchBlocksV1BlockData nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nonnull + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public WatchBlocksV1BlockData sha3Uncles(String sha3Uncles) { + + this.sha3Uncles = sha3Uncles; + return this; + } + + /** + * Get sha3Uncles + * @return sha3Uncles + **/ + @javax.annotation.Nonnull + public String getSha3Uncles() { + return sha3Uncles; + } + + + public void setSha3Uncles(String sha3Uncles) { + this.sha3Uncles = sha3Uncles; + } + + + public WatchBlocksV1BlockData logsBloom(String logsBloom) { + + this.logsBloom = logsBloom; + return this; + } + + /** + * Get logsBloom + * @return logsBloom + **/ + @javax.annotation.Nonnull + public String getLogsBloom() { + return logsBloom; + } + + + public void setLogsBloom(String logsBloom) { + this.logsBloom = logsBloom; + } + + + public WatchBlocksV1BlockData transactionsRoot(String transactionsRoot) { + + this.transactionsRoot = transactionsRoot; + return this; + } + + /** + * Get transactionsRoot + * @return transactionsRoot + **/ + @javax.annotation.Nullable + public String getTransactionsRoot() { + return transactionsRoot; + } + + + public void setTransactionsRoot(String transactionsRoot) { + this.transactionsRoot = transactionsRoot; + } + + + public WatchBlocksV1BlockData stateRoot(String stateRoot) { + + this.stateRoot = stateRoot; + return this; + } + + /** + * Get stateRoot + * @return stateRoot + **/ + @javax.annotation.Nonnull + public String getStateRoot() { + return stateRoot; + } + + + public void setStateRoot(String stateRoot) { + this.stateRoot = stateRoot; + } + + + public WatchBlocksV1BlockData receiptsRoot(String receiptsRoot) { + + this.receiptsRoot = receiptsRoot; + return this; + } + + /** + * Get receiptsRoot + * @return receiptsRoot + **/ + @javax.annotation.Nullable + public String getReceiptsRoot() { + return receiptsRoot; + } + + + public void setReceiptsRoot(String receiptsRoot) { + this.receiptsRoot = receiptsRoot; + } + + + public WatchBlocksV1BlockData difficulty(String difficulty) { + + this.difficulty = difficulty; + return this; + } + + /** + * Get difficulty + * @return difficulty + **/ + @javax.annotation.Nullable + public String getDifficulty() { + return difficulty; + } + + + public void setDifficulty(String difficulty) { + this.difficulty = difficulty; + } + + + public WatchBlocksV1BlockData mixHash(String mixHash) { + + this.mixHash = mixHash; + return this; + } + + /** + * Get mixHash + * @return mixHash + **/ + @javax.annotation.Nullable + public String getMixHash() { + return mixHash; + } + + + public void setMixHash(String mixHash) { + this.mixHash = mixHash; + } + + + public WatchBlocksV1BlockData miner(String miner) { + + this.miner = miner; + return this; + } + + /** + * Get miner + * @return miner + **/ + @javax.annotation.Nonnull + public String getMiner() { + return miner; + } + + + public void setMiner(String miner) { + this.miner = miner; + } + + + public WatchBlocksV1BlockData extraData(String extraData) { + + this.extraData = extraData; + return this; + } + + /** + * Get extraData + * @return extraData + **/ + @javax.annotation.Nonnull + public String getExtraData() { + return extraData; + } + + + public void setExtraData(String extraData) { + this.extraData = extraData; + } + + + public WatchBlocksV1BlockData gasLimit(Integer gasLimit) { + + this.gasLimit = gasLimit; + return this; + } + + /** + * Get gasLimit + * @return gasLimit + **/ + @javax.annotation.Nonnull + public Integer getGasLimit() { + return gasLimit; + } + + + public void setGasLimit(Integer gasLimit) { + this.gasLimit = gasLimit; + } + + + public WatchBlocksV1BlockData gasUsed(Integer gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + public Integer getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(Integer gasUsed) { + this.gasUsed = gasUsed; + } + + + public WatchBlocksV1BlockData timestamp(QuorumTransactionConfigFrom timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nonnull + public QuorumTransactionConfigFrom getTimestamp() { + return timestamp; + } + + + public void setTimestamp(QuorumTransactionConfigFrom timestamp) { + this.timestamp = timestamp; + } + + + public WatchBlocksV1BlockData size(BigDecimal size) { + + this.size = size; + return this; + } + + /** + * Get size + * @return size + **/ + @javax.annotation.Nonnull + public BigDecimal getSize() { + return size; + } + + + public void setSize(BigDecimal size) { + this.size = size; + } + + + public WatchBlocksV1BlockData totalDifficulty(String totalDifficulty) { + + this.totalDifficulty = totalDifficulty; + return this; + } + + /** + * Get totalDifficulty + * @return totalDifficulty + **/ + @javax.annotation.Nonnull + public String getTotalDifficulty() { + return totalDifficulty; + } + + + public void setTotalDifficulty(String totalDifficulty) { + this.totalDifficulty = totalDifficulty; + } + + + public WatchBlocksV1BlockData uncles(List uncles) { + + this.uncles = uncles; + return this; + } + + public WatchBlocksV1BlockData addUnclesItem(String unclesItem) { + if (this.uncles == null) { + this.uncles = new ArrayList<>(); + } + this.uncles.add(unclesItem); + return this; + } + + /** + * Get uncles + * @return uncles + **/ + @javax.annotation.Nonnull + public List getUncles() { + return uncles; + } + + + public void setUncles(List uncles) { + this.uncles = uncles; + } + + + public WatchBlocksV1BlockData transactions(List transactions) { + + this.transactions = transactions; + return this; + } + + public WatchBlocksV1BlockData addTransactionsItem(Web3Transaction transactionsItem) { + if (this.transactions == null) { + this.transactions = new ArrayList<>(); + } + this.transactions.add(transactionsItem); + return this; + } + + /** + * Get transactions + * @return transactions + **/ + @javax.annotation.Nonnull + public List getTransactions() { + return transactions; + } + + + public void setTransactions(List transactions) { + this.transactions = transactions; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1BlockData watchBlocksV1BlockData = (WatchBlocksV1BlockData) o; + return Objects.equals(this.number, watchBlocksV1BlockData.number) && + Objects.equals(this.hash, watchBlocksV1BlockData.hash) && + Objects.equals(this.parentHash, watchBlocksV1BlockData.parentHash) && + Objects.equals(this.nonce, watchBlocksV1BlockData.nonce) && + Objects.equals(this.sha3Uncles, watchBlocksV1BlockData.sha3Uncles) && + Objects.equals(this.logsBloom, watchBlocksV1BlockData.logsBloom) && + Objects.equals(this.transactionsRoot, watchBlocksV1BlockData.transactionsRoot) && + Objects.equals(this.stateRoot, watchBlocksV1BlockData.stateRoot) && + Objects.equals(this.receiptsRoot, watchBlocksV1BlockData.receiptsRoot) && + Objects.equals(this.difficulty, watchBlocksV1BlockData.difficulty) && + Objects.equals(this.mixHash, watchBlocksV1BlockData.mixHash) && + Objects.equals(this.miner, watchBlocksV1BlockData.miner) && + Objects.equals(this.extraData, watchBlocksV1BlockData.extraData) && + Objects.equals(this.gasLimit, watchBlocksV1BlockData.gasLimit) && + Objects.equals(this.gasUsed, watchBlocksV1BlockData.gasUsed) && + Objects.equals(this.timestamp, watchBlocksV1BlockData.timestamp) && + Objects.equals(this.size, watchBlocksV1BlockData.size) && + Objects.equals(this.totalDifficulty, watchBlocksV1BlockData.totalDifficulty) && + Objects.equals(this.uncles, watchBlocksV1BlockData.uncles) && + Objects.equals(this.transactions, watchBlocksV1BlockData.transactions); + } + + @Override + public int hashCode() { + return Objects.hash(number, hash, parentHash, nonce, sha3Uncles, logsBloom, transactionsRoot, stateRoot, receiptsRoot, difficulty, mixHash, miner, extraData, gasLimit, gasUsed, timestamp, size, totalDifficulty, uncles, transactions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1BlockData {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" parentHash: ").append(toIndentedString(parentHash)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" sha3Uncles: ").append(toIndentedString(sha3Uncles)).append("\n"); + sb.append(" logsBloom: ").append(toIndentedString(logsBloom)).append("\n"); + sb.append(" transactionsRoot: ").append(toIndentedString(transactionsRoot)).append("\n"); + sb.append(" stateRoot: ").append(toIndentedString(stateRoot)).append("\n"); + sb.append(" receiptsRoot: ").append(toIndentedString(receiptsRoot)).append("\n"); + sb.append(" difficulty: ").append(toIndentedString(difficulty)).append("\n"); + sb.append(" mixHash: ").append(toIndentedString(mixHash)).append("\n"); + sb.append(" miner: ").append(toIndentedString(miner)).append("\n"); + sb.append(" extraData: ").append(toIndentedString(extraData)).append("\n"); + sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" totalDifficulty: ").append(toIndentedString(totalDifficulty)).append("\n"); + sb.append(" uncles: ").append(toIndentedString(uncles)).append("\n"); + sb.append(" transactions: ").append(toIndentedString(transactions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("number"); + openapiFields.add("hash"); + openapiFields.add("parentHash"); + openapiFields.add("nonce"); + openapiFields.add("sha3Uncles"); + openapiFields.add("logsBloom"); + openapiFields.add("transactionsRoot"); + openapiFields.add("stateRoot"); + openapiFields.add("receiptsRoot"); + openapiFields.add("difficulty"); + openapiFields.add("mixHash"); + openapiFields.add("miner"); + openapiFields.add("extraData"); + openapiFields.add("gasLimit"); + openapiFields.add("gasUsed"); + openapiFields.add("timestamp"); + openapiFields.add("size"); + openapiFields.add("totalDifficulty"); + openapiFields.add("uncles"); + openapiFields.add("transactions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("number"); + openapiRequiredFields.add("hash"); + openapiRequiredFields.add("parentHash"); + openapiRequiredFields.add("nonce"); + openapiRequiredFields.add("sha3Uncles"); + openapiRequiredFields.add("logsBloom"); + openapiRequiredFields.add("stateRoot"); + openapiRequiredFields.add("miner"); + openapiRequiredFields.add("extraData"); + openapiRequiredFields.add("gasLimit"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("timestamp"); + openapiRequiredFields.add("size"); + openapiRequiredFields.add("totalDifficulty"); + openapiRequiredFields.add("uncles"); + openapiRequiredFields.add("transactions"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1BlockData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1BlockData.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1BlockData is not found in the empty JSON string", WatchBlocksV1BlockData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1BlockData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1BlockData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksV1BlockData.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if (!jsonObj.get("parentHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parentHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parentHash").toString())); + } + if (!jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if (!jsonObj.get("sha3Uncles").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sha3Uncles` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3Uncles").toString())); + } + if (!jsonObj.get("logsBloom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logsBloom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logsBloom").toString())); + } + if ((jsonObj.get("transactionsRoot") != null && !jsonObj.get("transactionsRoot").isJsonNull()) && !jsonObj.get("transactionsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionsRoot").toString())); + } + if (!jsonObj.get("stateRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateRoot").toString())); + } + if ((jsonObj.get("receiptsRoot") != null && !jsonObj.get("receiptsRoot").isJsonNull()) && !jsonObj.get("receiptsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `receiptsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiptsRoot").toString())); + } + if ((jsonObj.get("difficulty") != null && !jsonObj.get("difficulty").isJsonNull()) && !jsonObj.get("difficulty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `difficulty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("difficulty").toString())); + } + if ((jsonObj.get("mixHash") != null && !jsonObj.get("mixHash").isJsonNull()) && !jsonObj.get("mixHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mixHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mixHash").toString())); + } + if (!jsonObj.get("miner").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `miner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("miner").toString())); + } + if (!jsonObj.get("extraData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `extraData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraData").toString())); + } + // validate the required field `timestamp` + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("timestamp")); + if (!jsonObj.get("totalDifficulty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `totalDifficulty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalDifficulty").toString())); + } + // ensure the required json array is present + if (jsonObj.get("uncles") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("uncles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `uncles` to be an array in the JSON string but got `%s`", jsonObj.get("uncles").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("transactions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transactions` to be an array in the JSON string but got `%s`", jsonObj.get("transactions").toString())); + } + + JsonArray jsonArraytransactions = jsonObj.getAsJsonArray("transactions"); + // validate the required field `transactions` (array) + for (int i = 0; i < jsonArraytransactions.size(); i++) { + Web3Transaction.validateJsonObject(jsonArraytransactions.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1BlockData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1BlockData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1BlockData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1BlockData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1BlockData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1BlockData given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1BlockData + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1BlockData + */ + public static WatchBlocksV1BlockData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1BlockData.class); + } + + /** + * Convert an instance of WatchBlocksV1BlockData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java new file mode 100644 index 00000000000..4a62551e447 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java @@ -0,0 +1,205 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WatchBlocksV1Options + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1Options { + public static final String SERIALIZED_NAME_GET_BLOCK_DATA = "getBlockData"; + @SerializedName(SERIALIZED_NAME_GET_BLOCK_DATA) + private Boolean getBlockData; + + public WatchBlocksV1Options() { + } + + public WatchBlocksV1Options getBlockData(Boolean getBlockData) { + + this.getBlockData = getBlockData; + return this; + } + + /** + * Get getBlockData + * @return getBlockData + **/ + @javax.annotation.Nullable + public Boolean getGetBlockData() { + return getBlockData; + } + + + public void setGetBlockData(Boolean getBlockData) { + this.getBlockData = getBlockData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1Options watchBlocksV1Options = (WatchBlocksV1Options) o; + return Objects.equals(this.getBlockData, watchBlocksV1Options.getBlockData); + } + + @Override + public int hashCode() { + return Objects.hash(getBlockData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1Options {\n"); + sb.append(" getBlockData: ").append(toIndentedString(getBlockData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("getBlockData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1Options + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1Options.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1Options is not found in the empty JSON string", WatchBlocksV1Options.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1Options.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1Options` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1Options.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1Options' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1Options.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1Options value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1Options read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1Options given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1Options + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1Options + */ + public static WatchBlocksV1Options fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1Options.class); + } + + /** + * Convert an instance of WatchBlocksV1Options to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java new file mode 100644 index 00000000000..889f1e0a914 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java @@ -0,0 +1,243 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.WatchBlocksV1BlockData; +import org.openapitools.client.model.Web3BlockHeader; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WatchBlocksV1Progress + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1Progress { + public static final String SERIALIZED_NAME_BLOCK_HEADER = "blockHeader"; + @SerializedName(SERIALIZED_NAME_BLOCK_HEADER) + private Web3BlockHeader blockHeader; + + public static final String SERIALIZED_NAME_BLOCK_DATA = "blockData"; + @SerializedName(SERIALIZED_NAME_BLOCK_DATA) + private WatchBlocksV1BlockData blockData; + + public WatchBlocksV1Progress() { + } + + public WatchBlocksV1Progress blockHeader(Web3BlockHeader blockHeader) { + + this.blockHeader = blockHeader; + return this; + } + + /** + * Get blockHeader + * @return blockHeader + **/ + @javax.annotation.Nullable + public Web3BlockHeader getBlockHeader() { + return blockHeader; + } + + + public void setBlockHeader(Web3BlockHeader blockHeader) { + this.blockHeader = blockHeader; + } + + + public WatchBlocksV1Progress blockData(WatchBlocksV1BlockData blockData) { + + this.blockData = blockData; + return this; + } + + /** + * Get blockData + * @return blockData + **/ + @javax.annotation.Nullable + public WatchBlocksV1BlockData getBlockData() { + return blockData; + } + + + public void setBlockData(WatchBlocksV1BlockData blockData) { + this.blockData = blockData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1Progress watchBlocksV1Progress = (WatchBlocksV1Progress) o; + return Objects.equals(this.blockHeader, watchBlocksV1Progress.blockHeader) && + Objects.equals(this.blockData, watchBlocksV1Progress.blockData); + } + + @Override + public int hashCode() { + return Objects.hash(blockHeader, blockData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1Progress {\n"); + sb.append(" blockHeader: ").append(toIndentedString(blockHeader)).append("\n"); + sb.append(" blockData: ").append(toIndentedString(blockData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("blockHeader"); + openapiFields.add("blockData"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1Progress + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1Progress.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1Progress is not found in the empty JSON string", WatchBlocksV1Progress.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1Progress.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1Progress` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `blockHeader` + if (jsonObj.get("blockHeader") != null && !jsonObj.get("blockHeader").isJsonNull()) { + Web3BlockHeader.validateJsonObject(jsonObj.getAsJsonObject("blockHeader")); + } + // validate the optional field `blockData` + if (jsonObj.get("blockData") != null && !jsonObj.get("blockData").isJsonNull()) { + WatchBlocksV1BlockData.validateJsonObject(jsonObj.getAsJsonObject("blockData")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1Progress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1Progress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1Progress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1Progress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1Progress read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1Progress given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1Progress + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1Progress + */ + public static WatchBlocksV1Progress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1Progress.class); + } + + /** + * Convert an instance of WatchBlocksV1Progress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java new file mode 100644 index 00000000000..7fe69e3692e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3BlockHeader.java @@ -0,0 +1,684 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.QuorumTransactionConfigFrom; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3BlockHeader + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3BlockHeader { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private BigDecimal number; + + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_PARENT_HASH = "parentHash"; + @SerializedName(SERIALIZED_NAME_PARENT_HASH) + private String parentHash; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_SHA3_UNCLES = "sha3Uncles"; + @SerializedName(SERIALIZED_NAME_SHA3_UNCLES) + private String sha3Uncles; + + public static final String SERIALIZED_NAME_LOGS_BLOOM = "logsBloom"; + @SerializedName(SERIALIZED_NAME_LOGS_BLOOM) + private String logsBloom; + + public static final String SERIALIZED_NAME_TRANSACTIONS_ROOT = "transactionsRoot"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS_ROOT) + private String transactionsRoot; + + public static final String SERIALIZED_NAME_STATE_ROOT = "stateRoot"; + @SerializedName(SERIALIZED_NAME_STATE_ROOT) + private String stateRoot; + + public static final String SERIALIZED_NAME_RECEIPTS_ROOT = "receiptsRoot"; + @SerializedName(SERIALIZED_NAME_RECEIPTS_ROOT) + private String receiptsRoot; + + public static final String SERIALIZED_NAME_DIFFICULTY = "difficulty"; + @SerializedName(SERIALIZED_NAME_DIFFICULTY) + private String difficulty; + + public static final String SERIALIZED_NAME_MIX_HASH = "mixHash"; + @SerializedName(SERIALIZED_NAME_MIX_HASH) + private String mixHash; + + public static final String SERIALIZED_NAME_MINER = "miner"; + @SerializedName(SERIALIZED_NAME_MINER) + private String miner; + + public static final String SERIALIZED_NAME_EXTRA_DATA = "extraData"; + @SerializedName(SERIALIZED_NAME_EXTRA_DATA) + private String extraData; + + public static final String SERIALIZED_NAME_GAS_LIMIT = "gasLimit"; + @SerializedName(SERIALIZED_NAME_GAS_LIMIT) + private Integer gasLimit; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private Integer gasUsed; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private QuorumTransactionConfigFrom timestamp; + + public Web3BlockHeader() { + } + + public Web3BlockHeader number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @javax.annotation.Nonnull + public BigDecimal getNumber() { + return number; + } + + + public void setNumber(BigDecimal number) { + this.number = number; + } + + + public Web3BlockHeader hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + **/ + @javax.annotation.Nonnull + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public Web3BlockHeader parentHash(String parentHash) { + + this.parentHash = parentHash; + return this; + } + + /** + * Get parentHash + * @return parentHash + **/ + @javax.annotation.Nonnull + public String getParentHash() { + return parentHash; + } + + + public void setParentHash(String parentHash) { + this.parentHash = parentHash; + } + + + public Web3BlockHeader nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nonnull + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public Web3BlockHeader sha3Uncles(String sha3Uncles) { + + this.sha3Uncles = sha3Uncles; + return this; + } + + /** + * Get sha3Uncles + * @return sha3Uncles + **/ + @javax.annotation.Nonnull + public String getSha3Uncles() { + return sha3Uncles; + } + + + public void setSha3Uncles(String sha3Uncles) { + this.sha3Uncles = sha3Uncles; + } + + + public Web3BlockHeader logsBloom(String logsBloom) { + + this.logsBloom = logsBloom; + return this; + } + + /** + * Get logsBloom + * @return logsBloom + **/ + @javax.annotation.Nonnull + public String getLogsBloom() { + return logsBloom; + } + + + public void setLogsBloom(String logsBloom) { + this.logsBloom = logsBloom; + } + + + public Web3BlockHeader transactionsRoot(String transactionsRoot) { + + this.transactionsRoot = transactionsRoot; + return this; + } + + /** + * Get transactionsRoot + * @return transactionsRoot + **/ + @javax.annotation.Nullable + public String getTransactionsRoot() { + return transactionsRoot; + } + + + public void setTransactionsRoot(String transactionsRoot) { + this.transactionsRoot = transactionsRoot; + } + + + public Web3BlockHeader stateRoot(String stateRoot) { + + this.stateRoot = stateRoot; + return this; + } + + /** + * Get stateRoot + * @return stateRoot + **/ + @javax.annotation.Nonnull + public String getStateRoot() { + return stateRoot; + } + + + public void setStateRoot(String stateRoot) { + this.stateRoot = stateRoot; + } + + + public Web3BlockHeader receiptsRoot(String receiptsRoot) { + + this.receiptsRoot = receiptsRoot; + return this; + } + + /** + * Get receiptsRoot + * @return receiptsRoot + **/ + @javax.annotation.Nullable + public String getReceiptsRoot() { + return receiptsRoot; + } + + + public void setReceiptsRoot(String receiptsRoot) { + this.receiptsRoot = receiptsRoot; + } + + + public Web3BlockHeader difficulty(String difficulty) { + + this.difficulty = difficulty; + return this; + } + + /** + * Get difficulty + * @return difficulty + **/ + @javax.annotation.Nullable + public String getDifficulty() { + return difficulty; + } + + + public void setDifficulty(String difficulty) { + this.difficulty = difficulty; + } + + + public Web3BlockHeader mixHash(String mixHash) { + + this.mixHash = mixHash; + return this; + } + + /** + * Get mixHash + * @return mixHash + **/ + @javax.annotation.Nullable + public String getMixHash() { + return mixHash; + } + + + public void setMixHash(String mixHash) { + this.mixHash = mixHash; + } + + + public Web3BlockHeader miner(String miner) { + + this.miner = miner; + return this; + } + + /** + * Get miner + * @return miner + **/ + @javax.annotation.Nonnull + public String getMiner() { + return miner; + } + + + public void setMiner(String miner) { + this.miner = miner; + } + + + public Web3BlockHeader extraData(String extraData) { + + this.extraData = extraData; + return this; + } + + /** + * Get extraData + * @return extraData + **/ + @javax.annotation.Nonnull + public String getExtraData() { + return extraData; + } + + + public void setExtraData(String extraData) { + this.extraData = extraData; + } + + + public Web3BlockHeader gasLimit(Integer gasLimit) { + + this.gasLimit = gasLimit; + return this; + } + + /** + * Get gasLimit + * @return gasLimit + **/ + @javax.annotation.Nonnull + public Integer getGasLimit() { + return gasLimit; + } + + + public void setGasLimit(Integer gasLimit) { + this.gasLimit = gasLimit; + } + + + public Web3BlockHeader gasUsed(Integer gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + public Integer getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(Integer gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3BlockHeader timestamp(QuorumTransactionConfigFrom timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nonnull + public QuorumTransactionConfigFrom getTimestamp() { + return timestamp; + } + + + public void setTimestamp(QuorumTransactionConfigFrom timestamp) { + this.timestamp = timestamp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3BlockHeader web3BlockHeader = (Web3BlockHeader) o; + return Objects.equals(this.number, web3BlockHeader.number) && + Objects.equals(this.hash, web3BlockHeader.hash) && + Objects.equals(this.parentHash, web3BlockHeader.parentHash) && + Objects.equals(this.nonce, web3BlockHeader.nonce) && + Objects.equals(this.sha3Uncles, web3BlockHeader.sha3Uncles) && + Objects.equals(this.logsBloom, web3BlockHeader.logsBloom) && + Objects.equals(this.transactionsRoot, web3BlockHeader.transactionsRoot) && + Objects.equals(this.stateRoot, web3BlockHeader.stateRoot) && + Objects.equals(this.receiptsRoot, web3BlockHeader.receiptsRoot) && + Objects.equals(this.difficulty, web3BlockHeader.difficulty) && + Objects.equals(this.mixHash, web3BlockHeader.mixHash) && + Objects.equals(this.miner, web3BlockHeader.miner) && + Objects.equals(this.extraData, web3BlockHeader.extraData) && + Objects.equals(this.gasLimit, web3BlockHeader.gasLimit) && + Objects.equals(this.gasUsed, web3BlockHeader.gasUsed) && + Objects.equals(this.timestamp, web3BlockHeader.timestamp); + } + + @Override + public int hashCode() { + return Objects.hash(number, hash, parentHash, nonce, sha3Uncles, logsBloom, transactionsRoot, stateRoot, receiptsRoot, difficulty, mixHash, miner, extraData, gasLimit, gasUsed, timestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3BlockHeader {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" parentHash: ").append(toIndentedString(parentHash)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" sha3Uncles: ").append(toIndentedString(sha3Uncles)).append("\n"); + sb.append(" logsBloom: ").append(toIndentedString(logsBloom)).append("\n"); + sb.append(" transactionsRoot: ").append(toIndentedString(transactionsRoot)).append("\n"); + sb.append(" stateRoot: ").append(toIndentedString(stateRoot)).append("\n"); + sb.append(" receiptsRoot: ").append(toIndentedString(receiptsRoot)).append("\n"); + sb.append(" difficulty: ").append(toIndentedString(difficulty)).append("\n"); + sb.append(" mixHash: ").append(toIndentedString(mixHash)).append("\n"); + sb.append(" miner: ").append(toIndentedString(miner)).append("\n"); + sb.append(" extraData: ").append(toIndentedString(extraData)).append("\n"); + sb.append(" gasLimit: ").append(toIndentedString(gasLimit)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).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(); + openapiFields.add("number"); + openapiFields.add("hash"); + openapiFields.add("parentHash"); + openapiFields.add("nonce"); + openapiFields.add("sha3Uncles"); + openapiFields.add("logsBloom"); + openapiFields.add("transactionsRoot"); + openapiFields.add("stateRoot"); + openapiFields.add("receiptsRoot"); + openapiFields.add("difficulty"); + openapiFields.add("mixHash"); + openapiFields.add("miner"); + openapiFields.add("extraData"); + openapiFields.add("gasLimit"); + openapiFields.add("gasUsed"); + openapiFields.add("timestamp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("number"); + openapiRequiredFields.add("hash"); + openapiRequiredFields.add("parentHash"); + openapiRequiredFields.add("nonce"); + openapiRequiredFields.add("sha3Uncles"); + openapiRequiredFields.add("logsBloom"); + openapiRequiredFields.add("stateRoot"); + openapiRequiredFields.add("miner"); + openapiRequiredFields.add("extraData"); + openapiRequiredFields.add("gasLimit"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("timestamp"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3BlockHeader + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3BlockHeader.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3BlockHeader is not found in the empty JSON string", Web3BlockHeader.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3BlockHeader.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3BlockHeader` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3BlockHeader.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if (!jsonObj.get("parentHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `parentHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("parentHash").toString())); + } + if (!jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if (!jsonObj.get("sha3Uncles").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sha3Uncles` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sha3Uncles").toString())); + } + if (!jsonObj.get("logsBloom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logsBloom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logsBloom").toString())); + } + if ((jsonObj.get("transactionsRoot") != null && !jsonObj.get("transactionsRoot").isJsonNull()) && !jsonObj.get("transactionsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionsRoot").toString())); + } + if (!jsonObj.get("stateRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateRoot").toString())); + } + if ((jsonObj.get("receiptsRoot") != null && !jsonObj.get("receiptsRoot").isJsonNull()) && !jsonObj.get("receiptsRoot").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `receiptsRoot` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiptsRoot").toString())); + } + if ((jsonObj.get("difficulty") != null && !jsonObj.get("difficulty").isJsonNull()) && !jsonObj.get("difficulty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `difficulty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("difficulty").toString())); + } + if ((jsonObj.get("mixHash") != null && !jsonObj.get("mixHash").isJsonNull()) && !jsonObj.get("mixHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `mixHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mixHash").toString())); + } + if (!jsonObj.get("miner").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `miner` to be a primitive type in the JSON string but got `%s`", jsonObj.get("miner").toString())); + } + if (!jsonObj.get("extraData").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `extraData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraData").toString())); + } + // validate the required field `timestamp` + QuorumTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("timestamp")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3BlockHeader.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3BlockHeader' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3BlockHeader.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3BlockHeader value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3BlockHeader read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3BlockHeader given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3BlockHeader + * @throws IOException if the JSON string is invalid with respect to Web3BlockHeader + */ + public static Web3BlockHeader fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3BlockHeader.class); + } + + /** + * Convert an instance of Web3BlockHeader to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java new file mode 100644 index 00000000000..a4ea964d856 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java @@ -0,0 +1,391 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialGethKeychainPassword; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredential extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Web3SigningCredential.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWeb3SigningCredentialCactusKeychainRef = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + final TypeAdapter adapterWeb3SigningCredentialGethKeychainPassword = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialGethKeychainPassword.class)); + final TypeAdapter adapterWeb3SigningCredentialNone = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + final TypeAdapter adapterWeb3SigningCredentialPrivateKeyHex = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredential value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialCactusKeychainRef` + if (value.getActualInstance() instanceof Web3SigningCredentialCactusKeychainRef) { + JsonObject obj = adapterWeb3SigningCredentialCactusKeychainRef.toJsonTree((Web3SigningCredentialCactusKeychainRef)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialGethKeychainPassword` + if (value.getActualInstance() instanceof Web3SigningCredentialGethKeychainPassword) { + JsonObject obj = adapterWeb3SigningCredentialGethKeychainPassword.toJsonTree((Web3SigningCredentialGethKeychainPassword)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialNone` + if (value.getActualInstance() instanceof Web3SigningCredentialNone) { + JsonObject obj = adapterWeb3SigningCredentialNone.toJsonTree((Web3SigningCredentialNone)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialPrivateKeyHex` + if (value.getActualInstance() instanceof Web3SigningCredentialPrivateKeyHex) { + JsonObject obj = adapterWeb3SigningCredentialPrivateKeyHex.toJsonTree((Web3SigningCredentialPrivateKeyHex)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + @Override + public Web3SigningCredential read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Web3SigningCredentialCactusKeychainRef + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialCactusKeychainRef; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialCactusKeychainRef'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialCactusKeychainRef'", e); + } + + // deserialize Web3SigningCredentialGethKeychainPassword + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialGethKeychainPassword.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialGethKeychainPassword; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialGethKeychainPassword'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialGethKeychainPassword failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialGethKeychainPassword'", e); + } + + // deserialize Web3SigningCredentialNone + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialNone.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialNone; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialNone'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialNone'", e); + } + + // deserialize Web3SigningCredentialPrivateKeyHex + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialPrivateKeyHex; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialPrivateKeyHex'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialPrivateKeyHex'", e); + } + + if (match == 1) { + Web3SigningCredential ret = new Web3SigningCredential(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Web3SigningCredential: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Web3SigningCredential() { + super("oneOf", Boolean.FALSE); + } + + public Web3SigningCredential(Web3SigningCredentialCactusKeychainRef o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialGethKeychainPassword o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialNone o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialPrivateKeyHex o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Web3SigningCredentialCactusKeychainRef", new GenericType() { + }); + schemas.put("Web3SigningCredentialGethKeychainPassword", new GenericType() { + }); + schemas.put("Web3SigningCredentialNone", new GenericType() { + }); + schemas.put("Web3SigningCredentialPrivateKeyHex", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Web3SigningCredential.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Web3SigningCredentialCactusKeychainRef) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialGethKeychainPassword) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialNone) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialPrivateKeyHex) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + /** + * Get the actual instance, which can be the following: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * @return The actual instance (Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialCactusKeychainRef`. If the actual instance is not `Web3SigningCredentialCactusKeychainRef`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialCactusKeychainRef` + * @throws ClassCastException if the instance is not `Web3SigningCredentialCactusKeychainRef` + */ + public Web3SigningCredentialCactusKeychainRef getWeb3SigningCredentialCactusKeychainRef() throws ClassCastException { + return (Web3SigningCredentialCactusKeychainRef)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialGethKeychainPassword`. If the actual instance is not `Web3SigningCredentialGethKeychainPassword`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialGethKeychainPassword` + * @throws ClassCastException if the instance is not `Web3SigningCredentialGethKeychainPassword` + */ + public Web3SigningCredentialGethKeychainPassword getWeb3SigningCredentialGethKeychainPassword() throws ClassCastException { + return (Web3SigningCredentialGethKeychainPassword)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialNone`. If the actual instance is not `Web3SigningCredentialNone`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialNone` + * @throws ClassCastException if the instance is not `Web3SigningCredentialNone` + */ + public Web3SigningCredentialNone getWeb3SigningCredentialNone() throws ClassCastException { + return (Web3SigningCredentialNone)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialPrivateKeyHex`. If the actual instance is not `Web3SigningCredentialPrivateKeyHex`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialPrivateKeyHex` + * @throws ClassCastException if the instance is not `Web3SigningCredentialPrivateKeyHex` + */ + public Web3SigningCredentialPrivateKeyHex getWeb3SigningCredentialPrivateKeyHex() throws ClassCastException { + return (Web3SigningCredentialPrivateKeyHex)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Web3SigningCredentialCactusKeychainRef + try { + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialGethKeychainPassword + try { + Web3SigningCredentialGethKeychainPassword.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialGethKeychainPassword failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialNone + try { + Web3SigningCredentialNone.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialPrivateKeyHex + try { + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Web3SigningCredential with oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialGethKeychainPassword, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Web3SigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredential + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredential + */ + public static Web3SigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredential.class); + } + + /** + * Convert an instance of Web3SigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java new file mode 100644 index 00000000000..72aa31645aa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java @@ -0,0 +1,309 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialCactusKeychainRef + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialCactusKeychainRef { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY = "keychainEntryKey"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY) + private String keychainEntryKey; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public Web3SigningCredentialCactusKeychainRef() { + } + + public Web3SigningCredentialCactusKeychainRef type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialCactusKeychainRef ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialCactusKeychainRef keychainEntryKey(String keychainEntryKey) { + + this.keychainEntryKey = keychainEntryKey; + return this; + } + + /** + * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + * @return keychainEntryKey + **/ + @javax.annotation.Nonnull + public String getKeychainEntryKey() { + return keychainEntryKey; + } + + + public void setKeychainEntryKey(String keychainEntryKey) { + this.keychainEntryKey = keychainEntryKey; + } + + + public Web3SigningCredentialCactusKeychainRef keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + * @return keychainId + **/ + @javax.annotation.Nullable + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialCactusKeychainRef web3SigningCredentialCactusKeychainRef = (Web3SigningCredentialCactusKeychainRef) o; + return Objects.equals(this.type, web3SigningCredentialCactusKeychainRef.type) && + Objects.equals(this.ethAccount, web3SigningCredentialCactusKeychainRef.ethAccount) && + Objects.equals(this.keychainEntryKey, web3SigningCredentialCactusKeychainRef.keychainEntryKey) && + Objects.equals(this.keychainId, web3SigningCredentialCactusKeychainRef.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, keychainEntryKey, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialCactusKeychainRef {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" keychainEntryKey: ").append(toIndentedString(keychainEntryKey)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("keychainEntryKey"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("keychainEntryKey"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialCactusKeychainRef is not found in the empty JSON string", Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialCactusKeychainRef.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialCactusKeychainRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialCactusKeychainRef.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("keychainEntryKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainEntryKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainEntryKey").toString())); + } + if ((jsonObj.get("keychainId") != null && !jsonObj.get("keychainId").isJsonNull()) && !jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialCactusKeychainRef.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialCactusKeychainRef' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialCactusKeychainRef value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialCactusKeychainRef read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialCactusKeychainRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialCactusKeychainRef + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static Web3SigningCredentialCactusKeychainRef fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialCactusKeychainRef.class); + } + + /** + * Convert an instance of Web3SigningCredentialCactusKeychainRef to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java new file mode 100644 index 00000000000..396fba6a574 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPassword.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialGethKeychainPassword + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialGethKeychainPassword { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialGethKeychainPassword() { + } + + public Web3SigningCredentialGethKeychainPassword type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialGethKeychainPassword ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialGethKeychainPassword secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * A geth keychain unlock password. + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialGethKeychainPassword web3SigningCredentialGethKeychainPassword = (Web3SigningCredentialGethKeychainPassword) o; + return Objects.equals(this.type, web3SigningCredentialGethKeychainPassword.type) && + Objects.equals(this.ethAccount, web3SigningCredentialGethKeychainPassword.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialGethKeychainPassword.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialGethKeychainPassword {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialGethKeychainPassword + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialGethKeychainPassword.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialGethKeychainPassword is not found in the empty JSON string", Web3SigningCredentialGethKeychainPassword.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialGethKeychainPassword.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialGethKeychainPassword` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialGethKeychainPassword.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialGethKeychainPassword.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialGethKeychainPassword' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialGethKeychainPassword.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialGethKeychainPassword value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialGethKeychainPassword read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialGethKeychainPassword given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialGethKeychainPassword + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialGethKeychainPassword + */ + public static Web3SigningCredentialGethKeychainPassword fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialGethKeychainPassword.class); + } + + /** + * Convert an instance of Web3SigningCredentialGethKeychainPassword to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java new file mode 100644 index 00000000000..0f3468a530b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Using this denotes that there is no signing required because the transaction is pre-signed. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialNone { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public Web3SigningCredentialNone() { + } + + public Web3SigningCredentialNone type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialNone web3SigningCredentialNone = (Web3SigningCredentialNone) o; + return Objects.equals(this.type, web3SigningCredentialNone.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialNone {\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(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialNone + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialNone.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialNone is not found in the empty JSON string", Web3SigningCredentialNone.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialNone.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialNone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialNone.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialNone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialNone' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialNone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialNone read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialNone given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialNone + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialNone + */ + public static Web3SigningCredentialNone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialNone.class); + } + + /** + * Convert an instance of Web3SigningCredentialNone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java new file mode 100644 index 00000000000..c42e5e0e0e3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialPrivateKeyHex + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialPrivateKeyHex { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialPrivateKeyHex() { + } + + public Web3SigningCredentialPrivateKeyHex type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialPrivateKeyHex ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialPrivateKeyHex secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * The HEX encoded private key of an eth account. + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialPrivateKeyHex web3SigningCredentialPrivateKeyHex = (Web3SigningCredentialPrivateKeyHex) o; + return Objects.equals(this.type, web3SigningCredentialPrivateKeyHex.type) && + Objects.equals(this.ethAccount, web3SigningCredentialPrivateKeyHex.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialPrivateKeyHex.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialPrivateKeyHex {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialPrivateKeyHex is not found in the empty JSON string", Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialPrivateKeyHex.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialPrivateKeyHex` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialPrivateKeyHex.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialPrivateKeyHex.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialPrivateKeyHex' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialPrivateKeyHex value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialPrivateKeyHex read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialPrivateKeyHex given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialPrivateKeyHex + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static Web3SigningCredentialPrivateKeyHex fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialPrivateKeyHex.class); + } + + /** + * Convert an instance of Web3SigningCredentialPrivateKeyHex to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java new file mode 100644 index 00000000000..eaa857ab73d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Web3SigningCredentialType + */ +@JsonAdapter(Web3SigningCredentialType.Adapter.class) +public enum Web3SigningCredentialType { + + CACTUS_KEYCHAIN_REF("CACTUS_KEYCHAIN_REF"), + + GETH_KEYCHAIN_PASSWORD("GETH_KEYCHAIN_PASSWORD"), + + PRIVATE_KEY_HEX("PRIVATE_KEY_HEX"), + + NONE("NONE"); + + private String value; + + Web3SigningCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Web3SigningCredentialType fromValue(String value) { + for (Web3SigningCredentialType b : Web3SigningCredentialType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Web3SigningCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Web3SigningCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Web3SigningCredentialType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3Transaction.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3Transaction.java new file mode 100644 index 00000000000..cca2a7f01e7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3Transaction.java @@ -0,0 +1,618 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3Transaction + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3Transaction { + public static final String SERIALIZED_NAME_HASH = "hash"; + @SerializedName(SERIALIZED_NAME_HASH) + private String hash; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private BigDecimal blockNumber; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private BigDecimal transactionIndex; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private String gasPrice; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public static final String SERIALIZED_NAME_INPUT = "input"; + @SerializedName(SERIALIZED_NAME_INPUT) + private String input; + + public static final String SERIALIZED_NAME_V = "v"; + @SerializedName(SERIALIZED_NAME_V) + private String v; + + public static final String SERIALIZED_NAME_R = "r"; + @SerializedName(SERIALIZED_NAME_R) + private String r; + + public static final String SERIALIZED_NAME_S = "s"; + @SerializedName(SERIALIZED_NAME_S) + private String s; + + public Web3Transaction() { + } + + public Web3Transaction hash(String hash) { + + this.hash = hash; + return this; + } + + /** + * Get hash + * @return hash + **/ + @javax.annotation.Nonnull + public String getHash() { + return hash; + } + + + public void setHash(String hash) { + this.hash = hash; + } + + + public Web3Transaction nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nonnull + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public Web3Transaction blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nullable + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public Web3Transaction blockNumber(BigDecimal blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nullable + public BigDecimal getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(BigDecimal blockNumber) { + this.blockNumber = blockNumber; + } + + + public Web3Transaction transactionIndex(BigDecimal transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nullable + public BigDecimal getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(BigDecimal transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public Web3Transaction from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nonnull + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public Web3Transaction to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nullable + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + + public Web3Transaction value(String value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + public Web3Transaction gasPrice(String gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nonnull + public String getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(String gasPrice) { + this.gasPrice = gasPrice; + } + + + public Web3Transaction gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nonnull + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + public Web3Transaction input(String input) { + + this.input = input; + return this; + } + + /** + * Get input + * @return input + **/ + @javax.annotation.Nonnull + public String getInput() { + return input; + } + + + public void setInput(String input) { + this.input = input; + } + + + public Web3Transaction v(String v) { + + this.v = v; + return this; + } + + /** + * Get v + * @return v + **/ + @javax.annotation.Nullable + public String getV() { + return v; + } + + + public void setV(String v) { + this.v = v; + } + + + public Web3Transaction r(String r) { + + this.r = r; + return this; + } + + /** + * Get r + * @return r + **/ + @javax.annotation.Nullable + public String getR() { + return r; + } + + + public void setR(String r) { + this.r = r; + } + + + public Web3Transaction s(String s) { + + this.s = s; + return this; + } + + /** + * Get s + * @return s + **/ + @javax.annotation.Nullable + public String getS() { + return s; + } + + + public void setS(String s) { + this.s = s; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3Transaction web3Transaction = (Web3Transaction) o; + return Objects.equals(this.hash, web3Transaction.hash) && + Objects.equals(this.nonce, web3Transaction.nonce) && + Objects.equals(this.blockHash, web3Transaction.blockHash) && + Objects.equals(this.blockNumber, web3Transaction.blockNumber) && + Objects.equals(this.transactionIndex, web3Transaction.transactionIndex) && + Objects.equals(this.from, web3Transaction.from) && + Objects.equals(this.to, web3Transaction.to) && + Objects.equals(this.value, web3Transaction.value) && + Objects.equals(this.gasPrice, web3Transaction.gasPrice) && + Objects.equals(this.gas, web3Transaction.gas) && + Objects.equals(this.input, web3Transaction.input) && + Objects.equals(this.v, web3Transaction.v) && + Objects.equals(this.r, web3Transaction.r) && + Objects.equals(this.s, web3Transaction.s); + } + + @Override + public int hashCode() { + return Objects.hash(hash, nonce, blockHash, blockNumber, transactionIndex, from, to, value, gasPrice, gas, input, v, r, s); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3Transaction {\n"); + sb.append(" hash: ").append(toIndentedString(hash)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" input: ").append(toIndentedString(input)).append("\n"); + sb.append(" v: ").append(toIndentedString(v)).append("\n"); + sb.append(" r: ").append(toIndentedString(r)).append("\n"); + sb.append(" s: ").append(toIndentedString(s)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("hash"); + openapiFields.add("nonce"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("transactionIndex"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("value"); + openapiFields.add("gasPrice"); + openapiFields.add("gas"); + openapiFields.add("input"); + openapiFields.add("v"); + openapiFields.add("r"); + openapiFields.add("s"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("hash"); + openapiRequiredFields.add("nonce"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("blockNumber"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("to"); + openapiRequiredFields.add("value"); + openapiRequiredFields.add("gasPrice"); + openapiRequiredFields.add("gas"); + openapiRequiredFields.add("input"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3Transaction + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3Transaction.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3Transaction is not found in the empty JSON string", Web3Transaction.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3Transaction.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3Transaction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3Transaction.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hash").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if (!jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if (!jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + if (!jsonObj.get("gasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasPrice").toString())); + } + if (!jsonObj.get("input").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `input` to be a primitive type in the JSON string but got `%s`", jsonObj.get("input").toString())); + } + if ((jsonObj.get("v") != null && !jsonObj.get("v").isJsonNull()) && !jsonObj.get("v").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `v` to be a primitive type in the JSON string but got `%s`", jsonObj.get("v").toString())); + } + if ((jsonObj.get("r") != null && !jsonObj.get("r").isJsonNull()) && !jsonObj.get("r").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `r` to be a primitive type in the JSON string but got `%s`", jsonObj.get("r").toString())); + } + if ((jsonObj.get("s") != null && !jsonObj.get("s").isJsonNull()) && !jsonObj.get("s").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `s` to be a primitive type in the JSON string but got `%s`", jsonObj.get("s").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3Transaction.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3Transaction' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3Transaction.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3Transaction value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3Transaction read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3Transaction given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3Transaction + * @throws IOException if the JSON string is invalid with respect to Web3Transaction + */ + public static Web3Transaction fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3Transaction.class); + } + + /** + * Convert an instance of Web3Transaction to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java new file mode 100644 index 00000000000..6e4d29d7117 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java @@ -0,0 +1,741 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3TransactionReceipt + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3TransactionReceipt { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Boolean status; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private BigDecimal transactionIndex; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private BigDecimal blockNumber; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private BigDecimal gasUsed; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public static final String SERIALIZED_NAME_LOGS = "logs"; + @SerializedName(SERIALIZED_NAME_LOGS) + private List logs = null; + + public static final String SERIALIZED_NAME_LOGS_BLOOM = "logsBloom"; + @SerializedName(SERIALIZED_NAME_LOGS_BLOOM) + private String logsBloom; + + public static final String SERIALIZED_NAME_REVERT_REASON = "revertReason"; + @SerializedName(SERIALIZED_NAME_REVERT_REASON) + private String revertReason; + + public static final String SERIALIZED_NAME_OUTPUT = "output"; + @SerializedName(SERIALIZED_NAME_OUTPUT) + private String output; + + public static final String SERIALIZED_NAME_COMMITMENT_HASH = "commitmentHash"; + @SerializedName(SERIALIZED_NAME_COMMITMENT_HASH) + private String commitmentHash; + + public static final String SERIALIZED_NAME_CUMULATIVE_GAS_U_SED = "cumulativeGasUSed"; + @SerializedName(SERIALIZED_NAME_CUMULATIVE_GAS_U_SED) + private BigDecimal cumulativeGasUSed; + + public Web3TransactionReceipt() { + } + + public Web3TransactionReceipt status(Boolean status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public Boolean getStatus() { + return status; + } + + + public void setStatus(Boolean status) { + this.status = status; + } + + + public Web3TransactionReceipt transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nonnull + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + public Web3TransactionReceipt transactionIndex(BigDecimal transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nonnull + public BigDecimal getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(BigDecimal transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public Web3TransactionReceipt blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nonnull + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public Web3TransactionReceipt blockNumber(BigDecimal blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(BigDecimal blockNumber) { + this.blockNumber = blockNumber; + } + + + public Web3TransactionReceipt gasUsed(BigDecimal gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + public BigDecimal getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(BigDecimal gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3TransactionReceipt contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Get contractAddress + * @return contractAddress + **/ + @javax.annotation.Nullable + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public Web3TransactionReceipt from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nonnull + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public Web3TransactionReceipt to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nonnull + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + + public Web3TransactionReceipt logs(List logs) { + + this.logs = logs; + return this; + } + + public Web3TransactionReceipt addLogsItem(Object logsItem) { + if (this.logs == null) { + this.logs = null; + } + this.logs.add(logsItem); + return this; + } + + /** + * Get logs + * @return logs + **/ + @javax.annotation.Nullable + public List getLogs() { + return logs; + } + + + public void setLogs(List logs) { + this.logs = logs; + } + + + public Web3TransactionReceipt logsBloom(String logsBloom) { + + this.logsBloom = logsBloom; + return this; + } + + /** + * Get logsBloom + * @return logsBloom + **/ + @javax.annotation.Nullable + public String getLogsBloom() { + return logsBloom; + } + + + public void setLogsBloom(String logsBloom) { + this.logsBloom = logsBloom; + } + + + public Web3TransactionReceipt revertReason(String revertReason) { + + this.revertReason = revertReason; + return this; + } + + /** + * Get revertReason + * @return revertReason + **/ + @javax.annotation.Nullable + public String getRevertReason() { + return revertReason; + } + + + public void setRevertReason(String revertReason) { + this.revertReason = revertReason; + } + + + public Web3TransactionReceipt output(String output) { + + this.output = output; + return this; + } + + /** + * Get output + * @return output + **/ + @javax.annotation.Nullable + public String getOutput() { + return output; + } + + + public void setOutput(String output) { + this.output = output; + } + + + public Web3TransactionReceipt commitmentHash(String commitmentHash) { + + this.commitmentHash = commitmentHash; + return this; + } + + /** + * Get commitmentHash + * @return commitmentHash + **/ + @javax.annotation.Nullable + public String getCommitmentHash() { + return commitmentHash; + } + + + public void setCommitmentHash(String commitmentHash) { + this.commitmentHash = commitmentHash; + } + + + public Web3TransactionReceipt cumulativeGasUSed(BigDecimal cumulativeGasUSed) { + + this.cumulativeGasUSed = cumulativeGasUSed; + return this; + } + + /** + * Get cumulativeGasUSed + * @return cumulativeGasUSed + **/ + @javax.annotation.Nullable + public BigDecimal getCumulativeGasUSed() { + return cumulativeGasUSed; + } + + + public void setCumulativeGasUSed(BigDecimal cumulativeGasUSed) { + this.cumulativeGasUSed = cumulativeGasUSed; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Web3TransactionReceipt instance itself + */ + public Web3TransactionReceipt putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3TransactionReceipt web3TransactionReceipt = (Web3TransactionReceipt) o; + return Objects.equals(this.status, web3TransactionReceipt.status) && + Objects.equals(this.transactionHash, web3TransactionReceipt.transactionHash) && + Objects.equals(this.transactionIndex, web3TransactionReceipt.transactionIndex) && + Objects.equals(this.blockHash, web3TransactionReceipt.blockHash) && + Objects.equals(this.blockNumber, web3TransactionReceipt.blockNumber) && + Objects.equals(this.gasUsed, web3TransactionReceipt.gasUsed) && + Objects.equals(this.contractAddress, web3TransactionReceipt.contractAddress) && + Objects.equals(this.from, web3TransactionReceipt.from) && + Objects.equals(this.to, web3TransactionReceipt.to) && + Objects.equals(this.logs, web3TransactionReceipt.logs) && + Objects.equals(this.logsBloom, web3TransactionReceipt.logsBloom) && + Objects.equals(this.revertReason, web3TransactionReceipt.revertReason) && + Objects.equals(this.output, web3TransactionReceipt.output) && + Objects.equals(this.commitmentHash, web3TransactionReceipt.commitmentHash) && + Objects.equals(this.cumulativeGasUSed, web3TransactionReceipt.cumulativeGasUSed)&& + Objects.equals(this.additionalProperties, web3TransactionReceipt.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, transactionHash, transactionIndex, blockHash, blockNumber, gasUsed, contractAddress, from, to, logs, logsBloom, revertReason, output, commitmentHash, cumulativeGasUSed, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3TransactionReceipt {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" logs: ").append(toIndentedString(logs)).append("\n"); + sb.append(" logsBloom: ").append(toIndentedString(logsBloom)).append("\n"); + sb.append(" revertReason: ").append(toIndentedString(revertReason)).append("\n"); + sb.append(" output: ").append(toIndentedString(output)).append("\n"); + sb.append(" commitmentHash: ").append(toIndentedString(commitmentHash)).append("\n"); + sb.append(" cumulativeGasUSed: ").append(toIndentedString(cumulativeGasUSed)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("transactionHash"); + openapiFields.add("transactionIndex"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("gasUsed"); + openapiFields.add("contractAddress"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("logs"); + openapiFields.add("logsBloom"); + openapiFields.add("revertReason"); + openapiFields.add("output"); + openapiFields.add("commitmentHash"); + openapiFields.add("cumulativeGasUSed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("transactionHash"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("blockNumber"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("to"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3TransactionReceipt + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3TransactionReceipt.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3TransactionReceipt is not found in the empty JSON string", Web3TransactionReceipt.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3TransactionReceipt.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if ((jsonObj.get("contractAddress") != null && !jsonObj.get("contractAddress").isJsonNull()) && !jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if (!jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if (!jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("logs") != null && !jsonObj.get("logs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `logs` to be an array in the JSON string but got `%s`", jsonObj.get("logs").toString())); + } + if ((jsonObj.get("logsBloom") != null && !jsonObj.get("logsBloom").isJsonNull()) && !jsonObj.get("logsBloom").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logsBloom` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logsBloom").toString())); + } + if ((jsonObj.get("revertReason") != null && !jsonObj.get("revertReason").isJsonNull()) && !jsonObj.get("revertReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `revertReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("revertReason").toString())); + } + if ((jsonObj.get("output") != null && !jsonObj.get("output").isJsonNull()) && !jsonObj.get("output").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `output` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output").toString())); + } + if ((jsonObj.get("commitmentHash") != null && !jsonObj.get("commitmentHash").isJsonNull()) && !jsonObj.get("commitmentHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitmentHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitmentHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3TransactionReceipt.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3TransactionReceipt' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3TransactionReceipt.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3TransactionReceipt value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Web3TransactionReceipt read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Web3TransactionReceipt instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3TransactionReceipt given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3TransactionReceipt + * @throws IOException if the JSON string is invalid with respect to Web3TransactionReceipt + */ + public static Web3TransactionReceipt fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3TransactionReceipt.class); + } + + /** + * Convert an instance of Web3TransactionReceipt to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..58319a12224 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,140 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeployContractSolidityBytecodeJsonObjectV1Request; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Request; +import org.openapitools.client.model.DeployContractSolidityBytecodeV1Response; +import org.openapitools.client.model.InvokeContractJsonObjectV1Request; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.InvokeRawWeb3EthContractV1Request; +import org.openapitools.client.model.InvokeRawWeb3EthContractV1Response; +import org.openapitools.client.model.InvokeRawWeb3EthMethodV1Request; +import org.openapitools.client.model.InvokeRawWeb3EthMethodV1Response; +import org.openapitools.client.model.RunTransactionRequest; +import org.openapitools.client.model.RunTransactionResponse; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deploys the bytecode of a Solidity contract. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractSolBytecodeJsonObjectV1Test() throws ApiException { + DeployContractSolidityBytecodeJsonObjectV1Request deployContractSolidityBytecodeJsonObjectV1Request = null; + DeployContractSolidityBytecodeV1Response response = api.deployContractSolBytecodeJsonObjectV1(deployContractSolidityBytecodeJsonObjectV1Request); + // TODO: test validations + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractSolBytecodeV1Test() throws ApiException { + DeployContractSolidityBytecodeV1Request deployContractSolidityBytecodeV1Request = null; + DeployContractSolidityBytecodeV1Response response = api.deployContractSolBytecodeV1(deployContractSolidityBytecodeV1Request); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Invokes a contract on a besu ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeContractV1Test() throws ApiException { + InvokeContractV1Request invokeContractV1Request = null; + InvokeContractV1Response response = api.invokeContractV1(invokeContractV1Request); + // TODO: test validations + } + + /** + * Invokes a contract on a besu ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeContractV1NoKeychainTest() throws ApiException { + InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request = null; + InvokeContractV1Response response = api.invokeContractV1NoKeychain(invokeContractJsonObjectV1Request); + // TODO: test validations + } + + /** + * Low-level endpoint to invoke a method on deployed contract. + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeRawWeb3EthContractV1Test() throws ApiException { + InvokeRawWeb3EthContractV1Request invokeRawWeb3EthContractV1Request = null; + InvokeRawWeb3EthContractV1Response response = api.invokeRawWeb3EthContractV1(invokeRawWeb3EthContractV1Request); + // TODO: test validations + } + + /** + * Invoke any method from web3.eth (low-level) + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeWeb3EthMethodV1Test() throws ApiException { + InvokeRawWeb3EthMethodV1Request invokeRawWeb3EthMethodV1Request = null; + InvokeRawWeb3EthMethodV1Response response = api.invokeWeb3EthMethodV1(invokeRawWeb3EthMethodV1Request); + // TODO: test validations + } + + /** + * Executes a transaction on a quorum ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void runTransactionV1Test() throws ApiException { + RunTransactionRequest runTransactionRequest = null; + RunTransactionResponse response = api.runTransactionV1(runTransactionRequest); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java new file mode 100644 index 00000000000..2a53914067a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java @@ -0,0 +1,146 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ContractJSON + */ +public class ContractJSONTest { + private final ContractJSON model = new ContractJSON(); + + /** + * Model tests for ContractJSON + */ + @Test + public void testContractJSON() { + // TODO: test ContractJSON + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'abi' + */ + @Test + public void abiTest() { + // TODO: test abi + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'deployedBytecode' + */ + @Test + public void deployedBytecodeTest() { + // TODO: test deployedBytecode + } + + /** + * Test the property 'sourceMap' + */ + @Test + public void sourceMapTest() { + // TODO: test sourceMap + } + + /** + * Test the property 'deployedSourceMap' + */ + @Test + public void deployedSourceMapTest() { + // TODO: test deployedSourceMap + } + + /** + * Test the property 'sourcePath' + */ + @Test + public void sourcePathTest() { + // TODO: test sourcePath + } + + /** + * Test the property 'compiler' + */ + @Test + public void compilerTest() { + // TODO: test compiler + } + + /** + * Test the property 'networks' + */ + @Test + public void networksTest() { + // TODO: test networks + } + + /** + * Test the property 'ast' + */ + @Test + public void astTest() { + // TODO: test ast + } + + /** + * Test the property 'functionHashes' + */ + @Test + public void functionHashesTest() { + // TODO: test functionHashes + } + + /** + * Test the property 'gasEstimates' + */ + @Test + public void gasEstimatesTest() { + // TODO: test gasEstimates + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1RequestTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1RequestTest.java new file mode 100644 index 00000000000..d5273382f5d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeJsonObjectV1RequestTest.java @@ -0,0 +1,93 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractSolidityBytecodeJsonObjectV1Request + */ +public class DeployContractSolidityBytecodeJsonObjectV1RequestTest { + private final DeployContractSolidityBytecodeJsonObjectV1Request model = new DeployContractSolidityBytecodeJsonObjectV1Request(); + + /** + * Model tests for DeployContractSolidityBytecodeJsonObjectV1Request + */ + @Test + public void testDeployContractSolidityBytecodeJsonObjectV1Request() { + // TODO: test DeployContractSolidityBytecodeJsonObjectV1Request + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java new file mode 100644 index 00000000000..c38a39f6bca --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1RequestTest.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.QuorumPrivateTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractSolidityBytecodeV1Request + */ +public class DeployContractSolidityBytecodeV1RequestTest { + private final DeployContractSolidityBytecodeV1Request model = new DeployContractSolidityBytecodeV1Request(); + + /** + * Model tests for DeployContractSolidityBytecodeV1Request + */ + @Test + public void testDeployContractSolidityBytecodeV1Request() { + // TODO: test DeployContractSolidityBytecodeV1Request + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'contractAbi' + */ + @Test + public void contractAbiTest() { + // TODO: test contractAbi + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'privateTransactionConfig' + */ + @Test + public void privateTransactionConfigTest() { + // TODO: test privateTransactionConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java new file mode 100644 index 00000000000..2a38a91ffea --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractSolidityBytecodeV1ResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractSolidityBytecodeV1Response + */ +public class DeployContractSolidityBytecodeV1ResponseTest { + private final DeployContractSolidityBytecodeV1Response model = new DeployContractSolidityBytecodeV1Response(); + + /** + * Model tests for DeployContractSolidityBytecodeV1Response + */ + @Test + public void testDeployContractSolidityBytecodeV1Response() { + // TODO: test DeployContractSolidityBytecodeV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java new file mode 100644 index 00000000000..6ff31a64d2a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EthContractInvocationType + */ +public class EthContractInvocationTypeTest { + /** + * Model tests for EthContractInvocationType + */ + @Test + public void testEthContractInvocationType() { + // TODO: test EthContractInvocationType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationWeb3MethodTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationWeb3MethodTest.java new file mode 100644 index 00000000000..6240484b221 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationWeb3MethodTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EthContractInvocationWeb3Method + */ +public class EthContractInvocationWeb3MethodTest { + /** + * Model tests for EthContractInvocationWeb3Method + */ + @Test + public void testEthContractInvocationWeb3Method() { + // TODO: test EthContractInvocationWeb3Method + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java new file mode 100644 index 00000000000..598ca0bafe4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java @@ -0,0 +1,144 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.QuorumPrivateTransactionConfig; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractJsonObjectV1Request + */ +public class InvokeContractJsonObjectV1RequestTest { + private final InvokeContractJsonObjectV1Request model = new InvokeContractJsonObjectV1Request(); + + /** + * Model tests for InvokeContractJsonObjectV1Request + */ + @Test + public void testInvokeContractJsonObjectV1Request() { + // TODO: test InvokeContractJsonObjectV1Request + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + + /** + * Test the property 'privateTransactionConfig' + */ + @Test + public void privateTransactionConfigTest() { + // TODO: test privateTransactionConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java new file mode 100644 index 00000000000..f8816d534f2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java @@ -0,0 +1,134 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Request + */ +public class InvokeContractV1RequestTest { + private final InvokeContractV1Request model = new InvokeContractV1Request(); + + /** + * Model tests for InvokeContractV1Request + */ + @Test + public void testInvokeContractV1Request() { + // TODO: test InvokeContractV1Request + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java new file mode 100644 index 00000000000..c5d42749e4a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Response + */ +public class InvokeContractV1ResponseTest { + private final InvokeContractV1Response model = new InvokeContractV1Response(); + + /** + * Model tests for InvokeContractV1Response + */ + @Test + public void testInvokeContractV1Response() { + // TODO: test InvokeContractV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + + /** + * Test the property 'callOutput' + */ + @Test + public void callOutputTest() { + // TODO: test callOutput + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1RequestTest.java new file mode 100644 index 00000000000..cca1235b3ae --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1RequestTest.java @@ -0,0 +1,91 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.EthContractInvocationWeb3Method; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRawWeb3EthContractV1Request + */ +public class InvokeRawWeb3EthContractV1RequestTest { + private final InvokeRawWeb3EthContractV1Request model = new InvokeRawWeb3EthContractV1Request(); + + /** + * Model tests for InvokeRawWeb3EthContractV1Request + */ + @Test + public void testInvokeRawWeb3EthContractV1Request() { + // TODO: test InvokeRawWeb3EthContractV1Request + } + + /** + * Test the property 'abi' + */ + @Test + public void abiTest() { + // TODO: test abi + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'invocationParams' + */ + @Test + public void invocationParamsTest() { + // TODO: test invocationParams + } + + /** + * Test the property 'contractMethod' + */ + @Test + public void contractMethodTest() { + // TODO: test contractMethod + } + + /** + * Test the property 'contractMethodArgs' + */ + @Test + public void contractMethodArgsTest() { + // TODO: test contractMethodArgs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1ResponseTest.java new file mode 100644 index 00000000000..f0ac4137a19 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthContractV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRawWeb3EthContractV1Response + */ +public class InvokeRawWeb3EthContractV1ResponseTest { + private final InvokeRawWeb3EthContractV1Response model = new InvokeRawWeb3EthContractV1Response(); + + /** + * Model tests for InvokeRawWeb3EthContractV1Response + */ + @Test + public void testInvokeRawWeb3EthContractV1Response() { + // TODO: test InvokeRawWeb3EthContractV1Response + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'errorDetail' + */ + @Test + public void errorDetailTest() { + // TODO: test errorDetail + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1RequestTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1RequestTest.java new file mode 100644 index 00000000000..775b8a9570f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1RequestTest.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRawWeb3EthMethodV1Request + */ +public class InvokeRawWeb3EthMethodV1RequestTest { + private final InvokeRawWeb3EthMethodV1Request model = new InvokeRawWeb3EthMethodV1Request(); + + /** + * Model tests for InvokeRawWeb3EthMethodV1Request + */ + @Test + public void testInvokeRawWeb3EthMethodV1Request() { + // TODO: test InvokeRawWeb3EthMethodV1Request + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1ResponseTest.java new file mode 100644 index 00000000000..56eed9a27a7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRawWeb3EthMethodV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRawWeb3EthMethodV1Response + */ +public class InvokeRawWeb3EthMethodV1ResponseTest { + private final InvokeRawWeb3EthMethodV1Response model = new InvokeRawWeb3EthMethodV1Response(); + + /** + * Model tests for InvokeRawWeb3EthMethodV1Response + */ + @Test + public void testInvokeRawWeb3EthMethodV1Response() { + // TODO: test InvokeRawWeb3EthMethodV1Response + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'errorDetail' + */ + @Test + public void errorDetailTest() { + // TODO: test errorDetail + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumPrivateTransactionConfigTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumPrivateTransactionConfigTest.java new file mode 100644 index 00000000000..f2f38d07243 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumPrivateTransactionConfigTest.java @@ -0,0 +1,99 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for QuorumPrivateTransactionConfig + */ +public class QuorumPrivateTransactionConfigTest { + private final QuorumPrivateTransactionConfig model = new QuorumPrivateTransactionConfig(); + + /** + * Model tests for QuorumPrivateTransactionConfig + */ + @Test + public void testQuorumPrivateTransactionConfig() { + // TODO: test QuorumPrivateTransactionConfig + } + + /** + * Test the property 'privateFrom' + */ + @Test + public void privateFromTest() { + // TODO: test privateFrom + } + + /** + * Test the property 'privateFor' + */ + @Test + public void privateForTest() { + // TODO: test privateFor + } + + /** + * Test the property 'isPrivate' + */ + @Test + public void isPrivateTest() { + // TODO: test isPrivate + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'privateKey' + */ + @Test + public void privateKeyTest() { + // TODO: test privateKey + } + + /** + * Test the property 'privacyGroupId' + */ + @Test + public void privacyGroupIdTest() { + // TODO: test privacyGroupId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigFromTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigFromTest.java new file mode 100644 index 00000000000..2d361a19eb4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigFromTest.java @@ -0,0 +1,35 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for QuorumTransactionConfigFrom + */ +public class QuorumTransactionConfigFromTest { + private final QuorumTransactionConfigFrom model = new QuorumTransactionConfigFrom(); + + /** + * Model tests for QuorumTransactionConfigFrom + */ + @Test + public void testQuorumTransactionConfigFrom() { + // TODO: test QuorumTransactionConfigFrom + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigTest.java new file mode 100644 index 00000000000..24958299a3f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigTest.java @@ -0,0 +1,107 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.openapitools.client.model.QuorumTransactionConfigTo; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for QuorumTransactionConfig + */ +public class QuorumTransactionConfigTest { + private final QuorumTransactionConfig model = new QuorumTransactionConfig(); + + /** + * Model tests for QuorumTransactionConfig + */ + @Test + public void testQuorumTransactionConfig() { + // TODO: test QuorumTransactionConfig + } + + /** + * Test the property 'rawTransaction' + */ + @Test + public void rawTransactionTest() { + // TODO: test rawTransaction + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigToTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigToTest.java new file mode 100644 index 00000000000..f42127a4e1d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/QuorumTransactionConfigToTest.java @@ -0,0 +1,34 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for QuorumTransactionConfigTo + */ +public class QuorumTransactionConfigToTest { + private final QuorumTransactionConfigTo model = new QuorumTransactionConfigTo(); + + /** + * Model tests for QuorumTransactionConfigTo + */ + @Test + public void testQuorumTransactionConfigTo() { + // TODO: test QuorumTransactionConfigTo + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java new file mode 100644 index 00000000000..f66b5323c40 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionRequestTest.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.client.model.QuorumPrivateTransactionConfig; +import org.openapitools.client.model.QuorumTransactionConfig; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionRequest + */ +public class RunTransactionRequestTest { + private final RunTransactionRequest model = new RunTransactionRequest(); + + /** + * Model tests for RunTransactionRequest + */ + @Test + public void testRunTransactionRequest() { + // TODO: test RunTransactionRequest + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'transactionConfig' + */ + @Test + public void transactionConfigTest() { + // TODO: test transactionConfig + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'privateTransactionConfig' + */ + @Test + public void privateTransactionConfigTest() { + // TODO: test privateTransactionConfig + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java new file mode 100644 index 00000000000..ee68b7e7db8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionResponse + */ +public class RunTransactionResponseTest { + private final RunTransactionResponse model = new RunTransactionResponse(); + + /** + * Model tests for RunTransactionResponse + */ + @Test + public void testRunTransactionResponse() { + // TODO: test RunTransactionResponse + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java new file mode 100644 index 00000000000..952ed6b36c7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactCompiler + */ +public class SolidityContractJsonArtifactCompilerTest { + private final SolidityContractJsonArtifactCompiler model = new SolidityContractJsonArtifactCompiler(); + + /** + * Model tests for SolidityContractJsonArtifactCompiler + */ + @Test + public void testSolidityContractJsonArtifactCompiler() { + // TODO: test SolidityContractJsonArtifactCompiler + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java new file mode 100644 index 00000000000..b0384b7f4de --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactGasEstimatesCreation + */ +public class SolidityContractJsonArtifactGasEstimatesCreationTest { + private final SolidityContractJsonArtifactGasEstimatesCreation model = new SolidityContractJsonArtifactGasEstimatesCreation(); + + /** + * Model tests for SolidityContractJsonArtifactGasEstimatesCreation + */ + @Test + public void testSolidityContractJsonArtifactGasEstimatesCreation() { + // TODO: test SolidityContractJsonArtifactGasEstimatesCreation + } + + /** + * Test the property 'codeDepositCost' + */ + @Test + public void codeDepositCostTest() { + // TODO: test codeDepositCost + } + + /** + * Test the property 'executionCost' + */ + @Test + public void executionCostTest() { + // TODO: test executionCost + } + + /** + * Test the property 'totalCost' + */ + @Test + public void totalCostTest() { + // TODO: test totalCost + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java new file mode 100644 index 00000000000..d24bd685fa7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactGasEstimates + */ +public class SolidityContractJsonArtifactGasEstimatesTest { + private final SolidityContractJsonArtifactGasEstimates model = new SolidityContractJsonArtifactGasEstimates(); + + /** + * Model tests for SolidityContractJsonArtifactGasEstimates + */ + @Test + public void testSolidityContractJsonArtifactGasEstimates() { + // TODO: test SolidityContractJsonArtifactGasEstimates + } + + /** + * Test the property 'creation' + */ + @Test + public void creationTest() { + // TODO: test creation + } + + /** + * Test the property 'external' + */ + @Test + public void externalTest() { + // TODO: test external + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java new file mode 100644 index 00000000000..0c10a844658 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java @@ -0,0 +1,124 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactCompiler; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifact + */ +public class SolidityContractJsonArtifactTest { + private final SolidityContractJsonArtifact model = new SolidityContractJsonArtifact(); + + /** + * Model tests for SolidityContractJsonArtifact + */ + @Test + public void testSolidityContractJsonArtifact() { + // TODO: test SolidityContractJsonArtifact + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'deployedBytecode' + */ + @Test + public void deployedBytecodeTest() { + // TODO: test deployedBytecode + } + + /** + * Test the property 'sourceMap' + */ + @Test + public void sourceMapTest() { + // TODO: test sourceMap + } + + /** + * Test the property 'deployedSourceMap' + */ + @Test + public void deployedSourceMapTest() { + // TODO: test deployedSourceMap + } + + /** + * Test the property 'sourcePath' + */ + @Test + public void sourcePathTest() { + // TODO: test sourcePath + } + + /** + * Test the property 'compiler' + */ + @Test + public void compilerTest() { + // TODO: test compiler + } + + /** + * Test the property 'functionHashes' + */ + @Test + public void functionHashesTest() { + // TODO: test functionHashes + } + + /** + * Test the property 'gasEstimates' + */ + @Test + public void gasEstimatesTest() { + // TODO: test gasEstimates + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTest.java new file mode 100644 index 00000000000..53c309386d8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1BlockDataTest.java @@ -0,0 +1,205 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.openapitools.client.model.Web3Transaction; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1BlockData + */ +public class WatchBlocksV1BlockDataTest { + private final WatchBlocksV1BlockData model = new WatchBlocksV1BlockData(); + + /** + * Model tests for WatchBlocksV1BlockData + */ + @Test + public void testWatchBlocksV1BlockData() { + // TODO: test WatchBlocksV1BlockData + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'parentHash' + */ + @Test + public void parentHashTest() { + // TODO: test parentHash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'sha3Uncles' + */ + @Test + public void sha3UnclesTest() { + // TODO: test sha3Uncles + } + + /** + * Test the property 'logsBloom' + */ + @Test + public void logsBloomTest() { + // TODO: test logsBloom + } + + /** + * Test the property 'transactionsRoot' + */ + @Test + public void transactionsRootTest() { + // TODO: test transactionsRoot + } + + /** + * Test the property 'stateRoot' + */ + @Test + public void stateRootTest() { + // TODO: test stateRoot + } + + /** + * Test the property 'receiptsRoot' + */ + @Test + public void receiptsRootTest() { + // TODO: test receiptsRoot + } + + /** + * Test the property 'difficulty' + */ + @Test + public void difficultyTest() { + // TODO: test difficulty + } + + /** + * Test the property 'mixHash' + */ + @Test + public void mixHashTest() { + // TODO: test mixHash + } + + /** + * Test the property 'miner' + */ + @Test + public void minerTest() { + // TODO: test miner + } + + /** + * Test the property 'extraData' + */ + @Test + public void extraDataTest() { + // TODO: test extraData + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + + /** + * Test the property 'size' + */ + @Test + public void sizeTest() { + // TODO: test size + } + + /** + * Test the property 'totalDifficulty' + */ + @Test + public void totalDifficultyTest() { + // TODO: test totalDifficulty + } + + /** + * Test the property 'uncles' + */ + @Test + public void unclesTest() { + // TODO: test uncles + } + + /** + * Test the property 'transactions' + */ + @Test + public void transactionsTest() { + // TODO: test transactions + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java new file mode 100644 index 00000000000..33d36691b3d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1Options + */ +public class WatchBlocksV1OptionsTest { + private final WatchBlocksV1Options model = new WatchBlocksV1Options(); + + /** + * Model tests for WatchBlocksV1Options + */ + @Test + public void testWatchBlocksV1Options() { + // TODO: test WatchBlocksV1Options + } + + /** + * Test the property 'getBlockData' + */ + @Test + public void getBlockDataTest() { + // TODO: test getBlockData + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java new file mode 100644 index 00000000000..bd77871855b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.WatchBlocksV1BlockData; +import org.openapitools.client.model.Web3BlockHeader; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1Progress + */ +public class WatchBlocksV1ProgressTest { + private final WatchBlocksV1Progress model = new WatchBlocksV1Progress(); + + /** + * Model tests for WatchBlocksV1Progress + */ + @Test + public void testWatchBlocksV1Progress() { + // TODO: test WatchBlocksV1Progress + } + + /** + * Test the property 'blockHeader' + */ + @Test + public void blockHeaderTest() { + // TODO: test blockHeader + } + + /** + * Test the property 'blockData' + */ + @Test + public void blockDataTest() { + // TODO: test blockData + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java new file mode 100644 index 00000000000..ee0e2836527 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1 + */ +public class WatchBlocksV1Test { + /** + * Model tests for WatchBlocksV1 + */ + @Test + public void testWatchBlocksV1() { + // TODO: test WatchBlocksV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java new file mode 100644 index 00000000000..51d000276ec --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3BlockHeaderTest.java @@ -0,0 +1,170 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.client.model.QuorumTransactionConfigFrom; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3BlockHeader + */ +public class Web3BlockHeaderTest { + private final Web3BlockHeader model = new Web3BlockHeader(); + + /** + * Model tests for Web3BlockHeader + */ + @Test + public void testWeb3BlockHeader() { + // TODO: test Web3BlockHeader + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'parentHash' + */ + @Test + public void parentHashTest() { + // TODO: test parentHash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'sha3Uncles' + */ + @Test + public void sha3UnclesTest() { + // TODO: test sha3Uncles + } + + /** + * Test the property 'logsBloom' + */ + @Test + public void logsBloomTest() { + // TODO: test logsBloom + } + + /** + * Test the property 'transactionsRoot' + */ + @Test + public void transactionsRootTest() { + // TODO: test transactionsRoot + } + + /** + * Test the property 'stateRoot' + */ + @Test + public void stateRootTest() { + // TODO: test stateRoot + } + + /** + * Test the property 'receiptsRoot' + */ + @Test + public void receiptsRootTest() { + // TODO: test receiptsRoot + } + + /** + * Test the property 'difficulty' + */ + @Test + public void difficultyTest() { + // TODO: test difficulty + } + + /** + * Test the property 'mixHash' + */ + @Test + public void mixHashTest() { + // TODO: test mixHash + } + + /** + * Test the property 'miner' + */ + @Test + public void minerTest() { + // TODO: test miner + } + + /** + * Test the property 'extraData' + */ + @Test + public void extraDataTest() { + // TODO: test extraData + } + + /** + * Test the property 'gasLimit' + */ + @Test + public void gasLimitTest() { + // TODO: test gasLimit + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java new file mode 100644 index 00000000000..ff6af5d33b7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ +public class Web3SigningCredentialCactusKeychainRefTest { + private final Web3SigningCredentialCactusKeychainRef model = new Web3SigningCredentialCactusKeychainRef(); + + /** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ + @Test + public void testWeb3SigningCredentialCactusKeychainRef() { + // TODO: test Web3SigningCredentialCactusKeychainRef + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPasswordTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPasswordTest.java new file mode 100644 index 00000000000..34447b70159 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialGethKeychainPasswordTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialGethKeychainPassword + */ +public class Web3SigningCredentialGethKeychainPasswordTest { + private final Web3SigningCredentialGethKeychainPassword model = new Web3SigningCredentialGethKeychainPassword(); + + /** + * Model tests for Web3SigningCredentialGethKeychainPassword + */ + @Test + public void testWeb3SigningCredentialGethKeychainPassword() { + // TODO: test Web3SigningCredentialGethKeychainPassword + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java new file mode 100644 index 00000000000..f8d327a5b1c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialNone + */ +public class Web3SigningCredentialNoneTest { + private final Web3SigningCredentialNone model = new Web3SigningCredentialNone(); + + /** + * Model tests for Web3SigningCredentialNone + */ + @Test + public void testWeb3SigningCredentialNone() { + // TODO: test Web3SigningCredentialNone + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java new file mode 100644 index 00000000000..dc1b609814e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ +public class Web3SigningCredentialPrivateKeyHexTest { + private final Web3SigningCredentialPrivateKeyHex model = new Web3SigningCredentialPrivateKeyHex(); + + /** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ + @Test + public void testWeb3SigningCredentialPrivateKeyHex() { + // TODO: test Web3SigningCredentialPrivateKeyHex + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java new file mode 100644 index 00000000000..0a55e997253 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialGethKeychainPassword; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredential + */ +public class Web3SigningCredentialTest { + private final Web3SigningCredential model = new Web3SigningCredential(); + + /** + * Model tests for Web3SigningCredential + */ + @Test + public void testWeb3SigningCredential() { + // TODO: test Web3SigningCredential + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java new file mode 100644 index 00000000000..4c3e61219e7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialType + */ +public class Web3SigningCredentialTypeTest { + /** + * Model tests for Web3SigningCredentialType + */ + @Test + public void testWeb3SigningCredentialType() { + // TODO: test Web3SigningCredentialType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java new file mode 100644 index 00000000000..0c42e140bdf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java @@ -0,0 +1,164 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3TransactionReceipt + */ +public class Web3TransactionReceiptTest { + private final Web3TransactionReceipt model = new Web3TransactionReceipt(); + + /** + * Model tests for Web3TransactionReceipt + */ + @Test + public void testWeb3TransactionReceipt() { + // TODO: test Web3TransactionReceipt + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'logs' + */ + @Test + public void logsTest() { + // TODO: test logs + } + + /** + * Test the property 'logsBloom' + */ + @Test + public void logsBloomTest() { + // TODO: test logsBloom + } + + /** + * Test the property 'revertReason' + */ + @Test + public void revertReasonTest() { + // TODO: test revertReason + } + + /** + * Test the property 'output' + */ + @Test + public void outputTest() { + // TODO: test output + } + + /** + * Test the property 'commitmentHash' + */ + @Test + public void commitmentHashTest() { + // TODO: test commitmentHash + } + + /** + * Test the property 'cumulativeGasUSed' + */ + @Test + public void cumulativeGasUSedTest() { + // TODO: test cumulativeGasUSed + } + +} diff --git a/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionTest.java b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionTest.java new file mode 100644 index 00000000000..678eecb95fe --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-quorum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionTest.java @@ -0,0 +1,153 @@ +/* + * Hyperledger Cactus Plugin - Connector Quorum + * Can perform basic tasks on a Quorum ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3Transaction + */ +public class Web3TransactionTest { + private final Web3Transaction model = new Web3Transaction(); + + /** + * Model tests for Web3Transaction + */ + @Test + public void testWeb3Transaction() { + // TODO: test Web3Transaction + } + + /** + * Test the property 'hash' + */ + @Test + public void hashTest() { + // TODO: test hash + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'input' + */ + @Test + public void inputTest() { + // TODO: test input + } + + /** + * Test the property 'v' + */ + @Test + public void vTest() { + // TODO: test v + } + + /** + * Test the property 'r' + */ + @Test + public void rTest() { + // TODO: test r + } + + /** + * Test the property 's' + */ + @Test + public void sTest() { + // TODO: test s + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/package.json b/packages/cactus-plugin-ledger-connector-sawtooth/package.json index 96734d916d4..a15d59b4b72 100644 --- a/packages/cactus-plugin-ledger-connector-sawtooth/package.json +++ b/packages/cactus-plugin-ledger-connector-sawtooth/package.json @@ -49,6 +49,8 @@ "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:sawtooth-axios": "openapi-generator-cli generate -i ./src/main/json/sawtooth-openapi.json -g typescript-axios -o ./src/main/typescript/sawtooth-api/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", "webpack:dev:node": "webpack --env=dev --target=node --config ../../webpack.config.js", diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..b484f87dedf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,28 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_cacti_transaction_v1.go +model_cacti_transaction_v1_all_of.go +model_error_exception_response_v1.go +model_sawtooth_batch_header_v1.go +model_sawtooth_batch_v1.go +model_sawtooth_block_header_v1.go +model_sawtooth_block_v1.go +model_sawtooth_transaction_header_v1.go +model_sawtooth_transaction_v1.go +model_status_response_v1.go +model_watch_blocks_v1.go +model_watch_blocks_v1_cacti_transactions_response.go +model_watch_blocks_v1_full_response.go +model_watch_blocks_v1_listener_type.go +model_watch_blocks_v1_options.go +model_watch_blocks_v1_progress.go +model_watch_blocks_v1_transaction_filter.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..e7e42a4b585 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..9f568616f41 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,128 @@ +# Go API client for cactus-plugin-ledger-connector-sawtooth + +Can perform basic tasks on a Sawtooth ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-sawtooth "github.com/hyperledger/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-sawtooth.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-sawtooth.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-sawtooth.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-sawtooth.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetStatusV1**](docs/DefaultApi.md#getstatusv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-sawtooth/status | Get the status of the connector and the sawtooth validator + + +## Documentation For Models + + - [CactiTransactionV1](docs/CactiTransactionV1.md) + - [CactiTransactionV1AllOf](docs/CactiTransactionV1AllOf.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [SawtoothBatchHeaderV1](docs/SawtoothBatchHeaderV1.md) + - [SawtoothBatchV1](docs/SawtoothBatchV1.md) + - [SawtoothBlockHeaderV1](docs/SawtoothBlockHeaderV1.md) + - [SawtoothBlockV1](docs/SawtoothBlockV1.md) + - [SawtoothTransactionHeaderV1](docs/SawtoothTransactionHeaderV1.md) + - [SawtoothTransactionV1](docs/SawtoothTransactionV1.md) + - [StatusResponseV1](docs/StatusResponseV1.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WatchBlocksV1CactiTransactionsResponse](docs/WatchBlocksV1CactiTransactionsResponse.md) + - [WatchBlocksV1FullResponse](docs/WatchBlocksV1FullResponse.md) + - [WatchBlocksV1ListenerType](docs/WatchBlocksV1ListenerType.md) + - [WatchBlocksV1Options](docs/WatchBlocksV1Options.md) + - [WatchBlocksV1Progress](docs/WatchBlocksV1Progress.md) + - [WatchBlocksV1TransactionFilter](docs/WatchBlocksV1TransactionFilter.md) + + +## Documentation For Authorization + + Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..d625ff1acc4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,279 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Sawtooth ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cacti Plugin - Connector Sawtooth + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-sawtooth/status: + get: + operationId: getStatusV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/StatusResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Get the status of the connector and the sawtooth validator + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-sawtooth/status +components: + schemas: + SawtoothTransactionHeaderV1: + properties: + batcher_public_key: + example: 02d260a46457a064733153e09840c322bee1dff34445d7d49e19e60abd18fd0758 + type: string + dependencies: + items: + example: 1baee350bdb60bcee60e3d325d43283cf830b4c23b2cb17d3bb43935bd7af3761c2bee79847c72a9e396a9ae58f48add4e43f94eb83f84442c6085c1dd5d4dbe + type: string + type: array + family_name: + example: intkey + type: string + family_version: + example: "1.0" + type: string + inputs: + items: + example: 1cf12650d858e0985ecc7f60418aaf0cc5ab587f42c2570a884095a9e8ccacd0f6545c + type: string + type: array + nonce: + example: QAApS4L + type: string + outputs: + items: + example: 1cf12650d858e0985ecc7f60418aaf0cc5ab587f42c2570a884095a9e8ccacd0f6545c + type: string + type: array + payload_sha512: + example: fb6135ef73f4fe77367f9384b3bbbb158f4b8603c9d612157108e5c271868fce2242ee4abd7a29397ba63780c3ccab13783dfd4d9f0167beda03cdb0e37b87f4 + type: string + signer_public_key: + example: 038bba5708acc262464c9fe30d3de9e905a9a5fa30cedd151dd9cd09ea26d46d00 + type: string + required: + - batcher_public_key + - dependencies + - family_name + - family_version + - inputs + - nonce + - outputs + - payload_sha512 + - signer_public_key + SawtoothTransactionV1: + properties: + header: + $ref: '#/components/schemas/SawtoothTransactionHeaderV1' + header_signature: + example: 540a6803971d1880ec73a96cb97815a95d374cbad5d865925e5aa0432fcf1931539afe10310c122c5eaae15df61236079abbf4f258889359c4d175516934484a + type: string + payload: + type: string + required: + - header + - header_signature + - payload + SawtoothBatchHeaderV1: + properties: + signer_public_key: + example: 038bba5708acc262464c9fe30d3de9e905a9a5fa30cedd151dd9cd09ea26d46d00 + type: string + transaction_ids: + items: + example: 540a6803971d1880ec73a96cb97815a95d374cbad5d865925e5aa0432fcf1931539afe10310c122c5eaae15df61236079abbf4f258889359c4d175516934484a + type: string + type: array + required: + - signer_public_key + - transaction_ids + SawtoothBatchV1: + properties: + header: + $ref: '#/components/schemas/SawtoothBatchHeaderV1' + header_signature: + example: 89807bfc9089e37e00d87d97357de14cfbc455cd608438d426a625a30a0da9a31c406983803c4aa27e1f32a3ff61709e8ec4b56abbc553d7d330635b5d27029c + type: string + transactions: + items: + $ref: '#/components/schemas/SawtoothTransactionV1' + type: array + required: + - header + - header_signature + - transactions + SawtoothBlockHeaderV1: + properties: + block_num: + example: 12345 + type: integer + previous_block_id: + example: 65cd3a3ce088b265b626f704b7f3db97b6f12e848dccb35d7806f3d0324c71b709ed360d602b8b658b94695374717e3bdb4b76f77886953777d5d008558247dd + type: string + signer_public_key: + example: 02d260a46457a064733153e09840c322bee1dff34445d7d49e19e60abd18fd0758 + type: string + batch_ids: + items: + example: 89807bfc9089e37e00d87d97357de14cfbc455cd608438d426a625a30a0da9a31c406983803c4aa27e1f32a3ff61709e8ec4b56abbc553d7d330635b5d27029c + type: string + type: array + consensus: + type: string + state_root_hash: + example: 708ca7fbb701799bb387f2e50deaca402e8502abe229f705693d2d4f350e1ad6 + type: string + required: + - batch_ids + - block_num + - consensus + - previous_block_id + - signer_public_key + - state_root_hash + SawtoothBlockV1: + properties: + header: + $ref: '#/components/schemas/SawtoothBlockHeaderV1' + header_signature: + example: 65cd3a3ce088b265b626f704b7f3db97b6f12e848dccb35d7806f3d0324c71b709ed360d602b8b658b94695374717e3bdb4b76f77886953777d5d008558247dd + type: string + batches: + items: + $ref: '#/components/schemas/SawtoothBatchV1' + type: array + required: + - batches + - header + - header_signature + CactiTransactionV1: + allOf: + - $ref: '#/components/schemas/SawtoothTransactionV1' + - $ref: '#/components/schemas/CactiTransactionV1_allOf' + description: Sawtooth transaction with additional fields filled by Cacti connector. + type: object + WatchBlocksV1: + enum: + - org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Subscribe + - org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Next + - org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Unsubscribe + - org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Error + - org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + WatchBlocksV1ListenerType: + description: "Response type from WatchBlocks. 'Cacti*' are custom views, others\ + \ correspond to plain sawtooth data." + enum: + - full + - cacti:transactions + type: string + x-enum-varnames: + - Full + - CactiTransactions + WatchBlocksV1TransactionFilter: + properties: + family_name: + type: string + type: object + WatchBlocksV1Options: + properties: + type: + $ref: '#/components/schemas/WatchBlocksV1ListenerType' + txFilterBy: + $ref: '#/components/schemas/WatchBlocksV1TransactionFilter' + type: object + WatchBlocksV1CactiTransactionsResponse: + description: Custom response containing block transactions summary. + properties: + cactiTransactionsEvents: + description: List of sawtooth transactions matching specifid (optional) + filter + items: + $ref: '#/components/schemas/CactiTransactionV1' + type: array + required: + - cactiTransactionsEvents + type: object + WatchBlocksV1FullResponse: + description: Response that returns entire sawtooth block. + properties: + fullBlock: + $ref: '#/components/schemas/SawtoothBlockV1' + required: + - fullBlock + type: object + WatchBlocksV1Progress: + description: Response block from WatchBlocks endpoint. Depends on 'type' passed + in subscription options. + oneOf: + - $ref: '#/components/schemas/WatchBlocksV1CactiTransactionsResponse' + - $ref: '#/components/schemas/WatchBlocksV1FullResponse' + StatusResponseV1: + description: Response with plugin and validator status report. + example: + openApiSpecVersion: openApiSpecVersion + sawtoothStatus: "" + instanceId: instanceId + initialized: true + properties: + instanceId: + description: Plugin instance id. + nullable: false + type: string + openApiSpecVersion: + description: Version of connectors Open API Spec. + nullable: false + type: string + initialized: + description: "True if endpoints were created, false otherwise" + nullable: false + type: boolean + sawtoothStatus: + description: Response from sawtooth Rest API status endpoint + nullable: false + required: + - instanceId + type: object + ErrorExceptionResponseV1: + properties: + message: + nullable: false + type: string + error: + nullable: false + type: string + required: + - error + - message + type: object + CactiTransactionV1_allOf: + properties: + payload_decoded: + description: Decoded payload of sawtooth transaction. + example: "[{'Verb':'inc','Name':'monitorTest3','Value':11}]}]" + required: + - payload_decoded + type: object + example: null diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..66dd6008432 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,130 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGetStatusV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetStatusV1Request) Execute() (*StatusResponseV1, *http.Response, error) { + return r.ApiService.GetStatusV1Execute(r) +} + +/* +GetStatusV1 Get the status of the connector and the sawtooth validator + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetStatusV1Request +*/ +func (a *DefaultApiService) GetStatusV1(ctx context.Context) ApiGetStatusV1Request { + return ApiGetStatusV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return StatusResponseV1 +func (a *DefaultApiService) GetStatusV1Execute(r ApiGetStatusV1Request) (*StatusResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *StatusResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetStatusV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-sawtooth/status" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..b526ae006dd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,655 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "io/ioutil" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cacti Plugin - Connector Sawtooth API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToQuery adds the provided object to the url query supporting deep object syntax +func parameterAddToQuery(queryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToQuery(queryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToQuery(queryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = ioutil.TempFile("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = ioutil.TempFile("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + + // status title (detail) + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..428e8d81189 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..58b92c5da04 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client + +go 1.13 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_cacti_transaction_v1.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_cacti_transaction_v1.go new file mode 100644 index 00000000000..37fafbdbbcc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_cacti_transaction_v1.go @@ -0,0 +1,203 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" +) + +// checks if the CactiTransactionV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CactiTransactionV1{} + +// CactiTransactionV1 Sawtooth transaction with additional fields filled by Cacti connector. +type CactiTransactionV1 struct { + Header SawtoothTransactionHeaderV1 `json:"header"` + HeaderSignature string `json:"header_signature"` + Payload string `json:"payload"` + // Decoded payload of sawtooth transaction. + PayloadDecoded interface{} `json:"payload_decoded"` +} + +// NewCactiTransactionV1 instantiates a new CactiTransactionV1 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 +// will change when the set of required properties is changed +func NewCactiTransactionV1(header SawtoothTransactionHeaderV1, headerSignature string, payload string, payloadDecoded interface{}) *CactiTransactionV1 { + this := CactiTransactionV1{} + this.Header = header + this.HeaderSignature = headerSignature + this.Payload = payload + this.PayloadDecoded = payloadDecoded + return &this +} + +// NewCactiTransactionV1WithDefaults instantiates a new CactiTransactionV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCactiTransactionV1WithDefaults() *CactiTransactionV1 { + this := CactiTransactionV1{} + return &this +} + +// GetHeader returns the Header field value +func (o *CactiTransactionV1) GetHeader() SawtoothTransactionHeaderV1 { + if o == nil { + var ret SawtoothTransactionHeaderV1 + return ret + } + + return o.Header +} + +// GetHeaderOk returns a tuple with the Header field value +// and a boolean to check if the value has been set. +func (o *CactiTransactionV1) GetHeaderOk() (*SawtoothTransactionHeaderV1, bool) { + if o == nil { + return nil, false + } + return &o.Header, true +} + +// SetHeader sets field value +func (o *CactiTransactionV1) SetHeader(v SawtoothTransactionHeaderV1) { + o.Header = v +} + +// GetHeaderSignature returns the HeaderSignature field value +func (o *CactiTransactionV1) GetHeaderSignature() string { + if o == nil { + var ret string + return ret + } + + return o.HeaderSignature +} + +// GetHeaderSignatureOk returns a tuple with the HeaderSignature field value +// and a boolean to check if the value has been set. +func (o *CactiTransactionV1) GetHeaderSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HeaderSignature, true +} + +// SetHeaderSignature sets field value +func (o *CactiTransactionV1) SetHeaderSignature(v string) { + o.HeaderSignature = v +} + +// GetPayload returns the Payload field value +func (o *CactiTransactionV1) GetPayload() string { + if o == nil { + var ret string + return ret + } + + return o.Payload +} + +// GetPayloadOk returns a tuple with the Payload field value +// and a boolean to check if the value has been set. +func (o *CactiTransactionV1) GetPayloadOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Payload, true +} + +// SetPayload sets field value +func (o *CactiTransactionV1) SetPayload(v string) { + o.Payload = v +} + +// GetPayloadDecoded returns the PayloadDecoded field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *CactiTransactionV1) GetPayloadDecoded() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.PayloadDecoded +} + +// GetPayloadDecodedOk returns a tuple with the PayloadDecoded field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CactiTransactionV1) GetPayloadDecodedOk() (*interface{}, bool) { + if o == nil || isNil(o.PayloadDecoded) { + return nil, false + } + return &o.PayloadDecoded, true +} + +// SetPayloadDecoded sets field value +func (o *CactiTransactionV1) SetPayloadDecoded(v interface{}) { + o.PayloadDecoded = v +} + +func (o CactiTransactionV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CactiTransactionV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["header"] = o.Header + toSerialize["header_signature"] = o.HeaderSignature + toSerialize["payload"] = o.Payload + if o.PayloadDecoded != nil { + toSerialize["payload_decoded"] = o.PayloadDecoded + } + return toSerialize, nil +} + +type NullableCactiTransactionV1 struct { + value *CactiTransactionV1 + isSet bool +} + +func (v NullableCactiTransactionV1) Get() *CactiTransactionV1 { + return v.value +} + +func (v *NullableCactiTransactionV1) Set(val *CactiTransactionV1) { + v.value = val + v.isSet = true +} + +func (v NullableCactiTransactionV1) IsSet() bool { + return v.isSet +} + +func (v *NullableCactiTransactionV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCactiTransactionV1(val *CactiTransactionV1) *NullableCactiTransactionV1 { + return &NullableCactiTransactionV1{value: val, isSet: true} +} + +func (v NullableCactiTransactionV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCactiTransactionV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_cacti_transaction_v1_all_of.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_cacti_transaction_v1_all_of.go new file mode 100644 index 00000000000..61c5d73ecfc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_cacti_transaction_v1_all_of.go @@ -0,0 +1,122 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" +) + +// checks if the CactiTransactionV1AllOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CactiTransactionV1AllOf{} + +// CactiTransactionV1AllOf struct for CactiTransactionV1AllOf +type CactiTransactionV1AllOf struct { + // Decoded payload of sawtooth transaction. + PayloadDecoded interface{} `json:"payload_decoded"` +} + +// NewCactiTransactionV1AllOf instantiates a new CactiTransactionV1AllOf 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 +// will change when the set of required properties is changed +func NewCactiTransactionV1AllOf(payloadDecoded interface{}) *CactiTransactionV1AllOf { + this := CactiTransactionV1AllOf{} + this.PayloadDecoded = payloadDecoded + return &this +} + +// NewCactiTransactionV1AllOfWithDefaults instantiates a new CactiTransactionV1AllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCactiTransactionV1AllOfWithDefaults() *CactiTransactionV1AllOf { + this := CactiTransactionV1AllOf{} + return &this +} + +// GetPayloadDecoded returns the PayloadDecoded field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *CactiTransactionV1AllOf) GetPayloadDecoded() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.PayloadDecoded +} + +// GetPayloadDecodedOk returns a tuple with the PayloadDecoded field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CactiTransactionV1AllOf) GetPayloadDecodedOk() (*interface{}, bool) { + if o == nil || isNil(o.PayloadDecoded) { + return nil, false + } + return &o.PayloadDecoded, true +} + +// SetPayloadDecoded sets field value +func (o *CactiTransactionV1AllOf) SetPayloadDecoded(v interface{}) { + o.PayloadDecoded = v +} + +func (o CactiTransactionV1AllOf) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CactiTransactionV1AllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.PayloadDecoded != nil { + toSerialize["payload_decoded"] = o.PayloadDecoded + } + return toSerialize, nil +} + +type NullableCactiTransactionV1AllOf struct { + value *CactiTransactionV1AllOf + isSet bool +} + +func (v NullableCactiTransactionV1AllOf) Get() *CactiTransactionV1AllOf { + return v.value +} + +func (v *NullableCactiTransactionV1AllOf) Set(val *CactiTransactionV1AllOf) { + v.value = val + v.isSet = true +} + +func (v NullableCactiTransactionV1AllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableCactiTransactionV1AllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCactiTransactionV1AllOf(val *CactiTransactionV1AllOf) *NullableCactiTransactionV1AllOf { + return &NullableCactiTransactionV1AllOf{value: val, isSet: true} +} + +func (v NullableCactiTransactionV1AllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCactiTransactionV1AllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go new file mode 100644 index 00000000000..f59439e62cb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" +) + +// checks if the ErrorExceptionResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorExceptionResponseV1{} + +// ErrorExceptionResponseV1 struct for ErrorExceptionResponseV1 +type ErrorExceptionResponseV1 struct { + Message string `json:"message"` + Error string `json:"error"` +} + +// NewErrorExceptionResponseV1 instantiates a new ErrorExceptionResponseV1 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 +// will change when the set of required properties is changed +func NewErrorExceptionResponseV1(message string, error_ string) *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + this.Message = message + this.Error = error_ + return &this +} + +// NewErrorExceptionResponseV1WithDefaults instantiates a new ErrorExceptionResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorExceptionResponseV1WithDefaults() *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + return &this +} + +// GetMessage returns the Message field value +func (o *ErrorExceptionResponseV1) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ErrorExceptionResponseV1) SetMessage(v string) { + o.Message = v +} + +// GetError returns the Error field value +func (o *ErrorExceptionResponseV1) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *ErrorExceptionResponseV1) SetError(v string) { + o.Error = v +} + +func (o ErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorExceptionResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + toSerialize["error"] = o.Error + return toSerialize, nil +} + +type NullableErrorExceptionResponseV1 struct { + value *ErrorExceptionResponseV1 + isSet bool +} + +func (v NullableErrorExceptionResponseV1) Get() *ErrorExceptionResponseV1 { + return v.value +} + +func (v *NullableErrorExceptionResponseV1) Set(val *ErrorExceptionResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableErrorExceptionResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorExceptionResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorExceptionResponseV1(val *ErrorExceptionResponseV1) *NullableErrorExceptionResponseV1 { + return &NullableErrorExceptionResponseV1{value: val, isSet: true} +} + +func (v NullableErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorExceptionResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_batch_header_v1.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_batch_header_v1.go new file mode 100644 index 00000000000..bae089a5542 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_batch_header_v1.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" +) + +// checks if the SawtoothBatchHeaderV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SawtoothBatchHeaderV1{} + +// SawtoothBatchHeaderV1 struct for SawtoothBatchHeaderV1 +type SawtoothBatchHeaderV1 struct { + SignerPublicKey string `json:"signer_public_key"` + TransactionIds []string `json:"transaction_ids"` +} + +// NewSawtoothBatchHeaderV1 instantiates a new SawtoothBatchHeaderV1 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 +// will change when the set of required properties is changed +func NewSawtoothBatchHeaderV1(signerPublicKey string, transactionIds []string) *SawtoothBatchHeaderV1 { + this := SawtoothBatchHeaderV1{} + this.SignerPublicKey = signerPublicKey + this.TransactionIds = transactionIds + return &this +} + +// NewSawtoothBatchHeaderV1WithDefaults instantiates a new SawtoothBatchHeaderV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSawtoothBatchHeaderV1WithDefaults() *SawtoothBatchHeaderV1 { + this := SawtoothBatchHeaderV1{} + return &this +} + +// GetSignerPublicKey returns the SignerPublicKey field value +func (o *SawtoothBatchHeaderV1) GetSignerPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.SignerPublicKey +} + +// GetSignerPublicKeyOk returns a tuple with the SignerPublicKey field value +// and a boolean to check if the value has been set. +func (o *SawtoothBatchHeaderV1) GetSignerPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SignerPublicKey, true +} + +// SetSignerPublicKey sets field value +func (o *SawtoothBatchHeaderV1) SetSignerPublicKey(v string) { + o.SignerPublicKey = v +} + +// GetTransactionIds returns the TransactionIds field value +func (o *SawtoothBatchHeaderV1) GetTransactionIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.TransactionIds +} + +// GetTransactionIdsOk returns a tuple with the TransactionIds field value +// and a boolean to check if the value has been set. +func (o *SawtoothBatchHeaderV1) GetTransactionIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.TransactionIds, true +} + +// SetTransactionIds sets field value +func (o *SawtoothBatchHeaderV1) SetTransactionIds(v []string) { + o.TransactionIds = v +} + +func (o SawtoothBatchHeaderV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SawtoothBatchHeaderV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["signer_public_key"] = o.SignerPublicKey + toSerialize["transaction_ids"] = o.TransactionIds + return toSerialize, nil +} + +type NullableSawtoothBatchHeaderV1 struct { + value *SawtoothBatchHeaderV1 + isSet bool +} + +func (v NullableSawtoothBatchHeaderV1) Get() *SawtoothBatchHeaderV1 { + return v.value +} + +func (v *NullableSawtoothBatchHeaderV1) Set(val *SawtoothBatchHeaderV1) { + v.value = val + v.isSet = true +} + +func (v NullableSawtoothBatchHeaderV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSawtoothBatchHeaderV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSawtoothBatchHeaderV1(val *SawtoothBatchHeaderV1) *NullableSawtoothBatchHeaderV1 { + return &NullableSawtoothBatchHeaderV1{value: val, isSet: true} +} + +func (v NullableSawtoothBatchHeaderV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSawtoothBatchHeaderV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_batch_v1.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_batch_v1.go new file mode 100644 index 00000000000..05c6764e6db --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_batch_v1.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" +) + +// checks if the SawtoothBatchV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SawtoothBatchV1{} + +// SawtoothBatchV1 struct for SawtoothBatchV1 +type SawtoothBatchV1 struct { + Header SawtoothBatchHeaderV1 `json:"header"` + HeaderSignature string `json:"header_signature"` + Transactions []SawtoothTransactionV1 `json:"transactions"` +} + +// NewSawtoothBatchV1 instantiates a new SawtoothBatchV1 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 +// will change when the set of required properties is changed +func NewSawtoothBatchV1(header SawtoothBatchHeaderV1, headerSignature string, transactions []SawtoothTransactionV1) *SawtoothBatchV1 { + this := SawtoothBatchV1{} + this.Header = header + this.HeaderSignature = headerSignature + this.Transactions = transactions + return &this +} + +// NewSawtoothBatchV1WithDefaults instantiates a new SawtoothBatchV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSawtoothBatchV1WithDefaults() *SawtoothBatchV1 { + this := SawtoothBatchV1{} + return &this +} + +// GetHeader returns the Header field value +func (o *SawtoothBatchV1) GetHeader() SawtoothBatchHeaderV1 { + if o == nil { + var ret SawtoothBatchHeaderV1 + return ret + } + + return o.Header +} + +// GetHeaderOk returns a tuple with the Header field value +// and a boolean to check if the value has been set. +func (o *SawtoothBatchV1) GetHeaderOk() (*SawtoothBatchHeaderV1, bool) { + if o == nil { + return nil, false + } + return &o.Header, true +} + +// SetHeader sets field value +func (o *SawtoothBatchV1) SetHeader(v SawtoothBatchHeaderV1) { + o.Header = v +} + +// GetHeaderSignature returns the HeaderSignature field value +func (o *SawtoothBatchV1) GetHeaderSignature() string { + if o == nil { + var ret string + return ret + } + + return o.HeaderSignature +} + +// GetHeaderSignatureOk returns a tuple with the HeaderSignature field value +// and a boolean to check if the value has been set. +func (o *SawtoothBatchV1) GetHeaderSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HeaderSignature, true +} + +// SetHeaderSignature sets field value +func (o *SawtoothBatchV1) SetHeaderSignature(v string) { + o.HeaderSignature = v +} + +// GetTransactions returns the Transactions field value +func (o *SawtoothBatchV1) GetTransactions() []SawtoothTransactionV1 { + if o == nil { + var ret []SawtoothTransactionV1 + return ret + } + + return o.Transactions +} + +// GetTransactionsOk returns a tuple with the Transactions field value +// and a boolean to check if the value has been set. +func (o *SawtoothBatchV1) GetTransactionsOk() ([]SawtoothTransactionV1, bool) { + if o == nil { + return nil, false + } + return o.Transactions, true +} + +// SetTransactions sets field value +func (o *SawtoothBatchV1) SetTransactions(v []SawtoothTransactionV1) { + o.Transactions = v +} + +func (o SawtoothBatchV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SawtoothBatchV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["header"] = o.Header + toSerialize["header_signature"] = o.HeaderSignature + toSerialize["transactions"] = o.Transactions + return toSerialize, nil +} + +type NullableSawtoothBatchV1 struct { + value *SawtoothBatchV1 + isSet bool +} + +func (v NullableSawtoothBatchV1) Get() *SawtoothBatchV1 { + return v.value +} + +func (v *NullableSawtoothBatchV1) Set(val *SawtoothBatchV1) { + v.value = val + v.isSet = true +} + +func (v NullableSawtoothBatchV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSawtoothBatchV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSawtoothBatchV1(val *SawtoothBatchV1) *NullableSawtoothBatchV1 { + return &NullableSawtoothBatchV1{value: val, isSet: true} +} + +func (v NullableSawtoothBatchV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSawtoothBatchV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_block_header_v1.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_block_header_v1.go new file mode 100644 index 00000000000..6a9aa2af83a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_block_header_v1.go @@ -0,0 +1,252 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" +) + +// checks if the SawtoothBlockHeaderV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SawtoothBlockHeaderV1{} + +// SawtoothBlockHeaderV1 struct for SawtoothBlockHeaderV1 +type SawtoothBlockHeaderV1 struct { + BlockNum int32 `json:"block_num"` + PreviousBlockId string `json:"previous_block_id"` + SignerPublicKey string `json:"signer_public_key"` + BatchIds []string `json:"batch_ids"` + Consensus string `json:"consensus"` + StateRootHash string `json:"state_root_hash"` +} + +// NewSawtoothBlockHeaderV1 instantiates a new SawtoothBlockHeaderV1 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 +// will change when the set of required properties is changed +func NewSawtoothBlockHeaderV1(blockNum int32, previousBlockId string, signerPublicKey string, batchIds []string, consensus string, stateRootHash string) *SawtoothBlockHeaderV1 { + this := SawtoothBlockHeaderV1{} + this.BlockNum = blockNum + this.PreviousBlockId = previousBlockId + this.SignerPublicKey = signerPublicKey + this.BatchIds = batchIds + this.Consensus = consensus + this.StateRootHash = stateRootHash + return &this +} + +// NewSawtoothBlockHeaderV1WithDefaults instantiates a new SawtoothBlockHeaderV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSawtoothBlockHeaderV1WithDefaults() *SawtoothBlockHeaderV1 { + this := SawtoothBlockHeaderV1{} + return &this +} + +// GetBlockNum returns the BlockNum field value +func (o *SawtoothBlockHeaderV1) GetBlockNum() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BlockNum +} + +// GetBlockNumOk returns a tuple with the BlockNum field value +// and a boolean to check if the value has been set. +func (o *SawtoothBlockHeaderV1) GetBlockNumOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BlockNum, true +} + +// SetBlockNum sets field value +func (o *SawtoothBlockHeaderV1) SetBlockNum(v int32) { + o.BlockNum = v +} + +// GetPreviousBlockId returns the PreviousBlockId field value +func (o *SawtoothBlockHeaderV1) GetPreviousBlockId() string { + if o == nil { + var ret string + return ret + } + + return o.PreviousBlockId +} + +// GetPreviousBlockIdOk returns a tuple with the PreviousBlockId field value +// and a boolean to check if the value has been set. +func (o *SawtoothBlockHeaderV1) GetPreviousBlockIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PreviousBlockId, true +} + +// SetPreviousBlockId sets field value +func (o *SawtoothBlockHeaderV1) SetPreviousBlockId(v string) { + o.PreviousBlockId = v +} + +// GetSignerPublicKey returns the SignerPublicKey field value +func (o *SawtoothBlockHeaderV1) GetSignerPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.SignerPublicKey +} + +// GetSignerPublicKeyOk returns a tuple with the SignerPublicKey field value +// and a boolean to check if the value has been set. +func (o *SawtoothBlockHeaderV1) GetSignerPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SignerPublicKey, true +} + +// SetSignerPublicKey sets field value +func (o *SawtoothBlockHeaderV1) SetSignerPublicKey(v string) { + o.SignerPublicKey = v +} + +// GetBatchIds returns the BatchIds field value +func (o *SawtoothBlockHeaderV1) GetBatchIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.BatchIds +} + +// GetBatchIdsOk returns a tuple with the BatchIds field value +// and a boolean to check if the value has been set. +func (o *SawtoothBlockHeaderV1) GetBatchIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.BatchIds, true +} + +// SetBatchIds sets field value +func (o *SawtoothBlockHeaderV1) SetBatchIds(v []string) { + o.BatchIds = v +} + +// GetConsensus returns the Consensus field value +func (o *SawtoothBlockHeaderV1) GetConsensus() string { + if o == nil { + var ret string + return ret + } + + return o.Consensus +} + +// GetConsensusOk returns a tuple with the Consensus field value +// and a boolean to check if the value has been set. +func (o *SawtoothBlockHeaderV1) GetConsensusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Consensus, true +} + +// SetConsensus sets field value +func (o *SawtoothBlockHeaderV1) SetConsensus(v string) { + o.Consensus = v +} + +// GetStateRootHash returns the StateRootHash field value +func (o *SawtoothBlockHeaderV1) GetStateRootHash() string { + if o == nil { + var ret string + return ret + } + + return o.StateRootHash +} + +// GetStateRootHashOk returns a tuple with the StateRootHash field value +// and a boolean to check if the value has been set. +func (o *SawtoothBlockHeaderV1) GetStateRootHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StateRootHash, true +} + +// SetStateRootHash sets field value +func (o *SawtoothBlockHeaderV1) SetStateRootHash(v string) { + o.StateRootHash = v +} + +func (o SawtoothBlockHeaderV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SawtoothBlockHeaderV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["block_num"] = o.BlockNum + toSerialize["previous_block_id"] = o.PreviousBlockId + toSerialize["signer_public_key"] = o.SignerPublicKey + toSerialize["batch_ids"] = o.BatchIds + toSerialize["consensus"] = o.Consensus + toSerialize["state_root_hash"] = o.StateRootHash + return toSerialize, nil +} + +type NullableSawtoothBlockHeaderV1 struct { + value *SawtoothBlockHeaderV1 + isSet bool +} + +func (v NullableSawtoothBlockHeaderV1) Get() *SawtoothBlockHeaderV1 { + return v.value +} + +func (v *NullableSawtoothBlockHeaderV1) Set(val *SawtoothBlockHeaderV1) { + v.value = val + v.isSet = true +} + +func (v NullableSawtoothBlockHeaderV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSawtoothBlockHeaderV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSawtoothBlockHeaderV1(val *SawtoothBlockHeaderV1) *NullableSawtoothBlockHeaderV1 { + return &NullableSawtoothBlockHeaderV1{value: val, isSet: true} +} + +func (v NullableSawtoothBlockHeaderV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSawtoothBlockHeaderV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_block_v1.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_block_v1.go new file mode 100644 index 00000000000..882dce6ea79 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_block_v1.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" +) + +// checks if the SawtoothBlockV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SawtoothBlockV1{} + +// SawtoothBlockV1 struct for SawtoothBlockV1 +type SawtoothBlockV1 struct { + Header SawtoothBlockHeaderV1 `json:"header"` + HeaderSignature string `json:"header_signature"` + Batches []SawtoothBatchV1 `json:"batches"` +} + +// NewSawtoothBlockV1 instantiates a new SawtoothBlockV1 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 +// will change when the set of required properties is changed +func NewSawtoothBlockV1(header SawtoothBlockHeaderV1, headerSignature string, batches []SawtoothBatchV1) *SawtoothBlockV1 { + this := SawtoothBlockV1{} + this.Header = header + this.HeaderSignature = headerSignature + this.Batches = batches + return &this +} + +// NewSawtoothBlockV1WithDefaults instantiates a new SawtoothBlockV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSawtoothBlockV1WithDefaults() *SawtoothBlockV1 { + this := SawtoothBlockV1{} + return &this +} + +// GetHeader returns the Header field value +func (o *SawtoothBlockV1) GetHeader() SawtoothBlockHeaderV1 { + if o == nil { + var ret SawtoothBlockHeaderV1 + return ret + } + + return o.Header +} + +// GetHeaderOk returns a tuple with the Header field value +// and a boolean to check if the value has been set. +func (o *SawtoothBlockV1) GetHeaderOk() (*SawtoothBlockHeaderV1, bool) { + if o == nil { + return nil, false + } + return &o.Header, true +} + +// SetHeader sets field value +func (o *SawtoothBlockV1) SetHeader(v SawtoothBlockHeaderV1) { + o.Header = v +} + +// GetHeaderSignature returns the HeaderSignature field value +func (o *SawtoothBlockV1) GetHeaderSignature() string { + if o == nil { + var ret string + return ret + } + + return o.HeaderSignature +} + +// GetHeaderSignatureOk returns a tuple with the HeaderSignature field value +// and a boolean to check if the value has been set. +func (o *SawtoothBlockV1) GetHeaderSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HeaderSignature, true +} + +// SetHeaderSignature sets field value +func (o *SawtoothBlockV1) SetHeaderSignature(v string) { + o.HeaderSignature = v +} + +// GetBatches returns the Batches field value +func (o *SawtoothBlockV1) GetBatches() []SawtoothBatchV1 { + if o == nil { + var ret []SawtoothBatchV1 + return ret + } + + return o.Batches +} + +// GetBatchesOk returns a tuple with the Batches field value +// and a boolean to check if the value has been set. +func (o *SawtoothBlockV1) GetBatchesOk() ([]SawtoothBatchV1, bool) { + if o == nil { + return nil, false + } + return o.Batches, true +} + +// SetBatches sets field value +func (o *SawtoothBlockV1) SetBatches(v []SawtoothBatchV1) { + o.Batches = v +} + +func (o SawtoothBlockV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SawtoothBlockV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["header"] = o.Header + toSerialize["header_signature"] = o.HeaderSignature + toSerialize["batches"] = o.Batches + return toSerialize, nil +} + +type NullableSawtoothBlockV1 struct { + value *SawtoothBlockV1 + isSet bool +} + +func (v NullableSawtoothBlockV1) Get() *SawtoothBlockV1 { + return v.value +} + +func (v *NullableSawtoothBlockV1) Set(val *SawtoothBlockV1) { + v.value = val + v.isSet = true +} + +func (v NullableSawtoothBlockV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSawtoothBlockV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSawtoothBlockV1(val *SawtoothBlockV1) *NullableSawtoothBlockV1 { + return &NullableSawtoothBlockV1{value: val, isSet: true} +} + +func (v NullableSawtoothBlockV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSawtoothBlockV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_transaction_header_v1.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_transaction_header_v1.go new file mode 100644 index 00000000000..7c6fe9a7386 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_transaction_header_v1.go @@ -0,0 +1,333 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" +) + +// checks if the SawtoothTransactionHeaderV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SawtoothTransactionHeaderV1{} + +// SawtoothTransactionHeaderV1 struct for SawtoothTransactionHeaderV1 +type SawtoothTransactionHeaderV1 struct { + BatcherPublicKey string `json:"batcher_public_key"` + Dependencies []string `json:"dependencies"` + FamilyName string `json:"family_name"` + FamilyVersion string `json:"family_version"` + Inputs []string `json:"inputs"` + Nonce string `json:"nonce"` + Outputs []string `json:"outputs"` + PayloadSha512 string `json:"payload_sha512"` + SignerPublicKey string `json:"signer_public_key"` +} + +// NewSawtoothTransactionHeaderV1 instantiates a new SawtoothTransactionHeaderV1 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 +// will change when the set of required properties is changed +func NewSawtoothTransactionHeaderV1(batcherPublicKey string, dependencies []string, familyName string, familyVersion string, inputs []string, nonce string, outputs []string, payloadSha512 string, signerPublicKey string) *SawtoothTransactionHeaderV1 { + this := SawtoothTransactionHeaderV1{} + this.BatcherPublicKey = batcherPublicKey + this.Dependencies = dependencies + this.FamilyName = familyName + this.FamilyVersion = familyVersion + this.Inputs = inputs + this.Nonce = nonce + this.Outputs = outputs + this.PayloadSha512 = payloadSha512 + this.SignerPublicKey = signerPublicKey + return &this +} + +// NewSawtoothTransactionHeaderV1WithDefaults instantiates a new SawtoothTransactionHeaderV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSawtoothTransactionHeaderV1WithDefaults() *SawtoothTransactionHeaderV1 { + this := SawtoothTransactionHeaderV1{} + return &this +} + +// GetBatcherPublicKey returns the BatcherPublicKey field value +func (o *SawtoothTransactionHeaderV1) GetBatcherPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.BatcherPublicKey +} + +// GetBatcherPublicKeyOk returns a tuple with the BatcherPublicKey field value +// and a boolean to check if the value has been set. +func (o *SawtoothTransactionHeaderV1) GetBatcherPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BatcherPublicKey, true +} + +// SetBatcherPublicKey sets field value +func (o *SawtoothTransactionHeaderV1) SetBatcherPublicKey(v string) { + o.BatcherPublicKey = v +} + +// GetDependencies returns the Dependencies field value +func (o *SawtoothTransactionHeaderV1) GetDependencies() []string { + if o == nil { + var ret []string + return ret + } + + return o.Dependencies +} + +// GetDependenciesOk returns a tuple with the Dependencies field value +// and a boolean to check if the value has been set. +func (o *SawtoothTransactionHeaderV1) GetDependenciesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Dependencies, true +} + +// SetDependencies sets field value +func (o *SawtoothTransactionHeaderV1) SetDependencies(v []string) { + o.Dependencies = v +} + +// GetFamilyName returns the FamilyName field value +func (o *SawtoothTransactionHeaderV1) GetFamilyName() string { + if o == nil { + var ret string + return ret + } + + return o.FamilyName +} + +// GetFamilyNameOk returns a tuple with the FamilyName field value +// and a boolean to check if the value has been set. +func (o *SawtoothTransactionHeaderV1) GetFamilyNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FamilyName, true +} + +// SetFamilyName sets field value +func (o *SawtoothTransactionHeaderV1) SetFamilyName(v string) { + o.FamilyName = v +} + +// GetFamilyVersion returns the FamilyVersion field value +func (o *SawtoothTransactionHeaderV1) GetFamilyVersion() string { + if o == nil { + var ret string + return ret + } + + return o.FamilyVersion +} + +// GetFamilyVersionOk returns a tuple with the FamilyVersion field value +// and a boolean to check if the value has been set. +func (o *SawtoothTransactionHeaderV1) GetFamilyVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FamilyVersion, true +} + +// SetFamilyVersion sets field value +func (o *SawtoothTransactionHeaderV1) SetFamilyVersion(v string) { + o.FamilyVersion = v +} + +// GetInputs returns the Inputs field value +func (o *SawtoothTransactionHeaderV1) GetInputs() []string { + if o == nil { + var ret []string + return ret + } + + return o.Inputs +} + +// GetInputsOk returns a tuple with the Inputs field value +// and a boolean to check if the value has been set. +func (o *SawtoothTransactionHeaderV1) GetInputsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Inputs, true +} + +// SetInputs sets field value +func (o *SawtoothTransactionHeaderV1) SetInputs(v []string) { + o.Inputs = v +} + +// GetNonce returns the Nonce field value +func (o *SawtoothTransactionHeaderV1) GetNonce() string { + if o == nil { + var ret string + return ret + } + + return o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value +// and a boolean to check if the value has been set. +func (o *SawtoothTransactionHeaderV1) GetNonceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Nonce, true +} + +// SetNonce sets field value +func (o *SawtoothTransactionHeaderV1) SetNonce(v string) { + o.Nonce = v +} + +// GetOutputs returns the Outputs field value +func (o *SawtoothTransactionHeaderV1) GetOutputs() []string { + if o == nil { + var ret []string + return ret + } + + return o.Outputs +} + +// GetOutputsOk returns a tuple with the Outputs field value +// and a boolean to check if the value has been set. +func (o *SawtoothTransactionHeaderV1) GetOutputsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Outputs, true +} + +// SetOutputs sets field value +func (o *SawtoothTransactionHeaderV1) SetOutputs(v []string) { + o.Outputs = v +} + +// GetPayloadSha512 returns the PayloadSha512 field value +func (o *SawtoothTransactionHeaderV1) GetPayloadSha512() string { + if o == nil { + var ret string + return ret + } + + return o.PayloadSha512 +} + +// GetPayloadSha512Ok returns a tuple with the PayloadSha512 field value +// and a boolean to check if the value has been set. +func (o *SawtoothTransactionHeaderV1) GetPayloadSha512Ok() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PayloadSha512, true +} + +// SetPayloadSha512 sets field value +func (o *SawtoothTransactionHeaderV1) SetPayloadSha512(v string) { + o.PayloadSha512 = v +} + +// GetSignerPublicKey returns the SignerPublicKey field value +func (o *SawtoothTransactionHeaderV1) GetSignerPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.SignerPublicKey +} + +// GetSignerPublicKeyOk returns a tuple with the SignerPublicKey field value +// and a boolean to check if the value has been set. +func (o *SawtoothTransactionHeaderV1) GetSignerPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SignerPublicKey, true +} + +// SetSignerPublicKey sets field value +func (o *SawtoothTransactionHeaderV1) SetSignerPublicKey(v string) { + o.SignerPublicKey = v +} + +func (o SawtoothTransactionHeaderV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SawtoothTransactionHeaderV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["batcher_public_key"] = o.BatcherPublicKey + toSerialize["dependencies"] = o.Dependencies + toSerialize["family_name"] = o.FamilyName + toSerialize["family_version"] = o.FamilyVersion + toSerialize["inputs"] = o.Inputs + toSerialize["nonce"] = o.Nonce + toSerialize["outputs"] = o.Outputs + toSerialize["payload_sha512"] = o.PayloadSha512 + toSerialize["signer_public_key"] = o.SignerPublicKey + return toSerialize, nil +} + +type NullableSawtoothTransactionHeaderV1 struct { + value *SawtoothTransactionHeaderV1 + isSet bool +} + +func (v NullableSawtoothTransactionHeaderV1) Get() *SawtoothTransactionHeaderV1 { + return v.value +} + +func (v *NullableSawtoothTransactionHeaderV1) Set(val *SawtoothTransactionHeaderV1) { + v.value = val + v.isSet = true +} + +func (v NullableSawtoothTransactionHeaderV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSawtoothTransactionHeaderV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSawtoothTransactionHeaderV1(val *SawtoothTransactionHeaderV1) *NullableSawtoothTransactionHeaderV1 { + return &NullableSawtoothTransactionHeaderV1{value: val, isSet: true} +} + +func (v NullableSawtoothTransactionHeaderV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSawtoothTransactionHeaderV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_transaction_v1.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_transaction_v1.go new file mode 100644 index 00000000000..0ea81332b37 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_sawtooth_transaction_v1.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" +) + +// checks if the SawtoothTransactionV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SawtoothTransactionV1{} + +// SawtoothTransactionV1 struct for SawtoothTransactionV1 +type SawtoothTransactionV1 struct { + Header SawtoothTransactionHeaderV1 `json:"header"` + HeaderSignature string `json:"header_signature"` + Payload string `json:"payload"` +} + +// NewSawtoothTransactionV1 instantiates a new SawtoothTransactionV1 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 +// will change when the set of required properties is changed +func NewSawtoothTransactionV1(header SawtoothTransactionHeaderV1, headerSignature string, payload string) *SawtoothTransactionV1 { + this := SawtoothTransactionV1{} + this.Header = header + this.HeaderSignature = headerSignature + this.Payload = payload + return &this +} + +// NewSawtoothTransactionV1WithDefaults instantiates a new SawtoothTransactionV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSawtoothTransactionV1WithDefaults() *SawtoothTransactionV1 { + this := SawtoothTransactionV1{} + return &this +} + +// GetHeader returns the Header field value +func (o *SawtoothTransactionV1) GetHeader() SawtoothTransactionHeaderV1 { + if o == nil { + var ret SawtoothTransactionHeaderV1 + return ret + } + + return o.Header +} + +// GetHeaderOk returns a tuple with the Header field value +// and a boolean to check if the value has been set. +func (o *SawtoothTransactionV1) GetHeaderOk() (*SawtoothTransactionHeaderV1, bool) { + if o == nil { + return nil, false + } + return &o.Header, true +} + +// SetHeader sets field value +func (o *SawtoothTransactionV1) SetHeader(v SawtoothTransactionHeaderV1) { + o.Header = v +} + +// GetHeaderSignature returns the HeaderSignature field value +func (o *SawtoothTransactionV1) GetHeaderSignature() string { + if o == nil { + var ret string + return ret + } + + return o.HeaderSignature +} + +// GetHeaderSignatureOk returns a tuple with the HeaderSignature field value +// and a boolean to check if the value has been set. +func (o *SawtoothTransactionV1) GetHeaderSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HeaderSignature, true +} + +// SetHeaderSignature sets field value +func (o *SawtoothTransactionV1) SetHeaderSignature(v string) { + o.HeaderSignature = v +} + +// GetPayload returns the Payload field value +func (o *SawtoothTransactionV1) GetPayload() string { + if o == nil { + var ret string + return ret + } + + return o.Payload +} + +// GetPayloadOk returns a tuple with the Payload field value +// and a boolean to check if the value has been set. +func (o *SawtoothTransactionV1) GetPayloadOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Payload, true +} + +// SetPayload sets field value +func (o *SawtoothTransactionV1) SetPayload(v string) { + o.Payload = v +} + +func (o SawtoothTransactionV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SawtoothTransactionV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["header"] = o.Header + toSerialize["header_signature"] = o.HeaderSignature + toSerialize["payload"] = o.Payload + return toSerialize, nil +} + +type NullableSawtoothTransactionV1 struct { + value *SawtoothTransactionV1 + isSet bool +} + +func (v NullableSawtoothTransactionV1) Get() *SawtoothTransactionV1 { + return v.value +} + +func (v *NullableSawtoothTransactionV1) Set(val *SawtoothTransactionV1) { + v.value = val + v.isSet = true +} + +func (v NullableSawtoothTransactionV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSawtoothTransactionV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSawtoothTransactionV1(val *SawtoothTransactionV1) *NullableSawtoothTransactionV1 { + return &NullableSawtoothTransactionV1{value: val, isSet: true} +} + +func (v NullableSawtoothTransactionV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSawtoothTransactionV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_status_response_v1.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_status_response_v1.go new file mode 100644 index 00000000000..31ba1c75d40 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_status_response_v1.go @@ -0,0 +1,230 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" +) + +// checks if the StatusResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StatusResponseV1{} + +// StatusResponseV1 Response with plugin and validator status report. +type StatusResponseV1 struct { + // Plugin instance id. + InstanceId string `json:"instanceId"` + // Version of connectors Open API Spec. + OpenApiSpecVersion *string `json:"openApiSpecVersion,omitempty"` + // True if endpoints were created, false otherwise + Initialized *bool `json:"initialized,omitempty"` + // Response from sawtooth Rest API status endpoint + SawtoothStatus interface{} `json:"sawtoothStatus,omitempty"` +} + +// NewStatusResponseV1 instantiates a new StatusResponseV1 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 +// will change when the set of required properties is changed +func NewStatusResponseV1(instanceId string) *StatusResponseV1 { + this := StatusResponseV1{} + this.InstanceId = instanceId + return &this +} + +// NewStatusResponseV1WithDefaults instantiates a new StatusResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStatusResponseV1WithDefaults() *StatusResponseV1 { + this := StatusResponseV1{} + return &this +} + +// GetInstanceId returns the InstanceId field value +func (o *StatusResponseV1) GetInstanceId() string { + if o == nil { + var ret string + return ret + } + + return o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceId, true +} + +// SetInstanceId sets field value +func (o *StatusResponseV1) SetInstanceId(v string) { + o.InstanceId = v +} + +// GetOpenApiSpecVersion returns the OpenApiSpecVersion field value if set, zero value otherwise. +func (o *StatusResponseV1) GetOpenApiSpecVersion() string { + if o == nil || isNil(o.OpenApiSpecVersion) { + var ret string + return ret + } + return *o.OpenApiSpecVersion +} + +// GetOpenApiSpecVersionOk returns a tuple with the OpenApiSpecVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetOpenApiSpecVersionOk() (*string, bool) { + if o == nil || isNil(o.OpenApiSpecVersion) { + return nil, false + } + return o.OpenApiSpecVersion, true +} + +// HasOpenApiSpecVersion returns a boolean if a field has been set. +func (o *StatusResponseV1) HasOpenApiSpecVersion() bool { + if o != nil && !isNil(o.OpenApiSpecVersion) { + return true + } + + return false +} + +// SetOpenApiSpecVersion gets a reference to the given string and assigns it to the OpenApiSpecVersion field. +func (o *StatusResponseV1) SetOpenApiSpecVersion(v string) { + o.OpenApiSpecVersion = &v +} + +// GetInitialized returns the Initialized field value if set, zero value otherwise. +func (o *StatusResponseV1) GetInitialized() bool { + if o == nil || isNil(o.Initialized) { + var ret bool + return ret + } + return *o.Initialized +} + +// GetInitializedOk returns a tuple with the Initialized field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetInitializedOk() (*bool, bool) { + if o == nil || isNil(o.Initialized) { + return nil, false + } + return o.Initialized, true +} + +// HasInitialized returns a boolean if a field has been set. +func (o *StatusResponseV1) HasInitialized() bool { + if o != nil && !isNil(o.Initialized) { + return true + } + + return false +} + +// SetInitialized gets a reference to the given bool and assigns it to the Initialized field. +func (o *StatusResponseV1) SetInitialized(v bool) { + o.Initialized = &v +} + +// GetSawtoothStatus returns the SawtoothStatus field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *StatusResponseV1) GetSawtoothStatus() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.SawtoothStatus +} + +// GetSawtoothStatusOk returns a tuple with the SawtoothStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *StatusResponseV1) GetSawtoothStatusOk() (*interface{}, bool) { + if o == nil || isNil(o.SawtoothStatus) { + return nil, false + } + return &o.SawtoothStatus, true +} + +// HasSawtoothStatus returns a boolean if a field has been set. +func (o *StatusResponseV1) HasSawtoothStatus() bool { + if o != nil && isNil(o.SawtoothStatus) { + return true + } + + return false +} + +// SetSawtoothStatus gets a reference to the given interface{} and assigns it to the SawtoothStatus field. +func (o *StatusResponseV1) SetSawtoothStatus(v interface{}) { + o.SawtoothStatus = v +} + +func (o StatusResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StatusResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceId"] = o.InstanceId + if !isNil(o.OpenApiSpecVersion) { + toSerialize["openApiSpecVersion"] = o.OpenApiSpecVersion + } + if !isNil(o.Initialized) { + toSerialize["initialized"] = o.Initialized + } + if o.SawtoothStatus != nil { + toSerialize["sawtoothStatus"] = o.SawtoothStatus + } + return toSerialize, nil +} + +type NullableStatusResponseV1 struct { + value *StatusResponseV1 + isSet bool +} + +func (v NullableStatusResponseV1) Get() *StatusResponseV1 { + return v.value +} + +func (v *NullableStatusResponseV1) Set(val *StatusResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableStatusResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableStatusResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatusResponseV1(val *StatusResponseV1) *NullableStatusResponseV1 { + return &NullableStatusResponseV1{value: val, isSet: true} +} + +func (v NullableStatusResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatusResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go new file mode 100644 index 00000000000..b5b4afd7218 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksV1 the model 'WatchBlocksV1' +type WatchBlocksV1 string + +// List of WatchBlocksV1 +const ( + Subscribe WatchBlocksV1 = "org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Subscribe" + Next WatchBlocksV1 = "org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Next" + Unsubscribe WatchBlocksV1 = "org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Unsubscribe" + Error WatchBlocksV1 = "org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Error" + Complete WatchBlocksV1 = "org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Complete" +) + +// All allowed values of WatchBlocksV1 enum +var AllowedWatchBlocksV1EnumValues = []WatchBlocksV1{ + "org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Subscribe", + "org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Next", + "org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Unsubscribe", + "org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Error", + "org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Complete", +} + +func (v *WatchBlocksV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchBlocksV1(value) + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchBlocksV1", value) +} + +// NewWatchBlocksV1FromValue returns a pointer to a valid WatchBlocksV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchBlocksV1FromValue(v string) (*WatchBlocksV1, error) { + ev := WatchBlocksV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchBlocksV1: valid values are %v", v, AllowedWatchBlocksV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchBlocksV1) IsValid() bool { + for _, existing := range AllowedWatchBlocksV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchBlocksV1 value +func (v WatchBlocksV1) Ptr() *WatchBlocksV1 { + return &v +} + +type NullableWatchBlocksV1 struct { + value *WatchBlocksV1 + isSet bool +} + +func (v NullableWatchBlocksV1) Get() *WatchBlocksV1 { + return v.value +} + +func (v *NullableWatchBlocksV1) Set(val *WatchBlocksV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1(val *WatchBlocksV1) *NullableWatchBlocksV1 { + return &NullableWatchBlocksV1{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_cacti_transactions_response.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_cacti_transactions_response.go new file mode 100644 index 00000000000..dc18d59c734 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_cacti_transactions_response.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1CactiTransactionsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1CactiTransactionsResponse{} + +// WatchBlocksV1CactiTransactionsResponse Custom response containing block transactions summary. +type WatchBlocksV1CactiTransactionsResponse struct { + // List of sawtooth transactions matching specifid (optional) filter + CactiTransactionsEvents []CactiTransactionV1 `json:"cactiTransactionsEvents"` +} + +// NewWatchBlocksV1CactiTransactionsResponse instantiates a new WatchBlocksV1CactiTransactionsResponse 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 +// will change when the set of required properties is changed +func NewWatchBlocksV1CactiTransactionsResponse(cactiTransactionsEvents []CactiTransactionV1) *WatchBlocksV1CactiTransactionsResponse { + this := WatchBlocksV1CactiTransactionsResponse{} + this.CactiTransactionsEvents = cactiTransactionsEvents + return &this +} + +// NewWatchBlocksV1CactiTransactionsResponseWithDefaults instantiates a new WatchBlocksV1CactiTransactionsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1CactiTransactionsResponseWithDefaults() *WatchBlocksV1CactiTransactionsResponse { + this := WatchBlocksV1CactiTransactionsResponse{} + return &this +} + +// GetCactiTransactionsEvents returns the CactiTransactionsEvents field value +func (o *WatchBlocksV1CactiTransactionsResponse) GetCactiTransactionsEvents() []CactiTransactionV1 { + if o == nil { + var ret []CactiTransactionV1 + return ret + } + + return o.CactiTransactionsEvents +} + +// GetCactiTransactionsEventsOk returns a tuple with the CactiTransactionsEvents field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1CactiTransactionsResponse) GetCactiTransactionsEventsOk() ([]CactiTransactionV1, bool) { + if o == nil { + return nil, false + } + return o.CactiTransactionsEvents, true +} + +// SetCactiTransactionsEvents sets field value +func (o *WatchBlocksV1CactiTransactionsResponse) SetCactiTransactionsEvents(v []CactiTransactionV1) { + o.CactiTransactionsEvents = v +} + +func (o WatchBlocksV1CactiTransactionsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1CactiTransactionsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cactiTransactionsEvents"] = o.CactiTransactionsEvents + return toSerialize, nil +} + +type NullableWatchBlocksV1CactiTransactionsResponse struct { + value *WatchBlocksV1CactiTransactionsResponse + isSet bool +} + +func (v NullableWatchBlocksV1CactiTransactionsResponse) Get() *WatchBlocksV1CactiTransactionsResponse { + return v.value +} + +func (v *NullableWatchBlocksV1CactiTransactionsResponse) Set(val *WatchBlocksV1CactiTransactionsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1CactiTransactionsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1CactiTransactionsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1CactiTransactionsResponse(val *WatchBlocksV1CactiTransactionsResponse) *NullableWatchBlocksV1CactiTransactionsResponse { + return &NullableWatchBlocksV1CactiTransactionsResponse{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1CactiTransactionsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1CactiTransactionsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_full_response.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_full_response.go new file mode 100644 index 00000000000..4abd045890b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_full_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1FullResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1FullResponse{} + +// WatchBlocksV1FullResponse Response that returns entire sawtooth block. +type WatchBlocksV1FullResponse struct { + FullBlock SawtoothBlockV1 `json:"fullBlock"` +} + +// NewWatchBlocksV1FullResponse instantiates a new WatchBlocksV1FullResponse 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 +// will change when the set of required properties is changed +func NewWatchBlocksV1FullResponse(fullBlock SawtoothBlockV1) *WatchBlocksV1FullResponse { + this := WatchBlocksV1FullResponse{} + this.FullBlock = fullBlock + return &this +} + +// NewWatchBlocksV1FullResponseWithDefaults instantiates a new WatchBlocksV1FullResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1FullResponseWithDefaults() *WatchBlocksV1FullResponse { + this := WatchBlocksV1FullResponse{} + return &this +} + +// GetFullBlock returns the FullBlock field value +func (o *WatchBlocksV1FullResponse) GetFullBlock() SawtoothBlockV1 { + if o == nil { + var ret SawtoothBlockV1 + return ret + } + + return o.FullBlock +} + +// GetFullBlockOk returns a tuple with the FullBlock field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1FullResponse) GetFullBlockOk() (*SawtoothBlockV1, bool) { + if o == nil { + return nil, false + } + return &o.FullBlock, true +} + +// SetFullBlock sets field value +func (o *WatchBlocksV1FullResponse) SetFullBlock(v SawtoothBlockV1) { + o.FullBlock = v +} + +func (o WatchBlocksV1FullResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1FullResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["fullBlock"] = o.FullBlock + return toSerialize, nil +} + +type NullableWatchBlocksV1FullResponse struct { + value *WatchBlocksV1FullResponse + isSet bool +} + +func (v NullableWatchBlocksV1FullResponse) Get() *WatchBlocksV1FullResponse { + return v.value +} + +func (v *NullableWatchBlocksV1FullResponse) Set(val *WatchBlocksV1FullResponse) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1FullResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1FullResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1FullResponse(val *WatchBlocksV1FullResponse) *NullableWatchBlocksV1FullResponse { + return &NullableWatchBlocksV1FullResponse{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1FullResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1FullResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_listener_type.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_listener_type.go new file mode 100644 index 00000000000..dda1a2b1e06 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_listener_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksV1ListenerType Response type from WatchBlocks. 'Cacti*' are custom views, others correspond to plain sawtooth data. +type WatchBlocksV1ListenerType string + +// List of WatchBlocksV1ListenerType +const ( + Full WatchBlocksV1ListenerType = "full" + CactiTransactions WatchBlocksV1ListenerType = "cacti:transactions" +) + +// All allowed values of WatchBlocksV1ListenerType enum +var AllowedWatchBlocksV1ListenerTypeEnumValues = []WatchBlocksV1ListenerType{ + "full", + "cacti:transactions", +} + +func (v *WatchBlocksV1ListenerType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchBlocksV1ListenerType(value) + for _, existing := range AllowedWatchBlocksV1ListenerTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchBlocksV1ListenerType", value) +} + +// NewWatchBlocksV1ListenerTypeFromValue returns a pointer to a valid WatchBlocksV1ListenerType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchBlocksV1ListenerTypeFromValue(v string) (*WatchBlocksV1ListenerType, error) { + ev := WatchBlocksV1ListenerType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchBlocksV1ListenerType: valid values are %v", v, AllowedWatchBlocksV1ListenerTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchBlocksV1ListenerType) IsValid() bool { + for _, existing := range AllowedWatchBlocksV1ListenerTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchBlocksV1ListenerType value +func (v WatchBlocksV1ListenerType) Ptr() *WatchBlocksV1ListenerType { + return &v +} + +type NullableWatchBlocksV1ListenerType struct { + value *WatchBlocksV1ListenerType + isSet bool +} + +func (v NullableWatchBlocksV1ListenerType) Get() *WatchBlocksV1ListenerType { + return v.value +} + +func (v *NullableWatchBlocksV1ListenerType) Set(val *WatchBlocksV1ListenerType) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1ListenerType) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1ListenerType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1ListenerType(val *WatchBlocksV1ListenerType) *NullableWatchBlocksV1ListenerType { + return &NullableWatchBlocksV1ListenerType{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1ListenerType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1ListenerType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go new file mode 100644 index 00000000000..838d4978dee --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_options.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1Options type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1Options{} + +// WatchBlocksV1Options struct for WatchBlocksV1Options +type WatchBlocksV1Options struct { + Type *WatchBlocksV1ListenerType `json:"type,omitempty"` + TxFilterBy *WatchBlocksV1TransactionFilter `json:"txFilterBy,omitempty"` +} + +// NewWatchBlocksV1Options instantiates a new WatchBlocksV1Options 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 +// will change when the set of required properties is changed +func NewWatchBlocksV1Options() *WatchBlocksV1Options { + this := WatchBlocksV1Options{} + return &this +} + +// NewWatchBlocksV1OptionsWithDefaults instantiates a new WatchBlocksV1Options object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1OptionsWithDefaults() *WatchBlocksV1Options { + this := WatchBlocksV1Options{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WatchBlocksV1Options) GetType() WatchBlocksV1ListenerType { + if o == nil || isNil(o.Type) { + var ret WatchBlocksV1ListenerType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Options) GetTypeOk() (*WatchBlocksV1ListenerType, bool) { + if o == nil || isNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WatchBlocksV1Options) HasType() bool { + if o != nil && !isNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given WatchBlocksV1ListenerType and assigns it to the Type field. +func (o *WatchBlocksV1Options) SetType(v WatchBlocksV1ListenerType) { + o.Type = &v +} + +// GetTxFilterBy returns the TxFilterBy field value if set, zero value otherwise. +func (o *WatchBlocksV1Options) GetTxFilterBy() WatchBlocksV1TransactionFilter { + if o == nil || isNil(o.TxFilterBy) { + var ret WatchBlocksV1TransactionFilter + return ret + } + return *o.TxFilterBy +} + +// GetTxFilterByOk returns a tuple with the TxFilterBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Options) GetTxFilterByOk() (*WatchBlocksV1TransactionFilter, bool) { + if o == nil || isNil(o.TxFilterBy) { + return nil, false + } + return o.TxFilterBy, true +} + +// HasTxFilterBy returns a boolean if a field has been set. +func (o *WatchBlocksV1Options) HasTxFilterBy() bool { + if o != nil && !isNil(o.TxFilterBy) { + return true + } + + return false +} + +// SetTxFilterBy gets a reference to the given WatchBlocksV1TransactionFilter and assigns it to the TxFilterBy field. +func (o *WatchBlocksV1Options) SetTxFilterBy(v WatchBlocksV1TransactionFilter) { + o.TxFilterBy = &v +} + +func (o WatchBlocksV1Options) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1Options) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Type) { + toSerialize["type"] = o.Type + } + if !isNil(o.TxFilterBy) { + toSerialize["txFilterBy"] = o.TxFilterBy + } + return toSerialize, nil +} + +type NullableWatchBlocksV1Options struct { + value *WatchBlocksV1Options + isSet bool +} + +func (v NullableWatchBlocksV1Options) Get() *WatchBlocksV1Options { + return v.value +} + +func (v *NullableWatchBlocksV1Options) Set(val *WatchBlocksV1Options) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1Options) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1Options) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1Options(val *WatchBlocksV1Options) *NullableWatchBlocksV1Options { + return &NullableWatchBlocksV1Options{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1Options) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1Options) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go new file mode 100644 index 00000000000..295dd3b8af4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_progress.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" + "fmt" +) + +// WatchBlocksV1Progress - Response block from WatchBlocks endpoint. Depends on 'type' passed in subscription options. +type WatchBlocksV1Progress struct { + WatchBlocksV1CactiTransactionsResponse *WatchBlocksV1CactiTransactionsResponse + WatchBlocksV1FullResponse *WatchBlocksV1FullResponse +} + +// WatchBlocksV1CactiTransactionsResponseAsWatchBlocksV1Progress is a convenience function that returns WatchBlocksV1CactiTransactionsResponse wrapped in WatchBlocksV1Progress +func WatchBlocksV1CactiTransactionsResponseAsWatchBlocksV1Progress(v *WatchBlocksV1CactiTransactionsResponse) WatchBlocksV1Progress { + return WatchBlocksV1Progress{ + WatchBlocksV1CactiTransactionsResponse: v, + } +} + +// WatchBlocksV1FullResponseAsWatchBlocksV1Progress is a convenience function that returns WatchBlocksV1FullResponse wrapped in WatchBlocksV1Progress +func WatchBlocksV1FullResponseAsWatchBlocksV1Progress(v *WatchBlocksV1FullResponse) WatchBlocksV1Progress { + return WatchBlocksV1Progress{ + WatchBlocksV1FullResponse: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *WatchBlocksV1Progress) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into WatchBlocksV1CactiTransactionsResponse + err = newStrictDecoder(data).Decode(&dst.WatchBlocksV1CactiTransactionsResponse) + if err == nil { + jsonWatchBlocksV1CactiTransactionsResponse, _ := json.Marshal(dst.WatchBlocksV1CactiTransactionsResponse) + if string(jsonWatchBlocksV1CactiTransactionsResponse) == "{}" { // empty struct + dst.WatchBlocksV1CactiTransactionsResponse = nil + } else { + match++ + } + } else { + dst.WatchBlocksV1CactiTransactionsResponse = nil + } + + // try to unmarshal data into WatchBlocksV1FullResponse + err = newStrictDecoder(data).Decode(&dst.WatchBlocksV1FullResponse) + if err == nil { + jsonWatchBlocksV1FullResponse, _ := json.Marshal(dst.WatchBlocksV1FullResponse) + if string(jsonWatchBlocksV1FullResponse) == "{}" { // empty struct + dst.WatchBlocksV1FullResponse = nil + } else { + match++ + } + } else { + dst.WatchBlocksV1FullResponse = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.WatchBlocksV1CactiTransactionsResponse = nil + dst.WatchBlocksV1FullResponse = nil + + return fmt.Errorf("data matches more than one schema in oneOf(WatchBlocksV1Progress)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(WatchBlocksV1Progress)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src WatchBlocksV1Progress) MarshalJSON() ([]byte, error) { + if src.WatchBlocksV1CactiTransactionsResponse != nil { + return json.Marshal(&src.WatchBlocksV1CactiTransactionsResponse) + } + + if src.WatchBlocksV1FullResponse != nil { + return json.Marshal(&src.WatchBlocksV1FullResponse) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *WatchBlocksV1Progress) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.WatchBlocksV1CactiTransactionsResponse != nil { + return obj.WatchBlocksV1CactiTransactionsResponse + } + + if obj.WatchBlocksV1FullResponse != nil { + return obj.WatchBlocksV1FullResponse + } + + // all schemas are nil + return nil +} + +type NullableWatchBlocksV1Progress struct { + value *WatchBlocksV1Progress + isSet bool +} + +func (v NullableWatchBlocksV1Progress) Get() *WatchBlocksV1Progress { + return v.value +} + +func (v *NullableWatchBlocksV1Progress) Set(val *WatchBlocksV1Progress) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1Progress) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1Progress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1Progress(val *WatchBlocksV1Progress) *NullableWatchBlocksV1Progress { + return &NullableWatchBlocksV1Progress{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1Progress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1Progress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_transaction_filter.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_transaction_filter.go new file mode 100644 index 00000000000..fa9888216bb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_transaction_filter.go @@ -0,0 +1,126 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1TransactionFilter type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1TransactionFilter{} + +// WatchBlocksV1TransactionFilter struct for WatchBlocksV1TransactionFilter +type WatchBlocksV1TransactionFilter struct { + FamilyName *string `json:"family_name,omitempty"` +} + +// NewWatchBlocksV1TransactionFilter instantiates a new WatchBlocksV1TransactionFilter 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 +// will change when the set of required properties is changed +func NewWatchBlocksV1TransactionFilter() *WatchBlocksV1TransactionFilter { + this := WatchBlocksV1TransactionFilter{} + return &this +} + +// NewWatchBlocksV1TransactionFilterWithDefaults instantiates a new WatchBlocksV1TransactionFilter object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1TransactionFilterWithDefaults() *WatchBlocksV1TransactionFilter { + this := WatchBlocksV1TransactionFilter{} + return &this +} + +// GetFamilyName returns the FamilyName field value if set, zero value otherwise. +func (o *WatchBlocksV1TransactionFilter) GetFamilyName() string { + if o == nil || isNil(o.FamilyName) { + var ret string + return ret + } + return *o.FamilyName +} + +// GetFamilyNameOk returns a tuple with the FamilyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1TransactionFilter) GetFamilyNameOk() (*string, bool) { + if o == nil || isNil(o.FamilyName) { + return nil, false + } + return o.FamilyName, true +} + +// HasFamilyName returns a boolean if a field has been set. +func (o *WatchBlocksV1TransactionFilter) HasFamilyName() bool { + if o != nil && !isNil(o.FamilyName) { + return true + } + + return false +} + +// SetFamilyName gets a reference to the given string and assigns it to the FamilyName field. +func (o *WatchBlocksV1TransactionFilter) SetFamilyName(v string) { + o.FamilyName = &v +} + +func (o WatchBlocksV1TransactionFilter) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1TransactionFilter) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.FamilyName) { + toSerialize["family_name"] = o.FamilyName + } + return toSerialize, nil +} + +type NullableWatchBlocksV1TransactionFilter struct { + value *WatchBlocksV1TransactionFilter + isSet bool +} + +func (v NullableWatchBlocksV1TransactionFilter) Get() *WatchBlocksV1TransactionFilter { + return v.value +} + +func (v *NullableWatchBlocksV1TransactionFilter) Set(val *WatchBlocksV1TransactionFilter) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1TransactionFilter) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1TransactionFilter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1TransactionFilter(val *WatchBlocksV1TransactionFilter) *NullableWatchBlocksV1TransactionFilter { + return &NullableWatchBlocksV1TransactionFilter{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1TransactionFilter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1TransactionFilter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..630c4876595 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..4fa452aa302 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,37 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-ledger-connector-sawtooth_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService GetStatusV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetStatusV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..4e1cbef7c65 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// isNil checks if an input is nil +func isNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..68fd776de11 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/.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 Hyperledger Cacti Plugin - Connector Sawtooth + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..b8951845665 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,66 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/CactiTransactionV1.java +src/main/java/org/openapitools/client/model/CactiTransactionV1AllOf.java +src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java +src/main/java/org/openapitools/client/model/SawtoothBatchHeaderV1.java +src/main/java/org/openapitools/client/model/SawtoothBatchV1.java +src/main/java/org/openapitools/client/model/SawtoothBlockHeaderV1.java +src/main/java/org/openapitools/client/model/SawtoothBlockV1.java +src/main/java/org/openapitools/client/model/SawtoothTransactionHeaderV1.java +src/main/java/org/openapitools/client/model/SawtoothTransactionV1.java +src/main/java/org/openapitools/client/model/StatusResponseV1.java +src/main/java/org/openapitools/client/model/WatchBlocksV1.java +src/main/java/org/openapitools/client/model/WatchBlocksV1CactiTransactionsResponse.java +src/main/java/org/openapitools/client/model/WatchBlocksV1FullResponse.java +src/main/java/org/openapitools/client/model/WatchBlocksV1ListenerType.java +src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java +src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java +src/main/java/org/openapitools/client/model/WatchBlocksV1TransactionFilter.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/CactiTransactionV1AllOfTest.java +src/test/java/org/openapitools/client/model/CactiTransactionV1Test.java +src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java +src/test/java/org/openapitools/client/model/SawtoothBatchHeaderV1Test.java +src/test/java/org/openapitools/client/model/SawtoothBatchV1Test.java +src/test/java/org/openapitools/client/model/SawtoothBlockHeaderV1Test.java +src/test/java/org/openapitools/client/model/SawtoothBlockV1Test.java +src/test/java/org/openapitools/client/model/SawtoothTransactionHeaderV1Test.java +src/test/java/org/openapitools/client/model/SawtoothTransactionV1Test.java +src/test/java/org/openapitools/client/model/StatusResponseV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksV1CactiTransactionsResponseTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1FullResponseTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1ListenerTypeTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java +src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java +src/test/java/org/openapitools/client/model/WatchBlocksV1TransactionFilterTest.java diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..e7e42a4b585 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..18d031b0c34 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,151 @@ +# openapi-java-client + +Hyperledger Cacti Plugin - Connector Sawtooth +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a Sawtooth ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + StatusResponseV1 result = apiInstance.getStatusV1(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getStatusV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**getStatusV1**](docs/DefaultApi.md#getStatusV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-sawtooth/status | Get the status of the connector and the sawtooth validator + + +## Documentation for Models + + - [CactiTransactionV1](docs/CactiTransactionV1.md) + - [CactiTransactionV1AllOf](docs/CactiTransactionV1AllOf.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [SawtoothBatchHeaderV1](docs/SawtoothBatchHeaderV1.md) + - [SawtoothBatchV1](docs/SawtoothBatchV1.md) + - [SawtoothBlockHeaderV1](docs/SawtoothBlockHeaderV1.md) + - [SawtoothBlockV1](docs/SawtoothBlockV1.md) + - [SawtoothTransactionHeaderV1](docs/SawtoothTransactionHeaderV1.md) + - [SawtoothTransactionV1](docs/SawtoothTransactionV1.md) + - [StatusResponseV1](docs/StatusResponseV1.md) + - [WatchBlocksV1](docs/WatchBlocksV1.md) + - [WatchBlocksV1CactiTransactionsResponse](docs/WatchBlocksV1CactiTransactionsResponse.md) + - [WatchBlocksV1FullResponse](docs/WatchBlocksV1FullResponse.md) + - [WatchBlocksV1ListenerType](docs/WatchBlocksV1ListenerType.md) + - [WatchBlocksV1Options](docs/WatchBlocksV1Options.md) + - [WatchBlocksV1Progress](docs/WatchBlocksV1Progress.md) + - [WatchBlocksV1TransactionFilter](docs/WatchBlocksV1TransactionFilter.md) + + +## Documentation for Authorization + +All endpoints do not require authorization. +Authentication schemes defined for the API: + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..9d5750316a0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,281 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Sawtooth ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cacti Plugin - Connector Sawtooth + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-sawtooth/status: + get: + operationId: getStatusV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/StatusResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Get the status of the connector and the sawtooth validator + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-sawtooth/status + x-accepts: application/json +components: + schemas: + SawtoothTransactionHeaderV1: + properties: + batcher_public_key: + example: 02d260a46457a064733153e09840c322bee1dff34445d7d49e19e60abd18fd0758 + type: string + dependencies: + items: + example: 1baee350bdb60bcee60e3d325d43283cf830b4c23b2cb17d3bb43935bd7af3761c2bee79847c72a9e396a9ae58f48add4e43f94eb83f84442c6085c1dd5d4dbe + type: string + type: array + family_name: + example: intkey + type: string + family_version: + example: "1.0" + type: string + inputs: + items: + example: 1cf12650d858e0985ecc7f60418aaf0cc5ab587f42c2570a884095a9e8ccacd0f6545c + type: string + type: array + nonce: + example: QAApS4L + type: string + outputs: + items: + example: 1cf12650d858e0985ecc7f60418aaf0cc5ab587f42c2570a884095a9e8ccacd0f6545c + type: string + type: array + payload_sha512: + example: fb6135ef73f4fe77367f9384b3bbbb158f4b8603c9d612157108e5c271868fce2242ee4abd7a29397ba63780c3ccab13783dfd4d9f0167beda03cdb0e37b87f4 + type: string + signer_public_key: + example: 038bba5708acc262464c9fe30d3de9e905a9a5fa30cedd151dd9cd09ea26d46d00 + type: string + required: + - batcher_public_key + - dependencies + - family_name + - family_version + - inputs + - nonce + - outputs + - payload_sha512 + - signer_public_key + SawtoothTransactionV1: + properties: + header: + $ref: '#/components/schemas/SawtoothTransactionHeaderV1' + header_signature: + example: 540a6803971d1880ec73a96cb97815a95d374cbad5d865925e5aa0432fcf1931539afe10310c122c5eaae15df61236079abbf4f258889359c4d175516934484a + type: string + payload: + type: string + required: + - header + - header_signature + - payload + SawtoothBatchHeaderV1: + properties: + signer_public_key: + example: 038bba5708acc262464c9fe30d3de9e905a9a5fa30cedd151dd9cd09ea26d46d00 + type: string + transaction_ids: + items: + example: 540a6803971d1880ec73a96cb97815a95d374cbad5d865925e5aa0432fcf1931539afe10310c122c5eaae15df61236079abbf4f258889359c4d175516934484a + type: string + type: array + required: + - signer_public_key + - transaction_ids + SawtoothBatchV1: + properties: + header: + $ref: '#/components/schemas/SawtoothBatchHeaderV1' + header_signature: + example: 89807bfc9089e37e00d87d97357de14cfbc455cd608438d426a625a30a0da9a31c406983803c4aa27e1f32a3ff61709e8ec4b56abbc553d7d330635b5d27029c + type: string + transactions: + items: + $ref: '#/components/schemas/SawtoothTransactionV1' + type: array + required: + - header + - header_signature + - transactions + SawtoothBlockHeaderV1: + properties: + block_num: + example: 12345 + type: integer + previous_block_id: + example: 65cd3a3ce088b265b626f704b7f3db97b6f12e848dccb35d7806f3d0324c71b709ed360d602b8b658b94695374717e3bdb4b76f77886953777d5d008558247dd + type: string + signer_public_key: + example: 02d260a46457a064733153e09840c322bee1dff34445d7d49e19e60abd18fd0758 + type: string + batch_ids: + items: + example: 89807bfc9089e37e00d87d97357de14cfbc455cd608438d426a625a30a0da9a31c406983803c4aa27e1f32a3ff61709e8ec4b56abbc553d7d330635b5d27029c + type: string + type: array + consensus: + type: string + state_root_hash: + example: 708ca7fbb701799bb387f2e50deaca402e8502abe229f705693d2d4f350e1ad6 + type: string + required: + - batch_ids + - block_num + - consensus + - previous_block_id + - signer_public_key + - state_root_hash + SawtoothBlockV1: + properties: + header: + $ref: '#/components/schemas/SawtoothBlockHeaderV1' + header_signature: + example: 65cd3a3ce088b265b626f704b7f3db97b6f12e848dccb35d7806f3d0324c71b709ed360d602b8b658b94695374717e3bdb4b76f77886953777d5d008558247dd + type: string + batches: + items: + $ref: '#/components/schemas/SawtoothBatchV1' + type: array + required: + - batches + - header + - header_signature + CactiTransactionV1: + allOf: + - $ref: '#/components/schemas/SawtoothTransactionV1' + - $ref: '#/components/schemas/CactiTransactionV1_allOf' + description: Sawtooth transaction with additional fields filled by Cacti connector. + type: object + WatchBlocksV1: + enum: + - org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Subscribe + - org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Next + - org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Unsubscribe + - org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Error + - org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + WatchBlocksV1ListenerType: + description: "Response type from WatchBlocks. 'Cacti*' are custom views, others\ + \ correspond to plain sawtooth data." + enum: + - full + - cacti:transactions + type: string + x-enum-varnames: + - Full + - CactiTransactions + WatchBlocksV1TransactionFilter: + properties: + family_name: + type: string + type: object + WatchBlocksV1Options: + properties: + type: + $ref: '#/components/schemas/WatchBlocksV1ListenerType' + txFilterBy: + $ref: '#/components/schemas/WatchBlocksV1TransactionFilter' + type: object + WatchBlocksV1CactiTransactionsResponse: + description: Custom response containing block transactions summary. + properties: + cactiTransactionsEvents: + description: List of sawtooth transactions matching specifid (optional) + filter + items: + $ref: '#/components/schemas/CactiTransactionV1' + type: array + required: + - cactiTransactionsEvents + type: object + WatchBlocksV1FullResponse: + description: Response that returns entire sawtooth block. + properties: + fullBlock: + $ref: '#/components/schemas/SawtoothBlockV1' + required: + - fullBlock + type: object + WatchBlocksV1Progress: + description: Response block from WatchBlocks endpoint. Depends on 'type' passed + in subscription options. + oneOf: + - $ref: '#/components/schemas/WatchBlocksV1CactiTransactionsResponse' + - $ref: '#/components/schemas/WatchBlocksV1FullResponse' + StatusResponseV1: + description: Response with plugin and validator status report. + example: + openApiSpecVersion: openApiSpecVersion + sawtoothStatus: "" + instanceId: instanceId + initialized: true + properties: + instanceId: + description: Plugin instance id. + nullable: false + type: string + openApiSpecVersion: + description: Version of connectors Open API Spec. + nullable: false + type: string + initialized: + description: "True if endpoints were created, false otherwise" + nullable: false + type: boolean + sawtoothStatus: + description: Response from sawtooth Rest API status endpoint + nullable: false + required: + - instanceId + type: object + ErrorExceptionResponseV1: + properties: + message: + nullable: false + type: string + error: + nullable: false + type: string + required: + - error + - message + type: object + CactiTransactionV1_allOf: + properties: + payload_decoded: + description: Decoded payload of sawtooth transaction. + example: "[{'Verb':'inc','Name':'monitorTest3','Value':11}]}]" + required: + - payload_decoded + type: object + example: null + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..8135510869c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.4' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..4e5f1034c30 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.4", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..be00ac975c7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.4 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..1aa63a84e9c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..4f2a0ccfe80 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1546 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..435f2f625d4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..a4a4411b9f0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..06d1ea95c58 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,39 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..6d2b6ebefb2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..0273473f963 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,415 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.CactiTransactionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CactiTransactionV1AllOf.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ErrorExceptionResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SawtoothBatchHeaderV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SawtoothBatchV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SawtoothBlockHeaderV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SawtoothBlockV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SawtoothTransactionHeaderV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SawtoothTransactionV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.StatusResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1CactiTransactionsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1FullResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1Options.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1Progress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.WatchBlocksV1TransactionFilter.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); + } + } + } + + /** + * 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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..01fee18f58f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..9c8a017d4d9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..ee2bf8e597e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..8bcbdb0bf42 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..44b90770f31 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,195 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.ErrorExceptionResponseV1; +import org.openapitools.client.model.StatusResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 getStatusV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call getStatusV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-sawtooth/status"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain", + "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 getStatusV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getStatusV1Call(_callback); + + } + + /** + * Get the status of the connector and the sawtooth validator + * + * @return StatusResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public StatusResponseV1 getStatusV1() throws ApiException { + ApiResponse localVarResp = getStatusV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the status of the connector and the sawtooth validator + * + * @return ApiResponse<StatusResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public ApiResponse getStatusV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getStatusV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the status of the connector and the sawtooth validator (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call getStatusV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getStatusV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..629133f6e27 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..4dc28d36157 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..1f36e04545b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..92458f74ba3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..246fbce3ba1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactiTransactionV1.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactiTransactionV1.java new file mode 100644 index 00000000000..34a784c9792 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactiTransactionV1.java @@ -0,0 +1,309 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.SawtoothTransactionHeaderV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Sawtooth transaction with additional fields filled by Cacti connector. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CactiTransactionV1 { + public static final String SERIALIZED_NAME_HEADER = "header"; + @SerializedName(SERIALIZED_NAME_HEADER) + private SawtoothTransactionHeaderV1 header; + + public static final String SERIALIZED_NAME_HEADER_SIGNATURE = "header_signature"; + @SerializedName(SERIALIZED_NAME_HEADER_SIGNATURE) + private String headerSignature; + + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private String payload; + + public static final String SERIALIZED_NAME_PAYLOAD_DECODED = "payload_decoded"; + @SerializedName(SERIALIZED_NAME_PAYLOAD_DECODED) + private Object payloadDecoded = null; + + public CactiTransactionV1() { + } + + public CactiTransactionV1 header(SawtoothTransactionHeaderV1 header) { + + this.header = header; + return this; + } + + /** + * Get header + * @return header + **/ + @javax.annotation.Nonnull + + public SawtoothTransactionHeaderV1 getHeader() { + return header; + } + + + public void setHeader(SawtoothTransactionHeaderV1 header) { + this.header = header; + } + + + public CactiTransactionV1 headerSignature(String headerSignature) { + + this.headerSignature = headerSignature; + return this; + } + + /** + * Get headerSignature + * @return headerSignature + **/ + @javax.annotation.Nonnull + + public String getHeaderSignature() { + return headerSignature; + } + + + public void setHeaderSignature(String headerSignature) { + this.headerSignature = headerSignature; + } + + + public CactiTransactionV1 payload(String payload) { + + this.payload = payload; + return this; + } + + /** + * Get payload + * @return payload + **/ + @javax.annotation.Nonnull + + public String getPayload() { + return payload; + } + + + public void setPayload(String payload) { + this.payload = payload; + } + + + public CactiTransactionV1 payloadDecoded(Object payloadDecoded) { + + this.payloadDecoded = payloadDecoded; + return this; + } + + /** + * Decoded payload of sawtooth transaction. + * @return payloadDecoded + **/ + @javax.annotation.Nullable + + public Object getPayloadDecoded() { + return payloadDecoded; + } + + + public void setPayloadDecoded(Object payloadDecoded) { + this.payloadDecoded = payloadDecoded; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CactiTransactionV1 cactiTransactionV1 = (CactiTransactionV1) o; + return Objects.equals(this.header, cactiTransactionV1.header) && + Objects.equals(this.headerSignature, cactiTransactionV1.headerSignature) && + Objects.equals(this.payload, cactiTransactionV1.payload) && + Objects.equals(this.payloadDecoded, cactiTransactionV1.payloadDecoded); + } + + @Override + public int hashCode() { + return Objects.hash(header, headerSignature, payload, payloadDecoded); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CactiTransactionV1 {\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" headerSignature: ").append(toIndentedString(headerSignature)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append(" payloadDecoded: ").append(toIndentedString(payloadDecoded)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("header"); + openapiFields.add("header_signature"); + openapiFields.add("payload"); + openapiFields.add("payload_decoded"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("header"); + openapiRequiredFields.add("header_signature"); + openapiRequiredFields.add("payload"); + openapiRequiredFields.add("payload_decoded"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CactiTransactionV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CactiTransactionV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CactiTransactionV1 is not found in the empty JSON string", CactiTransactionV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CactiTransactionV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CactiTransactionV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CactiTransactionV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `header` + SawtoothTransactionHeaderV1.validateJsonObject(jsonObj.getAsJsonObject("header")); + if (!jsonObj.get("header_signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `header_signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("header_signature").toString())); + } + if (!jsonObj.get("payload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payload").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CactiTransactionV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CactiTransactionV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CactiTransactionV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CactiTransactionV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CactiTransactionV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CactiTransactionV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of CactiTransactionV1 + * @throws IOException if the JSON string is invalid with respect to CactiTransactionV1 + */ + public static CactiTransactionV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CactiTransactionV1.class); + } + + /** + * Convert an instance of CactiTransactionV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactiTransactionV1AllOf.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactiTransactionV1AllOf.java new file mode 100644 index 00000000000..571739eb10d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CactiTransactionV1AllOf.java @@ -0,0 +1,210 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CactiTransactionV1AllOf + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CactiTransactionV1AllOf { + public static final String SERIALIZED_NAME_PAYLOAD_DECODED = "payload_decoded"; + @SerializedName(SERIALIZED_NAME_PAYLOAD_DECODED) + private Object payloadDecoded = null; + + public CactiTransactionV1AllOf() { + } + + public CactiTransactionV1AllOf payloadDecoded(Object payloadDecoded) { + + this.payloadDecoded = payloadDecoded; + return this; + } + + /** + * Decoded payload of sawtooth transaction. + * @return payloadDecoded + **/ + @javax.annotation.Nullable + + public Object getPayloadDecoded() { + return payloadDecoded; + } + + + public void setPayloadDecoded(Object payloadDecoded) { + this.payloadDecoded = payloadDecoded; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CactiTransactionV1AllOf cactiTransactionV1AllOf = (CactiTransactionV1AllOf) o; + return Objects.equals(this.payloadDecoded, cactiTransactionV1AllOf.payloadDecoded); + } + + @Override + public int hashCode() { + return Objects.hash(payloadDecoded); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CactiTransactionV1AllOf {\n"); + sb.append(" payloadDecoded: ").append(toIndentedString(payloadDecoded)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("payload_decoded"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("payload_decoded"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CactiTransactionV1AllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CactiTransactionV1AllOf.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CactiTransactionV1AllOf is not found in the empty JSON string", CactiTransactionV1AllOf.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CactiTransactionV1AllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CactiTransactionV1AllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CactiTransactionV1AllOf.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CactiTransactionV1AllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CactiTransactionV1AllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CactiTransactionV1AllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CactiTransactionV1AllOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CactiTransactionV1AllOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CactiTransactionV1AllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of CactiTransactionV1AllOf + * @throws IOException if the JSON string is invalid with respect to CactiTransactionV1AllOf + */ + public static CactiTransactionV1AllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CactiTransactionV1AllOf.class); + } + + /** + * Convert an instance of CactiTransactionV1AllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java new file mode 100644 index 00000000000..ac21ad44a83 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java @@ -0,0 +1,246 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ErrorExceptionResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ErrorExceptionResponseV1 { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private String error; + + public ErrorExceptionResponseV1() { + } + + public ErrorExceptionResponseV1 message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ErrorExceptionResponseV1 error(String error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nonnull + + public String getError() { + return error; + } + + + public void setError(String error) { + this.error = error; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorExceptionResponseV1 errorExceptionResponseV1 = (ErrorExceptionResponseV1) o; + return Objects.equals(this.message, errorExceptionResponseV1.message) && + Objects.equals(this.error, errorExceptionResponseV1.error); + } + + @Override + public int hashCode() { + return Objects.hash(message, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorExceptionResponseV1 {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + openapiFields.add("error"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("error"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ErrorExceptionResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ErrorExceptionResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorExceptionResponseV1 is not found in the empty JSON string", ErrorExceptionResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ErrorExceptionResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorExceptionResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorExceptionResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if (!jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorExceptionResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorExceptionResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorExceptionResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorExceptionResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorExceptionResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorExceptionResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorExceptionResponseV1 + * @throws IOException if the JSON string is invalid with respect to ErrorExceptionResponseV1 + */ + public static ErrorExceptionResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorExceptionResponseV1.class); + } + + /** + * Convert an instance of ErrorExceptionResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothBatchHeaderV1.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothBatchHeaderV1.java new file mode 100644 index 00000000000..ddb1faf620d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothBatchHeaderV1.java @@ -0,0 +1,256 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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 java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SawtoothBatchHeaderV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SawtoothBatchHeaderV1 { + public static final String SERIALIZED_NAME_SIGNER_PUBLIC_KEY = "signer_public_key"; + @SerializedName(SERIALIZED_NAME_SIGNER_PUBLIC_KEY) + private String signerPublicKey; + + public static final String SERIALIZED_NAME_TRANSACTION_IDS = "transaction_ids"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_IDS) + private List transactionIds = new ArrayList<>(); + + public SawtoothBatchHeaderV1() { + } + + public SawtoothBatchHeaderV1 signerPublicKey(String signerPublicKey) { + + this.signerPublicKey = signerPublicKey; + return this; + } + + /** + * Get signerPublicKey + * @return signerPublicKey + **/ + @javax.annotation.Nonnull + + public String getSignerPublicKey() { + return signerPublicKey; + } + + + public void setSignerPublicKey(String signerPublicKey) { + this.signerPublicKey = signerPublicKey; + } + + + public SawtoothBatchHeaderV1 transactionIds(List transactionIds) { + + this.transactionIds = transactionIds; + return this; + } + + public SawtoothBatchHeaderV1 addTransactionIdsItem(String transactionIdsItem) { + this.transactionIds.add(transactionIdsItem); + return this; + } + + /** + * Get transactionIds + * @return transactionIds + **/ + @javax.annotation.Nonnull + + public List getTransactionIds() { + return transactionIds; + } + + + public void setTransactionIds(List transactionIds) { + this.transactionIds = transactionIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SawtoothBatchHeaderV1 sawtoothBatchHeaderV1 = (SawtoothBatchHeaderV1) o; + return Objects.equals(this.signerPublicKey, sawtoothBatchHeaderV1.signerPublicKey) && + Objects.equals(this.transactionIds, sawtoothBatchHeaderV1.transactionIds); + } + + @Override + public int hashCode() { + return Objects.hash(signerPublicKey, transactionIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SawtoothBatchHeaderV1 {\n"); + sb.append(" signerPublicKey: ").append(toIndentedString(signerPublicKey)).append("\n"); + sb.append(" transactionIds: ").append(toIndentedString(transactionIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("signer_public_key"); + openapiFields.add("transaction_ids"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("signer_public_key"); + openapiRequiredFields.add("transaction_ids"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SawtoothBatchHeaderV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SawtoothBatchHeaderV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SawtoothBatchHeaderV1 is not found in the empty JSON string", SawtoothBatchHeaderV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SawtoothBatchHeaderV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SawtoothBatchHeaderV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SawtoothBatchHeaderV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("signer_public_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signer_public_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signer_public_key").toString())); + } + // ensure the required json array is present + if (jsonObj.get("transaction_ids") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("transaction_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transaction_ids` to be an array in the JSON string but got `%s`", jsonObj.get("transaction_ids").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SawtoothBatchHeaderV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SawtoothBatchHeaderV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SawtoothBatchHeaderV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SawtoothBatchHeaderV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SawtoothBatchHeaderV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SawtoothBatchHeaderV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SawtoothBatchHeaderV1 + * @throws IOException if the JSON string is invalid with respect to SawtoothBatchHeaderV1 + */ + public static SawtoothBatchHeaderV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SawtoothBatchHeaderV1.class); + } + + /** + * Convert an instance of SawtoothBatchHeaderV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothBatchV1.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothBatchV1.java new file mode 100644 index 00000000000..b4cce86ac27 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothBatchV1.java @@ -0,0 +1,294 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.SawtoothBatchHeaderV1; +import org.openapitools.client.model.SawtoothTransactionV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SawtoothBatchV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SawtoothBatchV1 { + public static final String SERIALIZED_NAME_HEADER = "header"; + @SerializedName(SERIALIZED_NAME_HEADER) + private SawtoothBatchHeaderV1 header; + + public static final String SERIALIZED_NAME_HEADER_SIGNATURE = "header_signature"; + @SerializedName(SERIALIZED_NAME_HEADER_SIGNATURE) + private String headerSignature; + + public static final String SERIALIZED_NAME_TRANSACTIONS = "transactions"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS) + private List transactions = new ArrayList<>(); + + public SawtoothBatchV1() { + } + + public SawtoothBatchV1 header(SawtoothBatchHeaderV1 header) { + + this.header = header; + return this; + } + + /** + * Get header + * @return header + **/ + @javax.annotation.Nonnull + + public SawtoothBatchHeaderV1 getHeader() { + return header; + } + + + public void setHeader(SawtoothBatchHeaderV1 header) { + this.header = header; + } + + + public SawtoothBatchV1 headerSignature(String headerSignature) { + + this.headerSignature = headerSignature; + return this; + } + + /** + * Get headerSignature + * @return headerSignature + **/ + @javax.annotation.Nonnull + + public String getHeaderSignature() { + return headerSignature; + } + + + public void setHeaderSignature(String headerSignature) { + this.headerSignature = headerSignature; + } + + + public SawtoothBatchV1 transactions(List transactions) { + + this.transactions = transactions; + return this; + } + + public SawtoothBatchV1 addTransactionsItem(SawtoothTransactionV1 transactionsItem) { + this.transactions.add(transactionsItem); + return this; + } + + /** + * Get transactions + * @return transactions + **/ + @javax.annotation.Nonnull + + public List getTransactions() { + return transactions; + } + + + public void setTransactions(List transactions) { + this.transactions = transactions; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SawtoothBatchV1 sawtoothBatchV1 = (SawtoothBatchV1) o; + return Objects.equals(this.header, sawtoothBatchV1.header) && + Objects.equals(this.headerSignature, sawtoothBatchV1.headerSignature) && + Objects.equals(this.transactions, sawtoothBatchV1.transactions); + } + + @Override + public int hashCode() { + return Objects.hash(header, headerSignature, transactions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SawtoothBatchV1 {\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" headerSignature: ").append(toIndentedString(headerSignature)).append("\n"); + sb.append(" transactions: ").append(toIndentedString(transactions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("header"); + openapiFields.add("header_signature"); + openapiFields.add("transactions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("header"); + openapiRequiredFields.add("header_signature"); + openapiRequiredFields.add("transactions"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SawtoothBatchV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SawtoothBatchV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SawtoothBatchV1 is not found in the empty JSON string", SawtoothBatchV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SawtoothBatchV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SawtoothBatchV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SawtoothBatchV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `header` + SawtoothBatchHeaderV1.validateJsonObject(jsonObj.getAsJsonObject("header")); + if (!jsonObj.get("header_signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `header_signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("header_signature").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("transactions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transactions` to be an array in the JSON string but got `%s`", jsonObj.get("transactions").toString())); + } + + JsonArray jsonArraytransactions = jsonObj.getAsJsonArray("transactions"); + // validate the required field `transactions` (array) + for (int i = 0; i < jsonArraytransactions.size(); i++) { + SawtoothTransactionV1.validateJsonObject(jsonArraytransactions.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SawtoothBatchV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SawtoothBatchV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SawtoothBatchV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SawtoothBatchV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SawtoothBatchV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SawtoothBatchV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SawtoothBatchV1 + * @throws IOException if the JSON string is invalid with respect to SawtoothBatchV1 + */ + public static SawtoothBatchV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SawtoothBatchV1.class); + } + + /** + * Convert an instance of SawtoothBatchV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothBlockHeaderV1.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothBlockHeaderV1.java new file mode 100644 index 00000000000..40f0a9281d3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothBlockHeaderV1.java @@ -0,0 +1,385 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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 java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SawtoothBlockHeaderV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SawtoothBlockHeaderV1 { + public static final String SERIALIZED_NAME_BLOCK_NUM = "block_num"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUM) + private Integer blockNum; + + public static final String SERIALIZED_NAME_PREVIOUS_BLOCK_ID = "previous_block_id"; + @SerializedName(SERIALIZED_NAME_PREVIOUS_BLOCK_ID) + private String previousBlockId; + + public static final String SERIALIZED_NAME_SIGNER_PUBLIC_KEY = "signer_public_key"; + @SerializedName(SERIALIZED_NAME_SIGNER_PUBLIC_KEY) + private String signerPublicKey; + + public static final String SERIALIZED_NAME_BATCH_IDS = "batch_ids"; + @SerializedName(SERIALIZED_NAME_BATCH_IDS) + private List batchIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CONSENSUS = "consensus"; + @SerializedName(SERIALIZED_NAME_CONSENSUS) + private String consensus; + + public static final String SERIALIZED_NAME_STATE_ROOT_HASH = "state_root_hash"; + @SerializedName(SERIALIZED_NAME_STATE_ROOT_HASH) + private String stateRootHash; + + public SawtoothBlockHeaderV1() { + } + + public SawtoothBlockHeaderV1 blockNum(Integer blockNum) { + + this.blockNum = blockNum; + return this; + } + + /** + * Get blockNum + * @return blockNum + **/ + @javax.annotation.Nonnull + + public Integer getBlockNum() { + return blockNum; + } + + + public void setBlockNum(Integer blockNum) { + this.blockNum = blockNum; + } + + + public SawtoothBlockHeaderV1 previousBlockId(String previousBlockId) { + + this.previousBlockId = previousBlockId; + return this; + } + + /** + * Get previousBlockId + * @return previousBlockId + **/ + @javax.annotation.Nonnull + + public String getPreviousBlockId() { + return previousBlockId; + } + + + public void setPreviousBlockId(String previousBlockId) { + this.previousBlockId = previousBlockId; + } + + + public SawtoothBlockHeaderV1 signerPublicKey(String signerPublicKey) { + + this.signerPublicKey = signerPublicKey; + return this; + } + + /** + * Get signerPublicKey + * @return signerPublicKey + **/ + @javax.annotation.Nonnull + + public String getSignerPublicKey() { + return signerPublicKey; + } + + + public void setSignerPublicKey(String signerPublicKey) { + this.signerPublicKey = signerPublicKey; + } + + + public SawtoothBlockHeaderV1 batchIds(List batchIds) { + + this.batchIds = batchIds; + return this; + } + + public SawtoothBlockHeaderV1 addBatchIdsItem(String batchIdsItem) { + this.batchIds.add(batchIdsItem); + return this; + } + + /** + * Get batchIds + * @return batchIds + **/ + @javax.annotation.Nonnull + + public List getBatchIds() { + return batchIds; + } + + + public void setBatchIds(List batchIds) { + this.batchIds = batchIds; + } + + + public SawtoothBlockHeaderV1 consensus(String consensus) { + + this.consensus = consensus; + return this; + } + + /** + * Get consensus + * @return consensus + **/ + @javax.annotation.Nonnull + + public String getConsensus() { + return consensus; + } + + + public void setConsensus(String consensus) { + this.consensus = consensus; + } + + + public SawtoothBlockHeaderV1 stateRootHash(String stateRootHash) { + + this.stateRootHash = stateRootHash; + return this; + } + + /** + * Get stateRootHash + * @return stateRootHash + **/ + @javax.annotation.Nonnull + + public String getStateRootHash() { + return stateRootHash; + } + + + public void setStateRootHash(String stateRootHash) { + this.stateRootHash = stateRootHash; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SawtoothBlockHeaderV1 sawtoothBlockHeaderV1 = (SawtoothBlockHeaderV1) o; + return Objects.equals(this.blockNum, sawtoothBlockHeaderV1.blockNum) && + Objects.equals(this.previousBlockId, sawtoothBlockHeaderV1.previousBlockId) && + Objects.equals(this.signerPublicKey, sawtoothBlockHeaderV1.signerPublicKey) && + Objects.equals(this.batchIds, sawtoothBlockHeaderV1.batchIds) && + Objects.equals(this.consensus, sawtoothBlockHeaderV1.consensus) && + Objects.equals(this.stateRootHash, sawtoothBlockHeaderV1.stateRootHash); + } + + @Override + public int hashCode() { + return Objects.hash(blockNum, previousBlockId, signerPublicKey, batchIds, consensus, stateRootHash); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SawtoothBlockHeaderV1 {\n"); + sb.append(" blockNum: ").append(toIndentedString(blockNum)).append("\n"); + sb.append(" previousBlockId: ").append(toIndentedString(previousBlockId)).append("\n"); + sb.append(" signerPublicKey: ").append(toIndentedString(signerPublicKey)).append("\n"); + sb.append(" batchIds: ").append(toIndentedString(batchIds)).append("\n"); + sb.append(" consensus: ").append(toIndentedString(consensus)).append("\n"); + sb.append(" stateRootHash: ").append(toIndentedString(stateRootHash)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("block_num"); + openapiFields.add("previous_block_id"); + openapiFields.add("signer_public_key"); + openapiFields.add("batch_ids"); + openapiFields.add("consensus"); + openapiFields.add("state_root_hash"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("block_num"); + openapiRequiredFields.add("previous_block_id"); + openapiRequiredFields.add("signer_public_key"); + openapiRequiredFields.add("batch_ids"); + openapiRequiredFields.add("consensus"); + openapiRequiredFields.add("state_root_hash"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SawtoothBlockHeaderV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SawtoothBlockHeaderV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SawtoothBlockHeaderV1 is not found in the empty JSON string", SawtoothBlockHeaderV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SawtoothBlockHeaderV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SawtoothBlockHeaderV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SawtoothBlockHeaderV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("previous_block_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `previous_block_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("previous_block_id").toString())); + } + if (!jsonObj.get("signer_public_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signer_public_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signer_public_key").toString())); + } + // ensure the required json array is present + if (jsonObj.get("batch_ids") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("batch_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `batch_ids` to be an array in the JSON string but got `%s`", jsonObj.get("batch_ids").toString())); + } + if (!jsonObj.get("consensus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `consensus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("consensus").toString())); + } + if (!jsonObj.get("state_root_hash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state_root_hash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state_root_hash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SawtoothBlockHeaderV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SawtoothBlockHeaderV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SawtoothBlockHeaderV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SawtoothBlockHeaderV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SawtoothBlockHeaderV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SawtoothBlockHeaderV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SawtoothBlockHeaderV1 + * @throws IOException if the JSON string is invalid with respect to SawtoothBlockHeaderV1 + */ + public static SawtoothBlockHeaderV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SawtoothBlockHeaderV1.class); + } + + /** + * Convert an instance of SawtoothBlockHeaderV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothBlockV1.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothBlockV1.java new file mode 100644 index 00000000000..0dbf6fc6933 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothBlockV1.java @@ -0,0 +1,294 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.SawtoothBatchV1; +import org.openapitools.client.model.SawtoothBlockHeaderV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SawtoothBlockV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SawtoothBlockV1 { + public static final String SERIALIZED_NAME_HEADER = "header"; + @SerializedName(SERIALIZED_NAME_HEADER) + private SawtoothBlockHeaderV1 header; + + public static final String SERIALIZED_NAME_HEADER_SIGNATURE = "header_signature"; + @SerializedName(SERIALIZED_NAME_HEADER_SIGNATURE) + private String headerSignature; + + public static final String SERIALIZED_NAME_BATCHES = "batches"; + @SerializedName(SERIALIZED_NAME_BATCHES) + private List batches = new ArrayList<>(); + + public SawtoothBlockV1() { + } + + public SawtoothBlockV1 header(SawtoothBlockHeaderV1 header) { + + this.header = header; + return this; + } + + /** + * Get header + * @return header + **/ + @javax.annotation.Nonnull + + public SawtoothBlockHeaderV1 getHeader() { + return header; + } + + + public void setHeader(SawtoothBlockHeaderV1 header) { + this.header = header; + } + + + public SawtoothBlockV1 headerSignature(String headerSignature) { + + this.headerSignature = headerSignature; + return this; + } + + /** + * Get headerSignature + * @return headerSignature + **/ + @javax.annotation.Nonnull + + public String getHeaderSignature() { + return headerSignature; + } + + + public void setHeaderSignature(String headerSignature) { + this.headerSignature = headerSignature; + } + + + public SawtoothBlockV1 batches(List batches) { + + this.batches = batches; + return this; + } + + public SawtoothBlockV1 addBatchesItem(SawtoothBatchV1 batchesItem) { + this.batches.add(batchesItem); + return this; + } + + /** + * Get batches + * @return batches + **/ + @javax.annotation.Nonnull + + public List getBatches() { + return batches; + } + + + public void setBatches(List batches) { + this.batches = batches; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SawtoothBlockV1 sawtoothBlockV1 = (SawtoothBlockV1) o; + return Objects.equals(this.header, sawtoothBlockV1.header) && + Objects.equals(this.headerSignature, sawtoothBlockV1.headerSignature) && + Objects.equals(this.batches, sawtoothBlockV1.batches); + } + + @Override + public int hashCode() { + return Objects.hash(header, headerSignature, batches); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SawtoothBlockV1 {\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" headerSignature: ").append(toIndentedString(headerSignature)).append("\n"); + sb.append(" batches: ").append(toIndentedString(batches)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("header"); + openapiFields.add("header_signature"); + openapiFields.add("batches"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("header"); + openapiRequiredFields.add("header_signature"); + openapiRequiredFields.add("batches"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SawtoothBlockV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SawtoothBlockV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SawtoothBlockV1 is not found in the empty JSON string", SawtoothBlockV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SawtoothBlockV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SawtoothBlockV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SawtoothBlockV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `header` + SawtoothBlockHeaderV1.validateJsonObject(jsonObj.getAsJsonObject("header")); + if (!jsonObj.get("header_signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `header_signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("header_signature").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("batches").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `batches` to be an array in the JSON string but got `%s`", jsonObj.get("batches").toString())); + } + + JsonArray jsonArraybatches = jsonObj.getAsJsonArray("batches"); + // validate the required field `batches` (array) + for (int i = 0; i < jsonArraybatches.size(); i++) { + SawtoothBatchV1.validateJsonObject(jsonArraybatches.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SawtoothBlockV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SawtoothBlockV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SawtoothBlockV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SawtoothBlockV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SawtoothBlockV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SawtoothBlockV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SawtoothBlockV1 + * @throws IOException if the JSON string is invalid with respect to SawtoothBlockV1 + */ + public static SawtoothBlockV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SawtoothBlockV1.class); + } + + /** + * Convert an instance of SawtoothBlockV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothTransactionHeaderV1.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothTransactionHeaderV1.java new file mode 100644 index 00000000000..64351b0bc28 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothTransactionHeaderV1.java @@ -0,0 +1,503 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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 java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SawtoothTransactionHeaderV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SawtoothTransactionHeaderV1 { + public static final String SERIALIZED_NAME_BATCHER_PUBLIC_KEY = "batcher_public_key"; + @SerializedName(SERIALIZED_NAME_BATCHER_PUBLIC_KEY) + private String batcherPublicKey; + + public static final String SERIALIZED_NAME_DEPENDENCIES = "dependencies"; + @SerializedName(SERIALIZED_NAME_DEPENDENCIES) + private List dependencies = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FAMILY_NAME = "family_name"; + @SerializedName(SERIALIZED_NAME_FAMILY_NAME) + private String familyName; + + public static final String SERIALIZED_NAME_FAMILY_VERSION = "family_version"; + @SerializedName(SERIALIZED_NAME_FAMILY_VERSION) + private String familyVersion; + + public static final String SERIALIZED_NAME_INPUTS = "inputs"; + @SerializedName(SERIALIZED_NAME_INPUTS) + private List inputs = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private String nonce; + + public static final String SERIALIZED_NAME_OUTPUTS = "outputs"; + @SerializedName(SERIALIZED_NAME_OUTPUTS) + private List outputs = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PAYLOAD_SHA512 = "payload_sha512"; + @SerializedName(SERIALIZED_NAME_PAYLOAD_SHA512) + private String payloadSha512; + + public static final String SERIALIZED_NAME_SIGNER_PUBLIC_KEY = "signer_public_key"; + @SerializedName(SERIALIZED_NAME_SIGNER_PUBLIC_KEY) + private String signerPublicKey; + + public SawtoothTransactionHeaderV1() { + } + + public SawtoothTransactionHeaderV1 batcherPublicKey(String batcherPublicKey) { + + this.batcherPublicKey = batcherPublicKey; + return this; + } + + /** + * Get batcherPublicKey + * @return batcherPublicKey + **/ + @javax.annotation.Nonnull + + public String getBatcherPublicKey() { + return batcherPublicKey; + } + + + public void setBatcherPublicKey(String batcherPublicKey) { + this.batcherPublicKey = batcherPublicKey; + } + + + public SawtoothTransactionHeaderV1 dependencies(List dependencies) { + + this.dependencies = dependencies; + return this; + } + + public SawtoothTransactionHeaderV1 addDependenciesItem(String dependenciesItem) { + this.dependencies.add(dependenciesItem); + return this; + } + + /** + * Get dependencies + * @return dependencies + **/ + @javax.annotation.Nonnull + + public List getDependencies() { + return dependencies; + } + + + public void setDependencies(List dependencies) { + this.dependencies = dependencies; + } + + + public SawtoothTransactionHeaderV1 familyName(String familyName) { + + this.familyName = familyName; + return this; + } + + /** + * Get familyName + * @return familyName + **/ + @javax.annotation.Nonnull + + public String getFamilyName() { + return familyName; + } + + + public void setFamilyName(String familyName) { + this.familyName = familyName; + } + + + public SawtoothTransactionHeaderV1 familyVersion(String familyVersion) { + + this.familyVersion = familyVersion; + return this; + } + + /** + * Get familyVersion + * @return familyVersion + **/ + @javax.annotation.Nonnull + + public String getFamilyVersion() { + return familyVersion; + } + + + public void setFamilyVersion(String familyVersion) { + this.familyVersion = familyVersion; + } + + + public SawtoothTransactionHeaderV1 inputs(List inputs) { + + this.inputs = inputs; + return this; + } + + public SawtoothTransactionHeaderV1 addInputsItem(String inputsItem) { + this.inputs.add(inputsItem); + return this; + } + + /** + * Get inputs + * @return inputs + **/ + @javax.annotation.Nonnull + + public List getInputs() { + return inputs; + } + + + public void setInputs(List inputs) { + this.inputs = inputs; + } + + + public SawtoothTransactionHeaderV1 nonce(String nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nonnull + + public String getNonce() { + return nonce; + } + + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + + public SawtoothTransactionHeaderV1 outputs(List outputs) { + + this.outputs = outputs; + return this; + } + + public SawtoothTransactionHeaderV1 addOutputsItem(String outputsItem) { + this.outputs.add(outputsItem); + return this; + } + + /** + * Get outputs + * @return outputs + **/ + @javax.annotation.Nonnull + + public List getOutputs() { + return outputs; + } + + + public void setOutputs(List outputs) { + this.outputs = outputs; + } + + + public SawtoothTransactionHeaderV1 payloadSha512(String payloadSha512) { + + this.payloadSha512 = payloadSha512; + return this; + } + + /** + * Get payloadSha512 + * @return payloadSha512 + **/ + @javax.annotation.Nonnull + + public String getPayloadSha512() { + return payloadSha512; + } + + + public void setPayloadSha512(String payloadSha512) { + this.payloadSha512 = payloadSha512; + } + + + public SawtoothTransactionHeaderV1 signerPublicKey(String signerPublicKey) { + + this.signerPublicKey = signerPublicKey; + return this; + } + + /** + * Get signerPublicKey + * @return signerPublicKey + **/ + @javax.annotation.Nonnull + + public String getSignerPublicKey() { + return signerPublicKey; + } + + + public void setSignerPublicKey(String signerPublicKey) { + this.signerPublicKey = signerPublicKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SawtoothTransactionHeaderV1 sawtoothTransactionHeaderV1 = (SawtoothTransactionHeaderV1) o; + return Objects.equals(this.batcherPublicKey, sawtoothTransactionHeaderV1.batcherPublicKey) && + Objects.equals(this.dependencies, sawtoothTransactionHeaderV1.dependencies) && + Objects.equals(this.familyName, sawtoothTransactionHeaderV1.familyName) && + Objects.equals(this.familyVersion, sawtoothTransactionHeaderV1.familyVersion) && + Objects.equals(this.inputs, sawtoothTransactionHeaderV1.inputs) && + Objects.equals(this.nonce, sawtoothTransactionHeaderV1.nonce) && + Objects.equals(this.outputs, sawtoothTransactionHeaderV1.outputs) && + Objects.equals(this.payloadSha512, sawtoothTransactionHeaderV1.payloadSha512) && + Objects.equals(this.signerPublicKey, sawtoothTransactionHeaderV1.signerPublicKey); + } + + @Override + public int hashCode() { + return Objects.hash(batcherPublicKey, dependencies, familyName, familyVersion, inputs, nonce, outputs, payloadSha512, signerPublicKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SawtoothTransactionHeaderV1 {\n"); + sb.append(" batcherPublicKey: ").append(toIndentedString(batcherPublicKey)).append("\n"); + sb.append(" dependencies: ").append(toIndentedString(dependencies)).append("\n"); + sb.append(" familyName: ").append(toIndentedString(familyName)).append("\n"); + sb.append(" familyVersion: ").append(toIndentedString(familyVersion)).append("\n"); + sb.append(" inputs: ").append(toIndentedString(inputs)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" outputs: ").append(toIndentedString(outputs)).append("\n"); + sb.append(" payloadSha512: ").append(toIndentedString(payloadSha512)).append("\n"); + sb.append(" signerPublicKey: ").append(toIndentedString(signerPublicKey)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("batcher_public_key"); + openapiFields.add("dependencies"); + openapiFields.add("family_name"); + openapiFields.add("family_version"); + openapiFields.add("inputs"); + openapiFields.add("nonce"); + openapiFields.add("outputs"); + openapiFields.add("payload_sha512"); + openapiFields.add("signer_public_key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("batcher_public_key"); + openapiRequiredFields.add("dependencies"); + openapiRequiredFields.add("family_name"); + openapiRequiredFields.add("family_version"); + openapiRequiredFields.add("inputs"); + openapiRequiredFields.add("nonce"); + openapiRequiredFields.add("outputs"); + openapiRequiredFields.add("payload_sha512"); + openapiRequiredFields.add("signer_public_key"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SawtoothTransactionHeaderV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SawtoothTransactionHeaderV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SawtoothTransactionHeaderV1 is not found in the empty JSON string", SawtoothTransactionHeaderV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SawtoothTransactionHeaderV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SawtoothTransactionHeaderV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SawtoothTransactionHeaderV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("batcher_public_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `batcher_public_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("batcher_public_key").toString())); + } + // ensure the required json array is present + if (jsonObj.get("dependencies") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("dependencies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `dependencies` to be an array in the JSON string but got `%s`", jsonObj.get("dependencies").toString())); + } + if (!jsonObj.get("family_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `family_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("family_name").toString())); + } + if (!jsonObj.get("family_version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `family_version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("family_version").toString())); + } + // ensure the required json array is present + if (jsonObj.get("inputs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("inputs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `inputs` to be an array in the JSON string but got `%s`", jsonObj.get("inputs").toString())); + } + if (!jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + // ensure the required json array is present + if (jsonObj.get("outputs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("outputs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `outputs` to be an array in the JSON string but got `%s`", jsonObj.get("outputs").toString())); + } + if (!jsonObj.get("payload_sha512").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payload_sha512` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payload_sha512").toString())); + } + if (!jsonObj.get("signer_public_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signer_public_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signer_public_key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SawtoothTransactionHeaderV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SawtoothTransactionHeaderV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SawtoothTransactionHeaderV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SawtoothTransactionHeaderV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SawtoothTransactionHeaderV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SawtoothTransactionHeaderV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SawtoothTransactionHeaderV1 + * @throws IOException if the JSON string is invalid with respect to SawtoothTransactionHeaderV1 + */ + public static SawtoothTransactionHeaderV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SawtoothTransactionHeaderV1.class); + } + + /** + * Convert an instance of SawtoothTransactionHeaderV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothTransactionV1.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothTransactionV1.java new file mode 100644 index 00000000000..a8e2853f96c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SawtoothTransactionV1.java @@ -0,0 +1,279 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.SawtoothTransactionHeaderV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SawtoothTransactionV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SawtoothTransactionV1 { + public static final String SERIALIZED_NAME_HEADER = "header"; + @SerializedName(SERIALIZED_NAME_HEADER) + private SawtoothTransactionHeaderV1 header; + + public static final String SERIALIZED_NAME_HEADER_SIGNATURE = "header_signature"; + @SerializedName(SERIALIZED_NAME_HEADER_SIGNATURE) + private String headerSignature; + + public static final String SERIALIZED_NAME_PAYLOAD = "payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private String payload; + + public SawtoothTransactionV1() { + } + + public SawtoothTransactionV1 header(SawtoothTransactionHeaderV1 header) { + + this.header = header; + return this; + } + + /** + * Get header + * @return header + **/ + @javax.annotation.Nonnull + + public SawtoothTransactionHeaderV1 getHeader() { + return header; + } + + + public void setHeader(SawtoothTransactionHeaderV1 header) { + this.header = header; + } + + + public SawtoothTransactionV1 headerSignature(String headerSignature) { + + this.headerSignature = headerSignature; + return this; + } + + /** + * Get headerSignature + * @return headerSignature + **/ + @javax.annotation.Nonnull + + public String getHeaderSignature() { + return headerSignature; + } + + + public void setHeaderSignature(String headerSignature) { + this.headerSignature = headerSignature; + } + + + public SawtoothTransactionV1 payload(String payload) { + + this.payload = payload; + return this; + } + + /** + * Get payload + * @return payload + **/ + @javax.annotation.Nonnull + + public String getPayload() { + return payload; + } + + + public void setPayload(String payload) { + this.payload = payload; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SawtoothTransactionV1 sawtoothTransactionV1 = (SawtoothTransactionV1) o; + return Objects.equals(this.header, sawtoothTransactionV1.header) && + Objects.equals(this.headerSignature, sawtoothTransactionV1.headerSignature) && + Objects.equals(this.payload, sawtoothTransactionV1.payload); + } + + @Override + public int hashCode() { + return Objects.hash(header, headerSignature, payload); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SawtoothTransactionV1 {\n"); + sb.append(" header: ").append(toIndentedString(header)).append("\n"); + sb.append(" headerSignature: ").append(toIndentedString(headerSignature)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("header"); + openapiFields.add("header_signature"); + openapiFields.add("payload"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("header"); + openapiRequiredFields.add("header_signature"); + openapiRequiredFields.add("payload"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SawtoothTransactionV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SawtoothTransactionV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SawtoothTransactionV1 is not found in the empty JSON string", SawtoothTransactionV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SawtoothTransactionV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SawtoothTransactionV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SawtoothTransactionV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `header` + SawtoothTransactionHeaderV1.validateJsonObject(jsonObj.getAsJsonObject("header")); + if (!jsonObj.get("header_signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `header_signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("header_signature").toString())); + } + if (!jsonObj.get("payload").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payload").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SawtoothTransactionV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SawtoothTransactionV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SawtoothTransactionV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SawtoothTransactionV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SawtoothTransactionV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SawtoothTransactionV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SawtoothTransactionV1 + * @throws IOException if the JSON string is invalid with respect to SawtoothTransactionV1 + */ + public static SawtoothTransactionV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SawtoothTransactionV1.class); + } + + /** + * Convert an instance of SawtoothTransactionV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StatusResponseV1.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StatusResponseV1.java new file mode 100644 index 00000000000..7f954770a10 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StatusResponseV1.java @@ -0,0 +1,315 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Response with plugin and validator status report. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StatusResponseV1 { + public static final String SERIALIZED_NAME_INSTANCE_ID = "instanceId"; + @SerializedName(SERIALIZED_NAME_INSTANCE_ID) + private String instanceId; + + public static final String SERIALIZED_NAME_OPEN_API_SPEC_VERSION = "openApiSpecVersion"; + @SerializedName(SERIALIZED_NAME_OPEN_API_SPEC_VERSION) + private String openApiSpecVersion; + + public static final String SERIALIZED_NAME_INITIALIZED = "initialized"; + @SerializedName(SERIALIZED_NAME_INITIALIZED) + private Boolean initialized; + + public static final String SERIALIZED_NAME_SAWTOOTH_STATUS = "sawtoothStatus"; + @SerializedName(SERIALIZED_NAME_SAWTOOTH_STATUS) + private Object sawtoothStatus = null; + + public StatusResponseV1() { + } + + public StatusResponseV1 instanceId(String instanceId) { + + this.instanceId = instanceId; + return this; + } + + /** + * Plugin instance id. + * @return instanceId + **/ + @javax.annotation.Nonnull + + public String getInstanceId() { + return instanceId; + } + + + public void setInstanceId(String instanceId) { + this.instanceId = instanceId; + } + + + public StatusResponseV1 openApiSpecVersion(String openApiSpecVersion) { + + this.openApiSpecVersion = openApiSpecVersion; + return this; + } + + /** + * Version of connectors Open API Spec. + * @return openApiSpecVersion + **/ + @javax.annotation.Nullable + + public String getOpenApiSpecVersion() { + return openApiSpecVersion; + } + + + public void setOpenApiSpecVersion(String openApiSpecVersion) { + this.openApiSpecVersion = openApiSpecVersion; + } + + + public StatusResponseV1 initialized(Boolean initialized) { + + this.initialized = initialized; + return this; + } + + /** + * True if endpoints were created, false otherwise + * @return initialized + **/ + @javax.annotation.Nullable + + public Boolean getInitialized() { + return initialized; + } + + + public void setInitialized(Boolean initialized) { + this.initialized = initialized; + } + + + public StatusResponseV1 sawtoothStatus(Object sawtoothStatus) { + + this.sawtoothStatus = sawtoothStatus; + return this; + } + + /** + * Response from sawtooth Rest API status endpoint + * @return sawtoothStatus + **/ + @javax.annotation.Nullable + + public Object getSawtoothStatus() { + return sawtoothStatus; + } + + + public void setSawtoothStatus(Object sawtoothStatus) { + this.sawtoothStatus = sawtoothStatus; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StatusResponseV1 statusResponseV1 = (StatusResponseV1) o; + return Objects.equals(this.instanceId, statusResponseV1.instanceId) && + Objects.equals(this.openApiSpecVersion, statusResponseV1.openApiSpecVersion) && + Objects.equals(this.initialized, statusResponseV1.initialized) && + Objects.equals(this.sawtoothStatus, statusResponseV1.sawtoothStatus); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(instanceId, openApiSpecVersion, initialized, sawtoothStatus); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StatusResponseV1 {\n"); + sb.append(" instanceId: ").append(toIndentedString(instanceId)).append("\n"); + sb.append(" openApiSpecVersion: ").append(toIndentedString(openApiSpecVersion)).append("\n"); + sb.append(" initialized: ").append(toIndentedString(initialized)).append("\n"); + sb.append(" sawtoothStatus: ").append(toIndentedString(sawtoothStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("instanceId"); + openapiFields.add("openApiSpecVersion"); + openapiFields.add("initialized"); + openapiFields.add("sawtoothStatus"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("instanceId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StatusResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!StatusResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StatusResponseV1 is not found in the empty JSON string", StatusResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StatusResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StatusResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StatusResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("instanceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `instanceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("instanceId").toString())); + } + if ((jsonObj.get("openApiSpecVersion") != null && !jsonObj.get("openApiSpecVersion").isJsonNull()) && !jsonObj.get("openApiSpecVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `openApiSpecVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openApiSpecVersion").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StatusResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StatusResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StatusResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StatusResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StatusResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StatusResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of StatusResponseV1 + * @throws IOException if the JSON string is invalid with respect to StatusResponseV1 + */ + public static StatusResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StatusResponseV1.class); + } + + /** + * Convert an instance of StatusResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java new file mode 100644 index 00000000000..9b604cff1b3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets WatchBlocksV1 + */ +@JsonAdapter(WatchBlocksV1.Adapter.class) +public enum WatchBlocksV1 { + + Subscribe("org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Subscribe"), + + Next("org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Next"), + + Unsubscribe("org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Unsubscribe"), + + Error("org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Error"), + + Complete("org.hyperledger.cacti.api.async.sawtooth.WatchBlocksV1.Complete"); + + private String value; + + WatchBlocksV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchBlocksV1 fromValue(String value) { + for (WatchBlocksV1 b : WatchBlocksV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchBlocksV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchBlocksV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchBlocksV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1CactiTransactionsResponse.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1CactiTransactionsResponse.java new file mode 100644 index 00000000000..9134e76c576 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1CactiTransactionsResponse.java @@ -0,0 +1,228 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.CactiTransactionV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Custom response containing block transactions summary. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1CactiTransactionsResponse { + public static final String SERIALIZED_NAME_CACTI_TRANSACTIONS_EVENTS = "cactiTransactionsEvents"; + @SerializedName(SERIALIZED_NAME_CACTI_TRANSACTIONS_EVENTS) + private List cactiTransactionsEvents = new ArrayList<>(); + + public WatchBlocksV1CactiTransactionsResponse() { + } + + public WatchBlocksV1CactiTransactionsResponse cactiTransactionsEvents(List cactiTransactionsEvents) { + + this.cactiTransactionsEvents = cactiTransactionsEvents; + return this; + } + + public WatchBlocksV1CactiTransactionsResponse addCactiTransactionsEventsItem(CactiTransactionV1 cactiTransactionsEventsItem) { + this.cactiTransactionsEvents.add(cactiTransactionsEventsItem); + return this; + } + + /** + * List of sawtooth transactions matching specifid (optional) filter + * @return cactiTransactionsEvents + **/ + @javax.annotation.Nonnull + + public List getCactiTransactionsEvents() { + return cactiTransactionsEvents; + } + + + public void setCactiTransactionsEvents(List cactiTransactionsEvents) { + this.cactiTransactionsEvents = cactiTransactionsEvents; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1CactiTransactionsResponse watchBlocksV1CactiTransactionsResponse = (WatchBlocksV1CactiTransactionsResponse) o; + return Objects.equals(this.cactiTransactionsEvents, watchBlocksV1CactiTransactionsResponse.cactiTransactionsEvents); + } + + @Override + public int hashCode() { + return Objects.hash(cactiTransactionsEvents); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1CactiTransactionsResponse {\n"); + sb.append(" cactiTransactionsEvents: ").append(toIndentedString(cactiTransactionsEvents)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cactiTransactionsEvents"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("cactiTransactionsEvents"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1CactiTransactionsResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1CactiTransactionsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1CactiTransactionsResponse is not found in the empty JSON string", WatchBlocksV1CactiTransactionsResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1CactiTransactionsResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1CactiTransactionsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksV1CactiTransactionsResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("cactiTransactionsEvents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `cactiTransactionsEvents` to be an array in the JSON string but got `%s`", jsonObj.get("cactiTransactionsEvents").toString())); + } + + JsonArray jsonArraycactiTransactionsEvents = jsonObj.getAsJsonArray("cactiTransactionsEvents"); + // validate the required field `cactiTransactionsEvents` (array) + for (int i = 0; i < jsonArraycactiTransactionsEvents.size(); i++) { + CactiTransactionV1.validateJsonObject(jsonArraycactiTransactionsEvents.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1CactiTransactionsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1CactiTransactionsResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1CactiTransactionsResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1CactiTransactionsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1CactiTransactionsResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1CactiTransactionsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1CactiTransactionsResponse + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1CactiTransactionsResponse + */ + public static WatchBlocksV1CactiTransactionsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1CactiTransactionsResponse.class); + } + + /** + * Convert an instance of WatchBlocksV1CactiTransactionsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1FullResponse.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1FullResponse.java new file mode 100644 index 00000000000..67ecc7c4fb4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1FullResponse.java @@ -0,0 +1,213 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.SawtoothBlockV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Response that returns entire sawtooth block. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1FullResponse { + public static final String SERIALIZED_NAME_FULL_BLOCK = "fullBlock"; + @SerializedName(SERIALIZED_NAME_FULL_BLOCK) + private SawtoothBlockV1 fullBlock; + + public WatchBlocksV1FullResponse() { + } + + public WatchBlocksV1FullResponse fullBlock(SawtoothBlockV1 fullBlock) { + + this.fullBlock = fullBlock; + return this; + } + + /** + * Get fullBlock + * @return fullBlock + **/ + @javax.annotation.Nonnull + + public SawtoothBlockV1 getFullBlock() { + return fullBlock; + } + + + public void setFullBlock(SawtoothBlockV1 fullBlock) { + this.fullBlock = fullBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1FullResponse watchBlocksV1FullResponse = (WatchBlocksV1FullResponse) o; + return Objects.equals(this.fullBlock, watchBlocksV1FullResponse.fullBlock); + } + + @Override + public int hashCode() { + return Objects.hash(fullBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1FullResponse {\n"); + sb.append(" fullBlock: ").append(toIndentedString(fullBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("fullBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("fullBlock"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1FullResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1FullResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1FullResponse is not found in the empty JSON string", WatchBlocksV1FullResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1FullResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1FullResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WatchBlocksV1FullResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `fullBlock` + SawtoothBlockV1.validateJsonObject(jsonObj.getAsJsonObject("fullBlock")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1FullResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1FullResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1FullResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1FullResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1FullResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1FullResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1FullResponse + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1FullResponse + */ + public static WatchBlocksV1FullResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1FullResponse.class); + } + + /** + * Convert an instance of WatchBlocksV1FullResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1ListenerType.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1ListenerType.java new file mode 100644 index 00000000000..fbfb36c2010 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1ListenerType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Response type from WatchBlocks. 'Cacti*' are custom views, others correspond to plain sawtooth data. + */ +@JsonAdapter(WatchBlocksV1ListenerType.Adapter.class) +public enum WatchBlocksV1ListenerType { + + Full("full"), + + CactiTransactions("cacti:transactions"); + + private String value; + + WatchBlocksV1ListenerType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WatchBlocksV1ListenerType fromValue(String value) { + for (WatchBlocksV1ListenerType b : WatchBlocksV1ListenerType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WatchBlocksV1ListenerType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WatchBlocksV1ListenerType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WatchBlocksV1ListenerType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java new file mode 100644 index 00000000000..e671c4914f2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Options.java @@ -0,0 +1,237 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.WatchBlocksV1ListenerType; +import org.openapitools.client.model.WatchBlocksV1TransactionFilter; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WatchBlocksV1Options + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1Options { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private WatchBlocksV1ListenerType type; + + public static final String SERIALIZED_NAME_TX_FILTER_BY = "txFilterBy"; + @SerializedName(SERIALIZED_NAME_TX_FILTER_BY) + private WatchBlocksV1TransactionFilter txFilterBy; + + public WatchBlocksV1Options() { + } + + public WatchBlocksV1Options type(WatchBlocksV1ListenerType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + + public WatchBlocksV1ListenerType getType() { + return type; + } + + + public void setType(WatchBlocksV1ListenerType type) { + this.type = type; + } + + + public WatchBlocksV1Options txFilterBy(WatchBlocksV1TransactionFilter txFilterBy) { + + this.txFilterBy = txFilterBy; + return this; + } + + /** + * Get txFilterBy + * @return txFilterBy + **/ + @javax.annotation.Nullable + + public WatchBlocksV1TransactionFilter getTxFilterBy() { + return txFilterBy; + } + + + public void setTxFilterBy(WatchBlocksV1TransactionFilter txFilterBy) { + this.txFilterBy = txFilterBy; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1Options watchBlocksV1Options = (WatchBlocksV1Options) o; + return Objects.equals(this.type, watchBlocksV1Options.type) && + Objects.equals(this.txFilterBy, watchBlocksV1Options.txFilterBy); + } + + @Override + public int hashCode() { + return Objects.hash(type, txFilterBy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1Options {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" txFilterBy: ").append(toIndentedString(txFilterBy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("txFilterBy"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1Options + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1Options.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1Options is not found in the empty JSON string", WatchBlocksV1Options.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1Options.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1Options` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `txFilterBy` + if (jsonObj.get("txFilterBy") != null && !jsonObj.get("txFilterBy").isJsonNull()) { + WatchBlocksV1TransactionFilter.validateJsonObject(jsonObj.getAsJsonObject("txFilterBy")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1Options.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1Options' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1Options.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1Options value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1Options read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1Options given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1Options + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1Options + */ + public static WatchBlocksV1Options fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1Options.class); + } + + /** + * Convert an instance of WatchBlocksV1Options to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java new file mode 100644 index 00000000000..455bc6678b4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1Progress.java @@ -0,0 +1,288 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.CactiTransactionV1; +import org.openapitools.client.model.SawtoothBlockV1; +import org.openapitools.client.model.WatchBlocksV1CactiTransactionsResponse; +import org.openapitools.client.model.WatchBlocksV1FullResponse; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1Progress extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(WatchBlocksV1Progress.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1Progress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1Progress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWatchBlocksV1CactiTransactionsResponse = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1CactiTransactionsResponse.class)); + final TypeAdapter adapterWatchBlocksV1FullResponse = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1FullResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1Progress value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `WatchBlocksV1CactiTransactionsResponse` + if (value.getActualInstance() instanceof WatchBlocksV1CactiTransactionsResponse) { + JsonObject obj = adapterWatchBlocksV1CactiTransactionsResponse.toJsonTree((WatchBlocksV1CactiTransactionsResponse)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `WatchBlocksV1FullResponse` + if (value.getActualInstance() instanceof WatchBlocksV1FullResponse) { + JsonObject obj = adapterWatchBlocksV1FullResponse.toJsonTree((WatchBlocksV1FullResponse)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: WatchBlocksV1CactiTransactionsResponse, WatchBlocksV1FullResponse"); + } + + @Override + public WatchBlocksV1Progress read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize WatchBlocksV1CactiTransactionsResponse + try { + // validate the JSON object to see if any exception is thrown + WatchBlocksV1CactiTransactionsResponse.validateJsonObject(jsonObject); + actualAdapter = adapterWatchBlocksV1CactiTransactionsResponse; + match++; + log.log(Level.FINER, "Input data matches schema 'WatchBlocksV1CactiTransactionsResponse'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for WatchBlocksV1CactiTransactionsResponse failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'WatchBlocksV1CactiTransactionsResponse'", e); + } + + // deserialize WatchBlocksV1FullResponse + try { + // validate the JSON object to see if any exception is thrown + WatchBlocksV1FullResponse.validateJsonObject(jsonObject); + actualAdapter = adapterWatchBlocksV1FullResponse; + match++; + log.log(Level.FINER, "Input data matches schema 'WatchBlocksV1FullResponse'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for WatchBlocksV1FullResponse failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'WatchBlocksV1FullResponse'", e); + } + + if (match == 1) { + WatchBlocksV1Progress ret = new WatchBlocksV1Progress(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for WatchBlocksV1Progress: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public WatchBlocksV1Progress() { + super("oneOf", Boolean.FALSE); + } + + public WatchBlocksV1Progress(WatchBlocksV1CactiTransactionsResponse o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public WatchBlocksV1Progress(WatchBlocksV1FullResponse o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("WatchBlocksV1CactiTransactionsResponse", new GenericType() { + }); + schemas.put("WatchBlocksV1FullResponse", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return WatchBlocksV1Progress.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * WatchBlocksV1CactiTransactionsResponse, WatchBlocksV1FullResponse + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof WatchBlocksV1CactiTransactionsResponse) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof WatchBlocksV1FullResponse) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be WatchBlocksV1CactiTransactionsResponse, WatchBlocksV1FullResponse"); + } + + /** + * Get the actual instance, which can be the following: + * WatchBlocksV1CactiTransactionsResponse, WatchBlocksV1FullResponse + * + * @return The actual instance (WatchBlocksV1CactiTransactionsResponse, WatchBlocksV1FullResponse) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `WatchBlocksV1CactiTransactionsResponse`. If the actual instance is not `WatchBlocksV1CactiTransactionsResponse`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `WatchBlocksV1CactiTransactionsResponse` + * @throws ClassCastException if the instance is not `WatchBlocksV1CactiTransactionsResponse` + */ + public WatchBlocksV1CactiTransactionsResponse getWatchBlocksV1CactiTransactionsResponse() throws ClassCastException { + return (WatchBlocksV1CactiTransactionsResponse)super.getActualInstance(); + } + + /** + * Get the actual instance of `WatchBlocksV1FullResponse`. If the actual instance is not `WatchBlocksV1FullResponse`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `WatchBlocksV1FullResponse` + * @throws ClassCastException if the instance is not `WatchBlocksV1FullResponse` + */ + public WatchBlocksV1FullResponse getWatchBlocksV1FullResponse() throws ClassCastException { + return (WatchBlocksV1FullResponse)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1Progress + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with WatchBlocksV1CactiTransactionsResponse + try { + WatchBlocksV1CactiTransactionsResponse.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for WatchBlocksV1CactiTransactionsResponse failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with WatchBlocksV1FullResponse + try { + WatchBlocksV1FullResponse.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for WatchBlocksV1FullResponse failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for WatchBlocksV1Progress with oneOf schemas: WatchBlocksV1CactiTransactionsResponse, WatchBlocksV1FullResponse. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of WatchBlocksV1Progress given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1Progress + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1Progress + */ + public static WatchBlocksV1Progress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1Progress.class); + } + + /** + * Convert an instance of WatchBlocksV1Progress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1TransactionFilter.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1TransactionFilter.java new file mode 100644 index 00000000000..3d84ca1812c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/WatchBlocksV1TransactionFilter.java @@ -0,0 +1,205 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * WatchBlocksV1TransactionFilter + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class WatchBlocksV1TransactionFilter { + public static final String SERIALIZED_NAME_FAMILY_NAME = "family_name"; + @SerializedName(SERIALIZED_NAME_FAMILY_NAME) + private String familyName; + + public WatchBlocksV1TransactionFilter() { + } + + public WatchBlocksV1TransactionFilter familyName(String familyName) { + + this.familyName = familyName; + return this; + } + + /** + * Get familyName + * @return familyName + **/ + @javax.annotation.Nullable + + public String getFamilyName() { + return familyName; + } + + + public void setFamilyName(String familyName) { + this.familyName = familyName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchBlocksV1TransactionFilter watchBlocksV1TransactionFilter = (WatchBlocksV1TransactionFilter) o; + return Objects.equals(this.familyName, watchBlocksV1TransactionFilter.familyName); + } + + @Override + public int hashCode() { + return Objects.hash(familyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchBlocksV1TransactionFilter {\n"); + sb.append(" familyName: ").append(toIndentedString(familyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("family_name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to WatchBlocksV1TransactionFilter + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!WatchBlocksV1TransactionFilter.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WatchBlocksV1TransactionFilter is not found in the empty JSON string", WatchBlocksV1TransactionFilter.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!WatchBlocksV1TransactionFilter.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WatchBlocksV1TransactionFilter` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("family_name") != null && !jsonObj.get("family_name").isJsonNull()) && !jsonObj.get("family_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `family_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("family_name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!WatchBlocksV1TransactionFilter.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WatchBlocksV1TransactionFilter' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WatchBlocksV1TransactionFilter.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, WatchBlocksV1TransactionFilter value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public WatchBlocksV1TransactionFilter read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WatchBlocksV1TransactionFilter given an JSON string + * + * @param jsonString JSON string + * @return An instance of WatchBlocksV1TransactionFilter + * @throws IOException if the JSON string is invalid with respect to WatchBlocksV1TransactionFilter + */ + public static WatchBlocksV1TransactionFilter fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WatchBlocksV1TransactionFilter.class); + } + + /** + * Convert an instance of WatchBlocksV1TransactionFilter to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..ab41041f164 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,46 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.ErrorExceptionResponseV1; +import org.openapitools.client.model.StatusResponseV1; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Get the status of the connector and the sawtooth validator + * + * @throws ApiException if the Api call fails + */ + @Test + public void getStatusV1Test() throws ApiException { + StatusResponseV1 response = api.getStatusV1(); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactiTransactionV1AllOfTest.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactiTransactionV1AllOfTest.java new file mode 100644 index 00000000000..6062b72d6c3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactiTransactionV1AllOfTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CactiTransactionV1AllOf + */ +public class CactiTransactionV1AllOfTest { + private final CactiTransactionV1AllOf model = new CactiTransactionV1AllOf(); + + /** + * Model tests for CactiTransactionV1AllOf + */ + @Test + public void testCactiTransactionV1AllOf() { + // TODO: test CactiTransactionV1AllOf + } + + /** + * Test the property 'payloadDecoded' + */ + @Test + public void payloadDecodedTest() { + // TODO: test payloadDecoded + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactiTransactionV1Test.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactiTransactionV1Test.java new file mode 100644 index 00000000000..d3ce909b9da --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CactiTransactionV1Test.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.SawtoothTransactionHeaderV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CactiTransactionV1 + */ +public class CactiTransactionV1Test { + private final CactiTransactionV1 model = new CactiTransactionV1(); + + /** + * Model tests for CactiTransactionV1 + */ + @Test + public void testCactiTransactionV1() { + // TODO: test CactiTransactionV1 + } + + /** + * Test the property 'header' + */ + @Test + public void headerTest() { + // TODO: test header + } + + /** + * Test the property 'headerSignature' + */ + @Test + public void headerSignatureTest() { + // TODO: test headerSignature + } + + /** + * Test the property 'payload' + */ + @Test + public void payloadTest() { + // TODO: test payload + } + + /** + * Test the property 'payloadDecoded' + */ + @Test + public void payloadDecodedTest() { + // TODO: test payloadDecoded + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java new file mode 100644 index 00000000000..5179592daff --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ErrorExceptionResponseV1 + */ +public class ErrorExceptionResponseV1Test { + private final ErrorExceptionResponseV1 model = new ErrorExceptionResponseV1(); + + /** + * Model tests for ErrorExceptionResponseV1 + */ + @Test + public void testErrorExceptionResponseV1() { + // TODO: test ErrorExceptionResponseV1 + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothBatchHeaderV1Test.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothBatchHeaderV1Test.java new file mode 100644 index 00000000000..8b19afe2768 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothBatchHeaderV1Test.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SawtoothBatchHeaderV1 + */ +public class SawtoothBatchHeaderV1Test { + private final SawtoothBatchHeaderV1 model = new SawtoothBatchHeaderV1(); + + /** + * Model tests for SawtoothBatchHeaderV1 + */ + @Test + public void testSawtoothBatchHeaderV1() { + // TODO: test SawtoothBatchHeaderV1 + } + + /** + * Test the property 'signerPublicKey' + */ + @Test + public void signerPublicKeyTest() { + // TODO: test signerPublicKey + } + + /** + * Test the property 'transactionIds' + */ + @Test + public void transactionIdsTest() { + // TODO: test transactionIds + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothBatchV1Test.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothBatchV1Test.java new file mode 100644 index 00000000000..b94fdb342cf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothBatchV1Test.java @@ -0,0 +1,68 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.SawtoothBatchHeaderV1; +import org.openapitools.client.model.SawtoothTransactionV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SawtoothBatchV1 + */ +public class SawtoothBatchV1Test { + private final SawtoothBatchV1 model = new SawtoothBatchV1(); + + /** + * Model tests for SawtoothBatchV1 + */ + @Test + public void testSawtoothBatchV1() { + // TODO: test SawtoothBatchV1 + } + + /** + * Test the property 'header' + */ + @Test + public void headerTest() { + // TODO: test header + } + + /** + * Test the property 'headerSignature' + */ + @Test + public void headerSignatureTest() { + // TODO: test headerSignature + } + + /** + * Test the property 'transactions' + */ + @Test + public void transactionsTest() { + // TODO: test transactions + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothBlockHeaderV1Test.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothBlockHeaderV1Test.java new file mode 100644 index 00000000000..db18b886d26 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothBlockHeaderV1Test.java @@ -0,0 +1,90 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SawtoothBlockHeaderV1 + */ +public class SawtoothBlockHeaderV1Test { + private final SawtoothBlockHeaderV1 model = new SawtoothBlockHeaderV1(); + + /** + * Model tests for SawtoothBlockHeaderV1 + */ + @Test + public void testSawtoothBlockHeaderV1() { + // TODO: test SawtoothBlockHeaderV1 + } + + /** + * Test the property 'blockNum' + */ + @Test + public void blockNumTest() { + // TODO: test blockNum + } + + /** + * Test the property 'previousBlockId' + */ + @Test + public void previousBlockIdTest() { + // TODO: test previousBlockId + } + + /** + * Test the property 'signerPublicKey' + */ + @Test + public void signerPublicKeyTest() { + // TODO: test signerPublicKey + } + + /** + * Test the property 'batchIds' + */ + @Test + public void batchIdsTest() { + // TODO: test batchIds + } + + /** + * Test the property 'consensus' + */ + @Test + public void consensusTest() { + // TODO: test consensus + } + + /** + * Test the property 'stateRootHash' + */ + @Test + public void stateRootHashTest() { + // TODO: test stateRootHash + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothBlockV1Test.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothBlockV1Test.java new file mode 100644 index 00000000000..f6d16724faf --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothBlockV1Test.java @@ -0,0 +1,68 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.SawtoothBatchV1; +import org.openapitools.client.model.SawtoothBlockHeaderV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SawtoothBlockV1 + */ +public class SawtoothBlockV1Test { + private final SawtoothBlockV1 model = new SawtoothBlockV1(); + + /** + * Model tests for SawtoothBlockV1 + */ + @Test + public void testSawtoothBlockV1() { + // TODO: test SawtoothBlockV1 + } + + /** + * Test the property 'header' + */ + @Test + public void headerTest() { + // TODO: test header + } + + /** + * Test the property 'headerSignature' + */ + @Test + public void headerSignatureTest() { + // TODO: test headerSignature + } + + /** + * Test the property 'batches' + */ + @Test + public void batchesTest() { + // TODO: test batches + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothTransactionHeaderV1Test.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothTransactionHeaderV1Test.java new file mode 100644 index 00000000000..ff61c78ef13 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothTransactionHeaderV1Test.java @@ -0,0 +1,114 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SawtoothTransactionHeaderV1 + */ +public class SawtoothTransactionHeaderV1Test { + private final SawtoothTransactionHeaderV1 model = new SawtoothTransactionHeaderV1(); + + /** + * Model tests for SawtoothTransactionHeaderV1 + */ + @Test + public void testSawtoothTransactionHeaderV1() { + // TODO: test SawtoothTransactionHeaderV1 + } + + /** + * Test the property 'batcherPublicKey' + */ + @Test + public void batcherPublicKeyTest() { + // TODO: test batcherPublicKey + } + + /** + * Test the property 'dependencies' + */ + @Test + public void dependenciesTest() { + // TODO: test dependencies + } + + /** + * Test the property 'familyName' + */ + @Test + public void familyNameTest() { + // TODO: test familyName + } + + /** + * Test the property 'familyVersion' + */ + @Test + public void familyVersionTest() { + // TODO: test familyVersion + } + + /** + * Test the property 'inputs' + */ + @Test + public void inputsTest() { + // TODO: test inputs + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'outputs' + */ + @Test + public void outputsTest() { + // TODO: test outputs + } + + /** + * Test the property 'payloadSha512' + */ + @Test + public void payloadSha512Test() { + // TODO: test payloadSha512 + } + + /** + * Test the property 'signerPublicKey' + */ + @Test + public void signerPublicKeyTest() { + // TODO: test signerPublicKey + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothTransactionV1Test.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothTransactionV1Test.java new file mode 100644 index 00000000000..639f89d31d6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SawtoothTransactionV1Test.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.SawtoothTransactionHeaderV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SawtoothTransactionV1 + */ +public class SawtoothTransactionV1Test { + private final SawtoothTransactionV1 model = new SawtoothTransactionV1(); + + /** + * Model tests for SawtoothTransactionV1 + */ + @Test + public void testSawtoothTransactionV1() { + // TODO: test SawtoothTransactionV1 + } + + /** + * Test the property 'header' + */ + @Test + public void headerTest() { + // TODO: test header + } + + /** + * Test the property 'headerSignature' + */ + @Test + public void headerSignatureTest() { + // TODO: test headerSignature + } + + /** + * Test the property 'payload' + */ + @Test + public void payloadTest() { + // TODO: test payload + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StatusResponseV1Test.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StatusResponseV1Test.java new file mode 100644 index 00000000000..14e948f2008 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StatusResponseV1Test.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for StatusResponseV1 + */ +public class StatusResponseV1Test { + private final StatusResponseV1 model = new StatusResponseV1(); + + /** + * Model tests for StatusResponseV1 + */ + @Test + public void testStatusResponseV1() { + // TODO: test StatusResponseV1 + } + + /** + * Test the property 'instanceId' + */ + @Test + public void instanceIdTest() { + // TODO: test instanceId + } + + /** + * Test the property 'openApiSpecVersion' + */ + @Test + public void openApiSpecVersionTest() { + // TODO: test openApiSpecVersion + } + + /** + * Test the property 'initialized' + */ + @Test + public void initializedTest() { + // TODO: test initialized + } + + /** + * Test the property 'sawtoothStatus' + */ + @Test + public void sawtoothStatusTest() { + // TODO: test sawtoothStatus + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1CactiTransactionsResponseTest.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1CactiTransactionsResponseTest.java new file mode 100644 index 00000000000..dacfa8b28bd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1CactiTransactionsResponseTest.java @@ -0,0 +1,51 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.CactiTransactionV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1CactiTransactionsResponse + */ +public class WatchBlocksV1CactiTransactionsResponseTest { + private final WatchBlocksV1CactiTransactionsResponse model = new WatchBlocksV1CactiTransactionsResponse(); + + /** + * Model tests for WatchBlocksV1CactiTransactionsResponse + */ + @Test + public void testWatchBlocksV1CactiTransactionsResponse() { + // TODO: test WatchBlocksV1CactiTransactionsResponse + } + + /** + * Test the property 'cactiTransactionsEvents' + */ + @Test + public void cactiTransactionsEventsTest() { + // TODO: test cactiTransactionsEvents + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1FullResponseTest.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1FullResponseTest.java new file mode 100644 index 00000000000..c15b2a566ea --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1FullResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.SawtoothBlockV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1FullResponse + */ +public class WatchBlocksV1FullResponseTest { + private final WatchBlocksV1FullResponse model = new WatchBlocksV1FullResponse(); + + /** + * Model tests for WatchBlocksV1FullResponse + */ + @Test + public void testWatchBlocksV1FullResponse() { + // TODO: test WatchBlocksV1FullResponse + } + + /** + * Test the property 'fullBlock' + */ + @Test + public void fullBlockTest() { + // TODO: test fullBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ListenerTypeTest.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ListenerTypeTest.java new file mode 100644 index 00000000000..c9674bc9a57 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ListenerTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1ListenerType + */ +public class WatchBlocksV1ListenerTypeTest { + /** + * Model tests for WatchBlocksV1ListenerType + */ + @Test + public void testWatchBlocksV1ListenerType() { + // TODO: test WatchBlocksV1ListenerType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java new file mode 100644 index 00000000000..6732056dda5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1OptionsTest.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.WatchBlocksV1ListenerType; +import org.openapitools.client.model.WatchBlocksV1TransactionFilter; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1Options + */ +public class WatchBlocksV1OptionsTest { + private final WatchBlocksV1Options model = new WatchBlocksV1Options(); + + /** + * Model tests for WatchBlocksV1Options + */ + @Test + public void testWatchBlocksV1Options() { + // TODO: test WatchBlocksV1Options + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'txFilterBy' + */ + @Test + public void txFilterByTest() { + // TODO: test txFilterBy + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java new file mode 100644 index 00000000000..7629625e83c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1ProgressTest.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.CactiTransactionV1; +import org.openapitools.client.model.SawtoothBlockV1; +import org.openapitools.client.model.WatchBlocksV1CactiTransactionsResponse; +import org.openapitools.client.model.WatchBlocksV1FullResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1Progress + */ +public class WatchBlocksV1ProgressTest { + private final WatchBlocksV1Progress model = new WatchBlocksV1Progress(); + + /** + * Model tests for WatchBlocksV1Progress + */ + @Test + public void testWatchBlocksV1Progress() { + // TODO: test WatchBlocksV1Progress + } + + /** + * Test the property 'cactiTransactionsEvents' + */ + @Test + public void cactiTransactionsEventsTest() { + // TODO: test cactiTransactionsEvents + } + + /** + * Test the property 'fullBlock' + */ + @Test + public void fullBlockTest() { + // TODO: test fullBlock + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java new file mode 100644 index 00000000000..475b3d8c039 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1 + */ +public class WatchBlocksV1Test { + /** + * Model tests for WatchBlocksV1 + */ + @Test + public void testWatchBlocksV1() { + // TODO: test WatchBlocksV1 + } + +} diff --git a/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1TransactionFilterTest.java b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1TransactionFilterTest.java new file mode 100644 index 00000000000..d89662d8b52 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/WatchBlocksV1TransactionFilterTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cacti Plugin - Connector Sawtooth + * Can perform basic tasks on a Sawtooth ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for WatchBlocksV1TransactionFilter + */ +public class WatchBlocksV1TransactionFilterTest { + private final WatchBlocksV1TransactionFilter model = new WatchBlocksV1TransactionFilter(); + + /** + * Model tests for WatchBlocksV1TransactionFilter + */ + @Test + public void testWatchBlocksV1TransactionFilter() { + // TODO: test WatchBlocksV1TransactionFilter + } + + /** + * Test the property 'familyName' + */ + @Test + public void familyNameTest() { + // TODO: test familyName + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/package.json b/packages/cactus-plugin-ledger-connector-ubiquity/package.json index 4b03d544648..fe8ad937bd6 100644 --- a/packages/cactus-plugin-ledger-connector-ubiquity/package.json +++ b/packages/cactus-plugin-ledger-connector-ubiquity/package.json @@ -46,7 +46,10 @@ "scripts": { "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", - "generate-sdk": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk": "run-p 'generate-sdk:*'", + "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "tsc": "tsc --project ./tsconfig.json", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..250626d8dc4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,12 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_get_transactions_by_address_endpoint.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..ec9e76dfd40 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,112 @@ +# Go API client for cactus-plugin-ledger-connector-ubiquity + +Ubiquity wrapper for Hyperledger Cactus + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-ubiquity "github.com/hyperledger/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-ubiquity.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-ubiquity.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-ubiquity.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-ubiquity.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetTransactionByAddressV1**](docs/DefaultApi.md#gettransactionbyaddressv1) | **Post** /api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress | + + +## Documentation For Models + + - [GetTransactionsByAddressEndpoint](docs/GetTransactionsByAddressEndpoint.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..357b03ae3f6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,48 @@ +openapi: 3.0.3 +info: + description: Ubiquity wrapper for Hyperledger Cactus + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Ubiquity + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress: + post: + description: "" + operationId: GetTransactionByAddressV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetTransactionsByAddressEndpoint' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress +components: + schemas: + GetTransactionsByAddressEndpoint: + description: "Gets transactions that an address was involved with, from newest\ + \ to oldest. This call uses pagination. Source: https://ubiquity.docs.blockdaemon.com/swagger-ui/#/Accounts/GetTxsByAddress" + example: + protocol: protocol + address: address + network: network + properties: + protocol: + type: string + network: + type: string + address: + type: string + required: + - address + - network + - protocol + type: object diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..120bd7e054d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,119 @@ +/* +Hyperledger Cactus Plugin - Ubiquity + +Ubiquity wrapper for Hyperledger Cactus + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ubiquity + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGetTransactionByAddressV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getTransactionsByAddressEndpoint *GetTransactionsByAddressEndpoint +} + +func (r ApiGetTransactionByAddressV1Request) GetTransactionsByAddressEndpoint(getTransactionsByAddressEndpoint GetTransactionsByAddressEndpoint) ApiGetTransactionByAddressV1Request { + r.getTransactionsByAddressEndpoint = &getTransactionsByAddressEndpoint + return r +} + +func (r ApiGetTransactionByAddressV1Request) Execute() (*http.Response, error) { + return r.ApiService.GetTransactionByAddressV1Execute(r) +} + +/* +GetTransactionByAddressV1 Method for GetTransactionByAddressV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetTransactionByAddressV1Request +*/ +func (a *DefaultApiService) GetTransactionByAddressV1(ctx context.Context) ApiGetTransactionByAddressV1Request { + return ApiGetTransactionByAddressV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) GetTransactionByAddressV1Execute(r ApiGetTransactionByAddressV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetTransactionByAddressV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getTransactionsByAddressEndpoint + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..3c07feb82f0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Ubiquity + +Ubiquity wrapper for Hyperledger Cactus + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ubiquity + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Ubiquity API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..71e65046b96 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Ubiquity + +Ubiquity wrapper for Hyperledger Cactus + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ubiquity + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..b59b77ef50c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/model_get_transactions_by_address_endpoint.go b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/model_get_transactions_by_address_endpoint.go new file mode 100644 index 00000000000..e5fc713a7f5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/model_get_transactions_by_address_endpoint.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Ubiquity + +Ubiquity wrapper for Hyperledger Cactus + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ubiquity + +import ( + "encoding/json" +) + +// checks if the GetTransactionsByAddressEndpoint type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetTransactionsByAddressEndpoint{} + +// GetTransactionsByAddressEndpoint Gets transactions that an address was involved with, from newest to oldest. This call uses pagination. Source: https://ubiquity.docs.blockdaemon.com/swagger-ui/#/Accounts/GetTxsByAddress +type GetTransactionsByAddressEndpoint struct { + Protocol string `json:"protocol"` + Network string `json:"network"` + Address string `json:"address"` +} + +// NewGetTransactionsByAddressEndpoint instantiates a new GetTransactionsByAddressEndpoint 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 +// will change when the set of required properties is changed +func NewGetTransactionsByAddressEndpoint(protocol string, network string, address string) *GetTransactionsByAddressEndpoint { + this := GetTransactionsByAddressEndpoint{} + this.Protocol = protocol + this.Network = network + this.Address = address + return &this +} + +// NewGetTransactionsByAddressEndpointWithDefaults instantiates a new GetTransactionsByAddressEndpoint object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetTransactionsByAddressEndpointWithDefaults() *GetTransactionsByAddressEndpoint { + this := GetTransactionsByAddressEndpoint{} + return &this +} + +// GetProtocol returns the Protocol field value +func (o *GetTransactionsByAddressEndpoint) GetProtocol() string { + if o == nil { + var ret string + return ret + } + + return o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value +// and a boolean to check if the value has been set. +func (o *GetTransactionsByAddressEndpoint) GetProtocolOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Protocol, true +} + +// SetProtocol sets field value +func (o *GetTransactionsByAddressEndpoint) SetProtocol(v string) { + o.Protocol = v +} + +// GetNetwork returns the Network field value +func (o *GetTransactionsByAddressEndpoint) GetNetwork() string { + if o == nil { + var ret string + return ret + } + + return o.Network +} + +// GetNetworkOk returns a tuple with the Network field value +// and a boolean to check if the value has been set. +func (o *GetTransactionsByAddressEndpoint) GetNetworkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Network, true +} + +// SetNetwork sets field value +func (o *GetTransactionsByAddressEndpoint) SetNetwork(v string) { + o.Network = v +} + +// GetAddress returns the Address field value +func (o *GetTransactionsByAddressEndpoint) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *GetTransactionsByAddressEndpoint) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *GetTransactionsByAddressEndpoint) SetAddress(v string) { + o.Address = v +} + +func (o GetTransactionsByAddressEndpoint) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetTransactionsByAddressEndpoint) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["protocol"] = o.Protocol + toSerialize["network"] = o.Network + toSerialize["address"] = o.Address + return toSerialize, nil +} + +type NullableGetTransactionsByAddressEndpoint struct { + value *GetTransactionsByAddressEndpoint + isSet bool +} + +func (v NullableGetTransactionsByAddressEndpoint) Get() *GetTransactionsByAddressEndpoint { + return v.value +} + +func (v *NullableGetTransactionsByAddressEndpoint) Set(val *GetTransactionsByAddressEndpoint) { + v.value = val + v.isSet = true +} + +func (v NullableGetTransactionsByAddressEndpoint) IsSet() bool { + return v.isSet +} + +func (v *NullableGetTransactionsByAddressEndpoint) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetTransactionsByAddressEndpoint(val *GetTransactionsByAddressEndpoint) *NullableGetTransactionsByAddressEndpoint { + return &NullableGetTransactionsByAddressEndpoint{value: val, isSet: true} +} + +func (v NullableGetTransactionsByAddressEndpoint) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetTransactionsByAddressEndpoint) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..1c268213836 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Ubiquity + +Ubiquity wrapper for Hyperledger Cactus + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ubiquity + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..cb73f3f03b0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,36 @@ +/* +Hyperledger Cactus Plugin - Ubiquity + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-ledger-connector-ubiquity + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-ledger-connector-ubiquity_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService GetTransactionByAddressV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.GetTransactionByAddressV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..6ff536fe584 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Ubiquity + +Ubiquity wrapper for Hyperledger Cactus + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ubiquity + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..9e1c21e1ec4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - Ubiquity + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..e04fae3669d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,34 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/GetTransactionsByAddressEndpoint.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/GetTransactionsByAddressEndpointTest.java diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..c996c15bbbb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,136 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Ubiquity +- API version: v2.0.0-alpha.2 + +Ubiquity wrapper for Hyperledger Cactus + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + GetTransactionsByAddressEndpoint getTransactionsByAddressEndpoint = new GetTransactionsByAddressEndpoint(); // GetTransactionsByAddressEndpoint | + try { + apiInstance.getTransactionByAddressV1(getTransactionsByAddressEndpoint); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getTransactionByAddressV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**getTransactionByAddressV1**](docs/DefaultApi.md#getTransactionByAddressV1) | **POST** /api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress | + + +## Documentation for Models + + - [GetTransactionsByAddressEndpoint](docs/GetTransactionsByAddressEndpoint.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..30d9cf06071 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,51 @@ +openapi: 3.0.3 +info: + description: Ubiquity wrapper for Hyperledger Cactus + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Ubiquity + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress: + post: + description: "" + operationId: GetTransactionByAddressV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetTransactionsByAddressEndpoint' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress + x-content-type: application/json + x-accepts: application/json +components: + schemas: + GetTransactionsByAddressEndpoint: + description: "Gets transactions that an address was involved with, from newest\ + \ to oldest. This call uses pagination. Source: https://ubiquity.docs.blockdaemon.com/swagger-ui/#/Accounts/GetTxsByAddress" + example: + protocol: protocol + address: address + network: network + properties: + protocol: + type: string + network: + type: string + address: + type: string + required: + - address + - network + - protocol + type: object + diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..89a0bc0fbd8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..23571ff72bc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..8b72d84dd24 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..39810a14f86 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..294099a4ac8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..3c1ed35d4f1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..5e592c2e1d3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,401 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.GetTransactionsByAddressEndpoint.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); + } + } + } + + /** + * 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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..08ad0e993a0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..caac3c535fd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..da801263b8f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..7ae95deaa9c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..bc6a83f6045 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,189 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.GetTransactionsByAddressEndpoint; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 getTransactionByAddressV1 + * @param getTransactionsByAddressEndpoint (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getTransactionByAddressV1Call(GetTransactionsByAddressEndpoint getTransactionsByAddressEndpoint, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getTransactionsByAddressEndpoint; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-ledger-connector-ubiquity/GetTransactionByAddress"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 getTransactionByAddressV1ValidateBeforeCall(GetTransactionsByAddressEndpoint getTransactionsByAddressEndpoint, final ApiCallback _callback) throws ApiException { + return getTransactionByAddressV1Call(getTransactionsByAddressEndpoint, _callback); + + } + + /** + * + * + * @param getTransactionsByAddressEndpoint (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void getTransactionByAddressV1(GetTransactionsByAddressEndpoint getTransactionsByAddressEndpoint) throws ApiException { + getTransactionByAddressV1WithHttpInfo(getTransactionsByAddressEndpoint); + } + + /** + * + * + * @param getTransactionsByAddressEndpoint (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getTransactionByAddressV1WithHttpInfo(GetTransactionsByAddressEndpoint getTransactionsByAddressEndpoint) throws ApiException { + okhttp3.Call localVarCall = getTransactionByAddressV1ValidateBeforeCall(getTransactionsByAddressEndpoint, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param getTransactionsByAddressEndpoint (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getTransactionByAddressV1Async(GetTransactionsByAddressEndpoint getTransactionsByAddressEndpoint, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getTransactionByAddressV1ValidateBeforeCall(getTransactionsByAddressEndpoint, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..9d32c272580 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..e1bdb3ed69d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..d6116bf8358 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..23daf1046c3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..247ba73296d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionsByAddressEndpoint.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionsByAddressEndpoint.java new file mode 100644 index 00000000000..ac17114eec6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/GetTransactionsByAddressEndpoint.java @@ -0,0 +1,280 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Gets transactions that an address was involved with, from newest to oldest. This call uses pagination. Source: https://ubiquity.docs.blockdaemon.com/swagger-ui/#/Accounts/GetTxsByAddress + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GetTransactionsByAddressEndpoint { + public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; + @SerializedName(SERIALIZED_NAME_PROTOCOL) + private String protocol; + + public static final String SERIALIZED_NAME_NETWORK = "network"; + @SerializedName(SERIALIZED_NAME_NETWORK) + private String network; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public GetTransactionsByAddressEndpoint() { + } + + public GetTransactionsByAddressEndpoint protocol(String protocol) { + + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * @return protocol + **/ + @javax.annotation.Nonnull + public String getProtocol() { + return protocol; + } + + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + + public GetTransactionsByAddressEndpoint network(String network) { + + this.network = network; + return this; + } + + /** + * Get network + * @return network + **/ + @javax.annotation.Nonnull + public String getNetwork() { + return network; + } + + + public void setNetwork(String network) { + this.network = network; + } + + + public GetTransactionsByAddressEndpoint address(String address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @javax.annotation.Nonnull + public String getAddress() { + return address; + } + + + public void setAddress(String address) { + this.address = address; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransactionsByAddressEndpoint getTransactionsByAddressEndpoint = (GetTransactionsByAddressEndpoint) o; + return Objects.equals(this.protocol, getTransactionsByAddressEndpoint.protocol) && + Objects.equals(this.network, getTransactionsByAddressEndpoint.network) && + Objects.equals(this.address, getTransactionsByAddressEndpoint.address); + } + + @Override + public int hashCode() { + return Objects.hash(protocol, network, address); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTransactionsByAddressEndpoint {\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); + sb.append(" network: ").append(toIndentedString(network)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("protocol"); + openapiFields.add("network"); + openapiFields.add("address"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("protocol"); + openapiRequiredFields.add("network"); + openapiRequiredFields.add("address"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTransactionsByAddressEndpoint + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!GetTransactionsByAddressEndpoint.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetTransactionsByAddressEndpoint is not found in the empty JSON string", GetTransactionsByAddressEndpoint.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTransactionsByAddressEndpoint.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTransactionsByAddressEndpoint` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTransactionsByAddressEndpoint.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("protocol").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `protocol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("protocol").toString())); + } + if (!jsonObj.get("network").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `network` to be a primitive type in the JSON string but got `%s`", jsonObj.get("network").toString())); + } + if (!jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTransactionsByAddressEndpoint.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTransactionsByAddressEndpoint' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetTransactionsByAddressEndpoint.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTransactionsByAddressEndpoint value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTransactionsByAddressEndpoint read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetTransactionsByAddressEndpoint given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTransactionsByAddressEndpoint + * @throws IOException if the JSON string is invalid with respect to GetTransactionsByAddressEndpoint + */ + public static GetTransactionsByAddressEndpoint fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTransactionsByAddressEndpoint.class); + } + + /** + * Convert an instance of GetTransactionsByAddressEndpoint to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..aa3de3a6c3f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,46 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.GetTransactionsByAddressEndpoint; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void getTransactionByAddressV1Test() throws ApiException { + GetTransactionsByAddressEndpoint getTransactionsByAddressEndpoint = null; + api.getTransactionByAddressV1(getTransactionsByAddressEndpoint); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionsByAddressEndpointTest.java b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionsByAddressEndpointTest.java new file mode 100644 index 00000000000..258420cfd2d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ubiquity/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/GetTransactionsByAddressEndpointTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Ubiquity + * Ubiquity wrapper for Hyperledger Cactus + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for GetTransactionsByAddressEndpoint + */ +public class GetTransactionsByAddressEndpointTest { + private final GetTransactionsByAddressEndpoint model = new GetTransactionsByAddressEndpoint(); + + /** + * Model tests for GetTransactionsByAddressEndpoint + */ + @Test + public void testGetTransactionsByAddressEndpoint() { + // TODO: test GetTransactionsByAddressEndpoint + } + + /** + * Test the property 'protocol' + */ + @Test + public void protocolTest() { + // TODO: test protocol + } + + /** + * Test the property 'network' + */ + @Test + public void networkTest() { + // TODO: test network + } + + /** + * Test the property 'address' + */ + @Test + public void addressTest() { + // TODO: test address + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/package.json b/packages/cactus-plugin-ledger-connector-xdai/package.json index b0ae8488122..6d254a79a50 100644 --- a/packages/cactus-plugin-ledger-connector-xdai/package.json +++ b/packages/cactus-plugin-ledger-connector-xdai/package.json @@ -47,6 +47,8 @@ "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..7c7ad38265c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,38 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_consistency_strategy.go +model_contract_json.go +model_deploy_contract_json_object_v1_request.go +model_deploy_contract_v1_request.go +model_deploy_contract_v1_response.go +model_deploy_request_base_v1.go +model_eth_contract_invocation_type.go +model_invoke_contract_json_object_v1_request.go +model_invoke_contract_v1_request.go +model_invoke_contract_v1_response.go +model_invoke_request_base_v1.go +model_receipt_type.go +model_run_transaction_v1_request.go +model_run_transaction_v1_response.go +model_solidity_contract_json_artifact.go +model_solidity_contract_json_artifact_compiler.go +model_solidity_contract_json_artifact_gas_estimates.go +model_solidity_contract_json_artifact_gas_estimates_creation.go +model_web3_signing_credential.go +model_web3_signing_credential_cactus_keychain_ref.go +model_web3_signing_credential_none.go +model_web3_signing_credential_private_key_hex.go +model_web3_signing_credential_type.go +model_web3_transaction_receipt.go +model_xdai_transaction_config.go +model_xdai_transaction_config_from.go +model_xdai_transaction_config_to.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..0aae7fe264b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,143 @@ +# Go API client for cactus-plugin-ledger-connector-xdai + +Can perform basic tasks on a Xdai ledger + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-ledger-connector-xdai "github.com/hyperledger/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-xdai.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-xdai.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-ledger-connector-xdai.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-xdai.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**DeployContractJsonObjectV1**](docs/DefaultApi.md#deploycontractjsonobjectv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode-json-object | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**DeployContractV1**](docs/DefaultApi.md#deploycontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**GetPrometheusMetricsV1**](docs/DefaultApi.md#getprometheusmetricsv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**InvokeContractJsonObject**](docs/DefaultApi.md#invokecontractjsonobject) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract-json-object | Invokes a contract on a besu ledger +*DefaultApi* | [**InvokeContractV1**](docs/DefaultApi.md#invokecontractv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract | Invokes a contract on a xdai ledger +*DefaultApi* | [**RunTransactionV1**](docs/DefaultApi.md#runtransactionv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction | Executes a transaction on a xdai ledger + + +## Documentation For Models + + - [ConsistencyStrategy](docs/ConsistencyStrategy.md) + - [ContractJSON](docs/ContractJSON.md) + - [DeployContractJsonObjectV1Request](docs/DeployContractJsonObjectV1Request.md) + - [DeployContractV1Request](docs/DeployContractV1Request.md) + - [DeployContractV1Response](docs/DeployContractV1Response.md) + - [DeployRequestBaseV1](docs/DeployRequestBaseV1.md) + - [EthContractInvocationType](docs/EthContractInvocationType.md) + - [InvokeContractJsonObjectV1Request](docs/InvokeContractJsonObjectV1Request.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [InvokeRequestBaseV1](docs/InvokeRequestBaseV1.md) + - [ReceiptType](docs/ReceiptType.md) + - [RunTransactionV1Request](docs/RunTransactionV1Request.md) + - [RunTransactionV1Response](docs/RunTransactionV1Response.md) + - [SolidityContractJsonArtifact](docs/SolidityContractJsonArtifact.md) + - [SolidityContractJsonArtifactCompiler](docs/SolidityContractJsonArtifactCompiler.md) + - [SolidityContractJsonArtifactGasEstimates](docs/SolidityContractJsonArtifactGasEstimates.md) + - [SolidityContractJsonArtifactGasEstimatesCreation](docs/SolidityContractJsonArtifactGasEstimatesCreation.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + - [XdaiTransactionConfig](docs/XdaiTransactionConfig.md) + - [XdaiTransactionConfigFrom](docs/XdaiTransactionConfigFrom.md) + - [XdaiTransactionConfigTo](docs/XdaiTransactionConfigTo.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..a5b80b5115f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,896 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Xdai ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Xdai + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode: + post: + operationId: deployContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode-json-object: + post: + operationId: deployContractJsonObjectV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode-json-object + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionV1Response' + description: OK + summary: Executes a transaction on a xdai ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a xdai ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract-json-object: + post: + operationId: invokeContractJsonObject + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a besu ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract-json-object + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics +components: + schemas: + ReceiptType: + description: Enumerates the possible types of receipts that can be waited for + by someone or something that has requested the execution of a transaction + on a ledger. + enum: + - NODE_TX_POOL_ACK + - LEDGER_BLOCK_ACK + type: string + ConsistencyStrategy: + example: + blockConfirmations: 2931 + receiptType: null + timeoutMs: 0 + pollIntervalMs: 0 + properties: + receiptType: + $ref: '#/components/schemas/ReceiptType' + timeoutMs: + description: "The amount of milliseconds to wait for the receipt to arrive\ + \ to the connector. Defaults to 0 which means to wait for an unlimited\ + \ amount of time. Note that this wait may be interrupted still by other\ + \ parts of the infrastructure such as load balancers cutting of HTTP requests\ + \ after some time even if they are the type that is supposed to be kept\ + \ alive. The question of re-entrance is a broader topic not in scope to\ + \ discuss here, but it is important to mention it." + minimum: 0 + type: integer + blockConfirmations: + description: "The number of blocks to wait to be confirmed in addition to\ + \ the block containing the transaction in question. Note that if the receipt\ + \ type is set to only wait for node transaction pool ACK and this parameter\ + \ is set to anything, but zero then the API will not accept the request\ + \ due to conflicting parameters." + maximum: 20000 + minimum: 0 + type: integer + pollIntervalMs: + description: The amount of time (in milliseconds) connector will wait before + making another confiramtion request to the network in case of previous + confiramtion request fails + minimum: 0 + type: integer + required: + - blockConfirmations + - receiptType + type: object + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + EthContractInvocationType: + enum: + - SEND + - CALL + type: string + SolidityContractJsonArtifact: + properties: + contractName: + nullable: false + type: string + metadata: + nullable: false + type: string + bytecode: + nullable: false + type: string + deployedBytecode: + nullable: false + type: string + sourceMap: + nullable: false + type: string + deployedSourceMap: + nullable: false + type: string + sourcePath: + type: string + compiler: + $ref: '#/components/schemas/SolidityContractJsonArtifact_compiler' + functionHashes: + additionalProperties: true + type: object + gasEstimates: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates' + required: + - contractName + type: object + XdaiTransactionConfig: + additionalProperties: true + example: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + rawTransaction: + nullable: false + type: string + from: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + to: + $ref: '#/components/schemas/XdaiTransactionConfig_to' + value: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gas: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + nonce: + type: number + data: + $ref: '#/components/schemas/XdaiTransactionConfig_to' + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + ContractJSON: + additionalProperties: true + example: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + contractName: + nullable: false + type: string + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + abi: + description: "The application binary interface of the solidity contract,\ + \ optional parameter" + items: {} + nullable: false + type: array + metadata: + type: string + deployedBytecode: + type: string + sourceMap: + type: string + deployedSourceMap: + type: string + sourcePath: + type: string + compiler: + type: object + networks: + type: object + ast: + type: object + functionHashes: + type: object + gasEstimates: + type: object + required: + - abi + - bytecode + - contractName + type: object + RunTransactionV1Request: + additionalProperties: false + example: + transactionConfig: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + consistencyStrategy: + blockConfirmations: 2931 + receiptType: null + timeoutMs: 0 + pollIntervalMs: 0 + web3SigningCredential: + type: null + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + transactionConfig: + $ref: '#/components/schemas/XdaiTransactionConfig' + consistencyStrategy: + $ref: '#/components/schemas/ConsistencyStrategy' + required: + - consistencyStrategy + - transactionConfig + - web3SigningCredential + type: object + RunTransactionV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractV1Request: + additionalProperties: false + example: + keychainId: keychainId + constructorArgs: + - "" + - "" + timeoutMs: 0.6027456183070403 + gas: 0.8008281904610115 + web3SigningCredential: + type: null + contractName: contractName + gasPrice: gasPrice + properties: + contractName: + description: The contract name for retrieve the contracts json on the keychain. + maxLength: 100 + minLength: 1 + nullable: false + type: string + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: string + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + required: + - contractName + - keychainId + - web3SigningCredential + type: object + DeployContractJsonObjectV1Request: + additionalProperties: false + example: + timeoutMs: 0.6027456183070403 + constructorArgs: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + gasPrice: gasPrice + contractJSON: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: string + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + required: + - contractJSON + - web3SigningCredential + type: object + DeployContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + InvokeContractV1Request: + additionalProperties: false + example: + invocationType: null + keychainId: keychainId + timeoutMs: 0.6027456183070403 + gas: null + web3SigningCredential: + type: null + methodName: methodName + contractName: contractName + params: + - "" + - "" + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + contractName: + description: The contract name to find it in the keychain plugin + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + value: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gas: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + type: string + required: + - contractName + - invocationType + - keychainId + - methodName + - params + - web3SigningCredential + type: object + InvokeContractJsonObjectV1Request: + additionalProperties: false + example: + invocationType: null + timeoutMs: 0.6027456183070403 + gas: null + web3SigningCredential: + type: null + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + value: null + nonce: 0.8008281904610115 + gasPrice: null + contractJSON: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + contractAddress: + description: Address of the solidity contract + nullable: false + type: string + value: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gas: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + required: + - contractAddress + - contractJSON + - invocationType + - methodName + - params + - web3SigningCredential + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + DeployRequestBaseV1: + properties: + contractJSON: + $ref: '#/components/schemas/ContractJSON' + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + required: + - contractJSON + - web3SigningCredential + type: object + InvokeRequestBaseV1: + additionalProperties: false + properties: + contractAddress: + description: Address of the solidity contract + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + value: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gas: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + required: + - contractAddress + - contractJSON + - invocationType + - methodName + - params + - web3SigningCredential + type: object + SolidityContractJsonArtifact_compiler: + additionalProperties: true + properties: + name: + type: string + version: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates_creation: + properties: + codeDepositCost: + type: string + executionCost: + type: string + totalCost: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates: + properties: + creation: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates_creation' + external: + additionalProperties: true + type: object + XdaiTransactionConfig_from: + oneOf: + - type: string + - type: number + XdaiTransactionConfig_to: + oneOf: + - type: string diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..fd949d82ebe --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,645 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeployContractJsonObjectV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractJsonObjectV1Request *DeployContractJsonObjectV1Request +} + +func (r ApiDeployContractJsonObjectV1Request) DeployContractJsonObjectV1Request(deployContractJsonObjectV1Request DeployContractJsonObjectV1Request) ApiDeployContractJsonObjectV1Request { + r.deployContractJsonObjectV1Request = &deployContractJsonObjectV1Request + return r +} + +func (r ApiDeployContractJsonObjectV1Request) Execute() (*DeployContractV1Response, *http.Response, error) { + return r.ApiService.DeployContractJsonObjectV1Execute(r) +} + +/* +DeployContractJsonObjectV1 Deploys the bytecode of a Solidity contract. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractJsonObjectV1Request +*/ +func (a *DefaultApiService) DeployContractJsonObjectV1(ctx context.Context) ApiDeployContractJsonObjectV1Request { + return ApiDeployContractJsonObjectV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractV1Response +func (a *DefaultApiService) DeployContractJsonObjectV1Execute(r ApiDeployContractJsonObjectV1Request) (*DeployContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractJsonObjectV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode-json-object" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractJsonObjectV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeployContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractV1Request *DeployContractV1Request +} + +func (r ApiDeployContractV1Request) DeployContractV1Request(deployContractV1Request DeployContractV1Request) ApiDeployContractV1Request { + r.deployContractV1Request = &deployContractV1Request + return r +} + +func (r ApiDeployContractV1Request) Execute() (*DeployContractV1Response, *http.Response, error) { + return r.ApiService.DeployContractV1Execute(r) +} + +/* +DeployContractV1 Deploys the bytecode of a Solidity contract. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractV1Request +*/ +func (a *DefaultApiService) DeployContractV1(ctx context.Context) ApiDeployContractV1Request { + return ApiDeployContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractV1Response +func (a *DefaultApiService) DeployContractV1Execute(r ApiDeployContractV1Request) (*DeployContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deployContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPrometheusMetricsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsV1Request) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsV1Execute(r) +} + +/* +GetPrometheusMetricsV1 Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsV1Request +*/ +func (a *DefaultApiService) GetPrometheusMetricsV1(ctx context.Context) ApiGetPrometheusMetricsV1Request { + return ApiGetPrometheusMetricsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsV1Execute(r ApiGetPrometheusMetricsV1Request) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetricsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeContractJsonObjectRequest struct { + ctx context.Context + ApiService *DefaultApiService + invokeContractJsonObjectV1Request *InvokeContractJsonObjectV1Request +} + +func (r ApiInvokeContractJsonObjectRequest) InvokeContractJsonObjectV1Request(invokeContractJsonObjectV1Request InvokeContractJsonObjectV1Request) ApiInvokeContractJsonObjectRequest { + r.invokeContractJsonObjectV1Request = &invokeContractJsonObjectV1Request + return r +} + +func (r ApiInvokeContractJsonObjectRequest) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.InvokeContractJsonObjectExecute(r) +} + +/* +InvokeContractJsonObject Invokes a contract on a besu ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeContractJsonObjectRequest +*/ +func (a *DefaultApiService) InvokeContractJsonObject(ctx context.Context) ApiInvokeContractJsonObjectRequest { + return ApiInvokeContractJsonObjectRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) InvokeContractJsonObjectExecute(r ApiInvokeContractJsonObjectRequest) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeContractJsonObject") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract-json-object" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeContractJsonObjectV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiInvokeContractV1Request struct { + ctx context.Context + ApiService *DefaultApiService + invokeContractV1Request *InvokeContractV1Request +} + +func (r ApiInvokeContractV1Request) InvokeContractV1Request(invokeContractV1Request InvokeContractV1Request) ApiInvokeContractV1Request { + r.invokeContractV1Request = &invokeContractV1Request + return r +} + +func (r ApiInvokeContractV1Request) Execute() (*InvokeContractV1Response, *http.Response, error) { + return r.ApiService.InvokeContractV1Execute(r) +} + +/* +InvokeContractV1 Invokes a contract on a xdai ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeContractV1Request +*/ +func (a *DefaultApiService) InvokeContractV1(ctx context.Context) ApiInvokeContractV1Request { + return ApiInvokeContractV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractV1Response +func (a *DefaultApiService) InvokeContractV1Execute(r ApiInvokeContractV1Request) (*InvokeContractV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeContractV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invokeContractV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRunTransactionV1Request struct { + ctx context.Context + ApiService *DefaultApiService + runTransactionV1Request *RunTransactionV1Request +} + +func (r ApiRunTransactionV1Request) RunTransactionV1Request(runTransactionV1Request RunTransactionV1Request) ApiRunTransactionV1Request { + r.runTransactionV1Request = &runTransactionV1Request + return r +} + +func (r ApiRunTransactionV1Request) Execute() (*RunTransactionV1Response, *http.Response, error) { + return r.ApiService.RunTransactionV1Execute(r) +} + +/* +RunTransactionV1 Executes a transaction on a xdai ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRunTransactionV1Request +*/ +func (a *DefaultApiService) RunTransactionV1(ctx context.Context) ApiRunTransactionV1Request { + return ApiRunTransactionV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionV1Response +func (a *DefaultApiService) RunTransactionV1Execute(r ApiRunTransactionV1Request) (*RunTransactionV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RunTransactionV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.runTransactionV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..a6319859e68 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Connector Xdai API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..d39adb26282 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..9110fb7b311 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_consistency_strategy.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_consistency_strategy.go new file mode 100644 index 00000000000..1b45891d4b3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_consistency_strategy.go @@ -0,0 +1,219 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the ConsistencyStrategy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsistencyStrategy{} + +// ConsistencyStrategy struct for ConsistencyStrategy +type ConsistencyStrategy struct { + ReceiptType ReceiptType `json:"receiptType"` + // The amount of milliseconds to wait for the receipt to arrive to the connector. Defaults to 0 which means to wait for an unlimited amount of time. Note that this wait may be interrupted still by other parts of the infrastructure such as load balancers cutting of HTTP requests after some time even if they are the type that is supposed to be kept alive. The question of re-entrance is a broader topic not in scope to discuss here, but it is important to mention it. + TimeoutMs *int32 `json:"timeoutMs,omitempty"` + // The number of blocks to wait to be confirmed in addition to the block containing the transaction in question. Note that if the receipt type is set to only wait for node transaction pool ACK and this parameter is set to anything, but zero then the API will not accept the request due to conflicting parameters. + BlockConfirmations int32 `json:"blockConfirmations"` + // The amount of time (in milliseconds) connector will wait before making another confiramtion request to the network in case of previous confiramtion request fails + PollIntervalMs *int32 `json:"pollIntervalMs,omitempty"` +} + +// NewConsistencyStrategy instantiates a new ConsistencyStrategy 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 +// will change when the set of required properties is changed +func NewConsistencyStrategy(receiptType ReceiptType, blockConfirmations int32) *ConsistencyStrategy { + this := ConsistencyStrategy{} + this.ReceiptType = receiptType + this.BlockConfirmations = blockConfirmations + return &this +} + +// NewConsistencyStrategyWithDefaults instantiates a new ConsistencyStrategy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsistencyStrategyWithDefaults() *ConsistencyStrategy { + this := ConsistencyStrategy{} + return &this +} + +// GetReceiptType returns the ReceiptType field value +func (o *ConsistencyStrategy) GetReceiptType() ReceiptType { + if o == nil { + var ret ReceiptType + return ret + } + + return o.ReceiptType +} + +// GetReceiptTypeOk returns a tuple with the ReceiptType field value +// and a boolean to check if the value has been set. +func (o *ConsistencyStrategy) GetReceiptTypeOk() (*ReceiptType, bool) { + if o == nil { + return nil, false + } + return &o.ReceiptType, true +} + +// SetReceiptType sets field value +func (o *ConsistencyStrategy) SetReceiptType(v ReceiptType) { + o.ReceiptType = v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *ConsistencyStrategy) GetTimeoutMs() int32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret int32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsistencyStrategy) GetTimeoutMsOk() (*int32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *ConsistencyStrategy) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given int32 and assigns it to the TimeoutMs field. +func (o *ConsistencyStrategy) SetTimeoutMs(v int32) { + o.TimeoutMs = &v +} + +// GetBlockConfirmations returns the BlockConfirmations field value +func (o *ConsistencyStrategy) GetBlockConfirmations() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BlockConfirmations +} + +// GetBlockConfirmationsOk returns a tuple with the BlockConfirmations field value +// and a boolean to check if the value has been set. +func (o *ConsistencyStrategy) GetBlockConfirmationsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BlockConfirmations, true +} + +// SetBlockConfirmations sets field value +func (o *ConsistencyStrategy) SetBlockConfirmations(v int32) { + o.BlockConfirmations = v +} + +// GetPollIntervalMs returns the PollIntervalMs field value if set, zero value otherwise. +func (o *ConsistencyStrategy) GetPollIntervalMs() int32 { + if o == nil || IsNil(o.PollIntervalMs) { + var ret int32 + return ret + } + return *o.PollIntervalMs +} + +// GetPollIntervalMsOk returns a tuple with the PollIntervalMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsistencyStrategy) GetPollIntervalMsOk() (*int32, bool) { + if o == nil || IsNil(o.PollIntervalMs) { + return nil, false + } + return o.PollIntervalMs, true +} + +// HasPollIntervalMs returns a boolean if a field has been set. +func (o *ConsistencyStrategy) HasPollIntervalMs() bool { + if o != nil && !IsNil(o.PollIntervalMs) { + return true + } + + return false +} + +// SetPollIntervalMs gets a reference to the given int32 and assigns it to the PollIntervalMs field. +func (o *ConsistencyStrategy) SetPollIntervalMs(v int32) { + o.PollIntervalMs = &v +} + +func (o ConsistencyStrategy) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsistencyStrategy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["receiptType"] = o.ReceiptType + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["blockConfirmations"] = o.BlockConfirmations + if !IsNil(o.PollIntervalMs) { + toSerialize["pollIntervalMs"] = o.PollIntervalMs + } + return toSerialize, nil +} + +type NullableConsistencyStrategy struct { + value *ConsistencyStrategy + isSet bool +} + +func (v NullableConsistencyStrategy) Get() *ConsistencyStrategy { + return v.value +} + +func (v *NullableConsistencyStrategy) Set(val *ConsistencyStrategy) { + v.value = val + v.isSet = true +} + +func (v NullableConsistencyStrategy) IsSet() bool { + return v.isSet +} + +func (v *NullableConsistencyStrategy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsistencyStrategy(val *ConsistencyStrategy) *NullableConsistencyStrategy { + return &NullableConsistencyStrategy{value: val, isSet: true} +} + +func (v NullableConsistencyStrategy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsistencyStrategy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_contract_json.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_contract_json.go new file mode 100644 index 00000000000..f37c11e2da4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_contract_json.go @@ -0,0 +1,570 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the ContractJSON type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContractJSON{} + +// ContractJSON struct for ContractJSON +type ContractJSON struct { + ContractName string `json:"contractName"` + // See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + Bytecode string `json:"bytecode"` + // The application binary interface of the solidity contract, optional parameter + Abi []interface{} `json:"abi"` + Metadata *string `json:"metadata,omitempty"` + DeployedBytecode *string `json:"deployedBytecode,omitempty"` + SourceMap *string `json:"sourceMap,omitempty"` + DeployedSourceMap *string `json:"deployedSourceMap,omitempty"` + SourcePath *string `json:"sourcePath,omitempty"` + Compiler map[string]interface{} `json:"compiler,omitempty"` + Networks map[string]interface{} `json:"networks,omitempty"` + Ast map[string]interface{} `json:"ast,omitempty"` + FunctionHashes map[string]interface{} `json:"functionHashes,omitempty"` + GasEstimates map[string]interface{} `json:"gasEstimates,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ContractJSON ContractJSON + +// NewContractJSON instantiates a new ContractJSON 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 +// will change when the set of required properties is changed +func NewContractJSON(contractName string, bytecode string, abi []interface{}) *ContractJSON { + this := ContractJSON{} + this.ContractName = contractName + this.Bytecode = bytecode + this.Abi = abi + return &this +} + +// NewContractJSONWithDefaults instantiates a new ContractJSON object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContractJSONWithDefaults() *ContractJSON { + this := ContractJSON{} + return &this +} + +// GetContractName returns the ContractName field value +func (o *ContractJSON) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *ContractJSON) SetContractName(v string) { + o.ContractName = v +} + +// GetBytecode returns the Bytecode field value +func (o *ContractJSON) GetBytecode() string { + if o == nil { + var ret string + return ret + } + + return o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetBytecodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bytecode, true +} + +// SetBytecode sets field value +func (o *ContractJSON) SetBytecode(v string) { + o.Bytecode = v +} + +// GetAbi returns the Abi field value +func (o *ContractJSON) GetAbi() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Abi +} + +// GetAbiOk returns a tuple with the Abi field value +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetAbiOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Abi, true +} + +// SetAbi sets field value +func (o *ContractJSON) SetAbi(v []interface{}) { + o.Abi = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *ContractJSON) GetMetadata() string { + if o == nil || IsNil(o.Metadata) { + var ret string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetMetadataOk() (*string, bool) { + if o == nil || IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *ContractJSON) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given string and assigns it to the Metadata field. +func (o *ContractJSON) SetMetadata(v string) { + o.Metadata = &v +} + +// GetDeployedBytecode returns the DeployedBytecode field value if set, zero value otherwise. +func (o *ContractJSON) GetDeployedBytecode() string { + if o == nil || IsNil(o.DeployedBytecode) { + var ret string + return ret + } + return *o.DeployedBytecode +} + +// GetDeployedBytecodeOk returns a tuple with the DeployedBytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetDeployedBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.DeployedBytecode) { + return nil, false + } + return o.DeployedBytecode, true +} + +// HasDeployedBytecode returns a boolean if a field has been set. +func (o *ContractJSON) HasDeployedBytecode() bool { + if o != nil && !IsNil(o.DeployedBytecode) { + return true + } + + return false +} + +// SetDeployedBytecode gets a reference to the given string and assigns it to the DeployedBytecode field. +func (o *ContractJSON) SetDeployedBytecode(v string) { + o.DeployedBytecode = &v +} + +// GetSourceMap returns the SourceMap field value if set, zero value otherwise. +func (o *ContractJSON) GetSourceMap() string { + if o == nil || IsNil(o.SourceMap) { + var ret string + return ret + } + return *o.SourceMap +} + +// GetSourceMapOk returns a tuple with the SourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.SourceMap) { + return nil, false + } + return o.SourceMap, true +} + +// HasSourceMap returns a boolean if a field has been set. +func (o *ContractJSON) HasSourceMap() bool { + if o != nil && !IsNil(o.SourceMap) { + return true + } + + return false +} + +// SetSourceMap gets a reference to the given string and assigns it to the SourceMap field. +func (o *ContractJSON) SetSourceMap(v string) { + o.SourceMap = &v +} + +// GetDeployedSourceMap returns the DeployedSourceMap field value if set, zero value otherwise. +func (o *ContractJSON) GetDeployedSourceMap() string { + if o == nil || IsNil(o.DeployedSourceMap) { + var ret string + return ret + } + return *o.DeployedSourceMap +} + +// GetDeployedSourceMapOk returns a tuple with the DeployedSourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetDeployedSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.DeployedSourceMap) { + return nil, false + } + return o.DeployedSourceMap, true +} + +// HasDeployedSourceMap returns a boolean if a field has been set. +func (o *ContractJSON) HasDeployedSourceMap() bool { + if o != nil && !IsNil(o.DeployedSourceMap) { + return true + } + + return false +} + +// SetDeployedSourceMap gets a reference to the given string and assigns it to the DeployedSourceMap field. +func (o *ContractJSON) SetDeployedSourceMap(v string) { + o.DeployedSourceMap = &v +} + +// GetSourcePath returns the SourcePath field value if set, zero value otherwise. +func (o *ContractJSON) GetSourcePath() string { + if o == nil || IsNil(o.SourcePath) { + var ret string + return ret + } + return *o.SourcePath +} + +// GetSourcePathOk returns a tuple with the SourcePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetSourcePathOk() (*string, bool) { + if o == nil || IsNil(o.SourcePath) { + return nil, false + } + return o.SourcePath, true +} + +// HasSourcePath returns a boolean if a field has been set. +func (o *ContractJSON) HasSourcePath() bool { + if o != nil && !IsNil(o.SourcePath) { + return true + } + + return false +} + +// SetSourcePath gets a reference to the given string and assigns it to the SourcePath field. +func (o *ContractJSON) SetSourcePath(v string) { + o.SourcePath = &v +} + +// GetCompiler returns the Compiler field value if set, zero value otherwise. +func (o *ContractJSON) GetCompiler() map[string]interface{} { + if o == nil || IsNil(o.Compiler) { + var ret map[string]interface{} + return ret + } + return o.Compiler +} + +// GetCompilerOk returns a tuple with the Compiler field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetCompilerOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Compiler) { + return map[string]interface{}{}, false + } + return o.Compiler, true +} + +// HasCompiler returns a boolean if a field has been set. +func (o *ContractJSON) HasCompiler() bool { + if o != nil && !IsNil(o.Compiler) { + return true + } + + return false +} + +// SetCompiler gets a reference to the given map[string]interface{} and assigns it to the Compiler field. +func (o *ContractJSON) SetCompiler(v map[string]interface{}) { + o.Compiler = v +} + +// GetNetworks returns the Networks field value if set, zero value otherwise. +func (o *ContractJSON) GetNetworks() map[string]interface{} { + if o == nil || IsNil(o.Networks) { + var ret map[string]interface{} + return ret + } + return o.Networks +} + +// GetNetworksOk returns a tuple with the Networks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetNetworksOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Networks) { + return map[string]interface{}{}, false + } + return o.Networks, true +} + +// HasNetworks returns a boolean if a field has been set. +func (o *ContractJSON) HasNetworks() bool { + if o != nil && !IsNil(o.Networks) { + return true + } + + return false +} + +// SetNetworks gets a reference to the given map[string]interface{} and assigns it to the Networks field. +func (o *ContractJSON) SetNetworks(v map[string]interface{}) { + o.Networks = v +} + +// GetAst returns the Ast field value if set, zero value otherwise. +func (o *ContractJSON) GetAst() map[string]interface{} { + if o == nil || IsNil(o.Ast) { + var ret map[string]interface{} + return ret + } + return o.Ast +} + +// GetAstOk returns a tuple with the Ast field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetAstOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Ast) { + return map[string]interface{}{}, false + } + return o.Ast, true +} + +// HasAst returns a boolean if a field has been set. +func (o *ContractJSON) HasAst() bool { + if o != nil && !IsNil(o.Ast) { + return true + } + + return false +} + +// SetAst gets a reference to the given map[string]interface{} and assigns it to the Ast field. +func (o *ContractJSON) SetAst(v map[string]interface{}) { + o.Ast = v +} + +// GetFunctionHashes returns the FunctionHashes field value if set, zero value otherwise. +func (o *ContractJSON) GetFunctionHashes() map[string]interface{} { + if o == nil || IsNil(o.FunctionHashes) { + var ret map[string]interface{} + return ret + } + return o.FunctionHashes +} + +// GetFunctionHashesOk returns a tuple with the FunctionHashes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetFunctionHashesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FunctionHashes) { + return map[string]interface{}{}, false + } + return o.FunctionHashes, true +} + +// HasFunctionHashes returns a boolean if a field has been set. +func (o *ContractJSON) HasFunctionHashes() bool { + if o != nil && !IsNil(o.FunctionHashes) { + return true + } + + return false +} + +// SetFunctionHashes gets a reference to the given map[string]interface{} and assigns it to the FunctionHashes field. +func (o *ContractJSON) SetFunctionHashes(v map[string]interface{}) { + o.FunctionHashes = v +} + +// GetGasEstimates returns the GasEstimates field value if set, zero value otherwise. +func (o *ContractJSON) GetGasEstimates() map[string]interface{} { + if o == nil || IsNil(o.GasEstimates) { + var ret map[string]interface{} + return ret + } + return o.GasEstimates +} + +// GetGasEstimatesOk returns a tuple with the GasEstimates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractJSON) GetGasEstimatesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.GasEstimates) { + return map[string]interface{}{}, false + } + return o.GasEstimates, true +} + +// HasGasEstimates returns a boolean if a field has been set. +func (o *ContractJSON) HasGasEstimates() bool { + if o != nil && !IsNil(o.GasEstimates) { + return true + } + + return false +} + +// SetGasEstimates gets a reference to the given map[string]interface{} and assigns it to the GasEstimates field. +func (o *ContractJSON) SetGasEstimates(v map[string]interface{}) { + o.GasEstimates = v +} + +func (o ContractJSON) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContractJSON) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + toSerialize["bytecode"] = o.Bytecode + toSerialize["abi"] = o.Abi + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !IsNil(o.DeployedBytecode) { + toSerialize["deployedBytecode"] = o.DeployedBytecode + } + if !IsNil(o.SourceMap) { + toSerialize["sourceMap"] = o.SourceMap + } + if !IsNil(o.DeployedSourceMap) { + toSerialize["deployedSourceMap"] = o.DeployedSourceMap + } + if !IsNil(o.SourcePath) { + toSerialize["sourcePath"] = o.SourcePath + } + if !IsNil(o.Compiler) { + toSerialize["compiler"] = o.Compiler + } + if !IsNil(o.Networks) { + toSerialize["networks"] = o.Networks + } + if !IsNil(o.Ast) { + toSerialize["ast"] = o.Ast + } + if !IsNil(o.FunctionHashes) { + toSerialize["functionHashes"] = o.FunctionHashes + } + if !IsNil(o.GasEstimates) { + toSerialize["gasEstimates"] = o.GasEstimates + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContractJSON) UnmarshalJSON(bytes []byte) (err error) { + varContractJSON := _ContractJSON{} + + if err = json.Unmarshal(bytes, &varContractJSON); err == nil { + *o = ContractJSON(varContractJSON) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "contractName") + delete(additionalProperties, "bytecode") + delete(additionalProperties, "abi") + delete(additionalProperties, "metadata") + delete(additionalProperties, "deployedBytecode") + delete(additionalProperties, "sourceMap") + delete(additionalProperties, "deployedSourceMap") + delete(additionalProperties, "sourcePath") + delete(additionalProperties, "compiler") + delete(additionalProperties, "networks") + delete(additionalProperties, "ast") + delete(additionalProperties, "functionHashes") + delete(additionalProperties, "gasEstimates") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContractJSON struct { + value *ContractJSON + isSet bool +} + +func (v NullableContractJSON) Get() *ContractJSON { + return v.value +} + +func (v *NullableContractJSON) Set(val *ContractJSON) { + v.value = val + v.isSet = true +} + +func (v NullableContractJSON) IsSet() bool { + return v.isSet +} + +func (v *NullableContractJSON) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContractJSON(val *ContractJSON) *NullableContractJSON { + return &NullableContractJSON{value: val, isSet: true} +} + +func (v NullableContractJSON) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContractJSON) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_json_object_v1_request.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_json_object_v1_request.go new file mode 100644 index 00000000000..30cbcd1f489 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_json_object_v1_request.go @@ -0,0 +1,294 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the DeployContractJsonObjectV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractJsonObjectV1Request{} + +// DeployContractJsonObjectV1Request struct for DeployContractJsonObjectV1Request +type DeployContractJsonObjectV1Request struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + Gas *float32 `json:"gas,omitempty"` + GasPrice *string `json:"gasPrice,omitempty"` + // The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + ContractJSON ContractJSON `json:"contractJSON"` + // The list of arguments to pass in to the constructor of the contract being deployed. + ConstructorArgs []interface{} `json:"constructorArgs,omitempty"` +} + +// NewDeployContractJsonObjectV1Request instantiates a new DeployContractJsonObjectV1Request 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 +// will change when the set of required properties is changed +func NewDeployContractJsonObjectV1Request(web3SigningCredential Web3SigningCredential, contractJSON ContractJSON) *DeployContractJsonObjectV1Request { + this := DeployContractJsonObjectV1Request{} + this.Web3SigningCredential = web3SigningCredential + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + this.ContractJSON = contractJSON + return &this +} + +// NewDeployContractJsonObjectV1RequestWithDefaults instantiates a new DeployContractJsonObjectV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractJsonObjectV1RequestWithDefaults() *DeployContractJsonObjectV1Request { + this := DeployContractJsonObjectV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployContractJsonObjectV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *DeployContractJsonObjectV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployContractJsonObjectV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *DeployContractJsonObjectV1Request) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractJsonObjectV1Request) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *DeployContractJsonObjectV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *DeployContractJsonObjectV1Request) SetGas(v float32) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *DeployContractJsonObjectV1Request) GetGasPrice() string { + if o == nil || IsNil(o.GasPrice) { + var ret string + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractJsonObjectV1Request) GetGasPriceOk() (*string, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *DeployContractJsonObjectV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given string and assigns it to the GasPrice field. +func (o *DeployContractJsonObjectV1Request) SetGasPrice(v string) { + o.GasPrice = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *DeployContractJsonObjectV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractJsonObjectV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *DeployContractJsonObjectV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *DeployContractJsonObjectV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetContractJSON returns the ContractJSON field value +func (o *DeployContractJsonObjectV1Request) GetContractJSON() ContractJSON { + if o == nil { + var ret ContractJSON + return ret + } + + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value +// and a boolean to check if the value has been set. +func (o *DeployContractJsonObjectV1Request) GetContractJSONOk() (*ContractJSON, bool) { + if o == nil { + return nil, false + } + return &o.ContractJSON, true +} + +// SetContractJSON sets field value +func (o *DeployContractJsonObjectV1Request) SetContractJSON(v ContractJSON) { + o.ContractJSON = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployContractJsonObjectV1Request) GetConstructorArgs() []interface{} { + if o == nil || IsNil(o.ConstructorArgs) { + var ret []interface{} + return ret + } + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractJsonObjectV1Request) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployContractJsonObjectV1Request) HasConstructorArgs() bool { + if o != nil && !IsNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given []interface{} and assigns it to the ConstructorArgs field. +func (o *DeployContractJsonObjectV1Request) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +func (o DeployContractJsonObjectV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractJsonObjectV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["contractJSON"] = o.ContractJSON + if !IsNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + return toSerialize, nil +} + +type NullableDeployContractJsonObjectV1Request struct { + value *DeployContractJsonObjectV1Request + isSet bool +} + +func (v NullableDeployContractJsonObjectV1Request) Get() *DeployContractJsonObjectV1Request { + return v.value +} + +func (v *NullableDeployContractJsonObjectV1Request) Set(val *DeployContractJsonObjectV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractJsonObjectV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractJsonObjectV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractJsonObjectV1Request(val *DeployContractJsonObjectV1Request) *NullableDeployContractJsonObjectV1Request { + return &NullableDeployContractJsonObjectV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractJsonObjectV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractJsonObjectV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go new file mode 100644 index 00000000000..be0eb922f8b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_request.go @@ -0,0 +1,322 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the DeployContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractV1Request{} + +// DeployContractV1Request struct for DeployContractV1Request +type DeployContractV1Request struct { + // The contract name for retrieve the contracts json on the keychain. + ContractName string `json:"contractName"` + ConstructorArgs []interface{} `json:"constructorArgs,omitempty"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // The keychainId for retrieve the contracts json. + KeychainId string `json:"keychainId"` + Gas *float32 `json:"gas,omitempty"` + GasPrice *string `json:"gasPrice,omitempty"` + // The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` +} + +// NewDeployContractV1Request instantiates a new DeployContractV1Request 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 +// will change when the set of required properties is changed +func NewDeployContractV1Request(contractName string, web3SigningCredential Web3SigningCredential, keychainId string) *DeployContractV1Request { + this := DeployContractV1Request{} + this.ContractName = contractName + this.Web3SigningCredential = web3SigningCredential + this.KeychainId = keychainId + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewDeployContractV1RequestWithDefaults instantiates a new DeployContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractV1RequestWithDefaults() *DeployContractV1Request { + this := DeployContractV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractName returns the ContractName field value +func (o *DeployContractV1Request) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *DeployContractV1Request) SetContractName(v string) { + o.ContractName = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetConstructorArgs() []interface{} { + if o == nil || IsNil(o.ConstructorArgs) { + var ret []interface{} + return ret + } + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasConstructorArgs() bool { + if o != nil && !IsNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given []interface{} and assigns it to the ConstructorArgs field. +func (o *DeployContractV1Request) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployContractV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployContractV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetKeychainId returns the KeychainId field value +func (o *DeployContractV1Request) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *DeployContractV1Request) SetKeychainId(v string) { + o.KeychainId = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetGas() float32 { + if o == nil || IsNil(o.Gas) { + var ret float32 + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetGasOk() (*float32, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given float32 and assigns it to the Gas field. +func (o *DeployContractV1Request) SetGas(v float32) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetGasPrice() string { + if o == nil || IsNil(o.GasPrice) { + var ret string + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetGasPriceOk() (*string, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given string and assigns it to the GasPrice field. +func (o *DeployContractV1Request) SetGasPrice(v string) { + o.GasPrice = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *DeployContractV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *DeployContractV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *DeployContractV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +func (o DeployContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + if !IsNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["keychainId"] = o.KeychainId + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + return toSerialize, nil +} + +type NullableDeployContractV1Request struct { + value *DeployContractV1Request + isSet bool +} + +func (v NullableDeployContractV1Request) Get() *DeployContractV1Request { + return v.value +} + +func (v *NullableDeployContractV1Request) Set(val *DeployContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractV1Request(val *DeployContractV1Request) *NullableDeployContractV1Request { + return &NullableDeployContractV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_response.go new file mode 100644 index 00000000000..70362cf2509 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_contract_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the DeployContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractV1Response{} + +// DeployContractV1Response struct for DeployContractV1Response +type DeployContractV1Response struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewDeployContractV1Response instantiates a new DeployContractV1Response 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 +// will change when the set of required properties is changed +func NewDeployContractV1Response(transactionReceipt Web3TransactionReceipt) *DeployContractV1Response { + this := DeployContractV1Response{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewDeployContractV1ResponseWithDefaults instantiates a new DeployContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractV1ResponseWithDefaults() *DeployContractV1Response { + this := DeployContractV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *DeployContractV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *DeployContractV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *DeployContractV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o DeployContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableDeployContractV1Response struct { + value *DeployContractV1Response + isSet bool +} + +func (v NullableDeployContractV1Response) Get() *DeployContractV1Response { + return v.value +} + +func (v *NullableDeployContractV1Response) Set(val *DeployContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractV1Response(val *DeployContractV1Response) *NullableDeployContractV1Response { + return &NullableDeployContractV1Response{value: val, isSet: true} +} + +func (v NullableDeployContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_request_base_v1.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_request_base_v1.go new file mode 100644 index 00000000000..34ab5467c26 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_deploy_request_base_v1.go @@ -0,0 +1,293 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the DeployRequestBaseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployRequestBaseV1{} + +// DeployRequestBaseV1 struct for DeployRequestBaseV1 +type DeployRequestBaseV1 struct { + ContractJSON ContractJSON `json:"contractJSON"` + ConstructorArgs []interface{} `json:"constructorArgs,omitempty"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + Gas *XdaiTransactionConfigFrom `json:"gas,omitempty"` + GasPrice *XdaiTransactionConfigFrom `json:"gasPrice,omitempty"` + // The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + TimeoutMs *float32 `json:"timeoutMs,omitempty"` +} + +// NewDeployRequestBaseV1 instantiates a new DeployRequestBaseV1 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 +// will change when the set of required properties is changed +func NewDeployRequestBaseV1(contractJSON ContractJSON, web3SigningCredential Web3SigningCredential) *DeployRequestBaseV1 { + this := DeployRequestBaseV1{} + this.ContractJSON = contractJSON + this.Web3SigningCredential = web3SigningCredential + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewDeployRequestBaseV1WithDefaults instantiates a new DeployRequestBaseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployRequestBaseV1WithDefaults() *DeployRequestBaseV1 { + this := DeployRequestBaseV1{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractJSON returns the ContractJSON field value +func (o *DeployRequestBaseV1) GetContractJSON() ContractJSON { + if o == nil { + var ret ContractJSON + return ret + } + + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value +// and a boolean to check if the value has been set. +func (o *DeployRequestBaseV1) GetContractJSONOk() (*ContractJSON, bool) { + if o == nil { + return nil, false + } + return &o.ContractJSON, true +} + +// SetContractJSON sets field value +func (o *DeployRequestBaseV1) SetContractJSON(v ContractJSON) { + o.ContractJSON = v +} + +// GetConstructorArgs returns the ConstructorArgs field value if set, zero value otherwise. +func (o *DeployRequestBaseV1) GetConstructorArgs() []interface{} { + if o == nil || IsNil(o.ConstructorArgs) { + var ret []interface{} + return ret + } + return o.ConstructorArgs +} + +// GetConstructorArgsOk returns a tuple with the ConstructorArgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployRequestBaseV1) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.ConstructorArgs) { + return nil, false + } + return o.ConstructorArgs, true +} + +// HasConstructorArgs returns a boolean if a field has been set. +func (o *DeployRequestBaseV1) HasConstructorArgs() bool { + if o != nil && !IsNil(o.ConstructorArgs) { + return true + } + + return false +} + +// SetConstructorArgs gets a reference to the given []interface{} and assigns it to the ConstructorArgs field. +func (o *DeployRequestBaseV1) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployRequestBaseV1) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *DeployRequestBaseV1) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployRequestBaseV1) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *DeployRequestBaseV1) GetGas() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Gas) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployRequestBaseV1) GetGasOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *DeployRequestBaseV1) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Gas field. +func (o *DeployRequestBaseV1) SetGas(v XdaiTransactionConfigFrom) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *DeployRequestBaseV1) GetGasPrice() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.GasPrice) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployRequestBaseV1) GetGasPriceOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *DeployRequestBaseV1) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given XdaiTransactionConfigFrom and assigns it to the GasPrice field. +func (o *DeployRequestBaseV1) SetGasPrice(v XdaiTransactionConfigFrom) { + o.GasPrice = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *DeployRequestBaseV1) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployRequestBaseV1) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *DeployRequestBaseV1) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *DeployRequestBaseV1) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +func (o DeployRequestBaseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployRequestBaseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractJSON"] = o.ContractJSON + if !IsNil(o.ConstructorArgs) { + toSerialize["constructorArgs"] = o.ConstructorArgs + } + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + return toSerialize, nil +} + +type NullableDeployRequestBaseV1 struct { + value *DeployRequestBaseV1 + isSet bool +} + +func (v NullableDeployRequestBaseV1) Get() *DeployRequestBaseV1 { + return v.value +} + +func (v *NullableDeployRequestBaseV1) Set(val *DeployRequestBaseV1) { + v.value = val + v.isSet = true +} + +func (v NullableDeployRequestBaseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployRequestBaseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployRequestBaseV1(val *DeployRequestBaseV1) *NullableDeployRequestBaseV1 { + return &NullableDeployRequestBaseV1{value: val, isSet: true} +} + +func (v NullableDeployRequestBaseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployRequestBaseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go new file mode 100644 index 00000000000..d5474c0a251 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_eth_contract_invocation_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" + "fmt" +) + +// EthContractInvocationType the model 'EthContractInvocationType' +type EthContractInvocationType string + +// List of EthContractInvocationType +const ( + SEND EthContractInvocationType = "SEND" + CALL EthContractInvocationType = "CALL" +) + +// All allowed values of EthContractInvocationType enum +var AllowedEthContractInvocationTypeEnumValues = []EthContractInvocationType{ + "SEND", + "CALL", +} + +func (v *EthContractInvocationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EthContractInvocationType(value) + for _, existing := range AllowedEthContractInvocationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EthContractInvocationType", value) +} + +// NewEthContractInvocationTypeFromValue returns a pointer to a valid EthContractInvocationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEthContractInvocationTypeFromValue(v string) (*EthContractInvocationType, error) { + ev := EthContractInvocationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EthContractInvocationType: valid values are %v", v, AllowedEthContractInvocationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EthContractInvocationType) IsValid() bool { + for _, existing := range AllowedEthContractInvocationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EthContractInvocationType value +func (v EthContractInvocationType) Ptr() *EthContractInvocationType { + return &v +} + +type NullableEthContractInvocationType struct { + value *EthContractInvocationType + isSet bool +} + +func (v NullableEthContractInvocationType) Get() *EthContractInvocationType { + return v.value +} + +func (v *NullableEthContractInvocationType) Set(val *EthContractInvocationType) { + v.value = val + v.isSet = true +} + +func (v NullableEthContractInvocationType) IsSet() bool { + return v.isSet +} + +func (v *NullableEthContractInvocationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEthContractInvocationType(val *EthContractInvocationType) *NullableEthContractInvocationType { + return &NullableEthContractInvocationType{value: val, isSet: true} +} + +func (v NullableEthContractInvocationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEthContractInvocationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go new file mode 100644 index 00000000000..8073b34015e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_json_object_v1_request.go @@ -0,0 +1,440 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the InvokeContractJsonObjectV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractJsonObjectV1Request{} + +// InvokeContractJsonObjectV1Request struct for InvokeContractJsonObjectV1Request +type InvokeContractJsonObjectV1Request struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + InvocationType EthContractInvocationType `json:"invocationType"` + // The name of the contract method to invoke. + MethodName string `json:"methodName"` + // The list of arguments to pass in to the contract method being invoked. + Params []interface{} `json:"params"` + // Address of the solidity contract + ContractAddress string `json:"contractAddress"` + Value *XdaiTransactionConfigFrom `json:"value,omitempty"` + Gas *XdaiTransactionConfigFrom `json:"gas,omitempty"` + GasPrice *XdaiTransactionConfigFrom `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + // The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + ContractJSON ContractJSON `json:"contractJSON"` +} + +// NewInvokeContractJsonObjectV1Request instantiates a new InvokeContractJsonObjectV1Request 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 +// will change when the set of required properties is changed +func NewInvokeContractJsonObjectV1Request(web3SigningCredential Web3SigningCredential, invocationType EthContractInvocationType, methodName string, params []interface{}, contractAddress string, contractJSON ContractJSON) *InvokeContractJsonObjectV1Request { + this := InvokeContractJsonObjectV1Request{} + this.Web3SigningCredential = web3SigningCredential + this.InvocationType = invocationType + this.MethodName = methodName + this.Params = params + this.ContractAddress = contractAddress + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + this.ContractJSON = contractJSON + return &this +} + +// NewInvokeContractJsonObjectV1RequestWithDefaults instantiates a new InvokeContractJsonObjectV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractJsonObjectV1RequestWithDefaults() *InvokeContractJsonObjectV1Request { + this := InvokeContractJsonObjectV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *InvokeContractJsonObjectV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *InvokeContractJsonObjectV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeContractJsonObjectV1Request) GetInvocationType() EthContractInvocationType { + if o == nil { + var ret EthContractInvocationType + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetInvocationTypeOk() (*EthContractInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeContractJsonObjectV1Request) SetInvocationType(v EthContractInvocationType) { + o.InvocationType = v +} + +// GetMethodName returns the MethodName field value +func (o *InvokeContractJsonObjectV1Request) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeContractJsonObjectV1Request) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value +func (o *InvokeContractJsonObjectV1Request) GetParams() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetParamsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *InvokeContractJsonObjectV1Request) SetParams(v []interface{}) { + o.Params = v +} + +// GetContractAddress returns the ContractAddress field value +func (o *InvokeContractJsonObjectV1Request) GetContractAddress() string { + if o == nil { + var ret string + return ret + } + + return o.ContractAddress +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractAddress, true +} + +// SetContractAddress sets field value +func (o *InvokeContractJsonObjectV1Request) SetContractAddress(v string) { + o.ContractAddress = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetValue() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Value) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetValueOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Value field. +func (o *InvokeContractJsonObjectV1Request) SetValue(v XdaiTransactionConfigFrom) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetGas() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Gas) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetGasOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Gas field. +func (o *InvokeContractJsonObjectV1Request) SetGas(v XdaiTransactionConfigFrom) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetGasPrice() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.GasPrice) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetGasPriceOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given XdaiTransactionConfigFrom and assigns it to the GasPrice field. +func (o *InvokeContractJsonObjectV1Request) SetGasPrice(v XdaiTransactionConfigFrom) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *InvokeContractJsonObjectV1Request) SetNonce(v float32) { + o.Nonce = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *InvokeContractJsonObjectV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *InvokeContractJsonObjectV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *InvokeContractJsonObjectV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetContractJSON returns the ContractJSON field value +func (o *InvokeContractJsonObjectV1Request) GetContractJSON() ContractJSON { + if o == nil { + var ret ContractJSON + return ret + } + + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value +// and a boolean to check if the value has been set. +func (o *InvokeContractJsonObjectV1Request) GetContractJSONOk() (*ContractJSON, bool) { + if o == nil { + return nil, false + } + return &o.ContractJSON, true +} + +// SetContractJSON sets field value +func (o *InvokeContractJsonObjectV1Request) SetContractJSON(v ContractJSON) { + o.ContractJSON = v +} + +func (o InvokeContractJsonObjectV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractJsonObjectV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["invocationType"] = o.InvocationType + toSerialize["methodName"] = o.MethodName + toSerialize["params"] = o.Params + toSerialize["contractAddress"] = o.ContractAddress + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["contractJSON"] = o.ContractJSON + return toSerialize, nil +} + +type NullableInvokeContractJsonObjectV1Request struct { + value *InvokeContractJsonObjectV1Request + isSet bool +} + +func (v NullableInvokeContractJsonObjectV1Request) Get() *InvokeContractJsonObjectV1Request { + return v.value +} + +func (v *NullableInvokeContractJsonObjectV1Request) Set(val *InvokeContractJsonObjectV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractJsonObjectV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractJsonObjectV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractJsonObjectV1Request(val *InvokeContractJsonObjectV1Request) *NullableInvokeContractJsonObjectV1Request { + return &NullableInvokeContractJsonObjectV1Request{value: val, isSet: true} +} + +func (v NullableInvokeContractJsonObjectV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractJsonObjectV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go new file mode 100644 index 00000000000..818fc0df7ba --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_request.go @@ -0,0 +1,441 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Request{} + +// InvokeContractV1Request struct for InvokeContractV1Request +type InvokeContractV1Request struct { + // The contract name to find it in the keychain plugin + ContractName string `json:"contractName"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + InvocationType EthContractInvocationType `json:"invocationType"` + // The name of the contract method to invoke. + MethodName string `json:"methodName"` + // The list of arguments to pass in to the contract method being invoked. + Params []interface{} `json:"params"` + Value *XdaiTransactionConfigFrom `json:"value,omitempty"` + Gas *XdaiTransactionConfigFrom `json:"gas,omitempty"` + GasPrice *XdaiTransactionConfigFrom `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + // The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + // The keychainId for retrieve the contracts json. + KeychainId string `json:"keychainId"` +} + +// NewInvokeContractV1Request instantiates a new InvokeContractV1Request 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 +// will change when the set of required properties is changed +func NewInvokeContractV1Request(contractName string, web3SigningCredential Web3SigningCredential, invocationType EthContractInvocationType, methodName string, params []interface{}, keychainId string) *InvokeContractV1Request { + this := InvokeContractV1Request{} + this.ContractName = contractName + this.Web3SigningCredential = web3SigningCredential + this.InvocationType = invocationType + this.MethodName = methodName + this.Params = params + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + this.KeychainId = keychainId + return &this +} + +// NewInvokeContractV1RequestWithDefaults instantiates a new InvokeContractV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1RequestWithDefaults() *InvokeContractV1Request { + this := InvokeContractV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractName returns the ContractName field value +func (o *InvokeContractV1Request) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *InvokeContractV1Request) SetContractName(v string) { + o.ContractName = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *InvokeContractV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *InvokeContractV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeContractV1Request) GetInvocationType() EthContractInvocationType { + if o == nil { + var ret EthContractInvocationType + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetInvocationTypeOk() (*EthContractInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeContractV1Request) SetInvocationType(v EthContractInvocationType) { + o.InvocationType = v +} + +// GetMethodName returns the MethodName field value +func (o *InvokeContractV1Request) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeContractV1Request) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value +func (o *InvokeContractV1Request) GetParams() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetParamsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *InvokeContractV1Request) SetParams(v []interface{}) { + o.Params = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetValue() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Value) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetValueOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Value field. +func (o *InvokeContractV1Request) SetValue(v XdaiTransactionConfigFrom) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetGas() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Gas) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetGasOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Gas field. +func (o *InvokeContractV1Request) SetGas(v XdaiTransactionConfigFrom) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetGasPrice() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.GasPrice) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetGasPriceOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given XdaiTransactionConfigFrom and assigns it to the GasPrice field. +func (o *InvokeContractV1Request) SetGasPrice(v XdaiTransactionConfigFrom) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *InvokeContractV1Request) SetNonce(v float32) { + o.Nonce = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *InvokeContractV1Request) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *InvokeContractV1Request) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *InvokeContractV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetKeychainId returns the KeychainId field value +func (o *InvokeContractV1Request) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Request) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *InvokeContractV1Request) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o InvokeContractV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["invocationType"] = o.InvocationType + toSerialize["methodName"] = o.MethodName + toSerialize["params"] = o.Params + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableInvokeContractV1Request struct { + value *InvokeContractV1Request + isSet bool +} + +func (v NullableInvokeContractV1Request) Get() *InvokeContractV1Request { + return v.value +} + +func (v *NullableInvokeContractV1Request) Set(val *InvokeContractV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Request(val *InvokeContractV1Request) *NullableInvokeContractV1Request { + return &NullableInvokeContractV1Request{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go new file mode 100644 index 00000000000..73590f436bc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_contract_v1_response.go @@ -0,0 +1,190 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the InvokeContractV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractV1Response{} + +// InvokeContractV1Response struct for InvokeContractV1Response +type InvokeContractV1Response struct { + TransactionReceipt *Web3TransactionReceipt `json:"transactionReceipt,omitempty"` + CallOutput interface{} `json:"callOutput,omitempty"` + Success bool `json:"success"` +} + +// NewInvokeContractV1Response instantiates a new InvokeContractV1Response 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 +// will change when the set of required properties is changed +func NewInvokeContractV1Response(success bool) *InvokeContractV1Response { + this := InvokeContractV1Response{} + this.Success = success + return &this +} + +// NewInvokeContractV1ResponseWithDefaults instantiates a new InvokeContractV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractV1ResponseWithDefaults() *InvokeContractV1Response { + this := InvokeContractV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value if set, zero value otherwise. +func (o *InvokeContractV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil || IsNil(o.TransactionReceipt) { + var ret Web3TransactionReceipt + return ret + } + return *o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil || IsNil(o.TransactionReceipt) { + return nil, false + } + return o.TransactionReceipt, true +} + +// HasTransactionReceipt returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasTransactionReceipt() bool { + if o != nil && !IsNil(o.TransactionReceipt) { + return true + } + + return false +} + +// SetTransactionReceipt gets a reference to the given Web3TransactionReceipt and assigns it to the TransactionReceipt field. +func (o *InvokeContractV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = &v +} + +// GetCallOutput returns the CallOutput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeContractV1Response) GetCallOutput() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.CallOutput +} + +// GetCallOutputOk returns a tuple with the CallOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvokeContractV1Response) GetCallOutputOk() (*interface{}, bool) { + if o == nil || IsNil(o.CallOutput) { + return nil, false + } + return &o.CallOutput, true +} + +// HasCallOutput returns a boolean if a field has been set. +func (o *InvokeContractV1Response) HasCallOutput() bool { + if o != nil && IsNil(o.CallOutput) { + return true + } + + return false +} + +// SetCallOutput gets a reference to the given interface{} and assigns it to the CallOutput field. +func (o *InvokeContractV1Response) SetCallOutput(v interface{}) { + o.CallOutput = v +} + +// GetSuccess returns the Success field value +func (o *InvokeContractV1Response) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *InvokeContractV1Response) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *InvokeContractV1Response) SetSuccess(v bool) { + o.Success = v +} + +func (o InvokeContractV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TransactionReceipt) { + toSerialize["transactionReceipt"] = o.TransactionReceipt + } + if o.CallOutput != nil { + toSerialize["callOutput"] = o.CallOutput + } + toSerialize["success"] = o.Success + return toSerialize, nil +} + +type NullableInvokeContractV1Response struct { + value *InvokeContractV1Response + isSet bool +} + +func (v NullableInvokeContractV1Response) Get() *InvokeContractV1Response { + return v.value +} + +func (v *NullableInvokeContractV1Response) Set(val *InvokeContractV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractV1Response(val *InvokeContractV1Response) *NullableInvokeContractV1Response { + return &NullableInvokeContractV1Response{value: val, isSet: true} +} + +func (v NullableInvokeContractV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_request_base_v1.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_request_base_v1.go new file mode 100644 index 00000000000..cd14765c8ac --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_invoke_request_base_v1.go @@ -0,0 +1,440 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the InvokeRequestBaseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeRequestBaseV1{} + +// InvokeRequestBaseV1 struct for InvokeRequestBaseV1 +type InvokeRequestBaseV1 struct { + // Address of the solidity contract + ContractAddress string `json:"contractAddress"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + InvocationType EthContractInvocationType `json:"invocationType"` + // The name of the contract method to invoke. + MethodName string `json:"methodName"` + // The list of arguments to pass in to the contract method being invoked. + Params []interface{} `json:"params"` + Value *XdaiTransactionConfigFrom `json:"value,omitempty"` + Gas *XdaiTransactionConfigFrom `json:"gas,omitempty"` + GasPrice *XdaiTransactionConfigFrom `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + // The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + TimeoutMs *float32 `json:"timeoutMs,omitempty"` + ContractJSON ContractJSON `json:"contractJSON"` +} + +// NewInvokeRequestBaseV1 instantiates a new InvokeRequestBaseV1 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 +// will change when the set of required properties is changed +func NewInvokeRequestBaseV1(contractAddress string, web3SigningCredential Web3SigningCredential, invocationType EthContractInvocationType, methodName string, params []interface{}, contractJSON ContractJSON) *InvokeRequestBaseV1 { + this := InvokeRequestBaseV1{} + this.ContractAddress = contractAddress + this.Web3SigningCredential = web3SigningCredential + this.InvocationType = invocationType + this.MethodName = methodName + this.Params = params + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + this.ContractJSON = contractJSON + return &this +} + +// NewInvokeRequestBaseV1WithDefaults instantiates a new InvokeRequestBaseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeRequestBaseV1WithDefaults() *InvokeRequestBaseV1 { + this := InvokeRequestBaseV1{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractAddress returns the ContractAddress field value +func (o *InvokeRequestBaseV1) GetContractAddress() string { + if o == nil { + var ret string + return ret + } + + return o.ContractAddress +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractAddress, true +} + +// SetContractAddress sets field value +func (o *InvokeRequestBaseV1) SetContractAddress(v string) { + o.ContractAddress = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *InvokeRequestBaseV1) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *InvokeRequestBaseV1) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeRequestBaseV1) GetInvocationType() EthContractInvocationType { + if o == nil { + var ret EthContractInvocationType + return ret + } + + return o.InvocationType +} + +// GetInvocationTypeOk returns a tuple with the InvocationType field value +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetInvocationTypeOk() (*EthContractInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeRequestBaseV1) SetInvocationType(v EthContractInvocationType) { + o.InvocationType = v +} + +// GetMethodName returns the MethodName field value +func (o *InvokeRequestBaseV1) GetMethodName() string { + if o == nil { + var ret string + return ret + } + + return o.MethodName +} + +// GetMethodNameOk returns a tuple with the MethodName field value +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeRequestBaseV1) SetMethodName(v string) { + o.MethodName = v +} + +// GetParams returns the Params field value +func (o *InvokeRequestBaseV1) GetParams() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetParamsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Params, true +} + +// SetParams sets field value +func (o *InvokeRequestBaseV1) SetParams(v []interface{}) { + o.Params = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *InvokeRequestBaseV1) GetValue() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Value) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetValueOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *InvokeRequestBaseV1) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Value field. +func (o *InvokeRequestBaseV1) SetValue(v XdaiTransactionConfigFrom) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *InvokeRequestBaseV1) GetGas() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Gas) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetGasOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *InvokeRequestBaseV1) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Gas field. +func (o *InvokeRequestBaseV1) SetGas(v XdaiTransactionConfigFrom) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *InvokeRequestBaseV1) GetGasPrice() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.GasPrice) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetGasPriceOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *InvokeRequestBaseV1) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given XdaiTransactionConfigFrom and assigns it to the GasPrice field. +func (o *InvokeRequestBaseV1) SetGasPrice(v XdaiTransactionConfigFrom) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *InvokeRequestBaseV1) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *InvokeRequestBaseV1) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *InvokeRequestBaseV1) SetNonce(v float32) { + o.Nonce = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *InvokeRequestBaseV1) GetTimeoutMs() float32 { + if o == nil || IsNil(o.TimeoutMs) { + var ret float32 + return ret + } + return *o.TimeoutMs +} + +// GetTimeoutMsOk returns a tuple with the TimeoutMs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetTimeoutMsOk() (*float32, bool) { + if o == nil || IsNil(o.TimeoutMs) { + return nil, false + } + return o.TimeoutMs, true +} + +// HasTimeoutMs returns a boolean if a field has been set. +func (o *InvokeRequestBaseV1) HasTimeoutMs() bool { + if o != nil && !IsNil(o.TimeoutMs) { + return true + } + + return false +} + +// SetTimeoutMs gets a reference to the given float32 and assigns it to the TimeoutMs field. +func (o *InvokeRequestBaseV1) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetContractJSON returns the ContractJSON field value +func (o *InvokeRequestBaseV1) GetContractJSON() ContractJSON { + if o == nil { + var ret ContractJSON + return ret + } + + return o.ContractJSON +} + +// GetContractJSONOk returns a tuple with the ContractJSON field value +// and a boolean to check if the value has been set. +func (o *InvokeRequestBaseV1) GetContractJSONOk() (*ContractJSON, bool) { + if o == nil { + return nil, false + } + return &o.ContractJSON, true +} + +// SetContractJSON sets field value +func (o *InvokeRequestBaseV1) SetContractJSON(v ContractJSON) { + o.ContractJSON = v +} + +func (o InvokeRequestBaseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeRequestBaseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractAddress"] = o.ContractAddress + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["invocationType"] = o.InvocationType + toSerialize["methodName"] = o.MethodName + toSerialize["params"] = o.Params + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.TimeoutMs) { + toSerialize["timeoutMs"] = o.TimeoutMs + } + toSerialize["contractJSON"] = o.ContractJSON + return toSerialize, nil +} + +type NullableInvokeRequestBaseV1 struct { + value *InvokeRequestBaseV1 + isSet bool +} + +func (v NullableInvokeRequestBaseV1) Get() *InvokeRequestBaseV1 { + return v.value +} + +func (v *NullableInvokeRequestBaseV1) Set(val *InvokeRequestBaseV1) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeRequestBaseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeRequestBaseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeRequestBaseV1(val *InvokeRequestBaseV1) *NullableInvokeRequestBaseV1 { + return &NullableInvokeRequestBaseV1{value: val, isSet: true} +} + +func (v NullableInvokeRequestBaseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeRequestBaseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_receipt_type.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_receipt_type.go new file mode 100644 index 00000000000..40936813b79 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_receipt_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" + "fmt" +) + +// ReceiptType Enumerates the possible types of receipts that can be waited for by someone or something that has requested the execution of a transaction on a ledger. +type ReceiptType string + +// List of ReceiptType +const ( + NODE_TX_POOL_ACK ReceiptType = "NODE_TX_POOL_ACK" + LEDGER_BLOCK_ACK ReceiptType = "LEDGER_BLOCK_ACK" +) + +// All allowed values of ReceiptType enum +var AllowedReceiptTypeEnumValues = []ReceiptType{ + "NODE_TX_POOL_ACK", + "LEDGER_BLOCK_ACK", +} + +func (v *ReceiptType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ReceiptType(value) + for _, existing := range AllowedReceiptTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ReceiptType", value) +} + +// NewReceiptTypeFromValue returns a pointer to a valid ReceiptType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewReceiptTypeFromValue(v string) (*ReceiptType, error) { + ev := ReceiptType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ReceiptType: valid values are %v", v, AllowedReceiptTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ReceiptType) IsValid() bool { + for _, existing := range AllowedReceiptTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ReceiptType value +func (v ReceiptType) Ptr() *ReceiptType { + return &v +} + +type NullableReceiptType struct { + value *ReceiptType + isSet bool +} + +func (v NullableReceiptType) Get() *ReceiptType { + return v.value +} + +func (v *NullableReceiptType) Set(val *ReceiptType) { + v.value = val + v.isSet = true +} + +func (v NullableReceiptType) IsSet() bool { + return v.isSet +} + +func (v *NullableReceiptType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReceiptType(val *ReceiptType) *NullableReceiptType { + return &NullableReceiptType{value: val, isSet: true} +} + +func (v NullableReceiptType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReceiptType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_run_transaction_v1_request.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_run_transaction_v1_request.go new file mode 100644 index 00000000000..01e13ddaecb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_run_transaction_v1_request.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the RunTransactionV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionV1Request{} + +// RunTransactionV1Request struct for RunTransactionV1Request +type RunTransactionV1Request struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + TransactionConfig XdaiTransactionConfig `json:"transactionConfig"` + ConsistencyStrategy ConsistencyStrategy `json:"consistencyStrategy"` +} + +// NewRunTransactionV1Request instantiates a new RunTransactionV1Request 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 +// will change when the set of required properties is changed +func NewRunTransactionV1Request(web3SigningCredential Web3SigningCredential, transactionConfig XdaiTransactionConfig, consistencyStrategy ConsistencyStrategy) *RunTransactionV1Request { + this := RunTransactionV1Request{} + this.Web3SigningCredential = web3SigningCredential + this.TransactionConfig = transactionConfig + this.ConsistencyStrategy = consistencyStrategy + return &this +} + +// NewRunTransactionV1RequestWithDefaults instantiates a new RunTransactionV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionV1RequestWithDefaults() *RunTransactionV1Request { + this := RunTransactionV1Request{} + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *RunTransactionV1Request) GetWeb3SigningCredential() Web3SigningCredential { + if o == nil { + var ret Web3SigningCredential + return ret + } + + return o.Web3SigningCredential +} + +// GetWeb3SigningCredentialOk returns a tuple with the Web3SigningCredential field value +// and a boolean to check if the value has been set. +func (o *RunTransactionV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *RunTransactionV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetTransactionConfig returns the TransactionConfig field value +func (o *RunTransactionV1Request) GetTransactionConfig() XdaiTransactionConfig { + if o == nil { + var ret XdaiTransactionConfig + return ret + } + + return o.TransactionConfig +} + +// GetTransactionConfigOk returns a tuple with the TransactionConfig field value +// and a boolean to check if the value has been set. +func (o *RunTransactionV1Request) GetTransactionConfigOk() (*XdaiTransactionConfig, bool) { + if o == nil { + return nil, false + } + return &o.TransactionConfig, true +} + +// SetTransactionConfig sets field value +func (o *RunTransactionV1Request) SetTransactionConfig(v XdaiTransactionConfig) { + o.TransactionConfig = v +} + +// GetConsistencyStrategy returns the ConsistencyStrategy field value +func (o *RunTransactionV1Request) GetConsistencyStrategy() ConsistencyStrategy { + if o == nil { + var ret ConsistencyStrategy + return ret + } + + return o.ConsistencyStrategy +} + +// GetConsistencyStrategyOk returns a tuple with the ConsistencyStrategy field value +// and a boolean to check if the value has been set. +func (o *RunTransactionV1Request) GetConsistencyStrategyOk() (*ConsistencyStrategy, bool) { + if o == nil { + return nil, false + } + return &o.ConsistencyStrategy, true +} + +// SetConsistencyStrategy sets field value +func (o *RunTransactionV1Request) SetConsistencyStrategy(v ConsistencyStrategy) { + o.ConsistencyStrategy = v +} + +func (o RunTransactionV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["transactionConfig"] = o.TransactionConfig + toSerialize["consistencyStrategy"] = o.ConsistencyStrategy + return toSerialize, nil +} + +type NullableRunTransactionV1Request struct { + value *RunTransactionV1Request + isSet bool +} + +func (v NullableRunTransactionV1Request) Get() *RunTransactionV1Request { + return v.value +} + +func (v *NullableRunTransactionV1Request) Set(val *RunTransactionV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionV1Request(val *RunTransactionV1Request) *NullableRunTransactionV1Request { + return &NullableRunTransactionV1Request{value: val, isSet: true} +} + +func (v NullableRunTransactionV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_run_transaction_v1_response.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_run_transaction_v1_response.go new file mode 100644 index 00000000000..e16edabda17 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_run_transaction_v1_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the RunTransactionV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunTransactionV1Response{} + +// RunTransactionV1Response struct for RunTransactionV1Response +type RunTransactionV1Response struct { + TransactionReceipt Web3TransactionReceipt `json:"transactionReceipt"` +} + +// NewRunTransactionV1Response instantiates a new RunTransactionV1Response 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 +// will change when the set of required properties is changed +func NewRunTransactionV1Response(transactionReceipt Web3TransactionReceipt) *RunTransactionV1Response { + this := RunTransactionV1Response{} + this.TransactionReceipt = transactionReceipt + return &this +} + +// NewRunTransactionV1ResponseWithDefaults instantiates a new RunTransactionV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunTransactionV1ResponseWithDefaults() *RunTransactionV1Response { + this := RunTransactionV1Response{} + return &this +} + +// GetTransactionReceipt returns the TransactionReceipt field value +func (o *RunTransactionV1Response) GetTransactionReceipt() Web3TransactionReceipt { + if o == nil { + var ret Web3TransactionReceipt + return ret + } + + return o.TransactionReceipt +} + +// GetTransactionReceiptOk returns a tuple with the TransactionReceipt field value +// and a boolean to check if the value has been set. +func (o *RunTransactionV1Response) GetTransactionReceiptOk() (*Web3TransactionReceipt, bool) { + if o == nil { + return nil, false + } + return &o.TransactionReceipt, true +} + +// SetTransactionReceipt sets field value +func (o *RunTransactionV1Response) SetTransactionReceipt(v Web3TransactionReceipt) { + o.TransactionReceipt = v +} + +func (o RunTransactionV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunTransactionV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["transactionReceipt"] = o.TransactionReceipt + return toSerialize, nil +} + +type NullableRunTransactionV1Response struct { + value *RunTransactionV1Response + isSet bool +} + +func (v NullableRunTransactionV1Response) Get() *RunTransactionV1Response { + return v.value +} + +func (v *NullableRunTransactionV1Response) Set(val *RunTransactionV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableRunTransactionV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableRunTransactionV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunTransactionV1Response(val *RunTransactionV1Response) *NullableRunTransactionV1Response { + return &NullableRunTransactionV1Response{value: val, isSet: true} +} + +func (v NullableRunTransactionV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunTransactionV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go new file mode 100644 index 00000000000..89c4e0c4be7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact.go @@ -0,0 +1,441 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifact type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifact{} + +// SolidityContractJsonArtifact struct for SolidityContractJsonArtifact +type SolidityContractJsonArtifact struct { + ContractName string `json:"contractName"` + Metadata *string `json:"metadata,omitempty"` + Bytecode *string `json:"bytecode,omitempty"` + DeployedBytecode *string `json:"deployedBytecode,omitempty"` + SourceMap *string `json:"sourceMap,omitempty"` + DeployedSourceMap *string `json:"deployedSourceMap,omitempty"` + SourcePath *string `json:"sourcePath,omitempty"` + Compiler *SolidityContractJsonArtifactCompiler `json:"compiler,omitempty"` + FunctionHashes map[string]interface{} `json:"functionHashes,omitempty"` + GasEstimates *SolidityContractJsonArtifactGasEstimates `json:"gasEstimates,omitempty"` +} + +// NewSolidityContractJsonArtifact instantiates a new SolidityContractJsonArtifact 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 +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifact(contractName string) *SolidityContractJsonArtifact { + this := SolidityContractJsonArtifact{} + this.ContractName = contractName + return &this +} + +// NewSolidityContractJsonArtifactWithDefaults instantiates a new SolidityContractJsonArtifact object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactWithDefaults() *SolidityContractJsonArtifact { + this := SolidityContractJsonArtifact{} + return &this +} + +// GetContractName returns the ContractName field value +func (o *SolidityContractJsonArtifact) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *SolidityContractJsonArtifact) SetContractName(v string) { + o.ContractName = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetMetadata() string { + if o == nil || IsNil(o.Metadata) { + var ret string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetMetadataOk() (*string, bool) { + if o == nil || IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given string and assigns it to the Metadata field. +func (o *SolidityContractJsonArtifact) SetMetadata(v string) { + o.Metadata = &v +} + +// GetBytecode returns the Bytecode field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetBytecode() string { + if o == nil || IsNil(o.Bytecode) { + var ret string + return ret + } + return *o.Bytecode +} + +// GetBytecodeOk returns a tuple with the Bytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.Bytecode) { + return nil, false + } + return o.Bytecode, true +} + +// HasBytecode returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasBytecode() bool { + if o != nil && !IsNil(o.Bytecode) { + return true + } + + return false +} + +// SetBytecode gets a reference to the given string and assigns it to the Bytecode field. +func (o *SolidityContractJsonArtifact) SetBytecode(v string) { + o.Bytecode = &v +} + +// GetDeployedBytecode returns the DeployedBytecode field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetDeployedBytecode() string { + if o == nil || IsNil(o.DeployedBytecode) { + var ret string + return ret + } + return *o.DeployedBytecode +} + +// GetDeployedBytecodeOk returns a tuple with the DeployedBytecode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetDeployedBytecodeOk() (*string, bool) { + if o == nil || IsNil(o.DeployedBytecode) { + return nil, false + } + return o.DeployedBytecode, true +} + +// HasDeployedBytecode returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasDeployedBytecode() bool { + if o != nil && !IsNil(o.DeployedBytecode) { + return true + } + + return false +} + +// SetDeployedBytecode gets a reference to the given string and assigns it to the DeployedBytecode field. +func (o *SolidityContractJsonArtifact) SetDeployedBytecode(v string) { + o.DeployedBytecode = &v +} + +// GetSourceMap returns the SourceMap field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetSourceMap() string { + if o == nil || IsNil(o.SourceMap) { + var ret string + return ret + } + return *o.SourceMap +} + +// GetSourceMapOk returns a tuple with the SourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.SourceMap) { + return nil, false + } + return o.SourceMap, true +} + +// HasSourceMap returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasSourceMap() bool { + if o != nil && !IsNil(o.SourceMap) { + return true + } + + return false +} + +// SetSourceMap gets a reference to the given string and assigns it to the SourceMap field. +func (o *SolidityContractJsonArtifact) SetSourceMap(v string) { + o.SourceMap = &v +} + +// GetDeployedSourceMap returns the DeployedSourceMap field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetDeployedSourceMap() string { + if o == nil || IsNil(o.DeployedSourceMap) { + var ret string + return ret + } + return *o.DeployedSourceMap +} + +// GetDeployedSourceMapOk returns a tuple with the DeployedSourceMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetDeployedSourceMapOk() (*string, bool) { + if o == nil || IsNil(o.DeployedSourceMap) { + return nil, false + } + return o.DeployedSourceMap, true +} + +// HasDeployedSourceMap returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasDeployedSourceMap() bool { + if o != nil && !IsNil(o.DeployedSourceMap) { + return true + } + + return false +} + +// SetDeployedSourceMap gets a reference to the given string and assigns it to the DeployedSourceMap field. +func (o *SolidityContractJsonArtifact) SetDeployedSourceMap(v string) { + o.DeployedSourceMap = &v +} + +// GetSourcePath returns the SourcePath field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetSourcePath() string { + if o == nil || IsNil(o.SourcePath) { + var ret string + return ret + } + return *o.SourcePath +} + +// GetSourcePathOk returns a tuple with the SourcePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetSourcePathOk() (*string, bool) { + if o == nil || IsNil(o.SourcePath) { + return nil, false + } + return o.SourcePath, true +} + +// HasSourcePath returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasSourcePath() bool { + if o != nil && !IsNil(o.SourcePath) { + return true + } + + return false +} + +// SetSourcePath gets a reference to the given string and assigns it to the SourcePath field. +func (o *SolidityContractJsonArtifact) SetSourcePath(v string) { + o.SourcePath = &v +} + +// GetCompiler returns the Compiler field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetCompiler() SolidityContractJsonArtifactCompiler { + if o == nil || IsNil(o.Compiler) { + var ret SolidityContractJsonArtifactCompiler + return ret + } + return *o.Compiler +} + +// GetCompilerOk returns a tuple with the Compiler field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetCompilerOk() (*SolidityContractJsonArtifactCompiler, bool) { + if o == nil || IsNil(o.Compiler) { + return nil, false + } + return o.Compiler, true +} + +// HasCompiler returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasCompiler() bool { + if o != nil && !IsNil(o.Compiler) { + return true + } + + return false +} + +// SetCompiler gets a reference to the given SolidityContractJsonArtifactCompiler and assigns it to the Compiler field. +func (o *SolidityContractJsonArtifact) SetCompiler(v SolidityContractJsonArtifactCompiler) { + o.Compiler = &v +} + +// GetFunctionHashes returns the FunctionHashes field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetFunctionHashes() map[string]interface{} { + if o == nil || IsNil(o.FunctionHashes) { + var ret map[string]interface{} + return ret + } + return o.FunctionHashes +} + +// GetFunctionHashesOk returns a tuple with the FunctionHashes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetFunctionHashesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FunctionHashes) { + return map[string]interface{}{}, false + } + return o.FunctionHashes, true +} + +// HasFunctionHashes returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasFunctionHashes() bool { + if o != nil && !IsNil(o.FunctionHashes) { + return true + } + + return false +} + +// SetFunctionHashes gets a reference to the given map[string]interface{} and assigns it to the FunctionHashes field. +func (o *SolidityContractJsonArtifact) SetFunctionHashes(v map[string]interface{}) { + o.FunctionHashes = v +} + +// GetGasEstimates returns the GasEstimates field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifact) GetGasEstimates() SolidityContractJsonArtifactGasEstimates { + if o == nil || IsNil(o.GasEstimates) { + var ret SolidityContractJsonArtifactGasEstimates + return ret + } + return *o.GasEstimates +} + +// GetGasEstimatesOk returns a tuple with the GasEstimates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifact) GetGasEstimatesOk() (*SolidityContractJsonArtifactGasEstimates, bool) { + if o == nil || IsNil(o.GasEstimates) { + return nil, false + } + return o.GasEstimates, true +} + +// HasGasEstimates returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifact) HasGasEstimates() bool { + if o != nil && !IsNil(o.GasEstimates) { + return true + } + + return false +} + +// SetGasEstimates gets a reference to the given SolidityContractJsonArtifactGasEstimates and assigns it to the GasEstimates field. +func (o *SolidityContractJsonArtifact) SetGasEstimates(v SolidityContractJsonArtifactGasEstimates) { + o.GasEstimates = &v +} + +func (o SolidityContractJsonArtifact) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifact) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !IsNil(o.Bytecode) { + toSerialize["bytecode"] = o.Bytecode + } + if !IsNil(o.DeployedBytecode) { + toSerialize["deployedBytecode"] = o.DeployedBytecode + } + if !IsNil(o.SourceMap) { + toSerialize["sourceMap"] = o.SourceMap + } + if !IsNil(o.DeployedSourceMap) { + toSerialize["deployedSourceMap"] = o.DeployedSourceMap + } + if !IsNil(o.SourcePath) { + toSerialize["sourcePath"] = o.SourcePath + } + if !IsNil(o.Compiler) { + toSerialize["compiler"] = o.Compiler + } + if !IsNil(o.FunctionHashes) { + toSerialize["functionHashes"] = o.FunctionHashes + } + if !IsNil(o.GasEstimates) { + toSerialize["gasEstimates"] = o.GasEstimates + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifact struct { + value *SolidityContractJsonArtifact + isSet bool +} + +func (v NullableSolidityContractJsonArtifact) Get() *SolidityContractJsonArtifact { + return v.value +} + +func (v *NullableSolidityContractJsonArtifact) Set(val *SolidityContractJsonArtifact) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifact) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifact) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifact(val *SolidityContractJsonArtifact) *NullableSolidityContractJsonArtifact { + return &NullableSolidityContractJsonArtifact{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifact) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifact) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go new file mode 100644 index 00000000000..faad0b2c0de --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_compiler.go @@ -0,0 +1,188 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactCompiler type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactCompiler{} + +// SolidityContractJsonArtifactCompiler struct for SolidityContractJsonArtifactCompiler +type SolidityContractJsonArtifactCompiler struct { + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SolidityContractJsonArtifactCompiler SolidityContractJsonArtifactCompiler + +// NewSolidityContractJsonArtifactCompiler instantiates a new SolidityContractJsonArtifactCompiler 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 +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactCompiler() *SolidityContractJsonArtifactCompiler { + this := SolidityContractJsonArtifactCompiler{} + return &this +} + +// NewSolidityContractJsonArtifactCompilerWithDefaults instantiates a new SolidityContractJsonArtifactCompiler object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactCompilerWithDefaults() *SolidityContractJsonArtifactCompiler { + this := SolidityContractJsonArtifactCompiler{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactCompiler) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactCompiler) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactCompiler) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SolidityContractJsonArtifactCompiler) SetName(v string) { + o.Name = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactCompiler) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactCompiler) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactCompiler) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *SolidityContractJsonArtifactCompiler) SetVersion(v string) { + o.Version = &v +} + +func (o SolidityContractJsonArtifactCompiler) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactCompiler) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SolidityContractJsonArtifactCompiler) UnmarshalJSON(bytes []byte) (err error) { + varSolidityContractJsonArtifactCompiler := _SolidityContractJsonArtifactCompiler{} + + if err = json.Unmarshal(bytes, &varSolidityContractJsonArtifactCompiler); err == nil { + *o = SolidityContractJsonArtifactCompiler(varSolidityContractJsonArtifactCompiler) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSolidityContractJsonArtifactCompiler struct { + value *SolidityContractJsonArtifactCompiler + isSet bool +} + +func (v NullableSolidityContractJsonArtifactCompiler) Get() *SolidityContractJsonArtifactCompiler { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactCompiler) Set(val *SolidityContractJsonArtifactCompiler) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactCompiler) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactCompiler) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactCompiler(val *SolidityContractJsonArtifactCompiler) *NullableSolidityContractJsonArtifactCompiler { + return &NullableSolidityContractJsonArtifactCompiler{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactCompiler) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactCompiler) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go new file mode 100644 index 00000000000..1c9aecc2a05 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactGasEstimates type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactGasEstimates{} + +// SolidityContractJsonArtifactGasEstimates struct for SolidityContractJsonArtifactGasEstimates +type SolidityContractJsonArtifactGasEstimates struct { + Creation *SolidityContractJsonArtifactGasEstimatesCreation `json:"creation,omitempty"` + External map[string]interface{} `json:"external,omitempty"` +} + +// NewSolidityContractJsonArtifactGasEstimates instantiates a new SolidityContractJsonArtifactGasEstimates 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 +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactGasEstimates() *SolidityContractJsonArtifactGasEstimates { + this := SolidityContractJsonArtifactGasEstimates{} + return &this +} + +// NewSolidityContractJsonArtifactGasEstimatesWithDefaults instantiates a new SolidityContractJsonArtifactGasEstimates object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactGasEstimatesWithDefaults() *SolidityContractJsonArtifactGasEstimates { + this := SolidityContractJsonArtifactGasEstimates{} + return &this +} + +// GetCreation returns the Creation field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimates) GetCreation() SolidityContractJsonArtifactGasEstimatesCreation { + if o == nil || IsNil(o.Creation) { + var ret SolidityContractJsonArtifactGasEstimatesCreation + return ret + } + return *o.Creation +} + +// GetCreationOk returns a tuple with the Creation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimates) GetCreationOk() (*SolidityContractJsonArtifactGasEstimatesCreation, bool) { + if o == nil || IsNil(o.Creation) { + return nil, false + } + return o.Creation, true +} + +// HasCreation returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimates) HasCreation() bool { + if o != nil && !IsNil(o.Creation) { + return true + } + + return false +} + +// SetCreation gets a reference to the given SolidityContractJsonArtifactGasEstimatesCreation and assigns it to the Creation field. +func (o *SolidityContractJsonArtifactGasEstimates) SetCreation(v SolidityContractJsonArtifactGasEstimatesCreation) { + o.Creation = &v +} + +// GetExternal returns the External field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimates) GetExternal() map[string]interface{} { + if o == nil || IsNil(o.External) { + var ret map[string]interface{} + return ret + } + return o.External +} + +// GetExternalOk returns a tuple with the External field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimates) GetExternalOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.External) { + return map[string]interface{}{}, false + } + return o.External, true +} + +// HasExternal returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimates) HasExternal() bool { + if o != nil && !IsNil(o.External) { + return true + } + + return false +} + +// SetExternal gets a reference to the given map[string]interface{} and assigns it to the External field. +func (o *SolidityContractJsonArtifactGasEstimates) SetExternal(v map[string]interface{}) { + o.External = v +} + +func (o SolidityContractJsonArtifactGasEstimates) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactGasEstimates) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Creation) { + toSerialize["creation"] = o.Creation + } + if !IsNil(o.External) { + toSerialize["external"] = o.External + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifactGasEstimates struct { + value *SolidityContractJsonArtifactGasEstimates + isSet bool +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) Get() *SolidityContractJsonArtifactGasEstimates { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) Set(val *SolidityContractJsonArtifactGasEstimates) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactGasEstimates(val *SolidityContractJsonArtifactGasEstimates) *NullableSolidityContractJsonArtifactGasEstimates { + return &NullableSolidityContractJsonArtifactGasEstimates{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactGasEstimates) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactGasEstimates) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go new file mode 100644 index 00000000000..8066fd4de15 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_solidity_contract_json_artifact_gas_estimates_creation.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the SolidityContractJsonArtifactGasEstimatesCreation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SolidityContractJsonArtifactGasEstimatesCreation{} + +// SolidityContractJsonArtifactGasEstimatesCreation struct for SolidityContractJsonArtifactGasEstimatesCreation +type SolidityContractJsonArtifactGasEstimatesCreation struct { + CodeDepositCost *string `json:"codeDepositCost,omitempty"` + ExecutionCost *string `json:"executionCost,omitempty"` + TotalCost *string `json:"totalCost,omitempty"` +} + +// NewSolidityContractJsonArtifactGasEstimatesCreation instantiates a new SolidityContractJsonArtifactGasEstimatesCreation 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 +// will change when the set of required properties is changed +func NewSolidityContractJsonArtifactGasEstimatesCreation() *SolidityContractJsonArtifactGasEstimatesCreation { + this := SolidityContractJsonArtifactGasEstimatesCreation{} + return &this +} + +// NewSolidityContractJsonArtifactGasEstimatesCreationWithDefaults instantiates a new SolidityContractJsonArtifactGasEstimatesCreation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSolidityContractJsonArtifactGasEstimatesCreationWithDefaults() *SolidityContractJsonArtifactGasEstimatesCreation { + this := SolidityContractJsonArtifactGasEstimatesCreation{} + return &this +} + +// GetCodeDepositCost returns the CodeDepositCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetCodeDepositCost() string { + if o == nil || IsNil(o.CodeDepositCost) { + var ret string + return ret + } + return *o.CodeDepositCost +} + +// GetCodeDepositCostOk returns a tuple with the CodeDepositCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetCodeDepositCostOk() (*string, bool) { + if o == nil || IsNil(o.CodeDepositCost) { + return nil, false + } + return o.CodeDepositCost, true +} + +// HasCodeDepositCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasCodeDepositCost() bool { + if o != nil && !IsNil(o.CodeDepositCost) { + return true + } + + return false +} + +// SetCodeDepositCost gets a reference to the given string and assigns it to the CodeDepositCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetCodeDepositCost(v string) { + o.CodeDepositCost = &v +} + +// GetExecutionCost returns the ExecutionCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetExecutionCost() string { + if o == nil || IsNil(o.ExecutionCost) { + var ret string + return ret + } + return *o.ExecutionCost +} + +// GetExecutionCostOk returns a tuple with the ExecutionCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetExecutionCostOk() (*string, bool) { + if o == nil || IsNil(o.ExecutionCost) { + return nil, false + } + return o.ExecutionCost, true +} + +// HasExecutionCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasExecutionCost() bool { + if o != nil && !IsNil(o.ExecutionCost) { + return true + } + + return false +} + +// SetExecutionCost gets a reference to the given string and assigns it to the ExecutionCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetExecutionCost(v string) { + o.ExecutionCost = &v +} + +// GetTotalCost returns the TotalCost field value if set, zero value otherwise. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetTotalCost() string { + if o == nil || IsNil(o.TotalCost) { + var ret string + return ret + } + return *o.TotalCost +} + +// GetTotalCostOk returns a tuple with the TotalCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) GetTotalCostOk() (*string, bool) { + if o == nil || IsNil(o.TotalCost) { + return nil, false + } + return o.TotalCost, true +} + +// HasTotalCost returns a boolean if a field has been set. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) HasTotalCost() bool { + if o != nil && !IsNil(o.TotalCost) { + return true + } + + return false +} + +// SetTotalCost gets a reference to the given string and assigns it to the TotalCost field. +func (o *SolidityContractJsonArtifactGasEstimatesCreation) SetTotalCost(v string) { + o.TotalCost = &v +} + +func (o SolidityContractJsonArtifactGasEstimatesCreation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SolidityContractJsonArtifactGasEstimatesCreation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CodeDepositCost) { + toSerialize["codeDepositCost"] = o.CodeDepositCost + } + if !IsNil(o.ExecutionCost) { + toSerialize["executionCost"] = o.ExecutionCost + } + if !IsNil(o.TotalCost) { + toSerialize["totalCost"] = o.TotalCost + } + return toSerialize, nil +} + +type NullableSolidityContractJsonArtifactGasEstimatesCreation struct { + value *SolidityContractJsonArtifactGasEstimatesCreation + isSet bool +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) Get() *SolidityContractJsonArtifactGasEstimatesCreation { + return v.value +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) Set(val *SolidityContractJsonArtifactGasEstimatesCreation) { + v.value = val + v.isSet = true +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) IsSet() bool { + return v.isSet +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSolidityContractJsonArtifactGasEstimatesCreation(val *SolidityContractJsonArtifactGasEstimatesCreation) *NullableSolidityContractJsonArtifactGasEstimatesCreation { + return &NullableSolidityContractJsonArtifactGasEstimatesCreation{value: val, isSet: true} +} + +func (v NullableSolidityContractJsonArtifactGasEstimatesCreation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSolidityContractJsonArtifactGasEstimatesCreation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go new file mode 100644 index 00000000000..4293ae58b28 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go @@ -0,0 +1,178 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredential - struct for Web3SigningCredential +type Web3SigningCredential struct { + Web3SigningCredentialCactusKeychainRef *Web3SigningCredentialCactusKeychainRef + Web3SigningCredentialNone *Web3SigningCredentialNone + Web3SigningCredentialPrivateKeyHex *Web3SigningCredentialPrivateKeyHex +} + +// Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialCactusKeychainRef wrapped in Web3SigningCredential +func Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential(v *Web3SigningCredentialCactusKeychainRef) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialCactusKeychainRef: v, + } +} + +// Web3SigningCredentialNoneAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialNone wrapped in Web3SigningCredential +func Web3SigningCredentialNoneAsWeb3SigningCredential(v *Web3SigningCredentialNone) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialNone: v, + } +} + +// Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialPrivateKeyHex wrapped in Web3SigningCredential +func Web3SigningCredentialPrivateKeyHexAsWeb3SigningCredential(v *Web3SigningCredentialPrivateKeyHex) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialPrivateKeyHex: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *Web3SigningCredential) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Web3SigningCredentialCactusKeychainRef + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialCactusKeychainRef) + if err == nil { + jsonWeb3SigningCredentialCactusKeychainRef, _ := json.Marshal(dst.Web3SigningCredentialCactusKeychainRef) + if string(jsonWeb3SigningCredentialCactusKeychainRef) == "{}" { // empty struct + dst.Web3SigningCredentialCactusKeychainRef = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialCactusKeychainRef = nil + } + + // try to unmarshal data into Web3SigningCredentialNone + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialNone) + if err == nil { + jsonWeb3SigningCredentialNone, _ := json.Marshal(dst.Web3SigningCredentialNone) + if string(jsonWeb3SigningCredentialNone) == "{}" { // empty struct + dst.Web3SigningCredentialNone = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialNone = nil + } + + // try to unmarshal data into Web3SigningCredentialPrivateKeyHex + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialPrivateKeyHex) + if err == nil { + jsonWeb3SigningCredentialPrivateKeyHex, _ := json.Marshal(dst.Web3SigningCredentialPrivateKeyHex) + if string(jsonWeb3SigningCredentialPrivateKeyHex) == "{}" { // empty struct + dst.Web3SigningCredentialPrivateKeyHex = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialPrivateKeyHex = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Web3SigningCredentialCactusKeychainRef = nil + dst.Web3SigningCredentialNone = nil + dst.Web3SigningCredentialPrivateKeyHex = nil + + return fmt.Errorf("data matches more than one schema in oneOf(Web3SigningCredential)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(Web3SigningCredential)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Web3SigningCredential) MarshalJSON() ([]byte, error) { + if src.Web3SigningCredentialCactusKeychainRef != nil { + return json.Marshal(&src.Web3SigningCredentialCactusKeychainRef) + } + + if src.Web3SigningCredentialNone != nil { + return json.Marshal(&src.Web3SigningCredentialNone) + } + + if src.Web3SigningCredentialPrivateKeyHex != nil { + return json.Marshal(&src.Web3SigningCredentialPrivateKeyHex) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *Web3SigningCredential) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Web3SigningCredentialCactusKeychainRef != nil { + return obj.Web3SigningCredentialCactusKeychainRef + } + + if obj.Web3SigningCredentialNone != nil { + return obj.Web3SigningCredentialNone + } + + if obj.Web3SigningCredentialPrivateKeyHex != nil { + return obj.Web3SigningCredentialPrivateKeyHex + } + + // all schemas are nil + return nil +} + +type NullableWeb3SigningCredential struct { + value *Web3SigningCredential + isSet bool +} + +func (v NullableWeb3SigningCredential) Get() *Web3SigningCredential { + return v.value +} + +func (v *NullableWeb3SigningCredential) Set(val *Web3SigningCredential) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredential) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredential) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredential(val *Web3SigningCredential) *NullableWeb3SigningCredential { + return &NullableWeb3SigningCredential{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredential) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredential) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go new file mode 100644 index 00000000000..a6a7a4db74d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go @@ -0,0 +1,201 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialCactusKeychainRef type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialCactusKeychainRef{} + +// Web3SigningCredentialCactusKeychainRef struct for Web3SigningCredentialCactusKeychainRef +type Web3SigningCredentialCactusKeychainRef struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + KeychainEntryKey string `json:"keychainEntryKey"` + // The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + KeychainId string `json:"keychainId"` +} + +// NewWeb3SigningCredentialCactusKeychainRef instantiates a new Web3SigningCredentialCactusKeychainRef 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialCactusKeychainRef(type_ Web3SigningCredentialType, ethAccount string, keychainEntryKey string, keychainId string) *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + this.Type = type_ + this.EthAccount = ethAccount + this.KeychainEntryKey = keychainEntryKey + this.KeychainId = keychainId + return &this +} + +// NewWeb3SigningCredentialCactusKeychainRefWithDefaults instantiates a new Web3SigningCredentialCactusKeychainRef object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialCactusKeychainRefWithDefaults() *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialCactusKeychainRef) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetKeychainEntryKey returns the KeychainEntryKey field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKey() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainEntryKey +} + +// GetKeychainEntryKeyOk returns a tuple with the KeychainEntryKey field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainEntryKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainEntryKey, true +} + +// SetKeychainEntryKey sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainEntryKey(v string) { + o.KeychainEntryKey = v +} + +// GetKeychainId returns the KeychainId field value +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainId() string { + if o == nil { + var ret string + return ret + } + + return o.KeychainId +} + +// GetKeychainIdOk returns a tuple with the KeychainId field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialCactusKeychainRef) GetKeychainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KeychainId, true +} + +// SetKeychainId sets field value +func (o *Web3SigningCredentialCactusKeychainRef) SetKeychainId(v string) { + o.KeychainId = v +} + +func (o Web3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialCactusKeychainRef) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["keychainEntryKey"] = o.KeychainEntryKey + toSerialize["keychainId"] = o.KeychainId + return toSerialize, nil +} + +type NullableWeb3SigningCredentialCactusKeychainRef struct { + value *Web3SigningCredentialCactusKeychainRef + isSet bool +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) Get() *Web3SigningCredentialCactusKeychainRef { + return v.value +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Set(val *Web3SigningCredentialCactusKeychainRef) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialCactusKeychainRef(val *Web3SigningCredentialCactusKeychainRef) *NullableWeb3SigningCredentialCactusKeychainRef { + return &NullableWeb3SigningCredentialCactusKeychainRef{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialCactusKeychainRef) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialCactusKeychainRef) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go new file mode 100644 index 00000000000..a19ea342bf3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialNone type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialNone{} + +// Web3SigningCredentialNone Using this denotes that there is no signing required because the transaction is pre-signed. +type Web3SigningCredentialNone struct { + Type Web3SigningCredentialType `json:"type"` +} + +// NewWeb3SigningCredentialNone instantiates a new Web3SigningCredentialNone 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialNone(type_ Web3SigningCredentialType) *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + this.Type = type_ + return &this +} + +// NewWeb3SigningCredentialNoneWithDefaults instantiates a new Web3SigningCredentialNone object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialNoneWithDefaults() *Web3SigningCredentialNone { + this := Web3SigningCredentialNone{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialNone) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialNone) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialNone) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +func (o Web3SigningCredentialNone) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialNone) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableWeb3SigningCredentialNone struct { + value *Web3SigningCredentialNone + isSet bool +} + +func (v NullableWeb3SigningCredentialNone) Get() *Web3SigningCredentialNone { + return v.value +} + +func (v *NullableWeb3SigningCredentialNone) Set(val *Web3SigningCredentialNone) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialNone) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialNone) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialNone(val *Web3SigningCredentialNone) *NullableWeb3SigningCredentialNone { + return &NullableWeb3SigningCredentialNone{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialNone) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialNone) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go new file mode 100644 index 00000000000..c78818447a5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_private_key_hex.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialPrivateKeyHex type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialPrivateKeyHex{} + +// Web3SigningCredentialPrivateKeyHex struct for Web3SigningCredentialPrivateKeyHex +type Web3SigningCredentialPrivateKeyHex struct { + Type Web3SigningCredentialType `json:"type"` + // The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + EthAccount string `json:"ethAccount"` + // The HEX encoded private key of an eth account. + Secret string `json:"secret"` +} + +// NewWeb3SigningCredentialPrivateKeyHex instantiates a new Web3SigningCredentialPrivateKeyHex 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 +// will change when the set of required properties is changed +func NewWeb3SigningCredentialPrivateKeyHex(type_ Web3SigningCredentialType, ethAccount string, secret string) *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + this.Type = type_ + this.EthAccount = ethAccount + this.Secret = secret + return &this +} + +// NewWeb3SigningCredentialPrivateKeyHexWithDefaults instantiates a new Web3SigningCredentialPrivateKeyHex object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialPrivateKeyHexWithDefaults() *Web3SigningCredentialPrivateKeyHex { + this := Web3SigningCredentialPrivateKeyHex{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialPrivateKeyHex) GetType() Web3SigningCredentialType { + if o == nil { + var ret Web3SigningCredentialType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetEthAccount returns the EthAccount field value +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccount() string { + if o == nil { + var ret string + return ret + } + + return o.EthAccount +} + +// GetEthAccountOk returns a tuple with the EthAccount field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetEthAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EthAccount, true +} + +// SetEthAccount sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetEthAccount(v string) { + o.EthAccount = v +} + +// GetSecret returns the Secret field value +func (o *Web3SigningCredentialPrivateKeyHex) GetSecret() string { + if o == nil { + var ret string + return ret + } + + return o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialPrivateKeyHex) GetSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Secret, true +} + +// SetSecret sets field value +func (o *Web3SigningCredentialPrivateKeyHex) SetSecret(v string) { + o.Secret = v +} + +func (o Web3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialPrivateKeyHex) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["ethAccount"] = o.EthAccount + toSerialize["secret"] = o.Secret + return toSerialize, nil +} + +type NullableWeb3SigningCredentialPrivateKeyHex struct { + value *Web3SigningCredentialPrivateKeyHex + isSet bool +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) Get() *Web3SigningCredentialPrivateKeyHex { + return v.value +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Set(val *Web3SigningCredentialPrivateKeyHex) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialPrivateKeyHex(val *Web3SigningCredentialPrivateKeyHex) *NullableWeb3SigningCredentialPrivateKeyHex { + return &NullableWeb3SigningCredentialPrivateKeyHex{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialPrivateKeyHex) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialPrivateKeyHex) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go new file mode 100644 index 00000000000..9177a91dcdc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredentialType the model 'Web3SigningCredentialType' +type Web3SigningCredentialType string + +// List of Web3SigningCredentialType +const ( + CACTUS_KEYCHAIN_REF Web3SigningCredentialType = "CACTUS_KEYCHAIN_REF" + GETH_KEYCHAIN_PASSWORD Web3SigningCredentialType = "GETH_KEYCHAIN_PASSWORD" + PRIVATE_KEY_HEX Web3SigningCredentialType = "PRIVATE_KEY_HEX" + NONE Web3SigningCredentialType = "NONE" +) + +// All allowed values of Web3SigningCredentialType enum +var AllowedWeb3SigningCredentialTypeEnumValues = []Web3SigningCredentialType{ + "CACTUS_KEYCHAIN_REF", + "GETH_KEYCHAIN_PASSWORD", + "PRIVATE_KEY_HEX", + "NONE", +} + +func (v *Web3SigningCredentialType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Web3SigningCredentialType(value) + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Web3SigningCredentialType", value) +} + +// NewWeb3SigningCredentialTypeFromValue returns a pointer to a valid Web3SigningCredentialType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWeb3SigningCredentialTypeFromValue(v string) (*Web3SigningCredentialType, error) { + ev := Web3SigningCredentialType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Web3SigningCredentialType: valid values are %v", v, AllowedWeb3SigningCredentialTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Web3SigningCredentialType) IsValid() bool { + for _, existing := range AllowedWeb3SigningCredentialTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Web3SigningCredentialType value +func (v Web3SigningCredentialType) Ptr() *Web3SigningCredentialType { + return &v +} + +type NullableWeb3SigningCredentialType struct { + value *Web3SigningCredentialType + isSet bool +} + +func (v NullableWeb3SigningCredentialType) Get() *Web3SigningCredentialType { + return v.value +} + +func (v *NullableWeb3SigningCredentialType) Set(val *Web3SigningCredentialType) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialType) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialType(val *Web3SigningCredentialType) *NullableWeb3SigningCredentialType { + return &NullableWeb3SigningCredentialType{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go new file mode 100644 index 00000000000..4dbbb956cb5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_web3_transaction_receipt.go @@ -0,0 +1,385 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the Web3TransactionReceipt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3TransactionReceipt{} + +// Web3TransactionReceipt struct for Web3TransactionReceipt +type Web3TransactionReceipt struct { + Status bool `json:"status"` + TransactionHash string `json:"transactionHash"` + TransactionIndex float32 `json:"transactionIndex"` + BlockHash string `json:"blockHash"` + BlockNumber float32 `json:"blockNumber"` + GasUsed float32 `json:"gasUsed"` + ContractAddress NullableString `json:"contractAddress,omitempty"` + From string `json:"from"` + To string `json:"to"` + AdditionalProperties map[string]interface{} +} + +type _Web3TransactionReceipt Web3TransactionReceipt + +// NewWeb3TransactionReceipt instantiates a new Web3TransactionReceipt 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 +// will change when the set of required properties is changed +func NewWeb3TransactionReceipt(status bool, transactionHash string, transactionIndex float32, blockHash string, blockNumber float32, gasUsed float32, from string, to string) *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + this.Status = status + this.TransactionHash = transactionHash + this.TransactionIndex = transactionIndex + this.BlockHash = blockHash + this.BlockNumber = blockNumber + this.GasUsed = gasUsed + this.From = from + this.To = to + return &this +} + +// NewWeb3TransactionReceiptWithDefaults instantiates a new Web3TransactionReceipt object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3TransactionReceiptWithDefaults() *Web3TransactionReceipt { + this := Web3TransactionReceipt{} + return &this +} + +// GetStatus returns the Status field value +func (o *Web3TransactionReceipt) GetStatus() bool { + if o == nil { + var ret bool + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetStatusOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Web3TransactionReceipt) SetStatus(v bool) { + o.Status = v +} + +// GetTransactionHash returns the TransactionHash field value +func (o *Web3TransactionReceipt) GetTransactionHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionHash +} + +// GetTransactionHashOk returns a tuple with the TransactionHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionHash, true +} + +// SetTransactionHash sets field value +func (o *Web3TransactionReceipt) SetTransactionHash(v string) { + o.TransactionHash = v +} + +// GetTransactionIndex returns the TransactionIndex field value +func (o *Web3TransactionReceipt) GetTransactionIndex() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TransactionIndex +} + +// GetTransactionIndexOk returns a tuple with the TransactionIndex field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetTransactionIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TransactionIndex, true +} + +// SetTransactionIndex sets field value +func (o *Web3TransactionReceipt) SetTransactionIndex(v float32) { + o.TransactionIndex = v +} + +// GetBlockHash returns the BlockHash field value +func (o *Web3TransactionReceipt) GetBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.BlockHash +} + +// GetBlockHashOk returns a tuple with the BlockHash field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *Web3TransactionReceipt) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetBlockNumber returns the BlockNumber field value +func (o *Web3TransactionReceipt) GetBlockNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.BlockNumber +} + +// GetBlockNumberOk returns a tuple with the BlockNumber field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetBlockNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *Web3TransactionReceipt) SetBlockNumber(v float32) { + o.BlockNumber = v +} + +// GetGasUsed returns the GasUsed field value +func (o *Web3TransactionReceipt) GetGasUsed() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.GasUsed +} + +// GetGasUsedOk returns a tuple with the GasUsed field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetGasUsedOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.GasUsed, true +} + +// SetGasUsed sets field value +func (o *Web3TransactionReceipt) SetGasUsed(v float32) { + o.GasUsed = v +} + +// GetContractAddress returns the ContractAddress field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Web3TransactionReceipt) GetContractAddress() string { + if o == nil || IsNil(o.ContractAddress.Get()) { + var ret string + return ret + } + return *o.ContractAddress.Get() +} + +// GetContractAddressOk returns a tuple with the ContractAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Web3TransactionReceipt) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ContractAddress.Get(), o.ContractAddress.IsSet() +} + +// HasContractAddress returns a boolean if a field has been set. +func (o *Web3TransactionReceipt) HasContractAddress() bool { + if o != nil && o.ContractAddress.IsSet() { + return true + } + + return false +} + +// SetContractAddress gets a reference to the given NullableString and assigns it to the ContractAddress field. +func (o *Web3TransactionReceipt) SetContractAddress(v string) { + o.ContractAddress.Set(&v) +} +// SetContractAddressNil sets the value for ContractAddress to be an explicit nil +func (o *Web3TransactionReceipt) SetContractAddressNil() { + o.ContractAddress.Set(nil) +} + +// UnsetContractAddress ensures that no value is present for ContractAddress, not even an explicit nil +func (o *Web3TransactionReceipt) UnsetContractAddress() { + o.ContractAddress.Unset() +} + +// GetFrom returns the From field value +func (o *Web3TransactionReceipt) GetFrom() string { + if o == nil { + var ret string + return ret + } + + return o.From +} + +// GetFromOk returns a tuple with the From field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.From, true +} + +// SetFrom sets field value +func (o *Web3TransactionReceipt) SetFrom(v string) { + o.From = v +} + +// GetTo returns the To field value +func (o *Web3TransactionReceipt) GetTo() string { + if o == nil { + var ret string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *Web3TransactionReceipt) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *Web3TransactionReceipt) SetTo(v string) { + o.To = v +} + +func (o Web3TransactionReceipt) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3TransactionReceipt) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status"] = o.Status + toSerialize["transactionHash"] = o.TransactionHash + toSerialize["transactionIndex"] = o.TransactionIndex + toSerialize["blockHash"] = o.BlockHash + toSerialize["blockNumber"] = o.BlockNumber + toSerialize["gasUsed"] = o.GasUsed + if o.ContractAddress.IsSet() { + toSerialize["contractAddress"] = o.ContractAddress.Get() + } + toSerialize["from"] = o.From + toSerialize["to"] = o.To + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Web3TransactionReceipt) UnmarshalJSON(bytes []byte) (err error) { + varWeb3TransactionReceipt := _Web3TransactionReceipt{} + + if err = json.Unmarshal(bytes, &varWeb3TransactionReceipt); err == nil { + *o = Web3TransactionReceipt(varWeb3TransactionReceipt) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "status") + delete(additionalProperties, "transactionHash") + delete(additionalProperties, "transactionIndex") + delete(additionalProperties, "blockHash") + delete(additionalProperties, "blockNumber") + delete(additionalProperties, "gasUsed") + delete(additionalProperties, "contractAddress") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWeb3TransactionReceipt struct { + value *Web3TransactionReceipt + isSet bool +} + +func (v NullableWeb3TransactionReceipt) Get() *Web3TransactionReceipt { + return v.value +} + +func (v *NullableWeb3TransactionReceipt) Set(val *Web3TransactionReceipt) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3TransactionReceipt) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3TransactionReceipt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3TransactionReceipt(val *Web3TransactionReceipt) *NullableWeb3TransactionReceipt { + return &NullableWeb3TransactionReceipt{value: val, isSet: true} +} + +func (v NullableWeb3TransactionReceipt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3TransactionReceipt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config.go new file mode 100644 index 00000000000..6ef2d2925d2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config.go @@ -0,0 +1,410 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" +) + +// checks if the XdaiTransactionConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &XdaiTransactionConfig{} + +// XdaiTransactionConfig struct for XdaiTransactionConfig +type XdaiTransactionConfig struct { + RawTransaction *string `json:"rawTransaction,omitempty"` + From *XdaiTransactionConfigFrom `json:"from,omitempty"` + To *XdaiTransactionConfigTo `json:"to,omitempty"` + Value *XdaiTransactionConfigFrom `json:"value,omitempty"` + Gas *XdaiTransactionConfigFrom `json:"gas,omitempty"` + GasPrice *XdaiTransactionConfigFrom `json:"gasPrice,omitempty"` + Nonce *float32 `json:"nonce,omitempty"` + Data *XdaiTransactionConfigTo `json:"data,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _XdaiTransactionConfig XdaiTransactionConfig + +// NewXdaiTransactionConfig instantiates a new XdaiTransactionConfig 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 +// will change when the set of required properties is changed +func NewXdaiTransactionConfig() *XdaiTransactionConfig { + this := XdaiTransactionConfig{} + return &this +} + +// NewXdaiTransactionConfigWithDefaults instantiates a new XdaiTransactionConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewXdaiTransactionConfigWithDefaults() *XdaiTransactionConfig { + this := XdaiTransactionConfig{} + return &this +} + +// GetRawTransaction returns the RawTransaction field value if set, zero value otherwise. +func (o *XdaiTransactionConfig) GetRawTransaction() string { + if o == nil || IsNil(o.RawTransaction) { + var ret string + return ret + } + return *o.RawTransaction +} + +// GetRawTransactionOk returns a tuple with the RawTransaction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XdaiTransactionConfig) GetRawTransactionOk() (*string, bool) { + if o == nil || IsNil(o.RawTransaction) { + return nil, false + } + return o.RawTransaction, true +} + +// HasRawTransaction returns a boolean if a field has been set. +func (o *XdaiTransactionConfig) HasRawTransaction() bool { + if o != nil && !IsNil(o.RawTransaction) { + return true + } + + return false +} + +// SetRawTransaction gets a reference to the given string and assigns it to the RawTransaction field. +func (o *XdaiTransactionConfig) SetRawTransaction(v string) { + o.RawTransaction = &v +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *XdaiTransactionConfig) GetFrom() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.From) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XdaiTransactionConfig) GetFromOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.From) { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *XdaiTransactionConfig) HasFrom() bool { + if o != nil && !IsNil(o.From) { + return true + } + + return false +} + +// SetFrom gets a reference to the given XdaiTransactionConfigFrom and assigns it to the From field. +func (o *XdaiTransactionConfig) SetFrom(v XdaiTransactionConfigFrom) { + o.From = &v +} + +// GetTo returns the To field value if set, zero value otherwise. +func (o *XdaiTransactionConfig) GetTo() XdaiTransactionConfigTo { + if o == nil || IsNil(o.To) { + var ret XdaiTransactionConfigTo + return ret + } + return *o.To +} + +// GetToOk returns a tuple with the To field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XdaiTransactionConfig) GetToOk() (*XdaiTransactionConfigTo, bool) { + if o == nil || IsNil(o.To) { + return nil, false + } + return o.To, true +} + +// HasTo returns a boolean if a field has been set. +func (o *XdaiTransactionConfig) HasTo() bool { + if o != nil && !IsNil(o.To) { + return true + } + + return false +} + +// SetTo gets a reference to the given XdaiTransactionConfigTo and assigns it to the To field. +func (o *XdaiTransactionConfig) SetTo(v XdaiTransactionConfigTo) { + o.To = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *XdaiTransactionConfig) GetValue() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Value) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XdaiTransactionConfig) GetValueOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *XdaiTransactionConfig) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Value field. +func (o *XdaiTransactionConfig) SetValue(v XdaiTransactionConfigFrom) { + o.Value = &v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *XdaiTransactionConfig) GetGas() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.Gas) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.Gas +} + +// GetGasOk returns a tuple with the Gas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XdaiTransactionConfig) GetGasOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.Gas) { + return nil, false + } + return o.Gas, true +} + +// HasGas returns a boolean if a field has been set. +func (o *XdaiTransactionConfig) HasGas() bool { + if o != nil && !IsNil(o.Gas) { + return true + } + + return false +} + +// SetGas gets a reference to the given XdaiTransactionConfigFrom and assigns it to the Gas field. +func (o *XdaiTransactionConfig) SetGas(v XdaiTransactionConfigFrom) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *XdaiTransactionConfig) GetGasPrice() XdaiTransactionConfigFrom { + if o == nil || IsNil(o.GasPrice) { + var ret XdaiTransactionConfigFrom + return ret + } + return *o.GasPrice +} + +// GetGasPriceOk returns a tuple with the GasPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XdaiTransactionConfig) GetGasPriceOk() (*XdaiTransactionConfigFrom, bool) { + if o == nil || IsNil(o.GasPrice) { + return nil, false + } + return o.GasPrice, true +} + +// HasGasPrice returns a boolean if a field has been set. +func (o *XdaiTransactionConfig) HasGasPrice() bool { + if o != nil && !IsNil(o.GasPrice) { + return true + } + + return false +} + +// SetGasPrice gets a reference to the given XdaiTransactionConfigFrom and assigns it to the GasPrice field. +func (o *XdaiTransactionConfig) SetGasPrice(v XdaiTransactionConfigFrom) { + o.GasPrice = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *XdaiTransactionConfig) GetNonce() float32 { + if o == nil || IsNil(o.Nonce) { + var ret float32 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XdaiTransactionConfig) GetNonceOk() (*float32, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *XdaiTransactionConfig) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given float32 and assigns it to the Nonce field. +func (o *XdaiTransactionConfig) SetNonce(v float32) { + o.Nonce = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *XdaiTransactionConfig) GetData() XdaiTransactionConfigTo { + if o == nil || IsNil(o.Data) { + var ret XdaiTransactionConfigTo + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XdaiTransactionConfig) GetDataOk() (*XdaiTransactionConfigTo, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *XdaiTransactionConfig) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given XdaiTransactionConfigTo and assigns it to the Data field. +func (o *XdaiTransactionConfig) SetData(v XdaiTransactionConfigTo) { + o.Data = &v +} + +func (o XdaiTransactionConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o XdaiTransactionConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RawTransaction) { + toSerialize["rawTransaction"] = o.RawTransaction + } + if !IsNil(o.From) { + toSerialize["from"] = o.From + } + if !IsNil(o.To) { + toSerialize["to"] = o.To + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Gas) { + toSerialize["gas"] = o.Gas + } + if !IsNil(o.GasPrice) { + toSerialize["gasPrice"] = o.GasPrice + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *XdaiTransactionConfig) UnmarshalJSON(bytes []byte) (err error) { + varXdaiTransactionConfig := _XdaiTransactionConfig{} + + if err = json.Unmarshal(bytes, &varXdaiTransactionConfig); err == nil { + *o = XdaiTransactionConfig(varXdaiTransactionConfig) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "rawTransaction") + delete(additionalProperties, "from") + delete(additionalProperties, "to") + delete(additionalProperties, "value") + delete(additionalProperties, "gas") + delete(additionalProperties, "gasPrice") + delete(additionalProperties, "nonce") + delete(additionalProperties, "data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableXdaiTransactionConfig struct { + value *XdaiTransactionConfig + isSet bool +} + +func (v NullableXdaiTransactionConfig) Get() *XdaiTransactionConfig { + return v.value +} + +func (v *NullableXdaiTransactionConfig) Set(val *XdaiTransactionConfig) { + v.value = val + v.isSet = true +} + +func (v NullableXdaiTransactionConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableXdaiTransactionConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableXdaiTransactionConfig(val *XdaiTransactionConfig) *NullableXdaiTransactionConfig { + return &NullableXdaiTransactionConfig{value: val, isSet: true} +} + +func (v NullableXdaiTransactionConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableXdaiTransactionConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config_from.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config_from.go new file mode 100644 index 00000000000..29ea6955b27 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config_from.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" + "fmt" +) + +// XdaiTransactionConfigFrom - struct for XdaiTransactionConfigFrom +type XdaiTransactionConfigFrom struct { + Float32 *float32 + String *string +} + +// float32AsXdaiTransactionConfigFrom is a convenience function that returns float32 wrapped in XdaiTransactionConfigFrom +func Float32AsXdaiTransactionConfigFrom(v *float32) XdaiTransactionConfigFrom { + return XdaiTransactionConfigFrom{ + Float32: v, + } +} + +// stringAsXdaiTransactionConfigFrom is a convenience function that returns string wrapped in XdaiTransactionConfigFrom +func StringAsXdaiTransactionConfigFrom(v *string) XdaiTransactionConfigFrom { + return XdaiTransactionConfigFrom{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *XdaiTransactionConfigFrom) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Float32 + err = newStrictDecoder(data).Decode(&dst.Float32) + if err == nil { + jsonFloat32, _ := json.Marshal(dst.Float32) + if string(jsonFloat32) == "{}" { // empty struct + dst.Float32 = nil + } else { + match++ + } + } else { + dst.Float32 = nil + } + + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Float32 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(XdaiTransactionConfigFrom)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(XdaiTransactionConfigFrom)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src XdaiTransactionConfigFrom) MarshalJSON() ([]byte, error) { + if src.Float32 != nil { + return json.Marshal(&src.Float32) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *XdaiTransactionConfigFrom) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Float32 != nil { + return obj.Float32 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableXdaiTransactionConfigFrom struct { + value *XdaiTransactionConfigFrom + isSet bool +} + +func (v NullableXdaiTransactionConfigFrom) Get() *XdaiTransactionConfigFrom { + return v.value +} + +func (v *NullableXdaiTransactionConfigFrom) Set(val *XdaiTransactionConfigFrom) { + v.value = val + v.isSet = true +} + +func (v NullableXdaiTransactionConfigFrom) IsSet() bool { + return v.isSet +} + +func (v *NullableXdaiTransactionConfigFrom) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableXdaiTransactionConfigFrom(val *XdaiTransactionConfigFrom) *NullableXdaiTransactionConfigFrom { + return &NullableXdaiTransactionConfigFrom{value: val, isSet: true} +} + +func (v NullableXdaiTransactionConfigFrom) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableXdaiTransactionConfigFrom) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config_to.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config_to.go new file mode 100644 index 00000000000..9aecfd62d62 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/model_xdai_transaction_config_to.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" + "fmt" +) + +// XdaiTransactionConfigTo - struct for XdaiTransactionConfigTo +type XdaiTransactionConfigTo struct { + String *string +} + +// stringAsXdaiTransactionConfigTo is a convenience function that returns string wrapped in XdaiTransactionConfigTo +func StringAsXdaiTransactionConfigTo(v *string) XdaiTransactionConfigTo { + return XdaiTransactionConfigTo{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *XdaiTransactionConfigTo) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into String + err = newStrictDecoder(data).Decode(&dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(XdaiTransactionConfigTo)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(XdaiTransactionConfigTo)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src XdaiTransactionConfigTo) MarshalJSON() ([]byte, error) { + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *XdaiTransactionConfigTo) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableXdaiTransactionConfigTo struct { + value *XdaiTransactionConfigTo + isSet bool +} + +func (v NullableXdaiTransactionConfigTo) Get() *XdaiTransactionConfigTo { + return v.value +} + +func (v *NullableXdaiTransactionConfigTo) Set(val *XdaiTransactionConfigTo) { + v.value = val + v.isSet = true +} + +func (v NullableXdaiTransactionConfigTo) IsSet() bool { + return v.isSet +} + +func (v *NullableXdaiTransactionConfigTo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableXdaiTransactionConfigTo(val *XdaiTransactionConfigTo) *NullableXdaiTransactionConfigTo { + return &NullableXdaiTransactionConfigTo{value: val, isSet: true} +} + +func (v NullableXdaiTransactionConfigTo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableXdaiTransactionConfigTo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..fc501d8d6a0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..866443a7e40 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,97 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-ledger-connector-xdai + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-ledger-connector-xdai_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService DeployContractJsonObjectV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeployContractJsonObjectV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService DeployContractV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeployContractV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPrometheusMetricsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPrometheusMetricsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeContractJsonObject", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeContractJsonObject(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeContractV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeContractV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RunTransactionV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.RunTransactionV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..09f0729ee76 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Connector Xdai + +Can perform basic tasks on a Xdai ledger + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-xdai + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..f61de6e006d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - Connector Xdai + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..7540811e70b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,86 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/ConsistencyStrategy.java +src/main/java/org/openapitools/client/model/ContractJSON.java +src/main/java/org/openapitools/client/model/DeployContractJsonObjectV1Request.java +src/main/java/org/openapitools/client/model/DeployContractV1Request.java +src/main/java/org/openapitools/client/model/DeployContractV1Response.java +src/main/java/org/openapitools/client/model/DeployRequestBaseV1.java +src/main/java/org/openapitools/client/model/EthContractInvocationType.java +src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java +src/main/java/org/openapitools/client/model/InvokeContractV1Request.java +src/main/java/org/openapitools/client/model/InvokeContractV1Response.java +src/main/java/org/openapitools/client/model/InvokeRequestBaseV1.java +src/main/java/org/openapitools/client/model/ReceiptType.java +src/main/java/org/openapitools/client/model/RunTransactionV1Request.java +src/main/java/org/openapitools/client/model/RunTransactionV1Response.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java +src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java +src/main/java/org/openapitools/client/model/Web3SigningCredential.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java +src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java +src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java +src/main/java/org/openapitools/client/model/XdaiTransactionConfig.java +src/main/java/org/openapitools/client/model/XdaiTransactionConfigFrom.java +src/main/java/org/openapitools/client/model/XdaiTransactionConfigTo.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/ConsistencyStrategyTest.java +src/test/java/org/openapitools/client/model/ContractJSONTest.java +src/test/java/org/openapitools/client/model/DeployContractJsonObjectV1RequestTest.java +src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java +src/test/java/org/openapitools/client/model/DeployContractV1ResponseTest.java +src/test/java/org/openapitools/client/model/DeployRequestBaseV1Test.java +src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java +src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java +src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java +src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java +src/test/java/org/openapitools/client/model/InvokeRequestBaseV1Test.java +src/test/java/org/openapitools/client/model/ReceiptTypeTest.java +src/test/java/org/openapitools/client/model/RunTransactionV1RequestTest.java +src/test/java/org/openapitools/client/model/RunTransactionV1ResponseTest.java +src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java +src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java +src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java +src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java +src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java +src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java +src/test/java/org/openapitools/client/model/XdaiTransactionConfigFromTest.java +src/test/java/org/openapitools/client/model/XdaiTransactionConfigTest.java +src/test/java/org/openapitools/client/model/XdaiTransactionConfigToTest.java diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..69ea211ce4f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,168 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Connector Xdai +- API version: v2.0.0-alpha.2 + +Can perform basic tasks on a Xdai ledger + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + DeployContractJsonObjectV1Request deployContractJsonObjectV1Request = new DeployContractJsonObjectV1Request(); // DeployContractJsonObjectV1Request | + try { + DeployContractV1Response result = apiInstance.deployContractJsonObjectV1(deployContractJsonObjectV1Request); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#deployContractJsonObjectV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**deployContractJsonObjectV1**](docs/DefaultApi.md#deployContractJsonObjectV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode-json-object | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**deployContractV1**](docs/DefaultApi.md#deployContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode | Deploys the bytecode of a Solidity contract. +*DefaultApi* | [**getPrometheusMetricsV1**](docs/DefaultApi.md#getPrometheusMetricsV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**invokeContractJsonObject**](docs/DefaultApi.md#invokeContractJsonObject) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract-json-object | Invokes a contract on a besu ledger +*DefaultApi* | [**invokeContractV1**](docs/DefaultApi.md#invokeContractV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract | Invokes a contract on a xdai ledger +*DefaultApi* | [**runTransactionV1**](docs/DefaultApi.md#runTransactionV1) | **POST** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction | Executes a transaction on a xdai ledger + + +## Documentation for Models + + - [ConsistencyStrategy](docs/ConsistencyStrategy.md) + - [ContractJSON](docs/ContractJSON.md) + - [DeployContractJsonObjectV1Request](docs/DeployContractJsonObjectV1Request.md) + - [DeployContractV1Request](docs/DeployContractV1Request.md) + - [DeployContractV1Response](docs/DeployContractV1Response.md) + - [DeployRequestBaseV1](docs/DeployRequestBaseV1.md) + - [EthContractInvocationType](docs/EthContractInvocationType.md) + - [InvokeContractJsonObjectV1Request](docs/InvokeContractJsonObjectV1Request.md) + - [InvokeContractV1Request](docs/InvokeContractV1Request.md) + - [InvokeContractV1Response](docs/InvokeContractV1Response.md) + - [InvokeRequestBaseV1](docs/InvokeRequestBaseV1.md) + - [ReceiptType](docs/ReceiptType.md) + - [RunTransactionV1Request](docs/RunTransactionV1Request.md) + - [RunTransactionV1Response](docs/RunTransactionV1Response.md) + - [SolidityContractJsonArtifact](docs/SolidityContractJsonArtifact.md) + - [SolidityContractJsonArtifactCompiler](docs/SolidityContractJsonArtifactCompiler.md) + - [SolidityContractJsonArtifactGasEstimates](docs/SolidityContractJsonArtifactGasEstimates.md) + - [SolidityContractJsonArtifactGasEstimatesCreation](docs/SolidityContractJsonArtifactGasEstimatesCreation.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialPrivateKeyHex](docs/Web3SigningCredentialPrivateKeyHex.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.md) + - [Web3TransactionReceipt](docs/Web3TransactionReceipt.md) + - [XdaiTransactionConfig](docs/XdaiTransactionConfig.md) + - [XdaiTransactionConfigFrom](docs/XdaiTransactionConfigFrom.md) + - [XdaiTransactionConfigTo](docs/XdaiTransactionConfigTo.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..d601f5380a2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,908 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Xdai ledger + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Xdai + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode: + post: + operationId: deployContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode-json-object: + post: + operationId: deployContractJsonObjectV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode-json-object + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction: + post: + operationId: runTransactionV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RunTransactionV1Response' + description: OK + summary: Executes a transaction on a xdai ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract: + post: + operationId: invokeContractV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a xdai ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract-json-object: + post: + operationId: invokeContractJsonObject + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractJsonObjectV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractV1Response' + description: OK + summary: Invokes a contract on a besu ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract-json-object + x-content-type: application/json + x-accepts: application/json + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetricsV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics + x-accepts: text/plain +components: + schemas: + ReceiptType: + description: Enumerates the possible types of receipts that can be waited for + by someone or something that has requested the execution of a transaction + on a ledger. + enum: + - NODE_TX_POOL_ACK + - LEDGER_BLOCK_ACK + type: string + ConsistencyStrategy: + example: + blockConfirmations: 2931 + receiptType: null + timeoutMs: 0 + pollIntervalMs: 0 + properties: + receiptType: + $ref: '#/components/schemas/ReceiptType' + timeoutMs: + description: "The amount of milliseconds to wait for the receipt to arrive\ + \ to the connector. Defaults to 0 which means to wait for an unlimited\ + \ amount of time. Note that this wait may be interrupted still by other\ + \ parts of the infrastructure such as load balancers cutting of HTTP requests\ + \ after some time even if they are the type that is supposed to be kept\ + \ alive. The question of re-entrance is a broader topic not in scope to\ + \ discuss here, but it is important to mention it." + minimum: 0 + type: integer + blockConfirmations: + description: "The number of blocks to wait to be confirmed in addition to\ + \ the block containing the transaction in question. Note that if the receipt\ + \ type is set to only wait for node transaction pool ACK and this parameter\ + \ is set to anything, but zero then the API will not accept the request\ + \ due to conflicting parameters." + maximum: 20000 + minimum: 0 + type: integer + pollIntervalMs: + description: The amount of time (in milliseconds) connector will wait before + making another confiramtion request to the network in case of previous + confiramtion request fails + minimum: 0 + type: integer + required: + - blockConfirmations + - receiptType + type: object + Web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialPrivateKeyHex' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + keychainEntryKey: + description: The key to use when looking up the the keychain entry holding + the secret pointed to by the keychainEntryKey parameter. + maxLength: 1024 + minLength: 0 + type: string + keychainId: + description: The keychain ID to use when looking up the the keychain plugin + instance that will be used to retrieve the secret pointed to by the keychainEntryKey + parameter. + maxLength: 1024 + minLength: 0 + type: string + required: + - ethAccount + - keychainEntryKey + - keychainId + - type + type: object + Web3SigningCredentialPrivateKeyHex: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + ethAccount: + description: The ethereum account (public key) that the credential belongs + to. Basically the username in the traditional terminology of authentication. + maxLength: 64 + minLength: 64 + nullable: false + type: string + secret: + description: The HEX encoded private key of an eth account. + maxLength: 65535 + minLength: 0 + type: string + required: + - ethAccount + - secret + - type + type: object + Web3SigningCredentialNone: + description: Using this denotes that there is no signing required because the + transaction is pre-signed. + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + EthContractInvocationType: + enum: + - SEND + - CALL + type: string + SolidityContractJsonArtifact: + properties: + contractName: + nullable: false + type: string + metadata: + nullable: false + type: string + bytecode: + nullable: false + type: string + deployedBytecode: + nullable: false + type: string + sourceMap: + nullable: false + type: string + deployedSourceMap: + nullable: false + type: string + sourcePath: + type: string + compiler: + $ref: '#/components/schemas/SolidityContractJsonArtifact_compiler' + functionHashes: + additionalProperties: true + type: object + gasEstimates: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates' + required: + - contractName + type: object + XdaiTransactionConfig: + additionalProperties: true + example: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + rawTransaction: + nullable: false + type: string + from: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + to: + $ref: '#/components/schemas/XdaiTransactionConfig_to' + value: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gas: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + nonce: + type: number + data: + $ref: '#/components/schemas/XdaiTransactionConfig_to' + type: object + Web3TransactionReceipt: + additionalProperties: true + example: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + status: + nullable: false + type: boolean + transactionHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + transactionIndex: + nullable: false + type: number + blockHash: + maxLength: 66 + minLength: 66 + pattern: "^0x([A-Fa-f0-9]{64})$" + type: string + blockNumber: + nullable: false + type: number + gasUsed: + nullable: false + type: number + contractAddress: + nullable: true + type: string + from: + nullable: false + type: string + to: + nullable: false + type: string + required: + - blockHash + - blockNumber + - from + - gasUsed + - status + - to + - transactionHash + - transactionIndex + type: object + ContractJSON: + additionalProperties: true + example: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + contractName: + nullable: false + type: string + bytecode: + description: See https://ethereum.stackexchange.com/a/47556 regarding the + maximum length of the bytecode + maxLength: 24576 + minLength: 1 + nullable: false + type: string + abi: + description: "The application binary interface of the solidity contract,\ + \ optional parameter" + items: {} + nullable: false + type: array + metadata: + type: string + deployedBytecode: + type: string + sourceMap: + type: string + deployedSourceMap: + type: string + sourcePath: + type: string + compiler: + type: object + networks: + type: object + ast: + type: object + functionHashes: + type: object + gasEstimates: + type: object + required: + - abi + - bytecode + - contractName + type: object + RunTransactionV1Request: + additionalProperties: false + example: + transactionConfig: + rawTransaction: rawTransaction + data: null + gas: null + from: null + to: null + value: null + nonce: 0.8008281904610115 + gasPrice: null + consistencyStrategy: + blockConfirmations: 2931 + receiptType: null + timeoutMs: 0 + pollIntervalMs: 0 + web3SigningCredential: + type: null + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + transactionConfig: + $ref: '#/components/schemas/XdaiTransactionConfig' + consistencyStrategy: + $ref: '#/components/schemas/ConsistencyStrategy' + required: + - consistencyStrategy + - transactionConfig + - web3SigningCredential + type: object + RunTransactionV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + DeployContractV1Request: + additionalProperties: false + example: + keychainId: keychainId + constructorArgs: + - "" + - "" + timeoutMs: 0.6027456183070403 + gas: 0.8008281904610115 + web3SigningCredential: + type: null + contractName: contractName + gasPrice: gasPrice + properties: + contractName: + description: The contract name for retrieve the contracts json on the keychain. + maxLength: 100 + minLength: 1 + nullable: false + type: string + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + nullable: false + type: string + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: string + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + required: + - contractName + - keychainId + - web3SigningCredential + type: object + DeployContractJsonObjectV1Request: + additionalProperties: false + example: + timeoutMs: 0.6027456183070403 + constructorArgs: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + gasPrice: gasPrice + contractJSON: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + nullable: false + type: number + gasPrice: + nullable: false + type: string + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + constructorArgs: + default: [] + description: The list of arguments to pass in to the constructor of the + contract being deployed. + items: {} + type: array + required: + - contractJSON + - web3SigningCredential + type: object + DeployContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + required: + - transactionReceipt + type: object + InvokeContractV1Request: + additionalProperties: false + example: + invocationType: null + keychainId: keychainId + timeoutMs: 0.6027456183070403 + gas: null + web3SigningCredential: + type: null + methodName: methodName + contractName: contractName + params: + - "" + - "" + value: null + nonce: 0.8008281904610115 + gasPrice: null + properties: + contractName: + description: The contract name to find it in the keychain plugin + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + value: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gas: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + keychainId: + description: The keychainId for retrieve the contracts json. + maxLength: 100 + minLength: 1 + type: string + required: + - contractName + - invocationType + - keychainId + - methodName + - params + - web3SigningCredential + type: object + InvokeContractJsonObjectV1Request: + additionalProperties: false + example: + invocationType: null + timeoutMs: 0.6027456183070403 + gas: null + web3SigningCredential: + type: null + methodName: methodName + contractAddress: contractAddress + params: + - "" + - "" + value: null + nonce: 0.8008281904610115 + gasPrice: null + contractJSON: + bytecode: bytecode + metadata: metadata + ast: "{}" + deployedBytecode: deployedBytecode + sourceMap: sourceMap + deployedSourceMap: deployedSourceMap + abi: + - "" + - "" + networks: "{}" + functionHashes: "{}" + gasEstimates: "{}" + contractName: contractName + compiler: "{}" + sourcePath: sourcePath + properties: + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + contractAddress: + description: Address of the solidity contract + nullable: false + type: string + value: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gas: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + required: + - contractAddress + - contractJSON + - invocationType + - methodName + - params + - web3SigningCredential + type: object + InvokeContractV1Response: + example: + transactionReceipt: + blockHash: blockHash + gasUsed: 1.4658129805029452 + blockNumber: 6.027456183070403 + contractAddress: contractAddress + transactionIndex: 0.8008281904610115 + from: from + to: to + transactionHash: transactionHash + status: true + callOutput: "" + success: true + properties: + transactionReceipt: + $ref: '#/components/schemas/Web3TransactionReceipt' + callOutput: {} + success: + nullable: false + type: boolean + required: + - success + type: object + PrometheusExporterMetricsResponse: + nullable: false + type: string + DeployRequestBaseV1: + properties: + contractJSON: + $ref: '#/components/schemas/ContractJSON' + constructorArgs: + default: [] + items: {} + type: array + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + gas: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + with theaddress of the contract(which indicates successful deployment) + beforegiving up and crashing. + minimum: 0 + nullable: false + type: number + required: + - contractJSON + - web3SigningCredential + type: object + InvokeRequestBaseV1: + additionalProperties: false + properties: + contractAddress: + description: Address of the solidity contract + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/Web3SigningCredential' + invocationType: + $ref: '#/components/schemas/EthContractInvocationType' + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked. + items: {} + type: array + value: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gas: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + gasPrice: + $ref: '#/components/schemas/XdaiTransactionConfig_from' + nonce: + type: number + timeoutMs: + default: 60000 + description: The amount of milliseconds to wait for a transaction receipt + beforegiving up and crashing. Only has any effect if the invocation type + is SEND + minimum: 0 + nullable: false + type: number + contractJSON: + $ref: '#/components/schemas/ContractJSON' + required: + - contractAddress + - contractJSON + - invocationType + - methodName + - params + - web3SigningCredential + type: object + SolidityContractJsonArtifact_compiler: + additionalProperties: true + properties: + name: + type: string + version: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates_creation: + properties: + codeDepositCost: + type: string + executionCost: + type: string + totalCost: + type: string + type: object + SolidityContractJsonArtifact_gasEstimates: + properties: + creation: + $ref: '#/components/schemas/SolidityContractJsonArtifact_gasEstimates_creation' + external: + additionalProperties: true + type: object + XdaiTransactionConfig_from: + oneOf: + - type: string + - type: number + XdaiTransactionConfig_to: + oneOf: + - type: string + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..c2ec97f0112 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..cd1cb6bf3a7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..0c1ecace1fb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..663f82b3fbe --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..1a533c5045a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..679fc21aa09 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..a607730a83e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,436 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(org.openapitools.client.model.Web3SigningCredential.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Web3SigningCredentialCactusKeychainRef", org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.class); + classByDiscriminatorValue.put("Web3SigningCredentialNone", org.openapitools.client.model.Web3SigningCredentialNone.class); + classByDiscriminatorValue.put("Web3SigningCredentialPrivateKeyHex", org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.class); + classByDiscriminatorValue.put("Web3SigningCredential", org.openapitools.client.model.Web3SigningCredential.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } + }) + ; + 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; + } + + { + 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.ConsistencyStrategy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ContractJSON.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractJsonObjectV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DeployRequestBaseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractJsonObjectV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeContractV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InvokeRequestBaseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RunTransactionV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifact.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactCompiler.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialNone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Web3TransactionReceipt.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.XdaiTransactionConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.XdaiTransactionConfigFrom.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.XdaiTransactionConfigTo.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); + } + } + } + + /** + * 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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..da11f45df3b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..7f33c6d43eb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..25d5d3e50a7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..ad3fd746e75 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..6af7f616309 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,786 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeployContractJsonObjectV1Request; +import org.openapitools.client.model.DeployContractV1Request; +import org.openapitools.client.model.DeployContractV1Response; +import org.openapitools.client.model.InvokeContractJsonObjectV1Request; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.RunTransactionV1Request; +import org.openapitools.client.model.RunTransactionV1Response; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 deployContractJsonObjectV1 + * @param deployContractJsonObjectV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractJsonObjectV1Call(DeployContractJsonObjectV1Request deployContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractJsonObjectV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode-json-object"; + + 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 deployContractJsonObjectV1ValidateBeforeCall(DeployContractJsonObjectV1Request deployContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + return deployContractJsonObjectV1Call(deployContractJsonObjectV1Request, _callback); + + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractJsonObjectV1Request (optional) + * @return DeployContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DeployContractV1Response deployContractJsonObjectV1(DeployContractJsonObjectV1Request deployContractJsonObjectV1Request) throws ApiException { + ApiResponse localVarResp = deployContractJsonObjectV1WithHttpInfo(deployContractJsonObjectV1Request); + return localVarResp.getData(); + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractJsonObjectV1Request (optional) + * @return ApiResponse<DeployContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse deployContractJsonObjectV1WithHttpInfo(DeployContractJsonObjectV1Request deployContractJsonObjectV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractJsonObjectV1ValidateBeforeCall(deployContractJsonObjectV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys the bytecode of a Solidity contract. (asynchronously) + * + * @param deployContractJsonObjectV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractJsonObjectV1Async(DeployContractJsonObjectV1Request deployContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractJsonObjectV1ValidateBeforeCall(deployContractJsonObjectV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deployContractV1 + * @param deployContractV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractV1Call(DeployContractV1Request deployContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = deployContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/deploy-contract-solidity-bytecode"; + + 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 deployContractV1ValidateBeforeCall(DeployContractV1Request deployContractV1Request, final ApiCallback _callback) throws ApiException { + return deployContractV1Call(deployContractV1Request, _callback); + + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractV1Request (optional) + * @return DeployContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public DeployContractV1Response deployContractV1(DeployContractV1Request deployContractV1Request) throws ApiException { + ApiResponse localVarResp = deployContractV1WithHttpInfo(deployContractV1Request); + return localVarResp.getData(); + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @param deployContractV1Request (optional) + * @return ApiResponse<DeployContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse deployContractV1WithHttpInfo(DeployContractV1Request deployContractV1Request) throws ApiException { + okhttp3.Call localVarCall = deployContractV1ValidateBeforeCall(deployContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Deploys the bytecode of a Solidity contract. (asynchronously) + * + * @param deployContractV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call deployContractV1Async(DeployContractV1Request deployContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deployContractV1ValidateBeforeCall(deployContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrometheusMetricsV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/get-prometheus-exporter-metrics"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain" + }; + 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 getPrometheusMetricsV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPrometheusMetricsV1Call(_callback); + + } + + /** + * Get the Prometheus Metrics + * + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public String getPrometheusMetricsV1() throws ApiException { + ApiResponse localVarResp = getPrometheusMetricsV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the Prometheus Metrics + * + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse getPrometheusMetricsV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Prometheus Metrics (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call getPrometheusMetricsV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrometheusMetricsV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeContractJsonObject + * @param invokeContractJsonObjectV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractJsonObjectCall(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeContractJsonObjectV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract-json-object"; + + 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 invokeContractJsonObjectValidateBeforeCall(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + return invokeContractJsonObjectCall(invokeContractJsonObjectV1Request, _callback); + + } + + /** + * Invokes a contract on a besu ledger + * + * @param invokeContractJsonObjectV1Request (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response invokeContractJsonObject(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request) throws ApiException { + ApiResponse localVarResp = invokeContractJsonObjectWithHttpInfo(invokeContractJsonObjectV1Request); + return localVarResp.getData(); + } + + /** + * Invokes a contract on a besu ledger + * + * @param invokeContractJsonObjectV1Request (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeContractJsonObjectWithHttpInfo(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeContractJsonObjectValidateBeforeCall(invokeContractJsonObjectV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invokes a contract on a besu ledger (asynchronously) + * + * @param invokeContractJsonObjectV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractJsonObjectAsync(InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeContractJsonObjectValidateBeforeCall(invokeContractJsonObjectV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invokeContractV1 + * @param invokeContractV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Call(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = invokeContractV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/invoke-contract"; + + 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 invokeContractV1ValidateBeforeCall(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + return invokeContractV1Call(invokeContractV1Request, _callback); + + } + + /** + * Invokes a contract on a xdai ledger + * + * @param invokeContractV1Request (optional) + * @return InvokeContractV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public InvokeContractV1Response invokeContractV1(InvokeContractV1Request invokeContractV1Request) throws ApiException { + ApiResponse localVarResp = invokeContractV1WithHttpInfo(invokeContractV1Request); + return localVarResp.getData(); + } + + /** + * Invokes a contract on a xdai ledger + * + * @param invokeContractV1Request (optional) + * @return ApiResponse<InvokeContractV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse invokeContractV1WithHttpInfo(InvokeContractV1Request invokeContractV1Request) throws ApiException { + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invokes a contract on a xdai ledger (asynchronously) + * + * @param invokeContractV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call invokeContractV1Async(InvokeContractV1Request invokeContractV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = invokeContractV1ValidateBeforeCall(invokeContractV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for runTransactionV1 + * @param runTransactionV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call runTransactionV1Call(RunTransactionV1Request runTransactionV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = runTransactionV1Request; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-xdai/run-transaction"; + + 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 runTransactionV1ValidateBeforeCall(RunTransactionV1Request runTransactionV1Request, final ApiCallback _callback) throws ApiException { + return runTransactionV1Call(runTransactionV1Request, _callback); + + } + + /** + * Executes a transaction on a xdai ledger + * + * @param runTransactionV1Request (optional) + * @return RunTransactionV1Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public RunTransactionV1Response runTransactionV1(RunTransactionV1Request runTransactionV1Request) throws ApiException { + ApiResponse localVarResp = runTransactionV1WithHttpInfo(runTransactionV1Request); + return localVarResp.getData(); + } + + /** + * Executes a transaction on a xdai ledger + * + * @param runTransactionV1Request (optional) + * @return ApiResponse<RunTransactionV1Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse runTransactionV1WithHttpInfo(RunTransactionV1Request runTransactionV1Request) throws ApiException { + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Executes a transaction on a xdai ledger (asynchronously) + * + * @param runTransactionV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call runTransactionV1Async(RunTransactionV1Request runTransactionV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = runTransactionV1ValidateBeforeCall(runTransactionV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..f8752c145fa --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..b916aaedaba --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..47d16fe3099 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..add22a2645e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..a0013ac38d6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsistencyStrategy.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsistencyStrategy.java new file mode 100644 index 00000000000..dcade87586f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ConsistencyStrategy.java @@ -0,0 +1,303 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ReceiptType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ConsistencyStrategy + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConsistencyStrategy { + public static final String SERIALIZED_NAME_RECEIPT_TYPE = "receiptType"; + @SerializedName(SERIALIZED_NAME_RECEIPT_TYPE) + private ReceiptType receiptType; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private Integer timeoutMs; + + public static final String SERIALIZED_NAME_BLOCK_CONFIRMATIONS = "blockConfirmations"; + @SerializedName(SERIALIZED_NAME_BLOCK_CONFIRMATIONS) + private Integer blockConfirmations; + + public static final String SERIALIZED_NAME_POLL_INTERVAL_MS = "pollIntervalMs"; + @SerializedName(SERIALIZED_NAME_POLL_INTERVAL_MS) + private Integer pollIntervalMs; + + public ConsistencyStrategy() { + } + + public ConsistencyStrategy receiptType(ReceiptType receiptType) { + + this.receiptType = receiptType; + return this; + } + + /** + * Get receiptType + * @return receiptType + **/ + @javax.annotation.Nonnull + public ReceiptType getReceiptType() { + return receiptType; + } + + + public void setReceiptType(ReceiptType receiptType) { + this.receiptType = receiptType; + } + + + public ConsistencyStrategy timeoutMs(Integer timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for the receipt to arrive to the connector. Defaults to 0 which means to wait for an unlimited amount of time. Note that this wait may be interrupted still by other parts of the infrastructure such as load balancers cutting of HTTP requests after some time even if they are the type that is supposed to be kept alive. The question of re-entrance is a broader topic not in scope to discuss here, but it is important to mention it. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public Integer getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(Integer timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public ConsistencyStrategy blockConfirmations(Integer blockConfirmations) { + + this.blockConfirmations = blockConfirmations; + return this; + } + + /** + * The number of blocks to wait to be confirmed in addition to the block containing the transaction in question. Note that if the receipt type is set to only wait for node transaction pool ACK and this parameter is set to anything, but zero then the API will not accept the request due to conflicting parameters. + * minimum: 0 + * maximum: 20000 + * @return blockConfirmations + **/ + @javax.annotation.Nonnull + public Integer getBlockConfirmations() { + return blockConfirmations; + } + + + public void setBlockConfirmations(Integer blockConfirmations) { + this.blockConfirmations = blockConfirmations; + } + + + public ConsistencyStrategy pollIntervalMs(Integer pollIntervalMs) { + + this.pollIntervalMs = pollIntervalMs; + return this; + } + + /** + * The amount of time (in milliseconds) connector will wait before making another confiramtion request to the network in case of previous confiramtion request fails + * minimum: 0 + * @return pollIntervalMs + **/ + @javax.annotation.Nullable + public Integer getPollIntervalMs() { + return pollIntervalMs; + } + + + public void setPollIntervalMs(Integer pollIntervalMs) { + this.pollIntervalMs = pollIntervalMs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsistencyStrategy consistencyStrategy = (ConsistencyStrategy) o; + return Objects.equals(this.receiptType, consistencyStrategy.receiptType) && + Objects.equals(this.timeoutMs, consistencyStrategy.timeoutMs) && + Objects.equals(this.blockConfirmations, consistencyStrategy.blockConfirmations) && + Objects.equals(this.pollIntervalMs, consistencyStrategy.pollIntervalMs); + } + + @Override + public int hashCode() { + return Objects.hash(receiptType, timeoutMs, blockConfirmations, pollIntervalMs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsistencyStrategy {\n"); + sb.append(" receiptType: ").append(toIndentedString(receiptType)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" blockConfirmations: ").append(toIndentedString(blockConfirmations)).append("\n"); + sb.append(" pollIntervalMs: ").append(toIndentedString(pollIntervalMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("receiptType"); + openapiFields.add("timeoutMs"); + openapiFields.add("blockConfirmations"); + openapiFields.add("pollIntervalMs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("receiptType"); + openapiRequiredFields.add("blockConfirmations"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ConsistencyStrategy + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ConsistencyStrategy.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsistencyStrategy is not found in the empty JSON string", ConsistencyStrategy.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ConsistencyStrategy.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ConsistencyStrategy` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConsistencyStrategy.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ConsistencyStrategy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsistencyStrategy' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsistencyStrategy.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ConsistencyStrategy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ConsistencyStrategy read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsistencyStrategy given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsistencyStrategy + * @throws IOException if the JSON string is invalid with respect to ConsistencyStrategy + */ + public static ConsistencyStrategy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsistencyStrategy.class); + } + + /** + * Convert an instance of ConsistencyStrategy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java new file mode 100644 index 00000000000..f476487e801 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ContractJSON.java @@ -0,0 +1,663 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ContractJSON + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ContractJSON { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_ABI = "abi"; + @SerializedName(SERIALIZED_NAME_ABI) + private List abi = new ArrayList<>(); + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private String metadata; + + public static final String SERIALIZED_NAME_DEPLOYED_BYTECODE = "deployedBytecode"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_BYTECODE) + private String deployedBytecode; + + public static final String SERIALIZED_NAME_SOURCE_MAP = "sourceMap"; + @SerializedName(SERIALIZED_NAME_SOURCE_MAP) + private String sourceMap; + + public static final String SERIALIZED_NAME_DEPLOYED_SOURCE_MAP = "deployedSourceMap"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_SOURCE_MAP) + private String deployedSourceMap; + + public static final String SERIALIZED_NAME_SOURCE_PATH = "sourcePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_PATH) + private String sourcePath; + + public static final String SERIALIZED_NAME_COMPILER = "compiler"; + @SerializedName(SERIALIZED_NAME_COMPILER) + private Object compiler; + + public static final String SERIALIZED_NAME_NETWORKS = "networks"; + @SerializedName(SERIALIZED_NAME_NETWORKS) + private Object networks; + + public static final String SERIALIZED_NAME_AST = "ast"; + @SerializedName(SERIALIZED_NAME_AST) + private Object ast; + + public static final String SERIALIZED_NAME_FUNCTION_HASHES = "functionHashes"; + @SerializedName(SERIALIZED_NAME_FUNCTION_HASHES) + private Object functionHashes; + + public static final String SERIALIZED_NAME_GAS_ESTIMATES = "gasEstimates"; + @SerializedName(SERIALIZED_NAME_GAS_ESTIMATES) + private Object gasEstimates; + + public ContractJSON() { + } + + public ContractJSON contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public ContractJSON bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * See https://ethereum.stackexchange.com/a/47556 regarding the maximum length of the bytecode + * @return bytecode + **/ + @javax.annotation.Nonnull + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public ContractJSON abi(List abi) { + + this.abi = abi; + return this; + } + + public ContractJSON addAbiItem(Object abiItem) { + if (this.abi == null) { + this.abi = new ArrayList<>(); + } + this.abi.add(abiItem); + return this; + } + + /** + * The application binary interface of the solidity contract, optional parameter + * @return abi + **/ + @javax.annotation.Nonnull + public List getAbi() { + return abi; + } + + + public void setAbi(List abi) { + this.abi = abi; + } + + + public ContractJSON metadata(String metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + public String getMetadata() { + return metadata; + } + + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + + public ContractJSON deployedBytecode(String deployedBytecode) { + + this.deployedBytecode = deployedBytecode; + return this; + } + + /** + * Get deployedBytecode + * @return deployedBytecode + **/ + @javax.annotation.Nullable + public String getDeployedBytecode() { + return deployedBytecode; + } + + + public void setDeployedBytecode(String deployedBytecode) { + this.deployedBytecode = deployedBytecode; + } + + + public ContractJSON sourceMap(String sourceMap) { + + this.sourceMap = sourceMap; + return this; + } + + /** + * Get sourceMap + * @return sourceMap + **/ + @javax.annotation.Nullable + public String getSourceMap() { + return sourceMap; + } + + + public void setSourceMap(String sourceMap) { + this.sourceMap = sourceMap; + } + + + public ContractJSON deployedSourceMap(String deployedSourceMap) { + + this.deployedSourceMap = deployedSourceMap; + return this; + } + + /** + * Get deployedSourceMap + * @return deployedSourceMap + **/ + @javax.annotation.Nullable + public String getDeployedSourceMap() { + return deployedSourceMap; + } + + + public void setDeployedSourceMap(String deployedSourceMap) { + this.deployedSourceMap = deployedSourceMap; + } + + + public ContractJSON sourcePath(String sourcePath) { + + this.sourcePath = sourcePath; + return this; + } + + /** + * Get sourcePath + * @return sourcePath + **/ + @javax.annotation.Nullable + public String getSourcePath() { + return sourcePath; + } + + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + } + + + public ContractJSON compiler(Object compiler) { + + this.compiler = compiler; + return this; + } + + /** + * Get compiler + * @return compiler + **/ + @javax.annotation.Nullable + public Object getCompiler() { + return compiler; + } + + + public void setCompiler(Object compiler) { + this.compiler = compiler; + } + + + public ContractJSON networks(Object networks) { + + this.networks = networks; + return this; + } + + /** + * Get networks + * @return networks + **/ + @javax.annotation.Nullable + public Object getNetworks() { + return networks; + } + + + public void setNetworks(Object networks) { + this.networks = networks; + } + + + public ContractJSON ast(Object ast) { + + this.ast = ast; + return this; + } + + /** + * Get ast + * @return ast + **/ + @javax.annotation.Nullable + public Object getAst() { + return ast; + } + + + public void setAst(Object ast) { + this.ast = ast; + } + + + public ContractJSON functionHashes(Object functionHashes) { + + this.functionHashes = functionHashes; + return this; + } + + /** + * Get functionHashes + * @return functionHashes + **/ + @javax.annotation.Nullable + public Object getFunctionHashes() { + return functionHashes; + } + + + public void setFunctionHashes(Object functionHashes) { + this.functionHashes = functionHashes; + } + + + public ContractJSON gasEstimates(Object gasEstimates) { + + this.gasEstimates = gasEstimates; + return this; + } + + /** + * Get gasEstimates + * @return gasEstimates + **/ + @javax.annotation.Nullable + public Object getGasEstimates() { + return gasEstimates; + } + + + public void setGasEstimates(Object gasEstimates) { + this.gasEstimates = gasEstimates; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ContractJSON instance itself + */ + public ContractJSON putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContractJSON contractJSON = (ContractJSON) o; + return Objects.equals(this.contractName, contractJSON.contractName) && + Objects.equals(this.bytecode, contractJSON.bytecode) && + Objects.equals(this.abi, contractJSON.abi) && + Objects.equals(this.metadata, contractJSON.metadata) && + Objects.equals(this.deployedBytecode, contractJSON.deployedBytecode) && + Objects.equals(this.sourceMap, contractJSON.sourceMap) && + Objects.equals(this.deployedSourceMap, contractJSON.deployedSourceMap) && + Objects.equals(this.sourcePath, contractJSON.sourcePath) && + Objects.equals(this.compiler, contractJSON.compiler) && + Objects.equals(this.networks, contractJSON.networks) && + Objects.equals(this.ast, contractJSON.ast) && + Objects.equals(this.functionHashes, contractJSON.functionHashes) && + Objects.equals(this.gasEstimates, contractJSON.gasEstimates)&& + Objects.equals(this.additionalProperties, contractJSON.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, bytecode, abi, metadata, deployedBytecode, sourceMap, deployedSourceMap, sourcePath, compiler, networks, ast, functionHashes, gasEstimates, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContractJSON {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" abi: ").append(toIndentedString(abi)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" deployedBytecode: ").append(toIndentedString(deployedBytecode)).append("\n"); + sb.append(" sourceMap: ").append(toIndentedString(sourceMap)).append("\n"); + sb.append(" deployedSourceMap: ").append(toIndentedString(deployedSourceMap)).append("\n"); + sb.append(" sourcePath: ").append(toIndentedString(sourcePath)).append("\n"); + sb.append(" compiler: ").append(toIndentedString(compiler)).append("\n"); + sb.append(" networks: ").append(toIndentedString(networks)).append("\n"); + sb.append(" ast: ").append(toIndentedString(ast)).append("\n"); + sb.append(" functionHashes: ").append(toIndentedString(functionHashes)).append("\n"); + sb.append(" gasEstimates: ").append(toIndentedString(gasEstimates)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("bytecode"); + openapiFields.add("abi"); + openapiFields.add("metadata"); + openapiFields.add("deployedBytecode"); + openapiFields.add("sourceMap"); + openapiFields.add("deployedSourceMap"); + openapiFields.add("sourcePath"); + openapiFields.add("compiler"); + openapiFields.add("networks"); + openapiFields.add("ast"); + openapiFields.add("functionHashes"); + openapiFields.add("gasEstimates"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("bytecode"); + openapiRequiredFields.add("abi"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ContractJSON + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ContractJSON.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ContractJSON is not found in the empty JSON string", ContractJSON.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ContractJSON.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if (!jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + // ensure the required json array is present + if (jsonObj.get("abi") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("abi").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `abi` to be an array in the JSON string but got `%s`", jsonObj.get("abi").toString())); + } + if ((jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) && !jsonObj.get("metadata").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `metadata` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadata").toString())); + } + if ((jsonObj.get("deployedBytecode") != null && !jsonObj.get("deployedBytecode").isJsonNull()) && !jsonObj.get("deployedBytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedBytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedBytecode").toString())); + } + if ((jsonObj.get("sourceMap") != null && !jsonObj.get("sourceMap").isJsonNull()) && !jsonObj.get("sourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceMap").toString())); + } + if ((jsonObj.get("deployedSourceMap") != null && !jsonObj.get("deployedSourceMap").isJsonNull()) && !jsonObj.get("deployedSourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedSourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedSourceMap").toString())); + } + if ((jsonObj.get("sourcePath") != null && !jsonObj.get("sourcePath").isJsonNull()) && !jsonObj.get("sourcePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourcePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourcePath").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ContractJSON.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ContractJSON' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ContractJSON.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ContractJSON value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ContractJSON read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + ContractJSON instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ContractJSON given an JSON string + * + * @param jsonString JSON string + * @return An instance of ContractJSON + * @throws IOException if the JSON string is invalid with respect to ContractJSON + */ + public static ContractJSON fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ContractJSON.class); + } + + /** + * Convert an instance of ContractJSON to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJsonObjectV1Request.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJsonObjectV1Request.java new file mode 100644 index 00000000000..170199c876c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractJsonObjectV1Request.java @@ -0,0 +1,377 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractJsonObjectV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractJsonObjectV1Request { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private String gasPrice; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private ContractJSON contractJSON; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public DeployContractJsonObjectV1Request() { + } + + public DeployContractJsonObjectV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public DeployContractJsonObjectV1Request gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + public DeployContractJsonObjectV1Request gasPrice(String gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public String getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(String gasPrice) { + this.gasPrice = gasPrice; + } + + + public DeployContractJsonObjectV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public DeployContractJsonObjectV1Request contractJSON(ContractJSON contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * Get contractJSON + * @return contractJSON + **/ + @javax.annotation.Nonnull + public ContractJSON getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(ContractJSON contractJSON) { + this.contractJSON = contractJSON; + } + + + public DeployContractJsonObjectV1Request constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public DeployContractJsonObjectV1Request addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * The list of arguments to pass in to the constructor of the contract being deployed. + * @return constructorArgs + **/ + @javax.annotation.Nullable + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractJsonObjectV1Request deployContractJsonObjectV1Request = (DeployContractJsonObjectV1Request) o; + return Objects.equals(this.web3SigningCredential, deployContractJsonObjectV1Request.web3SigningCredential) && + Objects.equals(this.gas, deployContractJsonObjectV1Request.gas) && + Objects.equals(this.gasPrice, deployContractJsonObjectV1Request.gasPrice) && + Objects.equals(this.timeoutMs, deployContractJsonObjectV1Request.timeoutMs) && + Objects.equals(this.contractJSON, deployContractJsonObjectV1Request.contractJSON) && + Objects.equals(this.constructorArgs, deployContractJsonObjectV1Request.constructorArgs); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, gas, gasPrice, timeoutMs, contractJSON, constructorArgs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractJsonObjectV1Request {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("timeoutMs"); + openapiFields.add("contractJSON"); + openapiFields.add("constructorArgs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("contractJSON"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractJsonObjectV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractJsonObjectV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractJsonObjectV1Request is not found in the empty JSON string", DeployContractJsonObjectV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractJsonObjectV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractJsonObjectV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractJsonObjectV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if ((jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) && !jsonObj.get("gasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasPrice").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractJsonObjectV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractJsonObjectV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractJsonObjectV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractJsonObjectV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractJsonObjectV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractJsonObjectV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractJsonObjectV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractJsonObjectV1Request + */ + public static DeployContractJsonObjectV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractJsonObjectV1Request.class); + } + + /** + * Convert an instance of DeployContractJsonObjectV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java new file mode 100644 index 00000000000..835e127b323 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Request.java @@ -0,0 +1,411 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractV1Request { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private BigDecimal gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private String gasPrice; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public DeployContractV1Request() { + } + + public DeployContractV1Request contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * The contract name for retrieve the contracts json on the keychain. + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public DeployContractV1Request constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public DeployContractV1Request addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * Get constructorArgs + * @return constructorArgs + **/ + @javax.annotation.Nullable + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public DeployContractV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public DeployContractV1Request keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychainId for retrieve the contracts json. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + public DeployContractV1Request gas(BigDecimal gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public BigDecimal getGas() { + return gas; + } + + + public void setGas(BigDecimal gas) { + this.gas = gas; + } + + + public DeployContractV1Request gasPrice(String gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public String getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(String gasPrice) { + this.gasPrice = gasPrice; + } + + + public DeployContractV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractV1Request deployContractV1Request = (DeployContractV1Request) o; + return Objects.equals(this.contractName, deployContractV1Request.contractName) && + Objects.equals(this.constructorArgs, deployContractV1Request.constructorArgs) && + Objects.equals(this.web3SigningCredential, deployContractV1Request.web3SigningCredential) && + Objects.equals(this.keychainId, deployContractV1Request.keychainId) && + Objects.equals(this.gas, deployContractV1Request.gas) && + Objects.equals(this.gasPrice, deployContractV1Request.gasPrice) && + Objects.equals(this.timeoutMs, deployContractV1Request.timeoutMs); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, constructorArgs, web3SigningCredential, keychainId, gas, gasPrice, timeoutMs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractV1Request {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("constructorArgs"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("keychainId"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("timeoutMs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractV1Request is not found in the empty JSON string", DeployContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + if ((jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) && !jsonObj.get("gasPrice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gasPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gasPrice").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractV1Request + * @throws IOException if the JSON string is invalid with respect to DeployContractV1Request + */ + public static DeployContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractV1Request.class); + } + + /** + * Convert an instance of DeployContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Response.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Response.java new file mode 100644 index 00000000000..7a3e9693d4c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployContractV1Response.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployContractV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public DeployContractV1Response() { + } + + public DeployContractV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployContractV1Response deployContractV1Response = (DeployContractV1Response) o; + return Objects.equals(this.transactionReceipt, deployContractV1Response.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployContractV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployContractV1Response is not found in the empty JSON string", DeployContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployContractV1Response + * @throws IOException if the JSON string is invalid with respect to DeployContractV1Response + */ + public static DeployContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployContractV1Response.class); + } + + /** + * Convert an instance of DeployContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployRequestBaseV1.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployRequestBaseV1.java new file mode 100644 index 00000000000..39f20b21488 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/DeployRequestBaseV1.java @@ -0,0 +1,383 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfigFrom; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * DeployRequestBaseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DeployRequestBaseV1 { + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private ContractJSON contractJSON; + + public static final String SERIALIZED_NAME_CONSTRUCTOR_ARGS = "constructorArgs"; + @SerializedName(SERIALIZED_NAME_CONSTRUCTOR_ARGS) + private List constructorArgs = null; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private XdaiTransactionConfigFrom gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private XdaiTransactionConfigFrom gasPrice; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public DeployRequestBaseV1() { + } + + public DeployRequestBaseV1 contractJSON(ContractJSON contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * Get contractJSON + * @return contractJSON + **/ + @javax.annotation.Nonnull + public ContractJSON getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(ContractJSON contractJSON) { + this.contractJSON = contractJSON; + } + + + public DeployRequestBaseV1 constructorArgs(List constructorArgs) { + + this.constructorArgs = constructorArgs; + return this; + } + + public DeployRequestBaseV1 addConstructorArgsItem(Object constructorArgsItem) { + if (this.constructorArgs == null) { + this.constructorArgs = null; + } + this.constructorArgs.add(constructorArgsItem); + return this; + } + + /** + * Get constructorArgs + * @return constructorArgs + **/ + @javax.annotation.Nullable + public List getConstructorArgs() { + return constructorArgs; + } + + + public void setConstructorArgs(List constructorArgs) { + this.constructorArgs = constructorArgs; + } + + + public DeployRequestBaseV1 web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public DeployRequestBaseV1 gas(XdaiTransactionConfigFrom gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGas() { + return gas; + } + + + public void setGas(XdaiTransactionConfigFrom gas) { + this.gas = gas; + } + + + public DeployRequestBaseV1 gasPrice(XdaiTransactionConfigFrom gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(XdaiTransactionConfigFrom gasPrice) { + this.gasPrice = gasPrice; + } + + + public DeployRequestBaseV1 timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt with theaddress of the contract(which indicates successful deployment) beforegiving up and crashing. + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeployRequestBaseV1 deployRequestBaseV1 = (DeployRequestBaseV1) o; + return Objects.equals(this.contractJSON, deployRequestBaseV1.contractJSON) && + Objects.equals(this.constructorArgs, deployRequestBaseV1.constructorArgs) && + Objects.equals(this.web3SigningCredential, deployRequestBaseV1.web3SigningCredential) && + Objects.equals(this.gas, deployRequestBaseV1.gas) && + Objects.equals(this.gasPrice, deployRequestBaseV1.gasPrice) && + Objects.equals(this.timeoutMs, deployRequestBaseV1.timeoutMs); + } + + @Override + public int hashCode() { + return Objects.hash(contractJSON, constructorArgs, web3SigningCredential, gas, gasPrice, timeoutMs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeployRequestBaseV1 {\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append(" constructorArgs: ").append(toIndentedString(constructorArgs)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractJSON"); + openapiFields.add("constructorArgs"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("timeoutMs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractJSON"); + openapiRequiredFields.add("web3SigningCredential"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeployRequestBaseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!DeployRequestBaseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeployRequestBaseV1 is not found in the empty JSON string", DeployRequestBaseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeployRequestBaseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeployRequestBaseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeployRequestBaseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("constructorArgs") != null && !jsonObj.get("constructorArgs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `constructorArgs` to be an array in the JSON string but got `%s`", jsonObj.get("constructorArgs").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DeployRequestBaseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeployRequestBaseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeployRequestBaseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DeployRequestBaseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DeployRequestBaseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeployRequestBaseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeployRequestBaseV1 + * @throws IOException if the JSON string is invalid with respect to DeployRequestBaseV1 + */ + public static DeployRequestBaseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeployRequestBaseV1.class); + } + + /** + * Convert an instance of DeployRequestBaseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java new file mode 100644 index 00000000000..7cca84fc50c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/EthContractInvocationType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets EthContractInvocationType + */ +@JsonAdapter(EthContractInvocationType.Adapter.class) +public enum EthContractInvocationType { + + SEND("SEND"), + + CALL("CALL"); + + private String value; + + EthContractInvocationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EthContractInvocationType fromValue(String value) { + for (EthContractInvocationType b : EthContractInvocationType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EthContractInvocationType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EthContractInvocationType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EthContractInvocationType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java new file mode 100644 index 00000000000..868de4dba0b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractJsonObjectV1Request.java @@ -0,0 +1,540 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfigFrom; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractJsonObjectV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractJsonObjectV1Request { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private XdaiTransactionConfigFrom value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private XdaiTransactionConfigFrom gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private XdaiTransactionConfigFrom gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private ContractJSON contractJSON; + + public InvokeContractJsonObjectV1Request() { + } + + public InvokeContractJsonObjectV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InvokeContractJsonObjectV1Request invocationType(EthContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public EthContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public InvokeContractJsonObjectV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the contract method to invoke. + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeContractJsonObjectV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeContractJsonObjectV1Request addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeContractJsonObjectV1Request contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Address of the solidity contract + * @return contractAddress + **/ + @javax.annotation.Nonnull + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public InvokeContractJsonObjectV1Request value(XdaiTransactionConfigFrom value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getValue() { + return value; + } + + + public void setValue(XdaiTransactionConfigFrom value) { + this.value = value; + } + + + public InvokeContractJsonObjectV1Request gas(XdaiTransactionConfigFrom gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGas() { + return gas; + } + + + public void setGas(XdaiTransactionConfigFrom gas) { + this.gas = gas; + } + + + public InvokeContractJsonObjectV1Request gasPrice(XdaiTransactionConfigFrom gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(XdaiTransactionConfigFrom gasPrice) { + this.gasPrice = gasPrice; + } + + + public InvokeContractJsonObjectV1Request nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public InvokeContractJsonObjectV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public InvokeContractJsonObjectV1Request contractJSON(ContractJSON contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * Get contractJSON + * @return contractJSON + **/ + @javax.annotation.Nonnull + public ContractJSON getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(ContractJSON contractJSON) { + this.contractJSON = contractJSON; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request = (InvokeContractJsonObjectV1Request) o; + return Objects.equals(this.web3SigningCredential, invokeContractJsonObjectV1Request.web3SigningCredential) && + Objects.equals(this.invocationType, invokeContractJsonObjectV1Request.invocationType) && + Objects.equals(this.methodName, invokeContractJsonObjectV1Request.methodName) && + Objects.equals(this.params, invokeContractJsonObjectV1Request.params) && + Objects.equals(this.contractAddress, invokeContractJsonObjectV1Request.contractAddress) && + Objects.equals(this.value, invokeContractJsonObjectV1Request.value) && + Objects.equals(this.gas, invokeContractJsonObjectV1Request.gas) && + Objects.equals(this.gasPrice, invokeContractJsonObjectV1Request.gasPrice) && + Objects.equals(this.nonce, invokeContractJsonObjectV1Request.nonce) && + Objects.equals(this.timeoutMs, invokeContractJsonObjectV1Request.timeoutMs) && + Objects.equals(this.contractJSON, invokeContractJsonObjectV1Request.contractJSON); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, invocationType, methodName, params, contractAddress, value, gas, gasPrice, nonce, timeoutMs, contractJSON); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractJsonObjectV1Request {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("contractAddress"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("timeoutMs"); + openapiFields.add("contractJSON"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + openapiRequiredFields.add("contractAddress"); + openapiRequiredFields.add("contractJSON"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractJsonObjectV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractJsonObjectV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractJsonObjectV1Request is not found in the empty JSON string", InvokeContractJsonObjectV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractJsonObjectV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractJsonObjectV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractJsonObjectV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + if (!jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractJsonObjectV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractJsonObjectV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractJsonObjectV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractJsonObjectV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractJsonObjectV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractJsonObjectV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractJsonObjectV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeContractJsonObjectV1Request + */ + public static InvokeContractJsonObjectV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractJsonObjectV1Request.class); + } + + /** + * Convert an instance of InvokeContractJsonObjectV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java new file mode 100644 index 00000000000..8b7017b1ec8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Request.java @@ -0,0 +1,542 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfigFrom; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Request { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private XdaiTransactionConfigFrom value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private XdaiTransactionConfigFrom gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private XdaiTransactionConfigFrom gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public InvokeContractV1Request() { + } + + public InvokeContractV1Request contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * The contract name to find it in the keychain plugin + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public InvokeContractV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InvokeContractV1Request invocationType(EthContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public EthContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public InvokeContractV1Request methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the contract method to invoke. + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeContractV1Request params(List params) { + + this.params = params; + return this; + } + + public InvokeContractV1Request addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeContractV1Request value(XdaiTransactionConfigFrom value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getValue() { + return value; + } + + + public void setValue(XdaiTransactionConfigFrom value) { + this.value = value; + } + + + public InvokeContractV1Request gas(XdaiTransactionConfigFrom gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGas() { + return gas; + } + + + public void setGas(XdaiTransactionConfigFrom gas) { + this.gas = gas; + } + + + public InvokeContractV1Request gasPrice(XdaiTransactionConfigFrom gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(XdaiTransactionConfigFrom gasPrice) { + this.gasPrice = gasPrice; + } + + + public InvokeContractV1Request nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public InvokeContractV1Request timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public InvokeContractV1Request keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychainId for retrieve the contracts json. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Request invokeContractV1Request = (InvokeContractV1Request) o; + return Objects.equals(this.contractName, invokeContractV1Request.contractName) && + Objects.equals(this.web3SigningCredential, invokeContractV1Request.web3SigningCredential) && + Objects.equals(this.invocationType, invokeContractV1Request.invocationType) && + Objects.equals(this.methodName, invokeContractV1Request.methodName) && + Objects.equals(this.params, invokeContractV1Request.params) && + Objects.equals(this.value, invokeContractV1Request.value) && + Objects.equals(this.gas, invokeContractV1Request.gas) && + Objects.equals(this.gasPrice, invokeContractV1Request.gasPrice) && + Objects.equals(this.nonce, invokeContractV1Request.nonce) && + Objects.equals(this.timeoutMs, invokeContractV1Request.timeoutMs) && + Objects.equals(this.keychainId, invokeContractV1Request.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, web3SigningCredential, invocationType, methodName, params, value, gas, gasPrice, nonce, timeoutMs, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Request {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("timeoutMs"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Request is not found in the empty JSON string", InvokeContractV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Request + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Request + */ + public static InvokeContractV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Request.class); + } + + /** + * Convert an instance of InvokeContractV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java new file mode 100644 index 00000000000..294d8009202 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeContractV1Response.java @@ -0,0 +1,282 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeContractV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeContractV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public static final String SERIALIZED_NAME_CALL_OUTPUT = "callOutput"; + @SerializedName(SERIALIZED_NAME_CALL_OUTPUT) + private Object callOutput = null; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public InvokeContractV1Response() { + } + + public InvokeContractV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nullable + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + public InvokeContractV1Response callOutput(Object callOutput) { + + this.callOutput = callOutput; + return this; + } + + /** + * Get callOutput + * @return callOutput + **/ + @javax.annotation.Nullable + public Object getCallOutput() { + return callOutput; + } + + + public void setCallOutput(Object callOutput) { + this.callOutput = callOutput; + } + + + public InvokeContractV1Response success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeContractV1Response invokeContractV1Response = (InvokeContractV1Response) o; + return Objects.equals(this.transactionReceipt, invokeContractV1Response.transactionReceipt) && + Objects.equals(this.callOutput, invokeContractV1Response.callOutput) && + Objects.equals(this.success, invokeContractV1Response.success); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt, callOutput, success); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeContractV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append(" callOutput: ").append(toIndentedString(callOutput)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + openapiFields.add("callOutput"); + openapiFields.add("success"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("success"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeContractV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeContractV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeContractV1Response is not found in the empty JSON string", InvokeContractV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeContractV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeContractV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeContractV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeContractV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeContractV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeContractV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeContractV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeContractV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeContractV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeContractV1Response + * @throws IOException if the JSON string is invalid with respect to InvokeContractV1Response + */ + public static InvokeContractV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeContractV1Response.class); + } + + /** + * Convert an instance of InvokeContractV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRequestBaseV1.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRequestBaseV1.java new file mode 100644 index 00000000000..9fc86a2ac77 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/InvokeRequestBaseV1.java @@ -0,0 +1,540 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfigFrom; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * InvokeRequestBaseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class InvokeRequestBaseV1 { + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_INVOCATION_TYPE = "invocationType"; + @SerializedName(SERIALIZED_NAME_INVOCATION_TYPE) + private EthContractInvocationType invocationType; + + public static final String SERIALIZED_NAME_METHOD_NAME = "methodName"; + @SerializedName(SERIALIZED_NAME_METHOD_NAME) + private String methodName; + + public static final String SERIALIZED_NAME_PARAMS = "params"; + @SerializedName(SERIALIZED_NAME_PARAMS) + private List params = null; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private XdaiTransactionConfigFrom value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private XdaiTransactionConfigFrom gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private XdaiTransactionConfigFrom gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_TIMEOUT_MS = "timeoutMs"; + @SerializedName(SERIALIZED_NAME_TIMEOUT_MS) + private BigDecimal timeoutMs = new BigDecimal("60000"); + + public static final String SERIALIZED_NAME_CONTRACT_J_S_O_N = "contractJSON"; + @SerializedName(SERIALIZED_NAME_CONTRACT_J_S_O_N) + private ContractJSON contractJSON; + + public InvokeRequestBaseV1() { + } + + public InvokeRequestBaseV1 contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Address of the solidity contract + * @return contractAddress + **/ + @javax.annotation.Nonnull + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public InvokeRequestBaseV1 web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public InvokeRequestBaseV1 invocationType(EthContractInvocationType invocationType) { + + this.invocationType = invocationType; + return this; + } + + /** + * Get invocationType + * @return invocationType + **/ + @javax.annotation.Nonnull + public EthContractInvocationType getInvocationType() { + return invocationType; + } + + + public void setInvocationType(EthContractInvocationType invocationType) { + this.invocationType = invocationType; + } + + + public InvokeRequestBaseV1 methodName(String methodName) { + + this.methodName = methodName; + return this; + } + + /** + * The name of the contract method to invoke. + * @return methodName + **/ + @javax.annotation.Nonnull + public String getMethodName() { + return methodName; + } + + + public void setMethodName(String methodName) { + this.methodName = methodName; + } + + + public InvokeRequestBaseV1 params(List params) { + + this.params = params; + return this; + } + + public InvokeRequestBaseV1 addParamsItem(Object paramsItem) { + if (this.params == null) { + this.params = null; + } + this.params.add(paramsItem); + return this; + } + + /** + * The list of arguments to pass in to the contract method being invoked. + * @return params + **/ + @javax.annotation.Nonnull + public List getParams() { + return params; + } + + + public void setParams(List params) { + this.params = params; + } + + + public InvokeRequestBaseV1 value(XdaiTransactionConfigFrom value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getValue() { + return value; + } + + + public void setValue(XdaiTransactionConfigFrom value) { + this.value = value; + } + + + public InvokeRequestBaseV1 gas(XdaiTransactionConfigFrom gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGas() { + return gas; + } + + + public void setGas(XdaiTransactionConfigFrom gas) { + this.gas = gas; + } + + + public InvokeRequestBaseV1 gasPrice(XdaiTransactionConfigFrom gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(XdaiTransactionConfigFrom gasPrice) { + this.gasPrice = gasPrice; + } + + + public InvokeRequestBaseV1 nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public InvokeRequestBaseV1 timeoutMs(BigDecimal timeoutMs) { + + this.timeoutMs = timeoutMs; + return this; + } + + /** + * The amount of milliseconds to wait for a transaction receipt beforegiving up and crashing. Only has any effect if the invocation type is SEND + * minimum: 0 + * @return timeoutMs + **/ + @javax.annotation.Nullable + public BigDecimal getTimeoutMs() { + return timeoutMs; + } + + + public void setTimeoutMs(BigDecimal timeoutMs) { + this.timeoutMs = timeoutMs; + } + + + public InvokeRequestBaseV1 contractJSON(ContractJSON contractJSON) { + + this.contractJSON = contractJSON; + return this; + } + + /** + * Get contractJSON + * @return contractJSON + **/ + @javax.annotation.Nonnull + public ContractJSON getContractJSON() { + return contractJSON; + } + + + public void setContractJSON(ContractJSON contractJSON) { + this.contractJSON = contractJSON; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvokeRequestBaseV1 invokeRequestBaseV1 = (InvokeRequestBaseV1) o; + return Objects.equals(this.contractAddress, invokeRequestBaseV1.contractAddress) && + Objects.equals(this.web3SigningCredential, invokeRequestBaseV1.web3SigningCredential) && + Objects.equals(this.invocationType, invokeRequestBaseV1.invocationType) && + Objects.equals(this.methodName, invokeRequestBaseV1.methodName) && + Objects.equals(this.params, invokeRequestBaseV1.params) && + Objects.equals(this.value, invokeRequestBaseV1.value) && + Objects.equals(this.gas, invokeRequestBaseV1.gas) && + Objects.equals(this.gasPrice, invokeRequestBaseV1.gasPrice) && + Objects.equals(this.nonce, invokeRequestBaseV1.nonce) && + Objects.equals(this.timeoutMs, invokeRequestBaseV1.timeoutMs) && + Objects.equals(this.contractJSON, invokeRequestBaseV1.contractJSON); + } + + @Override + public int hashCode() { + return Objects.hash(contractAddress, web3SigningCredential, invocationType, methodName, params, value, gas, gasPrice, nonce, timeoutMs, contractJSON); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvokeRequestBaseV1 {\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" invocationType: ").append(toIndentedString(invocationType)).append("\n"); + sb.append(" methodName: ").append(toIndentedString(methodName)).append("\n"); + sb.append(" params: ").append(toIndentedString(params)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" timeoutMs: ").append(toIndentedString(timeoutMs)).append("\n"); + sb.append(" contractJSON: ").append(toIndentedString(contractJSON)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractAddress"); + openapiFields.add("web3SigningCredential"); + openapiFields.add("invocationType"); + openapiFields.add("methodName"); + openapiFields.add("params"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("timeoutMs"); + openapiFields.add("contractJSON"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractAddress"); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("invocationType"); + openapiRequiredFields.add("methodName"); + openapiRequiredFields.add("params"); + openapiRequiredFields.add("contractJSON"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvokeRequestBaseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!InvokeRequestBaseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvokeRequestBaseV1 is not found in the empty JSON string", InvokeRequestBaseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvokeRequestBaseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvokeRequestBaseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvokeRequestBaseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + if (!jsonObj.get("methodName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `methodName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("methodName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("params") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("params").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `params` to be an array in the JSON string but got `%s`", jsonObj.get("params").toString())); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvokeRequestBaseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvokeRequestBaseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvokeRequestBaseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvokeRequestBaseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvokeRequestBaseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvokeRequestBaseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvokeRequestBaseV1 + * @throws IOException if the JSON string is invalid with respect to InvokeRequestBaseV1 + */ + public static InvokeRequestBaseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvokeRequestBaseV1.class); + } + + /** + * Convert an instance of InvokeRequestBaseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ReceiptType.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ReceiptType.java new file mode 100644 index 00000000000..28c3865e9c4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ReceiptType.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Enumerates the possible types of receipts that can be waited for by someone or something that has requested the execution of a transaction on a ledger. + */ +@JsonAdapter(ReceiptType.Adapter.class) +public enum ReceiptType { + + NODE_TX_POOL_ACK("NODE_TX_POOL_ACK"), + + LEDGER_BLOCK_ACK("LEDGER_BLOCK_ACK"); + + private String value; + + ReceiptType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ReceiptType fromValue(String value) { + for (ReceiptType b : ReceiptType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ReceiptType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ReceiptType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ReceiptType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionV1Request.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionV1Request.java new file mode 100644 index 00000000000..afaea7de46a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionV1Request.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.ConsistencyStrategy; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfig; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionV1Request { + public static final String SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL = "web3SigningCredential"; + @SerializedName(SERIALIZED_NAME_WEB3_SIGNING_CREDENTIAL) + private Web3SigningCredential web3SigningCredential; + + public static final String SERIALIZED_NAME_TRANSACTION_CONFIG = "transactionConfig"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_CONFIG) + private XdaiTransactionConfig transactionConfig; + + public static final String SERIALIZED_NAME_CONSISTENCY_STRATEGY = "consistencyStrategy"; + @SerializedName(SERIALIZED_NAME_CONSISTENCY_STRATEGY) + private ConsistencyStrategy consistencyStrategy; + + public RunTransactionV1Request() { + } + + public RunTransactionV1Request web3SigningCredential(Web3SigningCredential web3SigningCredential) { + + this.web3SigningCredential = web3SigningCredential; + return this; + } + + /** + * Get web3SigningCredential + * @return web3SigningCredential + **/ + @javax.annotation.Nonnull + public Web3SigningCredential getWeb3SigningCredential() { + return web3SigningCredential; + } + + + public void setWeb3SigningCredential(Web3SigningCredential web3SigningCredential) { + this.web3SigningCredential = web3SigningCredential; + } + + + public RunTransactionV1Request transactionConfig(XdaiTransactionConfig transactionConfig) { + + this.transactionConfig = transactionConfig; + return this; + } + + /** + * Get transactionConfig + * @return transactionConfig + **/ + @javax.annotation.Nonnull + public XdaiTransactionConfig getTransactionConfig() { + return transactionConfig; + } + + + public void setTransactionConfig(XdaiTransactionConfig transactionConfig) { + this.transactionConfig = transactionConfig; + } + + + public RunTransactionV1Request consistencyStrategy(ConsistencyStrategy consistencyStrategy) { + + this.consistencyStrategy = consistencyStrategy; + return this; + } + + /** + * Get consistencyStrategy + * @return consistencyStrategy + **/ + @javax.annotation.Nonnull + public ConsistencyStrategy getConsistencyStrategy() { + return consistencyStrategy; + } + + + public void setConsistencyStrategy(ConsistencyStrategy consistencyStrategy) { + this.consistencyStrategy = consistencyStrategy; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionV1Request runTransactionV1Request = (RunTransactionV1Request) o; + return Objects.equals(this.web3SigningCredential, runTransactionV1Request.web3SigningCredential) && + Objects.equals(this.transactionConfig, runTransactionV1Request.transactionConfig) && + Objects.equals(this.consistencyStrategy, runTransactionV1Request.consistencyStrategy); + } + + @Override + public int hashCode() { + return Objects.hash(web3SigningCredential, transactionConfig, consistencyStrategy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionV1Request {\n"); + sb.append(" web3SigningCredential: ").append(toIndentedString(web3SigningCredential)).append("\n"); + sb.append(" transactionConfig: ").append(toIndentedString(transactionConfig)).append("\n"); + sb.append(" consistencyStrategy: ").append(toIndentedString(consistencyStrategy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("web3SigningCredential"); + openapiFields.add("transactionConfig"); + openapiFields.add("consistencyStrategy"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("web3SigningCredential"); + openapiRequiredFields.add("transactionConfig"); + openapiRequiredFields.add("consistencyStrategy"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionV1Request is not found in the empty JSON string", RunTransactionV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `web3SigningCredential` + Web3SigningCredential.validateJsonObject(jsonObj.getAsJsonObject("web3SigningCredential")); + // validate the required field `consistencyStrategy` + ConsistencyStrategy.validateJsonObject(jsonObj.getAsJsonObject("consistencyStrategy")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionV1Request + * @throws IOException if the JSON string is invalid with respect to RunTransactionV1Request + */ + public static RunTransactionV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionV1Request.class); + } + + /** + * Convert an instance of RunTransactionV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionV1Response.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionV1Response.java new file mode 100644 index 00000000000..a342eddeed6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RunTransactionV1Response.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3TransactionReceipt; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RunTransactionV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RunTransactionV1Response { + public static final String SERIALIZED_NAME_TRANSACTION_RECEIPT = "transactionReceipt"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RECEIPT) + private Web3TransactionReceipt transactionReceipt; + + public RunTransactionV1Response() { + } + + public RunTransactionV1Response transactionReceipt(Web3TransactionReceipt transactionReceipt) { + + this.transactionReceipt = transactionReceipt; + return this; + } + + /** + * Get transactionReceipt + * @return transactionReceipt + **/ + @javax.annotation.Nonnull + public Web3TransactionReceipt getTransactionReceipt() { + return transactionReceipt; + } + + + public void setTransactionReceipt(Web3TransactionReceipt transactionReceipt) { + this.transactionReceipt = transactionReceipt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RunTransactionV1Response runTransactionV1Response = (RunTransactionV1Response) o; + return Objects.equals(this.transactionReceipt, runTransactionV1Response.transactionReceipt); + } + + @Override + public int hashCode() { + return Objects.hash(transactionReceipt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RunTransactionV1Response {\n"); + sb.append(" transactionReceipt: ").append(toIndentedString(transactionReceipt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("transactionReceipt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("transactionReceipt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RunTransactionV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RunTransactionV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RunTransactionV1Response is not found in the empty JSON string", RunTransactionV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RunTransactionV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RunTransactionV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RunTransactionV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RunTransactionV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RunTransactionV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RunTransactionV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RunTransactionV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RunTransactionV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RunTransactionV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of RunTransactionV1Response + * @throws IOException if the JSON string is invalid with respect to RunTransactionV1Response + */ + public static RunTransactionV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RunTransactionV1Response.class); + } + + /** + * Convert an instance of RunTransactionV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java new file mode 100644 index 00000000000..7b47452a23d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifact.java @@ -0,0 +1,502 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactCompiler; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifact + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifact { + public static final String SERIALIZED_NAME_CONTRACT_NAME = "contractName"; + @SerializedName(SERIALIZED_NAME_CONTRACT_NAME) + private String contractName; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private String metadata; + + public static final String SERIALIZED_NAME_BYTECODE = "bytecode"; + @SerializedName(SERIALIZED_NAME_BYTECODE) + private String bytecode; + + public static final String SERIALIZED_NAME_DEPLOYED_BYTECODE = "deployedBytecode"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_BYTECODE) + private String deployedBytecode; + + public static final String SERIALIZED_NAME_SOURCE_MAP = "sourceMap"; + @SerializedName(SERIALIZED_NAME_SOURCE_MAP) + private String sourceMap; + + public static final String SERIALIZED_NAME_DEPLOYED_SOURCE_MAP = "deployedSourceMap"; + @SerializedName(SERIALIZED_NAME_DEPLOYED_SOURCE_MAP) + private String deployedSourceMap; + + public static final String SERIALIZED_NAME_SOURCE_PATH = "sourcePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_PATH) + private String sourcePath; + + public static final String SERIALIZED_NAME_COMPILER = "compiler"; + @SerializedName(SERIALIZED_NAME_COMPILER) + private SolidityContractJsonArtifactCompiler compiler; + + public static final String SERIALIZED_NAME_FUNCTION_HASHES = "functionHashes"; + @SerializedName(SERIALIZED_NAME_FUNCTION_HASHES) + private Map functionHashes = new HashMap<>(); + + public static final String SERIALIZED_NAME_GAS_ESTIMATES = "gasEstimates"; + @SerializedName(SERIALIZED_NAME_GAS_ESTIMATES) + private SolidityContractJsonArtifactGasEstimates gasEstimates; + + public SolidityContractJsonArtifact() { + } + + public SolidityContractJsonArtifact contractName(String contractName) { + + this.contractName = contractName; + return this; + } + + /** + * Get contractName + * @return contractName + **/ + @javax.annotation.Nonnull + public String getContractName() { + return contractName; + } + + + public void setContractName(String contractName) { + this.contractName = contractName; + } + + + public SolidityContractJsonArtifact metadata(String metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + **/ + @javax.annotation.Nullable + public String getMetadata() { + return metadata; + } + + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + + public SolidityContractJsonArtifact bytecode(String bytecode) { + + this.bytecode = bytecode; + return this; + } + + /** + * Get bytecode + * @return bytecode + **/ + @javax.annotation.Nullable + public String getBytecode() { + return bytecode; + } + + + public void setBytecode(String bytecode) { + this.bytecode = bytecode; + } + + + public SolidityContractJsonArtifact deployedBytecode(String deployedBytecode) { + + this.deployedBytecode = deployedBytecode; + return this; + } + + /** + * Get deployedBytecode + * @return deployedBytecode + **/ + @javax.annotation.Nullable + public String getDeployedBytecode() { + return deployedBytecode; + } + + + public void setDeployedBytecode(String deployedBytecode) { + this.deployedBytecode = deployedBytecode; + } + + + public SolidityContractJsonArtifact sourceMap(String sourceMap) { + + this.sourceMap = sourceMap; + return this; + } + + /** + * Get sourceMap + * @return sourceMap + **/ + @javax.annotation.Nullable + public String getSourceMap() { + return sourceMap; + } + + + public void setSourceMap(String sourceMap) { + this.sourceMap = sourceMap; + } + + + public SolidityContractJsonArtifact deployedSourceMap(String deployedSourceMap) { + + this.deployedSourceMap = deployedSourceMap; + return this; + } + + /** + * Get deployedSourceMap + * @return deployedSourceMap + **/ + @javax.annotation.Nullable + public String getDeployedSourceMap() { + return deployedSourceMap; + } + + + public void setDeployedSourceMap(String deployedSourceMap) { + this.deployedSourceMap = deployedSourceMap; + } + + + public SolidityContractJsonArtifact sourcePath(String sourcePath) { + + this.sourcePath = sourcePath; + return this; + } + + /** + * Get sourcePath + * @return sourcePath + **/ + @javax.annotation.Nullable + public String getSourcePath() { + return sourcePath; + } + + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + } + + + public SolidityContractJsonArtifact compiler(SolidityContractJsonArtifactCompiler compiler) { + + this.compiler = compiler; + return this; + } + + /** + * Get compiler + * @return compiler + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactCompiler getCompiler() { + return compiler; + } + + + public void setCompiler(SolidityContractJsonArtifactCompiler compiler) { + this.compiler = compiler; + } + + + public SolidityContractJsonArtifact functionHashes(Map functionHashes) { + + this.functionHashes = functionHashes; + return this; + } + + public SolidityContractJsonArtifact putFunctionHashesItem(String key, Object functionHashesItem) { + if (this.functionHashes == null) { + this.functionHashes = new HashMap<>(); + } + this.functionHashes.put(key, functionHashesItem); + return this; + } + + /** + * Get functionHashes + * @return functionHashes + **/ + @javax.annotation.Nullable + public Map getFunctionHashes() { + return functionHashes; + } + + + public void setFunctionHashes(Map functionHashes) { + this.functionHashes = functionHashes; + } + + + public SolidityContractJsonArtifact gasEstimates(SolidityContractJsonArtifactGasEstimates gasEstimates) { + + this.gasEstimates = gasEstimates; + return this; + } + + /** + * Get gasEstimates + * @return gasEstimates + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactGasEstimates getGasEstimates() { + return gasEstimates; + } + + + public void setGasEstimates(SolidityContractJsonArtifactGasEstimates gasEstimates) { + this.gasEstimates = gasEstimates; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifact solidityContractJsonArtifact = (SolidityContractJsonArtifact) o; + return Objects.equals(this.contractName, solidityContractJsonArtifact.contractName) && + Objects.equals(this.metadata, solidityContractJsonArtifact.metadata) && + Objects.equals(this.bytecode, solidityContractJsonArtifact.bytecode) && + Objects.equals(this.deployedBytecode, solidityContractJsonArtifact.deployedBytecode) && + Objects.equals(this.sourceMap, solidityContractJsonArtifact.sourceMap) && + Objects.equals(this.deployedSourceMap, solidityContractJsonArtifact.deployedSourceMap) && + Objects.equals(this.sourcePath, solidityContractJsonArtifact.sourcePath) && + Objects.equals(this.compiler, solidityContractJsonArtifact.compiler) && + Objects.equals(this.functionHashes, solidityContractJsonArtifact.functionHashes) && + Objects.equals(this.gasEstimates, solidityContractJsonArtifact.gasEstimates); + } + + @Override + public int hashCode() { + return Objects.hash(contractName, metadata, bytecode, deployedBytecode, sourceMap, deployedSourceMap, sourcePath, compiler, functionHashes, gasEstimates); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifact {\n"); + sb.append(" contractName: ").append(toIndentedString(contractName)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" bytecode: ").append(toIndentedString(bytecode)).append("\n"); + sb.append(" deployedBytecode: ").append(toIndentedString(deployedBytecode)).append("\n"); + sb.append(" sourceMap: ").append(toIndentedString(sourceMap)).append("\n"); + sb.append(" deployedSourceMap: ").append(toIndentedString(deployedSourceMap)).append("\n"); + sb.append(" sourcePath: ").append(toIndentedString(sourcePath)).append("\n"); + sb.append(" compiler: ").append(toIndentedString(compiler)).append("\n"); + sb.append(" functionHashes: ").append(toIndentedString(functionHashes)).append("\n"); + sb.append(" gasEstimates: ").append(toIndentedString(gasEstimates)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("contractName"); + openapiFields.add("metadata"); + openapiFields.add("bytecode"); + openapiFields.add("deployedBytecode"); + openapiFields.add("sourceMap"); + openapiFields.add("deployedSourceMap"); + openapiFields.add("sourcePath"); + openapiFields.add("compiler"); + openapiFields.add("functionHashes"); + openapiFields.add("gasEstimates"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("contractName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifact + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifact.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifact is not found in the empty JSON string", SolidityContractJsonArtifact.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifact.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifact` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SolidityContractJsonArtifact.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("contractName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractName").toString())); + } + if ((jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) && !jsonObj.get("metadata").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `metadata` to be a primitive type in the JSON string but got `%s`", jsonObj.get("metadata").toString())); + } + if ((jsonObj.get("bytecode") != null && !jsonObj.get("bytecode").isJsonNull()) && !jsonObj.get("bytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bytecode").toString())); + } + if ((jsonObj.get("deployedBytecode") != null && !jsonObj.get("deployedBytecode").isJsonNull()) && !jsonObj.get("deployedBytecode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedBytecode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedBytecode").toString())); + } + if ((jsonObj.get("sourceMap") != null && !jsonObj.get("sourceMap").isJsonNull()) && !jsonObj.get("sourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceMap").toString())); + } + if ((jsonObj.get("deployedSourceMap") != null && !jsonObj.get("deployedSourceMap").isJsonNull()) && !jsonObj.get("deployedSourceMap").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deployedSourceMap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deployedSourceMap").toString())); + } + if ((jsonObj.get("sourcePath") != null && !jsonObj.get("sourcePath").isJsonNull()) && !jsonObj.get("sourcePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourcePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourcePath").toString())); + } + // validate the optional field `gasEstimates` + if (jsonObj.get("gasEstimates") != null && !jsonObj.get("gasEstimates").isJsonNull()) { + SolidityContractJsonArtifactGasEstimates.validateJsonObject(jsonObj.getAsJsonObject("gasEstimates")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifact.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifact' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifact.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifact value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifact read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifact given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifact + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifact + */ + public static SolidityContractJsonArtifact fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifact.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifact to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java new file mode 100644 index 00000000000..0d629e2f885 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactCompiler.java @@ -0,0 +1,314 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactCompiler + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactCompiler { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public SolidityContractJsonArtifactCompiler() { + } + + public SolidityContractJsonArtifactCompiler name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public SolidityContractJsonArtifactCompiler version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SolidityContractJsonArtifactCompiler instance itself + */ + public SolidityContractJsonArtifactCompiler putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactCompiler solidityContractJsonArtifactCompiler = (SolidityContractJsonArtifactCompiler) o; + return Objects.equals(this.name, solidityContractJsonArtifactCompiler.name) && + Objects.equals(this.version, solidityContractJsonArtifactCompiler.version)&& + Objects.equals(this.additionalProperties, solidityContractJsonArtifactCompiler.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, version, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactCompiler {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactCompiler + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactCompiler.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactCompiler is not found in the empty JSON string", SolidityContractJsonArtifactCompiler.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactCompiler.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactCompiler' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactCompiler.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactCompiler value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactCompiler read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + SolidityContractJsonArtifactCompiler instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactCompiler given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactCompiler + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactCompiler + */ + public static SolidityContractJsonArtifactCompiler fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactCompiler.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactCompiler to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java new file mode 100644 index 00000000000..a217bbaabb0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimates.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactGasEstimates + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactGasEstimates { + public static final String SERIALIZED_NAME_CREATION = "creation"; + @SerializedName(SERIALIZED_NAME_CREATION) + private SolidityContractJsonArtifactGasEstimatesCreation creation; + + public static final String SERIALIZED_NAME_EXTERNAL = "external"; + @SerializedName(SERIALIZED_NAME_EXTERNAL) + private Map external = new HashMap<>(); + + public SolidityContractJsonArtifactGasEstimates() { + } + + public SolidityContractJsonArtifactGasEstimates creation(SolidityContractJsonArtifactGasEstimatesCreation creation) { + + this.creation = creation; + return this; + } + + /** + * Get creation + * @return creation + **/ + @javax.annotation.Nullable + public SolidityContractJsonArtifactGasEstimatesCreation getCreation() { + return creation; + } + + + public void setCreation(SolidityContractJsonArtifactGasEstimatesCreation creation) { + this.creation = creation; + } + + + public SolidityContractJsonArtifactGasEstimates external(Map external) { + + this.external = external; + return this; + } + + public SolidityContractJsonArtifactGasEstimates putExternalItem(String key, Object externalItem) { + if (this.external == null) { + this.external = new HashMap<>(); + } + this.external.put(key, externalItem); + return this; + } + + /** + * Get external + * @return external + **/ + @javax.annotation.Nullable + public Map getExternal() { + return external; + } + + + public void setExternal(Map external) { + this.external = external; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactGasEstimates solidityContractJsonArtifactGasEstimates = (SolidityContractJsonArtifactGasEstimates) o; + return Objects.equals(this.creation, solidityContractJsonArtifactGasEstimates.creation) && + Objects.equals(this.external, solidityContractJsonArtifactGasEstimates.external); + } + + @Override + public int hashCode() { + return Objects.hash(creation, external); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactGasEstimates {\n"); + sb.append(" creation: ").append(toIndentedString(creation)).append("\n"); + sb.append(" external: ").append(toIndentedString(external)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("creation"); + openapiFields.add("external"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactGasEstimates + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactGasEstimates.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactGasEstimates is not found in the empty JSON string", SolidityContractJsonArtifactGasEstimates.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifactGasEstimates.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifactGasEstimates` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `creation` + if (jsonObj.get("creation") != null && !jsonObj.get("creation").isJsonNull()) { + SolidityContractJsonArtifactGasEstimatesCreation.validateJsonObject(jsonObj.getAsJsonObject("creation")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactGasEstimates.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactGasEstimates' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactGasEstimates.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactGasEstimates value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactGasEstimates read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactGasEstimates given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactGasEstimates + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactGasEstimates + */ + public static SolidityContractJsonArtifactGasEstimates fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactGasEstimates.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactGasEstimates to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java new file mode 100644 index 00000000000..fa2678daba9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreation.java @@ -0,0 +1,270 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SolidityContractJsonArtifactGasEstimatesCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SolidityContractJsonArtifactGasEstimatesCreation { + public static final String SERIALIZED_NAME_CODE_DEPOSIT_COST = "codeDepositCost"; + @SerializedName(SERIALIZED_NAME_CODE_DEPOSIT_COST) + private String codeDepositCost; + + public static final String SERIALIZED_NAME_EXECUTION_COST = "executionCost"; + @SerializedName(SERIALIZED_NAME_EXECUTION_COST) + private String executionCost; + + public static final String SERIALIZED_NAME_TOTAL_COST = "totalCost"; + @SerializedName(SERIALIZED_NAME_TOTAL_COST) + private String totalCost; + + public SolidityContractJsonArtifactGasEstimatesCreation() { + } + + public SolidityContractJsonArtifactGasEstimatesCreation codeDepositCost(String codeDepositCost) { + + this.codeDepositCost = codeDepositCost; + return this; + } + + /** + * Get codeDepositCost + * @return codeDepositCost + **/ + @javax.annotation.Nullable + public String getCodeDepositCost() { + return codeDepositCost; + } + + + public void setCodeDepositCost(String codeDepositCost) { + this.codeDepositCost = codeDepositCost; + } + + + public SolidityContractJsonArtifactGasEstimatesCreation executionCost(String executionCost) { + + this.executionCost = executionCost; + return this; + } + + /** + * Get executionCost + * @return executionCost + **/ + @javax.annotation.Nullable + public String getExecutionCost() { + return executionCost; + } + + + public void setExecutionCost(String executionCost) { + this.executionCost = executionCost; + } + + + public SolidityContractJsonArtifactGasEstimatesCreation totalCost(String totalCost) { + + this.totalCost = totalCost; + return this; + } + + /** + * Get totalCost + * @return totalCost + **/ + @javax.annotation.Nullable + public String getTotalCost() { + return totalCost; + } + + + public void setTotalCost(String totalCost) { + this.totalCost = totalCost; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SolidityContractJsonArtifactGasEstimatesCreation solidityContractJsonArtifactGasEstimatesCreation = (SolidityContractJsonArtifactGasEstimatesCreation) o; + return Objects.equals(this.codeDepositCost, solidityContractJsonArtifactGasEstimatesCreation.codeDepositCost) && + Objects.equals(this.executionCost, solidityContractJsonArtifactGasEstimatesCreation.executionCost) && + Objects.equals(this.totalCost, solidityContractJsonArtifactGasEstimatesCreation.totalCost); + } + + @Override + public int hashCode() { + return Objects.hash(codeDepositCost, executionCost, totalCost); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SolidityContractJsonArtifactGasEstimatesCreation {\n"); + sb.append(" codeDepositCost: ").append(toIndentedString(codeDepositCost)).append("\n"); + sb.append(" executionCost: ").append(toIndentedString(executionCost)).append("\n"); + sb.append(" totalCost: ").append(toIndentedString(totalCost)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("codeDepositCost"); + openapiFields.add("executionCost"); + openapiFields.add("totalCost"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SolidityContractJsonArtifactGasEstimatesCreation + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SolidityContractJsonArtifactGasEstimatesCreation is not found in the empty JSON string", SolidityContractJsonArtifactGasEstimatesCreation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SolidityContractJsonArtifactGasEstimatesCreation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("codeDepositCost") != null && !jsonObj.get("codeDepositCost").isJsonNull()) && !jsonObj.get("codeDepositCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `codeDepositCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("codeDepositCost").toString())); + } + if ((jsonObj.get("executionCost") != null && !jsonObj.get("executionCost").isJsonNull()) && !jsonObj.get("executionCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `executionCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("executionCost").toString())); + } + if ((jsonObj.get("totalCost") != null && !jsonObj.get("totalCost").isJsonNull()) && !jsonObj.get("totalCost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `totalCost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalCost").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SolidityContractJsonArtifactGasEstimatesCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SolidityContractJsonArtifactGasEstimatesCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SolidityContractJsonArtifactGasEstimatesCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SolidityContractJsonArtifactGasEstimatesCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SolidityContractJsonArtifactGasEstimatesCreation read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SolidityContractJsonArtifactGasEstimatesCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of SolidityContractJsonArtifactGasEstimatesCreation + * @throws IOException if the JSON string is invalid with respect to SolidityContractJsonArtifactGasEstimatesCreation + */ + public static SolidityContractJsonArtifactGasEstimatesCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SolidityContractJsonArtifactGasEstimatesCreation.class); + } + + /** + * Convert an instance of SolidityContractJsonArtifactGasEstimatesCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java new file mode 100644 index 00000000000..7ee4c5804d5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredential.java @@ -0,0 +1,338 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredential extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Web3SigningCredential.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredential' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterWeb3SigningCredentialCactusKeychainRef = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + final TypeAdapter adapterWeb3SigningCredentialNone = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + final TypeAdapter adapterWeb3SigningCredentialPrivateKeyHex = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredential value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialCactusKeychainRef` + if (value.getActualInstance() instanceof Web3SigningCredentialCactusKeychainRef) { + JsonObject obj = adapterWeb3SigningCredentialCactusKeychainRef.toJsonTree((Web3SigningCredentialCactusKeychainRef)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialNone` + if (value.getActualInstance() instanceof Web3SigningCredentialNone) { + JsonObject obj = adapterWeb3SigningCredentialNone.toJsonTree((Web3SigningCredentialNone)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `Web3SigningCredentialPrivateKeyHex` + if (value.getActualInstance() instanceof Web3SigningCredentialPrivateKeyHex) { + JsonObject obj = adapterWeb3SigningCredentialPrivateKeyHex.toJsonTree((Web3SigningCredentialPrivateKeyHex)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + @Override + public Web3SigningCredential read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Web3SigningCredentialCactusKeychainRef + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialCactusKeychainRef; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialCactusKeychainRef'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialCactusKeychainRef'", e); + } + + // deserialize Web3SigningCredentialNone + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialNone.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialNone; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialNone'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialNone'", e); + } + + // deserialize Web3SigningCredentialPrivateKeyHex + try { + // validate the JSON object to see if any exception is thrown + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObject); + actualAdapter = adapterWeb3SigningCredentialPrivateKeyHex; + match++; + log.log(Level.FINER, "Input data matches schema 'Web3SigningCredentialPrivateKeyHex'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Web3SigningCredentialPrivateKeyHex'", e); + } + + if (match == 1) { + Web3SigningCredential ret = new Web3SigningCredential(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for Web3SigningCredential: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Web3SigningCredential() { + super("oneOf", Boolean.FALSE); + } + + public Web3SigningCredential(Web3SigningCredentialCactusKeychainRef o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialNone o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Web3SigningCredential(Web3SigningCredentialPrivateKeyHex o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Web3SigningCredentialCactusKeychainRef", new GenericType() { + }); + schemas.put("Web3SigningCredentialNone", new GenericType() { + }); + schemas.put("Web3SigningCredentialPrivateKeyHex", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return Web3SigningCredential.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Web3SigningCredentialCactusKeychainRef) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialNone) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Web3SigningCredentialPrivateKeyHex) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex"); + } + + /** + * Get the actual instance, which can be the following: + * Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex + * + * @return The actual instance (Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialCactusKeychainRef`. If the actual instance is not `Web3SigningCredentialCactusKeychainRef`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialCactusKeychainRef` + * @throws ClassCastException if the instance is not `Web3SigningCredentialCactusKeychainRef` + */ + public Web3SigningCredentialCactusKeychainRef getWeb3SigningCredentialCactusKeychainRef() throws ClassCastException { + return (Web3SigningCredentialCactusKeychainRef)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialNone`. If the actual instance is not `Web3SigningCredentialNone`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialNone` + * @throws ClassCastException if the instance is not `Web3SigningCredentialNone` + */ + public Web3SigningCredentialNone getWeb3SigningCredentialNone() throws ClassCastException { + return (Web3SigningCredentialNone)super.getActualInstance(); + } + + /** + * Get the actual instance of `Web3SigningCredentialPrivateKeyHex`. If the actual instance is not `Web3SigningCredentialPrivateKeyHex`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Web3SigningCredentialPrivateKeyHex` + * @throws ClassCastException if the instance is not `Web3SigningCredentialPrivateKeyHex` + */ + public Web3SigningCredentialPrivateKeyHex getWeb3SigningCredentialPrivateKeyHex() throws ClassCastException { + return (Web3SigningCredentialPrivateKeyHex)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredential + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with Web3SigningCredentialCactusKeychainRef + try { + Web3SigningCredentialCactusKeychainRef.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialCactusKeychainRef failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialNone + try { + Web3SigningCredentialNone.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialNone failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Web3SigningCredentialPrivateKeyHex + try { + Web3SigningCredentialPrivateKeyHex.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Web3SigningCredentialPrivateKeyHex failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Web3SigningCredential with oneOf schemas: Web3SigningCredentialCactusKeychainRef, Web3SigningCredentialNone, Web3SigningCredentialPrivateKeyHex. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of Web3SigningCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredential + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredential + */ + public static Web3SigningCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredential.class); + } + + /** + * Convert an instance of Web3SigningCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java new file mode 100644 index 00000000000..fec704f3fae --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRef.java @@ -0,0 +1,310 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialCactusKeychainRef + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialCactusKeychainRef { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY = "keychainEntryKey"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ENTRY_KEY) + private String keychainEntryKey; + + public static final String SERIALIZED_NAME_KEYCHAIN_ID = "keychainId"; + @SerializedName(SERIALIZED_NAME_KEYCHAIN_ID) + private String keychainId; + + public Web3SigningCredentialCactusKeychainRef() { + } + + public Web3SigningCredentialCactusKeychainRef type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialCactusKeychainRef ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialCactusKeychainRef keychainEntryKey(String keychainEntryKey) { + + this.keychainEntryKey = keychainEntryKey; + return this; + } + + /** + * The key to use when looking up the the keychain entry holding the secret pointed to by the keychainEntryKey parameter. + * @return keychainEntryKey + **/ + @javax.annotation.Nonnull + public String getKeychainEntryKey() { + return keychainEntryKey; + } + + + public void setKeychainEntryKey(String keychainEntryKey) { + this.keychainEntryKey = keychainEntryKey; + } + + + public Web3SigningCredentialCactusKeychainRef keychainId(String keychainId) { + + this.keychainId = keychainId; + return this; + } + + /** + * The keychain ID to use when looking up the the keychain plugin instance that will be used to retrieve the secret pointed to by the keychainEntryKey parameter. + * @return keychainId + **/ + @javax.annotation.Nonnull + public String getKeychainId() { + return keychainId; + } + + + public void setKeychainId(String keychainId) { + this.keychainId = keychainId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialCactusKeychainRef web3SigningCredentialCactusKeychainRef = (Web3SigningCredentialCactusKeychainRef) o; + return Objects.equals(this.type, web3SigningCredentialCactusKeychainRef.type) && + Objects.equals(this.ethAccount, web3SigningCredentialCactusKeychainRef.ethAccount) && + Objects.equals(this.keychainEntryKey, web3SigningCredentialCactusKeychainRef.keychainEntryKey) && + Objects.equals(this.keychainId, web3SigningCredentialCactusKeychainRef.keychainId); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, keychainEntryKey, keychainId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialCactusKeychainRef {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" keychainEntryKey: ").append(toIndentedString(keychainEntryKey)).append("\n"); + sb.append(" keychainId: ").append(toIndentedString(keychainId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("keychainEntryKey"); + openapiFields.add("keychainId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("keychainEntryKey"); + openapiRequiredFields.add("keychainId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialCactusKeychainRef is not found in the empty JSON string", Web3SigningCredentialCactusKeychainRef.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialCactusKeychainRef.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialCactusKeychainRef` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialCactusKeychainRef.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("keychainEntryKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainEntryKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainEntryKey").toString())); + } + if (!jsonObj.get("keychainId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `keychainId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("keychainId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialCactusKeychainRef.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialCactusKeychainRef' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialCactusKeychainRef.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialCactusKeychainRef value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialCactusKeychainRef read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialCactusKeychainRef given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialCactusKeychainRef + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialCactusKeychainRef + */ + public static Web3SigningCredentialCactusKeychainRef fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialCactusKeychainRef.class); + } + + /** + * Convert an instance of Web3SigningCredentialCactusKeychainRef to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java new file mode 100644 index 00000000000..331f9e11c1a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialNone.java @@ -0,0 +1,214 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Using this denotes that there is no signing required because the transaction is pre-signed. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialNone { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public Web3SigningCredentialNone() { + } + + public Web3SigningCredentialNone type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialNone web3SigningCredentialNone = (Web3SigningCredentialNone) o; + return Objects.equals(this.type, web3SigningCredentialNone.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialNone {\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(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialNone + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialNone.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialNone is not found in the empty JSON string", Web3SigningCredentialNone.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialNone.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialNone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialNone.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialNone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialNone' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialNone.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialNone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialNone read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialNone given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialNone + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialNone + */ + public static Web3SigningCredentialNone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialNone.class); + } + + /** + * Convert an instance of Web3SigningCredentialNone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java new file mode 100644 index 00000000000..22b6e9a878c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHex.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.Web3SigningCredentialType; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3SigningCredentialPrivateKeyHex + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3SigningCredentialPrivateKeyHex { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private Web3SigningCredentialType type; + + public static final String SERIALIZED_NAME_ETH_ACCOUNT = "ethAccount"; + @SerializedName(SERIALIZED_NAME_ETH_ACCOUNT) + private String ethAccount; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public Web3SigningCredentialPrivateKeyHex() { + } + + public Web3SigningCredentialPrivateKeyHex type(Web3SigningCredentialType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public Web3SigningCredentialType getType() { + return type; + } + + + public void setType(Web3SigningCredentialType type) { + this.type = type; + } + + + public Web3SigningCredentialPrivateKeyHex ethAccount(String ethAccount) { + + this.ethAccount = ethAccount; + return this; + } + + /** + * The ethereum account (public key) that the credential belongs to. Basically the username in the traditional terminology of authentication. + * @return ethAccount + **/ + @javax.annotation.Nonnull + public String getEthAccount() { + return ethAccount; + } + + + public void setEthAccount(String ethAccount) { + this.ethAccount = ethAccount; + } + + + public Web3SigningCredentialPrivateKeyHex secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * The HEX encoded private key of an eth account. + * @return secret + **/ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3SigningCredentialPrivateKeyHex web3SigningCredentialPrivateKeyHex = (Web3SigningCredentialPrivateKeyHex) o; + return Objects.equals(this.type, web3SigningCredentialPrivateKeyHex.type) && + Objects.equals(this.ethAccount, web3SigningCredentialPrivateKeyHex.ethAccount) && + Objects.equals(this.secret, web3SigningCredentialPrivateKeyHex.secret); + } + + @Override + public int hashCode() { + return Objects.hash(type, ethAccount, secret); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3SigningCredentialPrivateKeyHex {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ethAccount: ").append(toIndentedString(ethAccount)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("ethAccount"); + openapiFields.add("secret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("ethAccount"); + openapiRequiredFields.add("secret"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3SigningCredentialPrivateKeyHex is not found in the empty JSON string", Web3SigningCredentialPrivateKeyHex.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Web3SigningCredentialPrivateKeyHex.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Web3SigningCredentialPrivateKeyHex` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3SigningCredentialPrivateKeyHex.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ethAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethAccount").toString())); + } + if (!jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3SigningCredentialPrivateKeyHex.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3SigningCredentialPrivateKeyHex' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3SigningCredentialPrivateKeyHex.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3SigningCredentialPrivateKeyHex value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Web3SigningCredentialPrivateKeyHex read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3SigningCredentialPrivateKeyHex given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3SigningCredentialPrivateKeyHex + * @throws IOException if the JSON string is invalid with respect to Web3SigningCredentialPrivateKeyHex + */ + public static Web3SigningCredentialPrivateKeyHex fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3SigningCredentialPrivateKeyHex.class); + } + + /** + * Convert an instance of Web3SigningCredentialPrivateKeyHex to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java new file mode 100644 index 00000000000..6dfb13b7338 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3SigningCredentialType.java @@ -0,0 +1,77 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets Web3SigningCredentialType + */ +@JsonAdapter(Web3SigningCredentialType.Adapter.class) +public enum Web3SigningCredentialType { + + CACTUS_KEYCHAIN_REF("CACTUS_KEYCHAIN_REF"), + + GETH_KEYCHAIN_PASSWORD("GETH_KEYCHAIN_PASSWORD"), + + PRIVATE_KEY_HEX("PRIVATE_KEY_HEX"), + + NONE("NONE"); + + private String value; + + Web3SigningCredentialType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Web3SigningCredentialType fromValue(String value) { + for (Web3SigningCredentialType b : Web3SigningCredentialType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Web3SigningCredentialType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Web3SigningCredentialType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Web3SigningCredentialType.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java new file mode 100644 index 00000000000..6e8ed4dce76 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/Web3TransactionReceipt.java @@ -0,0 +1,547 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Web3TransactionReceipt + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Web3TransactionReceipt { + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Boolean status; + + public static final String SERIALIZED_NAME_TRANSACTION_HASH = "transactionHash"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_HASH) + private String transactionHash; + + public static final String SERIALIZED_NAME_TRANSACTION_INDEX = "transactionIndex"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_INDEX) + private BigDecimal transactionIndex; + + public static final String SERIALIZED_NAME_BLOCK_HASH = "blockHash"; + @SerializedName(SERIALIZED_NAME_BLOCK_HASH) + private String blockHash; + + public static final String SERIALIZED_NAME_BLOCK_NUMBER = "blockNumber"; + @SerializedName(SERIALIZED_NAME_BLOCK_NUMBER) + private BigDecimal blockNumber; + + public static final String SERIALIZED_NAME_GAS_USED = "gasUsed"; + @SerializedName(SERIALIZED_NAME_GAS_USED) + private BigDecimal gasUsed; + + public static final String SERIALIZED_NAME_CONTRACT_ADDRESS = "contractAddress"; + @SerializedName(SERIALIZED_NAME_CONTRACT_ADDRESS) + private String contractAddress; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private String from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private String to; + + public Web3TransactionReceipt() { + } + + public Web3TransactionReceipt status(Boolean status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nonnull + public Boolean getStatus() { + return status; + } + + + public void setStatus(Boolean status) { + this.status = status; + } + + + public Web3TransactionReceipt transactionHash(String transactionHash) { + + this.transactionHash = transactionHash; + return this; + } + + /** + * Get transactionHash + * @return transactionHash + **/ + @javax.annotation.Nonnull + public String getTransactionHash() { + return transactionHash; + } + + + public void setTransactionHash(String transactionHash) { + this.transactionHash = transactionHash; + } + + + public Web3TransactionReceipt transactionIndex(BigDecimal transactionIndex) { + + this.transactionIndex = transactionIndex; + return this; + } + + /** + * Get transactionIndex + * @return transactionIndex + **/ + @javax.annotation.Nonnull + public BigDecimal getTransactionIndex() { + return transactionIndex; + } + + + public void setTransactionIndex(BigDecimal transactionIndex) { + this.transactionIndex = transactionIndex; + } + + + public Web3TransactionReceipt blockHash(String blockHash) { + + this.blockHash = blockHash; + return this; + } + + /** + * Get blockHash + * @return blockHash + **/ + @javax.annotation.Nonnull + public String getBlockHash() { + return blockHash; + } + + + public void setBlockHash(String blockHash) { + this.blockHash = blockHash; + } + + + public Web3TransactionReceipt blockNumber(BigDecimal blockNumber) { + + this.blockNumber = blockNumber; + return this; + } + + /** + * Get blockNumber + * @return blockNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getBlockNumber() { + return blockNumber; + } + + + public void setBlockNumber(BigDecimal blockNumber) { + this.blockNumber = blockNumber; + } + + + public Web3TransactionReceipt gasUsed(BigDecimal gasUsed) { + + this.gasUsed = gasUsed; + return this; + } + + /** + * Get gasUsed + * @return gasUsed + **/ + @javax.annotation.Nonnull + public BigDecimal getGasUsed() { + return gasUsed; + } + + + public void setGasUsed(BigDecimal gasUsed) { + this.gasUsed = gasUsed; + } + + + public Web3TransactionReceipt contractAddress(String contractAddress) { + + this.contractAddress = contractAddress; + return this; + } + + /** + * Get contractAddress + * @return contractAddress + **/ + @javax.annotation.Nullable + public String getContractAddress() { + return contractAddress; + } + + + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + + + public Web3TransactionReceipt from(String from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nonnull + public String getFrom() { + return from; + } + + + public void setFrom(String from) { + this.from = from; + } + + + public Web3TransactionReceipt to(String to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nonnull + public String getTo() { + return to; + } + + + public void setTo(String to) { + this.to = to; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Web3TransactionReceipt instance itself + */ + public Web3TransactionReceipt putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Web3TransactionReceipt web3TransactionReceipt = (Web3TransactionReceipt) o; + return Objects.equals(this.status, web3TransactionReceipt.status) && + Objects.equals(this.transactionHash, web3TransactionReceipt.transactionHash) && + Objects.equals(this.transactionIndex, web3TransactionReceipt.transactionIndex) && + Objects.equals(this.blockHash, web3TransactionReceipt.blockHash) && + Objects.equals(this.blockNumber, web3TransactionReceipt.blockNumber) && + Objects.equals(this.gasUsed, web3TransactionReceipt.gasUsed) && + Objects.equals(this.contractAddress, web3TransactionReceipt.contractAddress) && + Objects.equals(this.from, web3TransactionReceipt.from) && + Objects.equals(this.to, web3TransactionReceipt.to)&& + Objects.equals(this.additionalProperties, web3TransactionReceipt.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, transactionHash, transactionIndex, blockHash, blockNumber, gasUsed, contractAddress, from, to, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Web3TransactionReceipt {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" transactionHash: ").append(toIndentedString(transactionHash)).append("\n"); + sb.append(" transactionIndex: ").append(toIndentedString(transactionIndex)).append("\n"); + sb.append(" blockHash: ").append(toIndentedString(blockHash)).append("\n"); + sb.append(" blockNumber: ").append(toIndentedString(blockNumber)).append("\n"); + sb.append(" gasUsed: ").append(toIndentedString(gasUsed)).append("\n"); + sb.append(" contractAddress: ").append(toIndentedString(contractAddress)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("transactionHash"); + openapiFields.add("transactionIndex"); + openapiFields.add("blockHash"); + openapiFields.add("blockNumber"); + openapiFields.add("gasUsed"); + openapiFields.add("contractAddress"); + openapiFields.add("from"); + openapiFields.add("to"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("transactionHash"); + openapiRequiredFields.add("transactionIndex"); + openapiRequiredFields.add("blockHash"); + openapiRequiredFields.add("blockNumber"); + openapiRequiredFields.add("gasUsed"); + openapiRequiredFields.add("from"); + openapiRequiredFields.add("to"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Web3TransactionReceipt + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!Web3TransactionReceipt.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Web3TransactionReceipt is not found in the empty JSON string", Web3TransactionReceipt.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Web3TransactionReceipt.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("transactionHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transactionHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionHash").toString())); + } + if (!jsonObj.get("blockHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `blockHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blockHash").toString())); + } + if ((jsonObj.get("contractAddress") != null && !jsonObj.get("contractAddress").isJsonNull()) && !jsonObj.get("contractAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractAddress").toString())); + } + if (!jsonObj.get("from").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `from` to be a primitive type in the JSON string but got `%s`", jsonObj.get("from").toString())); + } + if (!jsonObj.get("to").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `to` to be a primitive type in the JSON string but got `%s`", jsonObj.get("to").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Web3TransactionReceipt.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Web3TransactionReceipt' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Web3TransactionReceipt.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Web3TransactionReceipt value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Web3TransactionReceipt read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + Web3TransactionReceipt instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Web3TransactionReceipt given an JSON string + * + * @param jsonString JSON string + * @return An instance of Web3TransactionReceipt + * @throws IOException if the JSON string is invalid with respect to Web3TransactionReceipt + */ + public static Web3TransactionReceipt fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Web3TransactionReceipt.class); + } + + /** + * Convert an instance of Web3TransactionReceipt to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfig.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfig.java new file mode 100644 index 00000000000..ca3a982b07f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfig.java @@ -0,0 +1,506 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.XdaiTransactionConfigFrom; +import org.openapitools.client.model.XdaiTransactionConfigTo; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * XdaiTransactionConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class XdaiTransactionConfig { + public static final String SERIALIZED_NAME_RAW_TRANSACTION = "rawTransaction"; + @SerializedName(SERIALIZED_NAME_RAW_TRANSACTION) + private String rawTransaction; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + private XdaiTransactionConfigFrom from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + private XdaiTransactionConfigTo to; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private XdaiTransactionConfigFrom value; + + public static final String SERIALIZED_NAME_GAS = "gas"; + @SerializedName(SERIALIZED_NAME_GAS) + private XdaiTransactionConfigFrom gas; + + public static final String SERIALIZED_NAME_GAS_PRICE = "gasPrice"; + @SerializedName(SERIALIZED_NAME_GAS_PRICE) + private XdaiTransactionConfigFrom gasPrice; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + private BigDecimal nonce; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private XdaiTransactionConfigTo data; + + public XdaiTransactionConfig() { + } + + public XdaiTransactionConfig rawTransaction(String rawTransaction) { + + this.rawTransaction = rawTransaction; + return this; + } + + /** + * Get rawTransaction + * @return rawTransaction + **/ + @javax.annotation.Nullable + public String getRawTransaction() { + return rawTransaction; + } + + + public void setRawTransaction(String rawTransaction) { + this.rawTransaction = rawTransaction; + } + + + public XdaiTransactionConfig from(XdaiTransactionConfigFrom from) { + + this.from = from; + return this; + } + + /** + * Get from + * @return from + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getFrom() { + return from; + } + + + public void setFrom(XdaiTransactionConfigFrom from) { + this.from = from; + } + + + public XdaiTransactionConfig to(XdaiTransactionConfigTo to) { + + this.to = to; + return this; + } + + /** + * Get to + * @return to + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigTo getTo() { + return to; + } + + + public void setTo(XdaiTransactionConfigTo to) { + this.to = to; + } + + + public XdaiTransactionConfig value(XdaiTransactionConfigFrom value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getValue() { + return value; + } + + + public void setValue(XdaiTransactionConfigFrom value) { + this.value = value; + } + + + public XdaiTransactionConfig gas(XdaiTransactionConfigFrom gas) { + + this.gas = gas; + return this; + } + + /** + * Get gas + * @return gas + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGas() { + return gas; + } + + + public void setGas(XdaiTransactionConfigFrom gas) { + this.gas = gas; + } + + + public XdaiTransactionConfig gasPrice(XdaiTransactionConfigFrom gasPrice) { + + this.gasPrice = gasPrice; + return this; + } + + /** + * Get gasPrice + * @return gasPrice + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigFrom getGasPrice() { + return gasPrice; + } + + + public void setGasPrice(XdaiTransactionConfigFrom gasPrice) { + this.gasPrice = gasPrice; + } + + + public XdaiTransactionConfig nonce(BigDecimal nonce) { + + this.nonce = nonce; + return this; + } + + /** + * Get nonce + * @return nonce + **/ + @javax.annotation.Nullable + public BigDecimal getNonce() { + return nonce; + } + + + public void setNonce(BigDecimal nonce) { + this.nonce = nonce; + } + + + public XdaiTransactionConfig data(XdaiTransactionConfigTo data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + public XdaiTransactionConfigTo getData() { + return data; + } + + + public void setData(XdaiTransactionConfigTo data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the XdaiTransactionConfig instance itself + */ + public XdaiTransactionConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XdaiTransactionConfig xdaiTransactionConfig = (XdaiTransactionConfig) o; + return Objects.equals(this.rawTransaction, xdaiTransactionConfig.rawTransaction) && + Objects.equals(this.from, xdaiTransactionConfig.from) && + Objects.equals(this.to, xdaiTransactionConfig.to) && + Objects.equals(this.value, xdaiTransactionConfig.value) && + Objects.equals(this.gas, xdaiTransactionConfig.gas) && + Objects.equals(this.gasPrice, xdaiTransactionConfig.gasPrice) && + Objects.equals(this.nonce, xdaiTransactionConfig.nonce) && + Objects.equals(this.data, xdaiTransactionConfig.data)&& + Objects.equals(this.additionalProperties, xdaiTransactionConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rawTransaction, from, to, value, gas, gasPrice, nonce, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XdaiTransactionConfig {\n"); + sb.append(" rawTransaction: ").append(toIndentedString(rawTransaction)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" gas: ").append(toIndentedString(gas)).append("\n"); + sb.append(" gasPrice: ").append(toIndentedString(gasPrice)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rawTransaction"); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("value"); + openapiFields.add("gas"); + openapiFields.add("gasPrice"); + openapiFields.add("nonce"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to XdaiTransactionConfig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!XdaiTransactionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in XdaiTransactionConfig is not found in the empty JSON string", XdaiTransactionConfig.openapiRequiredFields.toString())); + } + } + if ((jsonObj.get("rawTransaction") != null && !jsonObj.get("rawTransaction").isJsonNull()) && !jsonObj.get("rawTransaction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rawTransaction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawTransaction").toString())); + } + // validate the optional field `from` + if (jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("from")); + } + // validate the optional field `to` + if (jsonObj.get("to") != null && !jsonObj.get("to").isJsonNull()) { + XdaiTransactionConfigTo.validateJsonObject(jsonObj.getAsJsonObject("to")); + } + // validate the optional field `value` + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("value")); + } + // validate the optional field `gas` + if (jsonObj.get("gas") != null && !jsonObj.get("gas").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gas")); + } + // validate the optional field `gasPrice` + if (jsonObj.get("gasPrice") != null && !jsonObj.get("gasPrice").isJsonNull()) { + XdaiTransactionConfigFrom.validateJsonObject(jsonObj.getAsJsonObject("gasPrice")); + } + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + XdaiTransactionConfigTo.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!XdaiTransactionConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'XdaiTransactionConfig' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(XdaiTransactionConfig.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, XdaiTransactionConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public XdaiTransactionConfig read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + // store additional fields in the deserialized instance + XdaiTransactionConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of XdaiTransactionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of XdaiTransactionConfig + * @throws IOException if the JSON string is invalid with respect to XdaiTransactionConfig + */ + public static XdaiTransactionConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, XdaiTransactionConfig.class); + } + + /** + * Convert an instance of XdaiTransactionConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfigFrom.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfigFrom.java new file mode 100644 index 00000000000..14f4e3c0eb2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfigFrom.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import java.math.BigDecimal; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class XdaiTransactionConfigFrom extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(XdaiTransactionConfigFrom.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!XdaiTransactionConfigFrom.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'XdaiTransactionConfigFrom' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, XdaiTransactionConfigFrom value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonObject obj = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, String"); + } + + @Override + public XdaiTransactionConfigFrom read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + BigDecimal.validateJsonObject(jsonObject); + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + XdaiTransactionConfigFrom ret = new XdaiTransactionConfigFrom(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for XdaiTransactionConfigFrom: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public XdaiTransactionConfigFrom() { + super("oneOf", Boolean.FALSE); + } + + public XdaiTransactionConfigFrom(BigDecimal o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public XdaiTransactionConfigFrom(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BigDecimal", new GenericType() { + }); + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return XdaiTransactionConfigFrom.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, String"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, String + * + * @return The actual instance (BigDecimal, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to XdaiTransactionConfigFrom + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with BigDecimal + try { + BigDecimal.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for XdaiTransactionConfigFrom with oneOf schemas: BigDecimal, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of XdaiTransactionConfigFrom given an JSON string + * + * @param jsonString JSON string + * @return An instance of XdaiTransactionConfigFrom + * @throws IOException if the JSON string is invalid with respect to XdaiTransactionConfigFrom + */ + public static XdaiTransactionConfigFrom fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, XdaiTransactionConfigFrom.class); + } + + /** + * Convert an instance of XdaiTransactionConfigFrom to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfigTo.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfigTo.java new file mode 100644 index 00000000000..df421c1cb4b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/XdaiTransactionConfigTo.java @@ -0,0 +1,224 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class XdaiTransactionConfigTo extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(XdaiTransactionConfigTo.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!XdaiTransactionConfigTo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'XdaiTransactionConfigTo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, XdaiTransactionConfigTo value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonObject obj = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: String"); + } + + @Override + public XdaiTransactionConfigTo read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + String.validateJsonObject(jsonObject); + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + if (match == 1) { + XdaiTransactionConfigTo ret = new XdaiTransactionConfigTo(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for XdaiTransactionConfigTo: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public XdaiTransactionConfigTo() { + super("oneOf", Boolean.FALSE); + } + + public XdaiTransactionConfigTo(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return XdaiTransactionConfigTo.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * String + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be String"); + } + + /** + * Get the actual instance, which can be the following: + * String + * + * @return The actual instance (String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to XdaiTransactionConfigTo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with String + try { + String.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for XdaiTransactionConfigTo with oneOf schemas: String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of XdaiTransactionConfigTo given an JSON string + * + * @param jsonString JSON string + * @return An instance of XdaiTransactionConfigTo + * @throws IOException if the JSON string is invalid with respect to XdaiTransactionConfigTo + */ + public static XdaiTransactionConfigTo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, XdaiTransactionConfigTo.class); + } + + /** + * Convert an instance of XdaiTransactionConfigTo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..adaee04ee8d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,112 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.DeployContractJsonObjectV1Request; +import org.openapitools.client.model.DeployContractV1Request; +import org.openapitools.client.model.DeployContractV1Response; +import org.openapitools.client.model.InvokeContractJsonObjectV1Request; +import org.openapitools.client.model.InvokeContractV1Request; +import org.openapitools.client.model.InvokeContractV1Response; +import org.openapitools.client.model.RunTransactionV1Request; +import org.openapitools.client.model.RunTransactionV1Response; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Deploys the bytecode of a Solidity contract. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractJsonObjectV1Test() throws ApiException { + DeployContractJsonObjectV1Request deployContractJsonObjectV1Request = null; + DeployContractV1Response response = api.deployContractJsonObjectV1(deployContractJsonObjectV1Request); + // TODO: test validations + } + + /** + * Deploys the bytecode of a Solidity contract. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deployContractV1Test() throws ApiException { + DeployContractV1Request deployContractV1Request = null; + DeployContractV1Response response = api.deployContractV1(deployContractV1Request); + // TODO: test validations + } + + /** + * Get the Prometheus Metrics + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPrometheusMetricsV1Test() throws ApiException { + String response = api.getPrometheusMetricsV1(); + // TODO: test validations + } + + /** + * Invokes a contract on a besu ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeContractJsonObjectTest() throws ApiException { + InvokeContractJsonObjectV1Request invokeContractJsonObjectV1Request = null; + InvokeContractV1Response response = api.invokeContractJsonObject(invokeContractJsonObjectV1Request); + // TODO: test validations + } + + /** + * Invokes a contract on a xdai ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void invokeContractV1Test() throws ApiException { + InvokeContractV1Request invokeContractV1Request = null; + InvokeContractV1Response response = api.invokeContractV1(invokeContractV1Request); + // TODO: test validations + } + + /** + * Executes a transaction on a xdai ledger + * + * @throws ApiException if the Api call fails + */ + @Test + public void runTransactionV1Test() throws ApiException { + RunTransactionV1Request runTransactionV1Request = null; + RunTransactionV1Response response = api.runTransactionV1(runTransactionV1Request); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsistencyStrategyTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsistencyStrategyTest.java new file mode 100644 index 00000000000..cadccd08099 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ConsistencyStrategyTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.ReceiptType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ConsistencyStrategy + */ +public class ConsistencyStrategyTest { + private final ConsistencyStrategy model = new ConsistencyStrategy(); + + /** + * Model tests for ConsistencyStrategy + */ + @Test + public void testConsistencyStrategy() { + // TODO: test ConsistencyStrategy + } + + /** + * Test the property 'receiptType' + */ + @Test + public void receiptTypeTest() { + // TODO: test receiptType + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'blockConfirmations' + */ + @Test + public void blockConfirmationsTest() { + // TODO: test blockConfirmations + } + + /** + * Test the property 'pollIntervalMs' + */ + @Test + public void pollIntervalMsTest() { + // TODO: test pollIntervalMs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java new file mode 100644 index 00000000000..4c9b86b0efc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ContractJSONTest.java @@ -0,0 +1,146 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ContractJSON + */ +public class ContractJSONTest { + private final ContractJSON model = new ContractJSON(); + + /** + * Model tests for ContractJSON + */ + @Test + public void testContractJSON() { + // TODO: test ContractJSON + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'abi' + */ + @Test + public void abiTest() { + // TODO: test abi + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'deployedBytecode' + */ + @Test + public void deployedBytecodeTest() { + // TODO: test deployedBytecode + } + + /** + * Test the property 'sourceMap' + */ + @Test + public void sourceMapTest() { + // TODO: test sourceMap + } + + /** + * Test the property 'deployedSourceMap' + */ + @Test + public void deployedSourceMapTest() { + // TODO: test deployedSourceMap + } + + /** + * Test the property 'sourcePath' + */ + @Test + public void sourcePathTest() { + // TODO: test sourcePath + } + + /** + * Test the property 'compiler' + */ + @Test + public void compilerTest() { + // TODO: test compiler + } + + /** + * Test the property 'networks' + */ + @Test + public void networksTest() { + // TODO: test networks + } + + /** + * Test the property 'ast' + */ + @Test + public void astTest() { + // TODO: test ast + } + + /** + * Test the property 'functionHashes' + */ + @Test + public void functionHashesTest() { + // TODO: test functionHashes + } + + /** + * Test the property 'gasEstimates' + */ + @Test + public void gasEstimatesTest() { + // TODO: test gasEstimates + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJsonObjectV1RequestTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJsonObjectV1RequestTest.java new file mode 100644 index 00000000000..1b1ee49f1cb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractJsonObjectV1RequestTest.java @@ -0,0 +1,93 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractJsonObjectV1Request + */ +public class DeployContractJsonObjectV1RequestTest { + private final DeployContractJsonObjectV1Request model = new DeployContractJsonObjectV1Request(); + + /** + * Model tests for DeployContractJsonObjectV1Request + */ + @Test + public void testDeployContractJsonObjectV1Request() { + // TODO: test DeployContractJsonObjectV1Request + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java new file mode 100644 index 00000000000..7fe5b85c0c4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1RequestTest.java @@ -0,0 +1,100 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Web3SigningCredential; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractV1Request + */ +public class DeployContractV1RequestTest { + private final DeployContractV1Request model = new DeployContractV1Request(); + + /** + * Model tests for DeployContractV1Request + */ + @Test + public void testDeployContractV1Request() { + // TODO: test DeployContractV1Request + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1ResponseTest.java new file mode 100644 index 00000000000..2a544f649ef --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployContractV1ResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployContractV1Response + */ +public class DeployContractV1ResponseTest { + private final DeployContractV1Response model = new DeployContractV1Response(); + + /** + * Model tests for DeployContractV1Response + */ + @Test + public void testDeployContractV1Response() { + // TODO: test DeployContractV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployRequestBaseV1Test.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployRequestBaseV1Test.java new file mode 100644 index 00000000000..fd615bfe32d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/DeployRequestBaseV1Test.java @@ -0,0 +1,94 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfigFrom; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeployRequestBaseV1 + */ +public class DeployRequestBaseV1Test { + private final DeployRequestBaseV1 model = new DeployRequestBaseV1(); + + /** + * Model tests for DeployRequestBaseV1 + */ + @Test + public void testDeployRequestBaseV1() { + // TODO: test DeployRequestBaseV1 + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + + /** + * Test the property 'constructorArgs' + */ + @Test + public void constructorArgsTest() { + // TODO: test constructorArgs + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java new file mode 100644 index 00000000000..07b58618c53 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/EthContractInvocationTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EthContractInvocationType + */ +public class EthContractInvocationTypeTest { + /** + * Model tests for EthContractInvocationType + */ + @Test + public void testEthContractInvocationType() { + // TODO: test EthContractInvocationType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java new file mode 100644 index 00000000000..f3679a88c85 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractJsonObjectV1RequestTest.java @@ -0,0 +1,135 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfigFrom; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractJsonObjectV1Request + */ +public class InvokeContractJsonObjectV1RequestTest { + private final InvokeContractJsonObjectV1Request model = new InvokeContractJsonObjectV1Request(); + + /** + * Model tests for InvokeContractJsonObjectV1Request + */ + @Test + public void testInvokeContractJsonObjectV1Request() { + // TODO: test InvokeContractJsonObjectV1Request + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java new file mode 100644 index 00000000000..50e9695f20b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1RequestTest.java @@ -0,0 +1,134 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfigFrom; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Request + */ +public class InvokeContractV1RequestTest { + private final InvokeContractV1Request model = new InvokeContractV1Request(); + + /** + * Model tests for InvokeContractV1Request + */ + @Test + public void testInvokeContractV1Request() { + // TODO: test InvokeContractV1Request + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java new file mode 100644 index 00000000000..f4dd179c395 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeContractV1ResponseTest.java @@ -0,0 +1,66 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3TransactionReceipt; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeContractV1Response + */ +public class InvokeContractV1ResponseTest { + private final InvokeContractV1Response model = new InvokeContractV1Response(); + + /** + * Model tests for InvokeContractV1Response + */ + @Test + public void testInvokeContractV1Response() { + // TODO: test InvokeContractV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + + /** + * Test the property 'callOutput' + */ + @Test + public void callOutputTest() { + // TODO: test callOutput + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRequestBaseV1Test.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRequestBaseV1Test.java new file mode 100644 index 00000000000..eac3bcf2bb4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/InvokeRequestBaseV1Test.java @@ -0,0 +1,135 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ContractJSON; +import org.openapitools.client.model.EthContractInvocationType; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfigFrom; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for InvokeRequestBaseV1 + */ +public class InvokeRequestBaseV1Test { + private final InvokeRequestBaseV1 model = new InvokeRequestBaseV1(); + + /** + * Model tests for InvokeRequestBaseV1 + */ + @Test + public void testInvokeRequestBaseV1() { + // TODO: test InvokeRequestBaseV1 + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'invocationType' + */ + @Test + public void invocationTypeTest() { + // TODO: test invocationType + } + + /** + * Test the property 'methodName' + */ + @Test + public void methodNameTest() { + // TODO: test methodName + } + + /** + * Test the property 'params' + */ + @Test + public void paramsTest() { + // TODO: test params + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'timeoutMs' + */ + @Test + public void timeoutMsTest() { + // TODO: test timeoutMs + } + + /** + * Test the property 'contractJSON' + */ + @Test + public void contractJSONTest() { + // TODO: test contractJSON + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ReceiptTypeTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ReceiptTypeTest.java new file mode 100644 index 00000000000..c85769e0575 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ReceiptTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ReceiptType + */ +public class ReceiptTypeTest { + /** + * Model tests for ReceiptType + */ + @Test + public void testReceiptType() { + // TODO: test ReceiptType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionV1RequestTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionV1RequestTest.java new file mode 100644 index 00000000000..143a8d88348 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionV1RequestTest.java @@ -0,0 +1,67 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.ConsistencyStrategy; +import org.openapitools.client.model.Web3SigningCredential; +import org.openapitools.client.model.XdaiTransactionConfig; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionV1Request + */ +public class RunTransactionV1RequestTest { + private final RunTransactionV1Request model = new RunTransactionV1Request(); + + /** + * Model tests for RunTransactionV1Request + */ + @Test + public void testRunTransactionV1Request() { + // TODO: test RunTransactionV1Request + } + + /** + * Test the property 'web3SigningCredential' + */ + @Test + public void web3SigningCredentialTest() { + // TODO: test web3SigningCredential + } + + /** + * Test the property 'transactionConfig' + */ + @Test + public void transactionConfigTest() { + // TODO: test transactionConfig + } + + /** + * Test the property 'consistencyStrategy' + */ + @Test + public void consistencyStrategyTest() { + // TODO: test consistencyStrategy + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionV1ResponseTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionV1ResponseTest.java new file mode 100644 index 00000000000..a4a7e51c2af --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RunTransactionV1ResponseTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3TransactionReceipt; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RunTransactionV1Response + */ +public class RunTransactionV1ResponseTest { + private final RunTransactionV1Response model = new RunTransactionV1Response(); + + /** + * Model tests for RunTransactionV1Response + */ + @Test + public void testRunTransactionV1Response() { + // TODO: test RunTransactionV1Response + } + + /** + * Test the property 'transactionReceipt' + */ + @Test + public void transactionReceiptTest() { + // TODO: test transactionReceipt + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java new file mode 100644 index 00000000000..50f6dc8c8da --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactCompilerTest.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactCompiler + */ +public class SolidityContractJsonArtifactCompilerTest { + private final SolidityContractJsonArtifactCompiler model = new SolidityContractJsonArtifactCompiler(); + + /** + * Model tests for SolidityContractJsonArtifactCompiler + */ + @Test + public void testSolidityContractJsonArtifactCompiler() { + // TODO: test SolidityContractJsonArtifactCompiler + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java new file mode 100644 index 00000000000..e9a24cce4fc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesCreationTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactGasEstimatesCreation + */ +public class SolidityContractJsonArtifactGasEstimatesCreationTest { + private final SolidityContractJsonArtifactGasEstimatesCreation model = new SolidityContractJsonArtifactGasEstimatesCreation(); + + /** + * Model tests for SolidityContractJsonArtifactGasEstimatesCreation + */ + @Test + public void testSolidityContractJsonArtifactGasEstimatesCreation() { + // TODO: test SolidityContractJsonArtifactGasEstimatesCreation + } + + /** + * Test the property 'codeDepositCost' + */ + @Test + public void codeDepositCostTest() { + // TODO: test codeDepositCost + } + + /** + * Test the property 'executionCost' + */ + @Test + public void executionCostTest() { + // TODO: test executionCost + } + + /** + * Test the property 'totalCost' + */ + @Test + public void totalCostTest() { + // TODO: test totalCost + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java new file mode 100644 index 00000000000..d66e3939bea --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactGasEstimatesTest.java @@ -0,0 +1,59 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimatesCreation; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifactGasEstimates + */ +public class SolidityContractJsonArtifactGasEstimatesTest { + private final SolidityContractJsonArtifactGasEstimates model = new SolidityContractJsonArtifactGasEstimates(); + + /** + * Model tests for SolidityContractJsonArtifactGasEstimates + */ + @Test + public void testSolidityContractJsonArtifactGasEstimates() { + // TODO: test SolidityContractJsonArtifactGasEstimates + } + + /** + * Test the property 'creation' + */ + @Test + public void creationTest() { + // TODO: test creation + } + + /** + * Test the property 'external' + */ + @Test + public void externalTest() { + // TODO: test external + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java new file mode 100644 index 00000000000..9405b7fbf57 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SolidityContractJsonArtifactTest.java @@ -0,0 +1,124 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.HashMap; +import java.util.Map; +import org.openapitools.client.model.SolidityContractJsonArtifactCompiler; +import org.openapitools.client.model.SolidityContractJsonArtifactGasEstimates; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SolidityContractJsonArtifact + */ +public class SolidityContractJsonArtifactTest { + private final SolidityContractJsonArtifact model = new SolidityContractJsonArtifact(); + + /** + * Model tests for SolidityContractJsonArtifact + */ + @Test + public void testSolidityContractJsonArtifact() { + // TODO: test SolidityContractJsonArtifact + } + + /** + * Test the property 'contractName' + */ + @Test + public void contractNameTest() { + // TODO: test contractName + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + + /** + * Test the property 'bytecode' + */ + @Test + public void bytecodeTest() { + // TODO: test bytecode + } + + /** + * Test the property 'deployedBytecode' + */ + @Test + public void deployedBytecodeTest() { + // TODO: test deployedBytecode + } + + /** + * Test the property 'sourceMap' + */ + @Test + public void sourceMapTest() { + // TODO: test sourceMap + } + + /** + * Test the property 'deployedSourceMap' + */ + @Test + public void deployedSourceMapTest() { + // TODO: test deployedSourceMap + } + + /** + * Test the property 'sourcePath' + */ + @Test + public void sourcePathTest() { + // TODO: test sourcePath + } + + /** + * Test the property 'compiler' + */ + @Test + public void compilerTest() { + // TODO: test compiler + } + + /** + * Test the property 'functionHashes' + */ + @Test + public void functionHashesTest() { + // TODO: test functionHashes + } + + /** + * Test the property 'gasEstimates' + */ + @Test + public void gasEstimatesTest() { + // TODO: test gasEstimates + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java new file mode 100644 index 00000000000..542fec8e5d5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialCactusKeychainRefTest.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ +public class Web3SigningCredentialCactusKeychainRefTest { + private final Web3SigningCredentialCactusKeychainRef model = new Web3SigningCredentialCactusKeychainRef(); + + /** + * Model tests for Web3SigningCredentialCactusKeychainRef + */ + @Test + public void testWeb3SigningCredentialCactusKeychainRef() { + // TODO: test Web3SigningCredentialCactusKeychainRef + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java new file mode 100644 index 00000000000..911e965226d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialNoneTest.java @@ -0,0 +1,49 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialNone + */ +public class Web3SigningCredentialNoneTest { + private final Web3SigningCredentialNone model = new Web3SigningCredentialNone(); + + /** + * Model tests for Web3SigningCredentialNone + */ + @Test + public void testWeb3SigningCredentialNone() { + // TODO: test Web3SigningCredentialNone + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java new file mode 100644 index 00000000000..23285f94a71 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialPrivateKeyHexTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ +public class Web3SigningCredentialPrivateKeyHexTest { + private final Web3SigningCredentialPrivateKeyHex model = new Web3SigningCredentialPrivateKeyHex(); + + /** + * Model tests for Web3SigningCredentialPrivateKeyHex + */ + @Test + public void testWeb3SigningCredentialPrivateKeyHex() { + // TODO: test Web3SigningCredentialPrivateKeyHex + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java new file mode 100644 index 00000000000..908dfd8986b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTest.java @@ -0,0 +1,84 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.Web3SigningCredentialCactusKeychainRef; +import org.openapitools.client.model.Web3SigningCredentialNone; +import org.openapitools.client.model.Web3SigningCredentialPrivateKeyHex; +import org.openapitools.client.model.Web3SigningCredentialType; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredential + */ +public class Web3SigningCredentialTest { + private final Web3SigningCredential model = new Web3SigningCredential(); + + /** + * Model tests for Web3SigningCredential + */ + @Test + public void testWeb3SigningCredential() { + // TODO: test Web3SigningCredential + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'ethAccount' + */ + @Test + public void ethAccountTest() { + // TODO: test ethAccount + } + + /** + * Test the property 'keychainEntryKey' + */ + @Test + public void keychainEntryKeyTest() { + // TODO: test keychainEntryKey + } + + /** + * Test the property 'keychainId' + */ + @Test + public void keychainIdTest() { + // TODO: test keychainId + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java new file mode 100644 index 00000000000..ff3d197fd00 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3SigningCredentialTypeTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3SigningCredentialType + */ +public class Web3SigningCredentialTypeTest { + /** + * Model tests for Web3SigningCredentialType + */ + @Test + public void testWeb3SigningCredentialType() { + // TODO: test Web3SigningCredentialType + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java new file mode 100644 index 00000000000..1b42f4dd5c6 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/Web3TransactionReceiptTest.java @@ -0,0 +1,114 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Web3TransactionReceipt + */ +public class Web3TransactionReceiptTest { + private final Web3TransactionReceipt model = new Web3TransactionReceipt(); + + /** + * Model tests for Web3TransactionReceipt + */ + @Test + public void testWeb3TransactionReceipt() { + // TODO: test Web3TransactionReceipt + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'transactionHash' + */ + @Test + public void transactionHashTest() { + // TODO: test transactionHash + } + + /** + * Test the property 'transactionIndex' + */ + @Test + public void transactionIndexTest() { + // TODO: test transactionIndex + } + + /** + * Test the property 'blockHash' + */ + @Test + public void blockHashTest() { + // TODO: test blockHash + } + + /** + * Test the property 'blockNumber' + */ + @Test + public void blockNumberTest() { + // TODO: test blockNumber + } + + /** + * Test the property 'gasUsed' + */ + @Test + public void gasUsedTest() { + // TODO: test gasUsed + } + + /** + * Test the property 'contractAddress' + */ + @Test + public void contractAddressTest() { + // TODO: test contractAddress + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigFromTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigFromTest.java new file mode 100644 index 00000000000..c27f534bb8d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigFromTest.java @@ -0,0 +1,35 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for XdaiTransactionConfigFrom + */ +public class XdaiTransactionConfigFromTest { + private final XdaiTransactionConfigFrom model = new XdaiTransactionConfigFrom(); + + /** + * Model tests for XdaiTransactionConfigFrom + */ + @Test + public void testXdaiTransactionConfigFrom() { + // TODO: test XdaiTransactionConfigFrom + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigTest.java new file mode 100644 index 00000000000..9faa9d42cbd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigTest.java @@ -0,0 +1,107 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.client.model.XdaiTransactionConfigFrom; +import org.openapitools.client.model.XdaiTransactionConfigTo; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for XdaiTransactionConfig + */ +public class XdaiTransactionConfigTest { + private final XdaiTransactionConfig model = new XdaiTransactionConfig(); + + /** + * Model tests for XdaiTransactionConfig + */ + @Test + public void testXdaiTransactionConfig() { + // TODO: test XdaiTransactionConfig + } + + /** + * Test the property 'rawTransaction' + */ + @Test + public void rawTransactionTest() { + // TODO: test rawTransaction + } + + /** + * Test the property 'from' + */ + @Test + public void fromTest() { + // TODO: test from + } + + /** + * Test the property 'to' + */ + @Test + public void toTest() { + // TODO: test to + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'gas' + */ + @Test + public void gasTest() { + // TODO: test gas + } + + /** + * Test the property 'gasPrice' + */ + @Test + public void gasPriceTest() { + // TODO: test gasPrice + } + + /** + * Test the property 'nonce' + */ + @Test + public void nonceTest() { + // TODO: test nonce + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigToTest.java b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigToTest.java new file mode 100644 index 00000000000..6b4530d235c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/XdaiTransactionConfigToTest.java @@ -0,0 +1,34 @@ +/* + * Hyperledger Cactus Plugin - Connector Xdai + * Can perform basic tasks on a Xdai ledger + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for XdaiTransactionConfigTo + */ +public class XdaiTransactionConfigToTest { + private final XdaiTransactionConfigTo model = new XdaiTransactionConfigTo(); + + /** + * Model tests for XdaiTransactionConfigTo + */ + @Test + public void testXdaiTransactionConfigTo() { + // TODO: test XdaiTransactionConfigTo + } + +} diff --git a/packages/cactus-plugin-odap-hermes/package.json b/packages/cactus-plugin-odap-hermes/package.json index 2fced884635..9b0a29b99db 100644 --- a/packages/cactus-plugin-odap-hermes/package.json +++ b/packages/cactus-plugin-odap-hermes/package.json @@ -43,6 +43,8 @@ "generate-sdk": "run-p 'generate-sdk:*'", "generate-sdk:kotlin": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g kotlin -o ./src/main/kotlin/generated/openapi/kotlin-client/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "pretsc": "npm run generate-sdk", "tsc": "tsc --project ./tsconfig.json", "watch": "npm-watch" diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..8b083e7884c --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,38 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_asset_profile.go +model_client_v1_request.go +model_client_v1_request_client_gateway_configuration.go +model_commit_final_v1_request.go +model_commit_final_v1_response.go +model_commit_preparation_v1_request.go +model_commit_preparation_v1_response.go +model_credential_profile.go +model_history.go +model_lock_evidence_v1_request.go +model_lock_evidence_v1_response.go +model_odap_local_log.go +model_odap_message.go +model_odap_message_action_response.go +model_payload_profile.go +model_recover_success_v1_message.go +model_recover_update_ack_v1_message.go +model_recover_update_v1_message.go +model_recover_v1_message.go +model_rollback_ack_v1_message.go +model_rollback_v1_message.go +model_session_data.go +model_transfer_commence_v1_request.go +model_transfer_commence_v1_response.go +model_transfer_complete_v1_request.go +model_transfer_initialization_v1_request.go +model_transfer_initialization_v1_response.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..df0352d74b1 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,155 @@ +# Go API client for cactus-plugin-odap-hermes + +Implementation for Odap and Hermes + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-odap-hermes "github.com/hyperledger/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-odap-hermes.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-odap-hermes.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-odap-hermes.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-odap-hermes.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**ClientRequestV1**](docs/DefaultApi.md#clientrequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest | +*DefaultApi* | [**Phase1TransferInitiationRequestV1**](docs/DefaultApi.md#phase1transferinitiationrequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest | +*DefaultApi* | [**Phase1TransferInitiationResponseV1**](docs/DefaultApi.md#phase1transferinitiationresponsev1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse | +*DefaultApi* | [**Phase2LockEvidenceRequestV1**](docs/DefaultApi.md#phase2lockevidencerequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest | +*DefaultApi* | [**Phase2LockEvidenceResponseV1**](docs/DefaultApi.md#phase2lockevidenceresponsev1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse | +*DefaultApi* | [**Phase2TransferCommenceRequestV1**](docs/DefaultApi.md#phase2transfercommencerequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest | +*DefaultApi* | [**Phase2TransferCommenceResponseV1**](docs/DefaultApi.md#phase2transfercommenceresponsev1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse | +*DefaultApi* | [**Phase3CommitFinalRequestV1**](docs/DefaultApi.md#phase3commitfinalrequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest | +*DefaultApi* | [**Phase3CommitFinalResponseV1**](docs/DefaultApi.md#phase3commitfinalresponsev1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse | +*DefaultApi* | [**Phase3CommitPreparationRequestV1**](docs/DefaultApi.md#phase3commitpreparationrequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest | +*DefaultApi* | [**Phase3CommitPreparationResponseV1**](docs/DefaultApi.md#phase3commitpreparationresponsev1) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse | +*DefaultApi* | [**Phase3TransferCompleteRequestV1**](docs/DefaultApi.md#phase3transfercompleterequestv1) | **Get** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest | +*DefaultApi* | [**RecoverUpdateAckV1Message**](docs/DefaultApi.md#recoverupdateackv1message) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage | +*DefaultApi* | [**RecoverUpdateV1Message**](docs/DefaultApi.md#recoverupdatev1message) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage | +*DefaultApi* | [**RecoverV1Message**](docs/DefaultApi.md#recoverv1message) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage | +*DefaultApi* | [**RecoverV1Success**](docs/DefaultApi.md#recoverv1success) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage | +*DefaultApi* | [**RollbackAckV1Message**](docs/DefaultApi.md#rollbackackv1message) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage | +*DefaultApi* | [**RollbackV1Message**](docs/DefaultApi.md#rollbackv1message) | **Post** /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage | + + +## Documentation For Models + + - [AssetProfile](docs/AssetProfile.md) + - [ClientV1Request](docs/ClientV1Request.md) + - [ClientV1RequestClientGatewayConfiguration](docs/ClientV1RequestClientGatewayConfiguration.md) + - [CommitFinalV1Request](docs/CommitFinalV1Request.md) + - [CommitFinalV1Response](docs/CommitFinalV1Response.md) + - [CommitPreparationV1Request](docs/CommitPreparationV1Request.md) + - [CommitPreparationV1Response](docs/CommitPreparationV1Response.md) + - [CredentialProfile](docs/CredentialProfile.md) + - [History](docs/History.md) + - [LockEvidenceV1Request](docs/LockEvidenceV1Request.md) + - [LockEvidenceV1Response](docs/LockEvidenceV1Response.md) + - [OdapLocalLog](docs/OdapLocalLog.md) + - [OdapMessage](docs/OdapMessage.md) + - [OdapMessageActionResponse](docs/OdapMessageActionResponse.md) + - [PayloadProfile](docs/PayloadProfile.md) + - [RecoverSuccessV1Message](docs/RecoverSuccessV1Message.md) + - [RecoverUpdateAckV1Message](docs/RecoverUpdateAckV1Message.md) + - [RecoverUpdateV1Message](docs/RecoverUpdateV1Message.md) + - [RecoverV1Message](docs/RecoverV1Message.md) + - [RollbackAckV1Message](docs/RollbackAckV1Message.md) + - [RollbackV1Message](docs/RollbackV1Message.md) + - [SessionData](docs/SessionData.md) + - [TransferCommenceV1Request](docs/TransferCommenceV1Request.md) + - [TransferCommenceV1Response](docs/TransferCommenceV1Response.md) + - [TransferCompleteV1Request](docs/TransferCompleteV1Request.md) + - [TransferInitializationV1Request](docs/TransferInitializationV1Request.md) + - [TransferInitializationV1Response](docs/TransferInitializationV1Response.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..d03b39249eb --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,1600 @@ +openapi: 3.0.3 +info: + description: Implementation for Odap and Hermes + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Odap Hermes + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest: + post: + description: "" + operationId: phase1TransferInitiationRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferInitializationV1Request' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest: + post: + description: "" + operationId: phase2TransferCommenceRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferCommenceV1Request' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest: + post: + description: "" + operationId: phase2LockEvidenceRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LockEvidenceV1Request' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest: + post: + description: "" + operationId: phase3CommitPreparationRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitPreparationV1Request' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest: + post: + description: "" + operationId: phase3CommitFinalRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitFinalV1Request' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest: + get: + description: "" + operationId: phase3TransferCompleteRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferCompleteV1Request' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest + /api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest: + post: + description: "" + operationId: clientRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClientV1Request' + responses: + "200": + content: + application/json: + schema: {} + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse: + post: + description: "" + operationId: phase1TransferInitiationResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferInitializationV1Response' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse: + post: + description: "" + operationId: phase2TransferCommenceResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferCommenceV1Response' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse: + post: + description: "" + operationId: phase2LockEvidenceResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LockEvidenceV1Response' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse: + post: + description: "" + operationId: phase3CommitPreparationResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitPreparationV1Response' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse: + post: + description: "" + operationId: phase3CommitFinalResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitFinalV1Response' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse + /api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage: + post: + description: "" + operationId: RecoverV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverV1Message' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage + /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage: + post: + description: "" + operationId: RecoverUpdateV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverUpdateV1Message' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage + /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage: + post: + description: "" + operationId: RecoverUpdateAckV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverUpdateAckV1Message' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage + /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage: + post: + description: "" + operationId: RecoverV1Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverSuccessV1Message' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage + /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage: + post: + description: "" + operationId: RollbackV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RollbackV1Message' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage + /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage: + post: + description: "" + operationId: RollbackAckV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RollbackAckV1Message' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage +components: + schemas: + CredentialProfile: + enum: + - SAML + - OAUTH + - X509 + type: string + PayloadProfile: + example: + assetProfile: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + capabilities: capabilities + properties: + assetProfile: + $ref: '#/components/schemas/AssetProfile' + capabilities: + type: string + required: + - assetProfile + type: object + ApplicationProfile: + type: object + Payload: + type: object + AssetProfile: + example: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + properties: + issuer: + type: string + assetCode: + type: string + assetCodeType: + type: string + issuanceDate: + type: string + expirationDate: + type: string + verificationEndPoint: + type: string + digitalSignature: + type: string + prospectusLink: + type: string + keyInformationLink: + items: {} + type: array + keyWord: + items: {} + type: array + transferRestriction: + items: {} + type: array + ledgerRequirements: + items: {} + type: array + required: + - expirationDate + type: object + LoggingProfile: + items: + type: string + type: array + AccessControlProfile: + items: + type: string + type: array + Permissions: + type: object + Transaction: + type: object + ActionCategory: + type: object + History: + example: + Origin: Origin + Transactions: + - null + - null + Destination: Destination + Actions: + - null + - null + CurrentStatus: "{}" + ApplicationSpecificParameters: "{}" + Balance: Balance + properties: + Transactions: + items: + $ref: '#/components/schemas/Transaction' + type: array + Actions: + items: + $ref: '#/components/schemas/ActionCategory' + type: array + Origin: + type: string + Destination: + type: string + Balance: + type: string + CurrentStatus: + type: object + ApplicationSpecificParameters: + type: object + type: object + SenderDltSystem: + type: object + RecipientDltSystem: + type: object + LockEvidenceClaim: + type: object + LockClaimFormat: + type: object + CommitFinalClaim: + type: object + CommitFinalClaimFormat: + type: object + CommitAcknowledgementClaim: + type: object + CommitAcknowledgementClaimFormat: + type: object + SessionData: + properties: + id: + type: string + step: + type: number + version: + type: string + lastSequenceNumber: + type: number + loggingProfile: + type: string + accessControlProfile: + type: string + applicationProfile: + type: string + payloadProfile: + $ref: '#/components/schemas/PayloadProfile' + assetProfile: + $ref: '#/components/schemas/AssetProfile' + allowedSourceBackupGateways: + items: + type: string + type: array + allowedRecipientBackupGateways: + items: + type: string + type: array + sourceBasePath: + type: string + recipientBasePath: + type: string + originatorPubkey: + type: string + beneficiaryPubkey: + type: string + sourceGatewayPubkey: + type: string + sourceGatewayDltSystem: + type: string + recipientGatewayPubkey: + type: string + recipientGatewayDltSystem: + type: string + initializationRequestMessageHash: + type: string + initializationResponseMessageHash: + type: string + initializationRequestMessageRcvTimeStamp: + type: string + initializationRequestMessageProcessedTimeStamp: + type: string + clientSignatureInitializationRequestMessage: + type: string + serverSignatureInitializationResponseMessage: + type: string + transferCommenceMessageRequestHash: + type: string + transferCommenceMessageResponseHash: + type: string + clientSignatureTransferCommenceRequestMessage: + type: string + serverSignatureTransferCommenceResponseMessage: + type: string + lockEvidenceRequestMessageHash: + type: string + lockEvidenceResponseMessageHash: + type: string + clientSignatureLockEvidenceRequestMessage: + type: string + serverSignatureLockEvidenceResponseMessage: + type: string + lockEvidenceClaim: + type: string + commitPrepareRequestMessageHash: + type: string + commitPrepareResponseMessageHash: + type: string + clientSignatureCommitPreparationRequestMessage: + type: string + serverSignatureCommitPreparationResponseMessage: + type: string + commitFinalRequestMessageHash: + type: string + commitFinalResponseMessageHash: + type: string + commitFinalClaim: + type: string + commitFinalClaimFormat: + type: string + commitAcknowledgementClaim: + type: string + commitAcknowledgementClaimFormat: + type: string + clientSignatureCommitFinalRequestMessage: + type: string + serverSignatureCommitFinalResponseMessage: + type: string + transferCompleteMessageHash: + type: string + clientSignatureTransferCompleteMessage: + type: string + maxRetries: + type: number + recipientLedgerAssetID: + type: string + sourceLedgerAssetID: + type: string + maxTimeout: + type: number + lastLogEntryTimestamp: + type: string + unlockAssetClaim: + type: string + recreateAssetClaim: + type: string + deleteAssetClaim: + type: string + lastMessageReceivedTimestamp: + type: string + rollback: + type: boolean + rollbackMessageHash: + type: string + rollbackProofs: + items: + type: string + type: array + rollbackActionsPerformed: + items: + enum: + - CREATE + - DELETE + - LOCK + - UNLOCK + type: string + type: array + type: object + TransferInitializationV1Request: + example: + recipientLedgerAssetID: recipientLedgerAssetID + subsequentCalls: "{}" + backupGatewaysAllowed: + - backupGatewaysAllowed + - backupGatewaysAllowed + signature: signature + credentialProfile: null + origin: origin + destination: destination + recipientGatewayPubkey: recipientGatewayPubkey + sessionID: sessionID + sourceBasePath: sourceBasePath + loggingProfile: loggingProfile + sourceLedgerAssetID: sourceLedgerAssetID + messageType: messageType + permissions: "{}" + multipleClaimsAllowed: true + payloadProfile: + assetProfile: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + capabilities: capabilities + applicationProfile: applicationProfile + sourceGatewayPubkey: sourceGatewayPubkey + recipientGatewayDltSystem: recipientGatewayDltSystem + sequenceNumber: 0 + accessControlProfile: accessControlProfile + developerURN: developerURN + histories: + - Origin: Origin + Transactions: + - null + - null + Destination: Destination + Actions: + - null + - null + CurrentStatus: "{}" + ApplicationSpecificParameters: "{}" + Balance: Balance + - Origin: Origin + Transactions: + - null + - null + Destination: Destination + Actions: + - null + - null + CurrentStatus: "{}" + ApplicationSpecificParameters: "{}" + Balance: Balance + version: version + multipleCancelsAllowed: true + escrowType: FAUCET + maxRetries: 6.027456183070403 + sourceGatewayDltSystem: sourceGatewayDltSystem + recipientBasePath: recipientBasePath + maxTimeout: 1.4658129805029452 + expiryTime: expiryTime + properties: + messageType: + type: string + sessionID: + type: string + version: + type: string + developerURN: + type: string + credentialProfile: + $ref: '#/components/schemas/CredentialProfile' + payloadProfile: + $ref: '#/components/schemas/PayloadProfile' + applicationProfile: + type: string + loggingProfile: + type: string + accessControlProfile: + type: string + signature: + type: string + sourceGatewayPubkey: + type: string + sourceGatewayDltSystem: + type: string + recipientGatewayPubkey: + type: string + recipientGatewayDltSystem: + type: string + escrowType: + enum: + - FAUCET + - TIMELOCK + - HASHLOCK + - HASHTIMELOCK + - MULTICLAIMPC + - DESTROY + - BURN + type: string + expiryTime: + type: string + multipleClaimsAllowed: + type: boolean + multipleCancelsAllowed: + type: boolean + permissions: + type: object + origin: + type: string + destination: + type: string + subsequentCalls: + type: object + histories: + items: + $ref: '#/components/schemas/History' + type: array + sequenceNumber: + type: integer + sourceBasePath: + type: string + recipientBasePath: + type: string + maxRetries: + type: number + maxTimeout: + type: number + backupGatewaysAllowed: + items: + type: string + type: array + recipientLedgerAssetID: + type: string + sourceLedgerAssetID: + type: string + required: + - accessControlProfile + - applicationProfile + - backupGatewaysAllowed + - loggingProfile + - maxRetries + - maxTimeout + - messageType + - payloadProfile + - recipientBasePath + - recipientGatewayDltSystem + - recipientGatewayPubkey + - recipientLedgerAssetID + - sequenceNumber + - sessionID + - signature + - sourceBasePath + - sourceGatewayDltSystem + - sourceGatewayPubkey + - sourceLedgerAssetID + type: object + TransferInitializationV1Response: + example: + timeStamp: timeStamp + sequenceNumber: 0.8008281904610115 + odapPhase: TransferInitialization + initialRequestMessageHash: initialRequestMessageHash + messageType: messageType + backupGatewaysAllowed: + - backupGatewaysAllowed + - backupGatewaysAllowed + processedTimeStamp: processedTimeStamp + signature: signature + destination: destination + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + messageType: + type: string + sessionID: + type: string + sequenceNumber: + type: number + odapPhase: + enum: + - TransferInitialization + - LockEvidenceVerification + - CommitmentEstablishment + type: string + initialRequestMessageHash: + type: string + destination: + type: string + timeStamp: + type: string + processedTimeStamp: + type: string + serverIdentityPubkey: + type: string + signature: + type: string + backupGatewaysAllowed: + items: + type: string + type: array + required: + - backupGatewaysAllowed + - initialRequestMessageHash + - messageType + - processedTimeStamp + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + - timeStamp + type: object + TransferCommenceV1Request: + example: + beneficiaryPubkey: beneficiaryPubkey + sequenceNumber: 1 + hashAssetProfile: hashAssetProfile + clientIdentityPubkey: clientIdentityPubkey + clientTransferNumber: 6 + signature: signature + recipientDltSystem: recipientDltSystem + sessionID: sessionID + hashPrevMessage: hashPrevMessage + serverIdentityPubkey: serverIdentityPubkey + assetUnit: 0 + messageType: messageType + senderDltSystem: senderDltSystem + originatorPubkey: originatorPubkey + properties: + sessionID: + type: string + messageType: + type: string + originatorPubkey: + type: string + beneficiaryPubkey: + type: string + senderDltSystem: + type: string + recipientDltSystem: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashAssetProfile: + type: string + assetUnit: + type: integer + hashPrevMessage: + type: string + clientTransferNumber: + nullable: true + type: integer + signature: + type: string + sequenceNumber: + type: integer + required: + - beneficiaryPubkey + - clientIdentityPubkey + - hashAssetProfile + - hashPrevMessage + - messageType + - originatorPubkey + - recipientDltSystem + - senderDltSystem + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + TransferCommenceV1Response: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + signature: signature + serverTransferNumber: 0 + messageHash: messageHash + sessionID: sessionID + hashCommenceRequest: hashCommenceRequest + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashCommenceRequest: + type: string + serverTransferNumber: + nullable: true + type: integer + signature: + type: string + messageType: + type: string + messageHash: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashCommenceRequest + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + LockEvidenceV1Request: + example: + sequenceNumber: 6.027456183070403 + lockEvidenceExpiration: lockEvidenceExpiration + clientIdentityPubkey: clientIdentityPubkey + clientTransferNumber: 0 + messageType: messageType + signature: signature + lockEvidenceClaim: lockEvidenceClaim + lockEvidenceFormat: "{}" + hashCommenceAckRequest: hashCommenceAckRequest + messageHash: messageHash + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + lockEvidenceClaim: + type: string + lockEvidenceFormat: + type: object + lockEvidenceExpiration: + type: string + hashCommenceAckRequest: + type: string + clientTransferNumber: + nullable: true + type: integer + signature: + type: string + messageType: + type: string + messageHash: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashCommenceAckRequest + - lockEvidenceClaim + - lockEvidenceExpiration + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + LockEvidenceV1Response: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + signature: signature + serverTransferNumber: 0 + hashLockEvidenceRequest: hashLockEvidenceRequest + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashLockEvidenceRequest: + type: string + serverTransferNumber: + nullable: true + type: integer + signature: + type: string + messageType: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashLockEvidenceRequest + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + CommitPreparationV1Request: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + hashLockEvidenceAck: hashLockEvidenceAck + messageType: messageType + clientTransferNumber: 0 + signature: signature + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashLockEvidenceAck: + type: string + clientTransferNumber: + type: integer + signature: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashLockEvidenceAck + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + CommitPreparationV1Response: + example: + sequenceNumber: 0.8008281904610115 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + hashCommitPrep: hashCommitPrep + signature: signature + serverTransferNumber: serverTransferNumber + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashCommitPrep: + type: string + serverTransferNumber: + type: string + signature: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashCommitPrep + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + CommitFinalV1Request: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + clientTransferNumber: 0 + signature: signature + commitFinalClaim: commitFinalClaim + commitFinalClaimFormat: "{}" + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + hashCommitPrepareAck: hashCommitPrepareAck + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + commitFinalClaim: + type: string + commitFinalClaimFormat: + type: object + hashCommitPrepareAck: + type: string + clientTransferNumber: + nullable: true + type: integer + signature: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - commitFinalClaim + - hashCommitPrepareAck + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + CommitFinalV1Response: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + commitAcknowledgementClaimFormat: "{}" + signature: signature + serverTransferNumber: 0 + commitAcknowledgementClaim: commitAcknowledgementClaim + hashCommitFinal: hashCommitFinal + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + commitAcknowledgementClaim: + type: string + commitAcknowledgementClaimFormat: + type: object + hashCommitFinal: + type: string + serverTransferNumber: + type: integer + signature: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - commitAcknowledgementClaim + - hashCommitFinal + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + TransferCompleteV1Request: + example: + sequenceNumber: 6.027456183070403 + hashCommitFinalAck: hashCommitFinalAck + clientIdentityPubkey: clientIdentityPubkey + hashTransferCommence: hashTransferCommence + messageType: messageType + clientTransferNumber: 0 + signature: signature + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashCommitFinalAck: + type: string + clientTransferNumber: + nullable: true + type: integer + signature: + type: string + hashTransferCommence: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashCommitFinalAck + - hashTransferCommence + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + ClientV1Request: + example: + assetProfile: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + beneficiaryPubkey: beneficiaryPubkey + recipientLedgerAssetID: recipientLedgerAssetID + clientIdentityPubkey: clientIdentityPubkey + serverDltSystem: serverDltSystem + accessControlProfile: accessControlProfile + recipientGatewayPubkey: recipientGatewayPubkey + assetControlProfile: assetControlProfile + version: version + serverIdentityPubkey: serverIdentityPubkey + loggingProfile: loggingProfile + serverGatewayConfiguration: + apiHost: apiHost + sourceLedgerAssetID: sourceLedgerAssetID + clientGatewayConfiguration: + apiHost: apiHost + maxRetries: 0.8008281904610115 + sourceGatewayDltSystem: sourceGatewayDltSystem + maxTimeout: 6.027456183070403 + applicationProfile: applicationProfile + payloadProfile: + assetProfile: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + capabilities: capabilities + originatorPubkey: originatorPubkey + clientDltSystem: clientDltSystem + recipientGatewayDltSystem: recipientGatewayDltSystem + properties: + version: + type: string + loggingProfile: + type: string + accessControlProfile: + type: string + assetControlProfile: + type: string + applicationProfile: + type: string + assetProfile: + $ref: '#/components/schemas/AssetProfile' + payloadProfile: + $ref: '#/components/schemas/PayloadProfile' + sourceGatewayDltSystem: + type: string + recipientGatewayDltSystem: + type: string + recipientGatewayPubkey: + type: string + originatorPubkey: + type: string + beneficiaryPubkey: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + clientDltSystem: + type: string + serverDltSystem: + type: string + clientGatewayConfiguration: + $ref: '#/components/schemas/ClientV1Request_clientGatewayConfiguration' + serverGatewayConfiguration: + $ref: '#/components/schemas/ClientV1Request_clientGatewayConfiguration' + maxRetries: + type: number + maxTimeout: + type: number + sourceLedgerAssetID: + type: string + recipientLedgerAssetID: + type: string + required: + - accessControlProfile + - applicationProfile + - assetControlProfile + - assetProfile + - beneficiaryPubkey + - clientDltSystem + - clientGatewayConfiguration + - clientIdentityPubkey + - loggingProfile + - maxRetries + - maxTimeout + - originatorPubkey + - payloadProfile + - recipientGatewayDltSystem + - recipientGatewayPubkey + - recipientLedgerAssetID + - serverDltSystem + - serverGatewayConfiguration + - serverIdentityPubkey + - sourceGatewayDltSystem + - sourceLedgerAssetID + - version + type: object + RecoverV1Message: + example: + sequenceNumber: 0.8008281904610115 + isBackup: true + odapPhase: odapPhase + signature: signature + sessionID: sessionID + newGatewayPubKey: newGatewayPubKey + newBasePath: newBasePath + lastLogEntryTimestamp: lastLogEntryTimestamp + properties: + sessionID: + type: string + odapPhase: + type: string + sequenceNumber: + type: number + lastLogEntryTimestamp: + type: string + isBackup: + type: boolean + newBasePath: + type: string + newGatewayPubKey: + type: string + signature: + type: string + required: + - isBackup + - lastLogEntryTimestamp + - newBasePath + - odapPhase + - sequenceNumber + - sessionID + - signature + type: object + RecoverUpdateV1Message: + example: + signature: signature + sessionID: sessionID + recoveredLogs: + - data: data + sessionID: sessionID + type: type + operation: operation + key: key + timestamp: timestamp + - data: data + sessionID: sessionID + type: type + operation: operation + key: key + timestamp: timestamp + properties: + sessionID: + type: string + recoveredLogs: + items: + $ref: '#/components/schemas/OdapLocalLog' + type: array + signature: + type: string + required: + - recoveredLogs + - sessionID + - signature + type: object + RecoverUpdateAckV1Message: + example: + signature: signature + success: true + sessionID: sessionID + changedEntriesHash: + - changedEntriesHash + - changedEntriesHash + properties: + sessionID: + type: string + success: + type: boolean + changedEntriesHash: + items: + type: string + type: array + signature: + type: string + required: + - changedEntriesHash + - sessionID + - signature + - success + type: object + RecoverSuccessV1Message: + example: + signature: signature + success: true + sessionID: sessionID + properties: + sessionID: + type: string + success: + type: boolean + signature: + type: string + required: + - sessionID + - signature + - success + type: object + RollbackV1Message: + example: + actionPerformed: + - actionPerformed + - actionPerformed + signature: signature + success: true + proofs: + - proofs + - proofs + sessionID: sessionID + properties: + sessionID: + type: string + success: + type: boolean + actionPerformed: + items: + type: string + type: array + proofs: + items: + type: string + type: array + signature: + type: string + required: + - actionPerformed + - proofs + - sessionID + - signature + - success + type: object + RollbackAckV1Message: + example: + signature: signature + success: true + sessionID: sessionID + properties: + sessionID: + type: string + success: + type: boolean + signature: + type: string + required: + - sessionID + - signature + - success + type: object + OdapLocalLog: + example: + data: data + sessionID: sessionID + type: type + operation: operation + key: key + timestamp: timestamp + properties: + key: + type: string + sessionID: + type: string + data: + type: string + type: + type: string + operation: + type: string + timestamp: + type: string + required: + - operation + - sessionID + - type + type: object + OdapMessage: + properties: + SequenceNumber: + type: number + Phase: + enum: + - TransferInitialization + - LockEvidenceVerification + - CommitmentEstablishment + type: string + ResourceURL: + type: string + DeveloperURN: + type: string + ActionResponse: + $ref: '#/components/schemas/OdapMessage_ActionResponse' + CredentialProfile: + enum: + - SAML + - OAuth + - X509 + type: string + CredentialBlock: + items: {} + type: array + CredentialsProfile: + $ref: '#/components/schemas/PayloadProfile' + ApplicationProfile: + type: object + Payload: + type: object + PayloadHash: + type: string + MessageSignature: + type: string + type: object + ClientV1Request_clientGatewayConfiguration: + example: + apiHost: apiHost + properties: + apiHost: + type: string + required: + - apiHost + type: object + OdapMessage_ActionResponse: + properties: + ResponseCode: + enum: + - "200" + - "404" + type: string + x-enum-varnames: + - OK + - RESOURCE_NOT_FOUND + Arguments: + items: {} + type: array + type: object diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..3667cb6177f --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,1762 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiClientRequestV1Request struct { + ctx context.Context + ApiService *DefaultApiService + clientV1Request *ClientV1Request +} + +func (r ApiClientRequestV1Request) ClientV1Request(clientV1Request ClientV1Request) ApiClientRequestV1Request { + r.clientV1Request = &clientV1Request + return r +} + +func (r ApiClientRequestV1Request) Execute() (interface{}, *http.Response, error) { + return r.ApiService.ClientRequestV1Execute(r) +} + +/* +ClientRequestV1 Method for ClientRequestV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiClientRequestV1Request +*/ +func (a *DefaultApiService) ClientRequestV1(ctx context.Context) ApiClientRequestV1Request { + return ApiClientRequestV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return interface{} +func (a *DefaultApiService) ClientRequestV1Execute(r ApiClientRequestV1Request) (interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ClientRequestV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.clientV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPhase1TransferInitiationRequestV1Request struct { + ctx context.Context + ApiService *DefaultApiService + transferInitializationV1Request *TransferInitializationV1Request +} + +func (r ApiPhase1TransferInitiationRequestV1Request) TransferInitializationV1Request(transferInitializationV1Request TransferInitializationV1Request) ApiPhase1TransferInitiationRequestV1Request { + r.transferInitializationV1Request = &transferInitializationV1Request + return r +} + +func (r ApiPhase1TransferInitiationRequestV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase1TransferInitiationRequestV1Execute(r) +} + +/* +Phase1TransferInitiationRequestV1 Method for Phase1TransferInitiationRequestV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase1TransferInitiationRequestV1Request +*/ +func (a *DefaultApiService) Phase1TransferInitiationRequestV1(ctx context.Context) ApiPhase1TransferInitiationRequestV1Request { + return ApiPhase1TransferInitiationRequestV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase1TransferInitiationRequestV1Execute(r ApiPhase1TransferInitiationRequestV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase1TransferInitiationRequestV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.transferInitializationV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase1TransferInitiationResponseV1Request struct { + ctx context.Context + ApiService *DefaultApiService + transferInitializationV1Response *TransferInitializationV1Response +} + +func (r ApiPhase1TransferInitiationResponseV1Request) TransferInitializationV1Response(transferInitializationV1Response TransferInitializationV1Response) ApiPhase1TransferInitiationResponseV1Request { + r.transferInitializationV1Response = &transferInitializationV1Response + return r +} + +func (r ApiPhase1TransferInitiationResponseV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase1TransferInitiationResponseV1Execute(r) +} + +/* +Phase1TransferInitiationResponseV1 Method for Phase1TransferInitiationResponseV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase1TransferInitiationResponseV1Request +*/ +func (a *DefaultApiService) Phase1TransferInitiationResponseV1(ctx context.Context) ApiPhase1TransferInitiationResponseV1Request { + return ApiPhase1TransferInitiationResponseV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase1TransferInitiationResponseV1Execute(r ApiPhase1TransferInitiationResponseV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase1TransferInitiationResponseV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.transferInitializationV1Response + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase2LockEvidenceRequestV1Request struct { + ctx context.Context + ApiService *DefaultApiService + lockEvidenceV1Request *LockEvidenceV1Request +} + +func (r ApiPhase2LockEvidenceRequestV1Request) LockEvidenceV1Request(lockEvidenceV1Request LockEvidenceV1Request) ApiPhase2LockEvidenceRequestV1Request { + r.lockEvidenceV1Request = &lockEvidenceV1Request + return r +} + +func (r ApiPhase2LockEvidenceRequestV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase2LockEvidenceRequestV1Execute(r) +} + +/* +Phase2LockEvidenceRequestV1 Method for Phase2LockEvidenceRequestV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase2LockEvidenceRequestV1Request +*/ +func (a *DefaultApiService) Phase2LockEvidenceRequestV1(ctx context.Context) ApiPhase2LockEvidenceRequestV1Request { + return ApiPhase2LockEvidenceRequestV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase2LockEvidenceRequestV1Execute(r ApiPhase2LockEvidenceRequestV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase2LockEvidenceRequestV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.lockEvidenceV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase2LockEvidenceResponseV1Request struct { + ctx context.Context + ApiService *DefaultApiService + lockEvidenceV1Response *LockEvidenceV1Response +} + +func (r ApiPhase2LockEvidenceResponseV1Request) LockEvidenceV1Response(lockEvidenceV1Response LockEvidenceV1Response) ApiPhase2LockEvidenceResponseV1Request { + r.lockEvidenceV1Response = &lockEvidenceV1Response + return r +} + +func (r ApiPhase2LockEvidenceResponseV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase2LockEvidenceResponseV1Execute(r) +} + +/* +Phase2LockEvidenceResponseV1 Method for Phase2LockEvidenceResponseV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase2LockEvidenceResponseV1Request +*/ +func (a *DefaultApiService) Phase2LockEvidenceResponseV1(ctx context.Context) ApiPhase2LockEvidenceResponseV1Request { + return ApiPhase2LockEvidenceResponseV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase2LockEvidenceResponseV1Execute(r ApiPhase2LockEvidenceResponseV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase2LockEvidenceResponseV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.lockEvidenceV1Response + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase2TransferCommenceRequestV1Request struct { + ctx context.Context + ApiService *DefaultApiService + transferCommenceV1Request *TransferCommenceV1Request +} + +func (r ApiPhase2TransferCommenceRequestV1Request) TransferCommenceV1Request(transferCommenceV1Request TransferCommenceV1Request) ApiPhase2TransferCommenceRequestV1Request { + r.transferCommenceV1Request = &transferCommenceV1Request + return r +} + +func (r ApiPhase2TransferCommenceRequestV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase2TransferCommenceRequestV1Execute(r) +} + +/* +Phase2TransferCommenceRequestV1 Method for Phase2TransferCommenceRequestV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase2TransferCommenceRequestV1Request +*/ +func (a *DefaultApiService) Phase2TransferCommenceRequestV1(ctx context.Context) ApiPhase2TransferCommenceRequestV1Request { + return ApiPhase2TransferCommenceRequestV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase2TransferCommenceRequestV1Execute(r ApiPhase2TransferCommenceRequestV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase2TransferCommenceRequestV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.transferCommenceV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase2TransferCommenceResponseV1Request struct { + ctx context.Context + ApiService *DefaultApiService + transferCommenceV1Response *TransferCommenceV1Response +} + +func (r ApiPhase2TransferCommenceResponseV1Request) TransferCommenceV1Response(transferCommenceV1Response TransferCommenceV1Response) ApiPhase2TransferCommenceResponseV1Request { + r.transferCommenceV1Response = &transferCommenceV1Response + return r +} + +func (r ApiPhase2TransferCommenceResponseV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase2TransferCommenceResponseV1Execute(r) +} + +/* +Phase2TransferCommenceResponseV1 Method for Phase2TransferCommenceResponseV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase2TransferCommenceResponseV1Request +*/ +func (a *DefaultApiService) Phase2TransferCommenceResponseV1(ctx context.Context) ApiPhase2TransferCommenceResponseV1Request { + return ApiPhase2TransferCommenceResponseV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase2TransferCommenceResponseV1Execute(r ApiPhase2TransferCommenceResponseV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase2TransferCommenceResponseV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.transferCommenceV1Response + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase3CommitFinalRequestV1Request struct { + ctx context.Context + ApiService *DefaultApiService + commitFinalV1Request *CommitFinalV1Request +} + +func (r ApiPhase3CommitFinalRequestV1Request) CommitFinalV1Request(commitFinalV1Request CommitFinalV1Request) ApiPhase3CommitFinalRequestV1Request { + r.commitFinalV1Request = &commitFinalV1Request + return r +} + +func (r ApiPhase3CommitFinalRequestV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase3CommitFinalRequestV1Execute(r) +} + +/* +Phase3CommitFinalRequestV1 Method for Phase3CommitFinalRequestV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase3CommitFinalRequestV1Request +*/ +func (a *DefaultApiService) Phase3CommitFinalRequestV1(ctx context.Context) ApiPhase3CommitFinalRequestV1Request { + return ApiPhase3CommitFinalRequestV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase3CommitFinalRequestV1Execute(r ApiPhase3CommitFinalRequestV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase3CommitFinalRequestV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.commitFinalV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase3CommitFinalResponseV1Request struct { + ctx context.Context + ApiService *DefaultApiService + commitFinalV1Response *CommitFinalV1Response +} + +func (r ApiPhase3CommitFinalResponseV1Request) CommitFinalV1Response(commitFinalV1Response CommitFinalV1Response) ApiPhase3CommitFinalResponseV1Request { + r.commitFinalV1Response = &commitFinalV1Response + return r +} + +func (r ApiPhase3CommitFinalResponseV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase3CommitFinalResponseV1Execute(r) +} + +/* +Phase3CommitFinalResponseV1 Method for Phase3CommitFinalResponseV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase3CommitFinalResponseV1Request +*/ +func (a *DefaultApiService) Phase3CommitFinalResponseV1(ctx context.Context) ApiPhase3CommitFinalResponseV1Request { + return ApiPhase3CommitFinalResponseV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase3CommitFinalResponseV1Execute(r ApiPhase3CommitFinalResponseV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase3CommitFinalResponseV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.commitFinalV1Response + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase3CommitPreparationRequestV1Request struct { + ctx context.Context + ApiService *DefaultApiService + commitPreparationV1Request *CommitPreparationV1Request +} + +func (r ApiPhase3CommitPreparationRequestV1Request) CommitPreparationV1Request(commitPreparationV1Request CommitPreparationV1Request) ApiPhase3CommitPreparationRequestV1Request { + r.commitPreparationV1Request = &commitPreparationV1Request + return r +} + +func (r ApiPhase3CommitPreparationRequestV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase3CommitPreparationRequestV1Execute(r) +} + +/* +Phase3CommitPreparationRequestV1 Method for Phase3CommitPreparationRequestV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase3CommitPreparationRequestV1Request +*/ +func (a *DefaultApiService) Phase3CommitPreparationRequestV1(ctx context.Context) ApiPhase3CommitPreparationRequestV1Request { + return ApiPhase3CommitPreparationRequestV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase3CommitPreparationRequestV1Execute(r ApiPhase3CommitPreparationRequestV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase3CommitPreparationRequestV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.commitPreparationV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase3CommitPreparationResponseV1Request struct { + ctx context.Context + ApiService *DefaultApiService + commitPreparationV1Response *CommitPreparationV1Response +} + +func (r ApiPhase3CommitPreparationResponseV1Request) CommitPreparationV1Response(commitPreparationV1Response CommitPreparationV1Response) ApiPhase3CommitPreparationResponseV1Request { + r.commitPreparationV1Response = &commitPreparationV1Response + return r +} + +func (r ApiPhase3CommitPreparationResponseV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase3CommitPreparationResponseV1Execute(r) +} + +/* +Phase3CommitPreparationResponseV1 Method for Phase3CommitPreparationResponseV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase3CommitPreparationResponseV1Request +*/ +func (a *DefaultApiService) Phase3CommitPreparationResponseV1(ctx context.Context) ApiPhase3CommitPreparationResponseV1Request { + return ApiPhase3CommitPreparationResponseV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase3CommitPreparationResponseV1Execute(r ApiPhase3CommitPreparationResponseV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase3CommitPreparationResponseV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.commitPreparationV1Response + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPhase3TransferCompleteRequestV1Request struct { + ctx context.Context + ApiService *DefaultApiService + transferCompleteV1Request *TransferCompleteV1Request +} + +func (r ApiPhase3TransferCompleteRequestV1Request) TransferCompleteV1Request(transferCompleteV1Request TransferCompleteV1Request) ApiPhase3TransferCompleteRequestV1Request { + r.transferCompleteV1Request = &transferCompleteV1Request + return r +} + +func (r ApiPhase3TransferCompleteRequestV1Request) Execute() (*http.Response, error) { + return r.ApiService.Phase3TransferCompleteRequestV1Execute(r) +} + +/* +Phase3TransferCompleteRequestV1 Method for Phase3TransferCompleteRequestV1 + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPhase3TransferCompleteRequestV1Request +*/ +func (a *DefaultApiService) Phase3TransferCompleteRequestV1(ctx context.Context) ApiPhase3TransferCompleteRequestV1Request { + return ApiPhase3TransferCompleteRequestV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) Phase3TransferCompleteRequestV1Execute(r ApiPhase3TransferCompleteRequestV1Request) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.Phase3TransferCompleteRequestV1") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.transferCompleteV1Request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRecoverUpdateAckV1MessageRequest struct { + ctx context.Context + ApiService *DefaultApiService + recoverUpdateAckV1Message *RecoverUpdateAckV1Message +} + +func (r ApiRecoverUpdateAckV1MessageRequest) RecoverUpdateAckV1Message(recoverUpdateAckV1Message RecoverUpdateAckV1Message) ApiRecoverUpdateAckV1MessageRequest { + r.recoverUpdateAckV1Message = &recoverUpdateAckV1Message + return r +} + +func (r ApiRecoverUpdateAckV1MessageRequest) Execute() (*http.Response, error) { + return r.ApiService.RecoverUpdateAckV1MessageExecute(r) +} + +/* +RecoverUpdateAckV1Message Method for RecoverUpdateAckV1Message + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRecoverUpdateAckV1MessageRequest +*/ +func (a *DefaultApiService) RecoverUpdateAckV1Message(ctx context.Context) ApiRecoverUpdateAckV1MessageRequest { + return ApiRecoverUpdateAckV1MessageRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) RecoverUpdateAckV1MessageExecute(r ApiRecoverUpdateAckV1MessageRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RecoverUpdateAckV1Message") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.recoverUpdateAckV1Message + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRecoverUpdateV1MessageRequest struct { + ctx context.Context + ApiService *DefaultApiService + recoverUpdateV1Message *RecoverUpdateV1Message +} + +func (r ApiRecoverUpdateV1MessageRequest) RecoverUpdateV1Message(recoverUpdateV1Message RecoverUpdateV1Message) ApiRecoverUpdateV1MessageRequest { + r.recoverUpdateV1Message = &recoverUpdateV1Message + return r +} + +func (r ApiRecoverUpdateV1MessageRequest) Execute() (*http.Response, error) { + return r.ApiService.RecoverUpdateV1MessageExecute(r) +} + +/* +RecoverUpdateV1Message Method for RecoverUpdateV1Message + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRecoverUpdateV1MessageRequest +*/ +func (a *DefaultApiService) RecoverUpdateV1Message(ctx context.Context) ApiRecoverUpdateV1MessageRequest { + return ApiRecoverUpdateV1MessageRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) RecoverUpdateV1MessageExecute(r ApiRecoverUpdateV1MessageRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RecoverUpdateV1Message") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.recoverUpdateV1Message + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRecoverV1MessageRequest struct { + ctx context.Context + ApiService *DefaultApiService + recoverV1Message *RecoverV1Message +} + +func (r ApiRecoverV1MessageRequest) RecoverV1Message(recoverV1Message RecoverV1Message) ApiRecoverV1MessageRequest { + r.recoverV1Message = &recoverV1Message + return r +} + +func (r ApiRecoverV1MessageRequest) Execute() (*http.Response, error) { + return r.ApiService.RecoverV1MessageExecute(r) +} + +/* +RecoverV1Message Method for RecoverV1Message + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRecoverV1MessageRequest +*/ +func (a *DefaultApiService) RecoverV1Message(ctx context.Context) ApiRecoverV1MessageRequest { + return ApiRecoverV1MessageRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) RecoverV1MessageExecute(r ApiRecoverV1MessageRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RecoverV1Message") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.recoverV1Message + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRecoverV1SuccessRequest struct { + ctx context.Context + ApiService *DefaultApiService + recoverSuccessV1Message *RecoverSuccessV1Message +} + +func (r ApiRecoverV1SuccessRequest) RecoverSuccessV1Message(recoverSuccessV1Message RecoverSuccessV1Message) ApiRecoverV1SuccessRequest { + r.recoverSuccessV1Message = &recoverSuccessV1Message + return r +} + +func (r ApiRecoverV1SuccessRequest) Execute() (*http.Response, error) { + return r.ApiService.RecoverV1SuccessExecute(r) +} + +/* +RecoverV1Success Method for RecoverV1Success + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRecoverV1SuccessRequest +*/ +func (a *DefaultApiService) RecoverV1Success(ctx context.Context) ApiRecoverV1SuccessRequest { + return ApiRecoverV1SuccessRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) RecoverV1SuccessExecute(r ApiRecoverV1SuccessRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RecoverV1Success") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.recoverSuccessV1Message + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRollbackAckV1MessageRequest struct { + ctx context.Context + ApiService *DefaultApiService + rollbackAckV1Message *RollbackAckV1Message +} + +func (r ApiRollbackAckV1MessageRequest) RollbackAckV1Message(rollbackAckV1Message RollbackAckV1Message) ApiRollbackAckV1MessageRequest { + r.rollbackAckV1Message = &rollbackAckV1Message + return r +} + +func (r ApiRollbackAckV1MessageRequest) Execute() (*http.Response, error) { + return r.ApiService.RollbackAckV1MessageExecute(r) +} + +/* +RollbackAckV1Message Method for RollbackAckV1Message + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRollbackAckV1MessageRequest +*/ +func (a *DefaultApiService) RollbackAckV1Message(ctx context.Context) ApiRollbackAckV1MessageRequest { + return ApiRollbackAckV1MessageRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) RollbackAckV1MessageExecute(r ApiRollbackAckV1MessageRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RollbackAckV1Message") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rollbackAckV1Message + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRollbackV1MessageRequest struct { + ctx context.Context + ApiService *DefaultApiService + rollbackV1Message *RollbackV1Message +} + +func (r ApiRollbackV1MessageRequest) RollbackV1Message(rollbackV1Message RollbackV1Message) ApiRollbackV1MessageRequest { + r.rollbackV1Message = &rollbackV1Message + return r +} + +func (r ApiRollbackV1MessageRequest) Execute() (*http.Response, error) { + return r.ApiService.RollbackV1MessageExecute(r) +} + +/* +RollbackV1Message Method for RollbackV1Message + + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRollbackV1MessageRequest +*/ +func (a *DefaultApiService) RollbackV1Message(ctx context.Context) ApiRollbackV1MessageRequest { + return ApiRollbackV1MessageRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *DefaultApiService) RollbackV1MessageExecute(r ApiRollbackV1MessageRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RollbackV1Message") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rollbackV1Message + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..8e1c9669525 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Odap Hermes API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..59a3e94a0a8 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..9079b11f62b --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_asset_profile.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_asset_profile.go new file mode 100644 index 00000000000..20dfc53bd8a --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_asset_profile.go @@ -0,0 +1,513 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the AssetProfile type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AssetProfile{} + +// AssetProfile struct for AssetProfile +type AssetProfile struct { + Issuer *string `json:"issuer,omitempty"` + AssetCode *string `json:"assetCode,omitempty"` + AssetCodeType *string `json:"assetCodeType,omitempty"` + IssuanceDate *string `json:"issuanceDate,omitempty"` + ExpirationDate string `json:"expirationDate"` + VerificationEndPoint *string `json:"verificationEndPoint,omitempty"` + DigitalSignature *string `json:"digitalSignature,omitempty"` + ProspectusLink *string `json:"prospectusLink,omitempty"` + KeyInformationLink []interface{} `json:"keyInformationLink,omitempty"` + KeyWord []interface{} `json:"keyWord,omitempty"` + TransferRestriction []interface{} `json:"transferRestriction,omitempty"` + LedgerRequirements []interface{} `json:"ledgerRequirements,omitempty"` +} + +// NewAssetProfile instantiates a new AssetProfile 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 +// will change when the set of required properties is changed +func NewAssetProfile(expirationDate string) *AssetProfile { + this := AssetProfile{} + this.ExpirationDate = expirationDate + return &this +} + +// NewAssetProfileWithDefaults instantiates a new AssetProfile object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAssetProfileWithDefaults() *AssetProfile { + this := AssetProfile{} + return &this +} + +// GetIssuer returns the Issuer field value if set, zero value otherwise. +func (o *AssetProfile) GetIssuer() string { + if o == nil || IsNil(o.Issuer) { + var ret string + return ret + } + return *o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetIssuerOk() (*string, bool) { + if o == nil || IsNil(o.Issuer) { + return nil, false + } + return o.Issuer, true +} + +// HasIssuer returns a boolean if a field has been set. +func (o *AssetProfile) HasIssuer() bool { + if o != nil && !IsNil(o.Issuer) { + return true + } + + return false +} + +// SetIssuer gets a reference to the given string and assigns it to the Issuer field. +func (o *AssetProfile) SetIssuer(v string) { + o.Issuer = &v +} + +// GetAssetCode returns the AssetCode field value if set, zero value otherwise. +func (o *AssetProfile) GetAssetCode() string { + if o == nil || IsNil(o.AssetCode) { + var ret string + return ret + } + return *o.AssetCode +} + +// GetAssetCodeOk returns a tuple with the AssetCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetAssetCodeOk() (*string, bool) { + if o == nil || IsNil(o.AssetCode) { + return nil, false + } + return o.AssetCode, true +} + +// HasAssetCode returns a boolean if a field has been set. +func (o *AssetProfile) HasAssetCode() bool { + if o != nil && !IsNil(o.AssetCode) { + return true + } + + return false +} + +// SetAssetCode gets a reference to the given string and assigns it to the AssetCode field. +func (o *AssetProfile) SetAssetCode(v string) { + o.AssetCode = &v +} + +// GetAssetCodeType returns the AssetCodeType field value if set, zero value otherwise. +func (o *AssetProfile) GetAssetCodeType() string { + if o == nil || IsNil(o.AssetCodeType) { + var ret string + return ret + } + return *o.AssetCodeType +} + +// GetAssetCodeTypeOk returns a tuple with the AssetCodeType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetAssetCodeTypeOk() (*string, bool) { + if o == nil || IsNil(o.AssetCodeType) { + return nil, false + } + return o.AssetCodeType, true +} + +// HasAssetCodeType returns a boolean if a field has been set. +func (o *AssetProfile) HasAssetCodeType() bool { + if o != nil && !IsNil(o.AssetCodeType) { + return true + } + + return false +} + +// SetAssetCodeType gets a reference to the given string and assigns it to the AssetCodeType field. +func (o *AssetProfile) SetAssetCodeType(v string) { + o.AssetCodeType = &v +} + +// GetIssuanceDate returns the IssuanceDate field value if set, zero value otherwise. +func (o *AssetProfile) GetIssuanceDate() string { + if o == nil || IsNil(o.IssuanceDate) { + var ret string + return ret + } + return *o.IssuanceDate +} + +// GetIssuanceDateOk returns a tuple with the IssuanceDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetIssuanceDateOk() (*string, bool) { + if o == nil || IsNil(o.IssuanceDate) { + return nil, false + } + return o.IssuanceDate, true +} + +// HasIssuanceDate returns a boolean if a field has been set. +func (o *AssetProfile) HasIssuanceDate() bool { + if o != nil && !IsNil(o.IssuanceDate) { + return true + } + + return false +} + +// SetIssuanceDate gets a reference to the given string and assigns it to the IssuanceDate field. +func (o *AssetProfile) SetIssuanceDate(v string) { + o.IssuanceDate = &v +} + +// GetExpirationDate returns the ExpirationDate field value +func (o *AssetProfile) GetExpirationDate() string { + if o == nil { + var ret string + return ret + } + + return o.ExpirationDate +} + +// GetExpirationDateOk returns a tuple with the ExpirationDate field value +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetExpirationDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExpirationDate, true +} + +// SetExpirationDate sets field value +func (o *AssetProfile) SetExpirationDate(v string) { + o.ExpirationDate = v +} + +// GetVerificationEndPoint returns the VerificationEndPoint field value if set, zero value otherwise. +func (o *AssetProfile) GetVerificationEndPoint() string { + if o == nil || IsNil(o.VerificationEndPoint) { + var ret string + return ret + } + return *o.VerificationEndPoint +} + +// GetVerificationEndPointOk returns a tuple with the VerificationEndPoint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetVerificationEndPointOk() (*string, bool) { + if o == nil || IsNil(o.VerificationEndPoint) { + return nil, false + } + return o.VerificationEndPoint, true +} + +// HasVerificationEndPoint returns a boolean if a field has been set. +func (o *AssetProfile) HasVerificationEndPoint() bool { + if o != nil && !IsNil(o.VerificationEndPoint) { + return true + } + + return false +} + +// SetVerificationEndPoint gets a reference to the given string and assigns it to the VerificationEndPoint field. +func (o *AssetProfile) SetVerificationEndPoint(v string) { + o.VerificationEndPoint = &v +} + +// GetDigitalSignature returns the DigitalSignature field value if set, zero value otherwise. +func (o *AssetProfile) GetDigitalSignature() string { + if o == nil || IsNil(o.DigitalSignature) { + var ret string + return ret + } + return *o.DigitalSignature +} + +// GetDigitalSignatureOk returns a tuple with the DigitalSignature field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetDigitalSignatureOk() (*string, bool) { + if o == nil || IsNil(o.DigitalSignature) { + return nil, false + } + return o.DigitalSignature, true +} + +// HasDigitalSignature returns a boolean if a field has been set. +func (o *AssetProfile) HasDigitalSignature() bool { + if o != nil && !IsNil(o.DigitalSignature) { + return true + } + + return false +} + +// SetDigitalSignature gets a reference to the given string and assigns it to the DigitalSignature field. +func (o *AssetProfile) SetDigitalSignature(v string) { + o.DigitalSignature = &v +} + +// GetProspectusLink returns the ProspectusLink field value if set, zero value otherwise. +func (o *AssetProfile) GetProspectusLink() string { + if o == nil || IsNil(o.ProspectusLink) { + var ret string + return ret + } + return *o.ProspectusLink +} + +// GetProspectusLinkOk returns a tuple with the ProspectusLink field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetProspectusLinkOk() (*string, bool) { + if o == nil || IsNil(o.ProspectusLink) { + return nil, false + } + return o.ProspectusLink, true +} + +// HasProspectusLink returns a boolean if a field has been set. +func (o *AssetProfile) HasProspectusLink() bool { + if o != nil && !IsNil(o.ProspectusLink) { + return true + } + + return false +} + +// SetProspectusLink gets a reference to the given string and assigns it to the ProspectusLink field. +func (o *AssetProfile) SetProspectusLink(v string) { + o.ProspectusLink = &v +} + +// GetKeyInformationLink returns the KeyInformationLink field value if set, zero value otherwise. +func (o *AssetProfile) GetKeyInformationLink() []interface{} { + if o == nil || IsNil(o.KeyInformationLink) { + var ret []interface{} + return ret + } + return o.KeyInformationLink +} + +// GetKeyInformationLinkOk returns a tuple with the KeyInformationLink field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetKeyInformationLinkOk() ([]interface{}, bool) { + if o == nil || IsNil(o.KeyInformationLink) { + return nil, false + } + return o.KeyInformationLink, true +} + +// HasKeyInformationLink returns a boolean if a field has been set. +func (o *AssetProfile) HasKeyInformationLink() bool { + if o != nil && !IsNil(o.KeyInformationLink) { + return true + } + + return false +} + +// SetKeyInformationLink gets a reference to the given []interface{} and assigns it to the KeyInformationLink field. +func (o *AssetProfile) SetKeyInformationLink(v []interface{}) { + o.KeyInformationLink = v +} + +// GetKeyWord returns the KeyWord field value if set, zero value otherwise. +func (o *AssetProfile) GetKeyWord() []interface{} { + if o == nil || IsNil(o.KeyWord) { + var ret []interface{} + return ret + } + return o.KeyWord +} + +// GetKeyWordOk returns a tuple with the KeyWord field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetKeyWordOk() ([]interface{}, bool) { + if o == nil || IsNil(o.KeyWord) { + return nil, false + } + return o.KeyWord, true +} + +// HasKeyWord returns a boolean if a field has been set. +func (o *AssetProfile) HasKeyWord() bool { + if o != nil && !IsNil(o.KeyWord) { + return true + } + + return false +} + +// SetKeyWord gets a reference to the given []interface{} and assigns it to the KeyWord field. +func (o *AssetProfile) SetKeyWord(v []interface{}) { + o.KeyWord = v +} + +// GetTransferRestriction returns the TransferRestriction field value if set, zero value otherwise. +func (o *AssetProfile) GetTransferRestriction() []interface{} { + if o == nil || IsNil(o.TransferRestriction) { + var ret []interface{} + return ret + } + return o.TransferRestriction +} + +// GetTransferRestrictionOk returns a tuple with the TransferRestriction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetTransferRestrictionOk() ([]interface{}, bool) { + if o == nil || IsNil(o.TransferRestriction) { + return nil, false + } + return o.TransferRestriction, true +} + +// HasTransferRestriction returns a boolean if a field has been set. +func (o *AssetProfile) HasTransferRestriction() bool { + if o != nil && !IsNil(o.TransferRestriction) { + return true + } + + return false +} + +// SetTransferRestriction gets a reference to the given []interface{} and assigns it to the TransferRestriction field. +func (o *AssetProfile) SetTransferRestriction(v []interface{}) { + o.TransferRestriction = v +} + +// GetLedgerRequirements returns the LedgerRequirements field value if set, zero value otherwise. +func (o *AssetProfile) GetLedgerRequirements() []interface{} { + if o == nil || IsNil(o.LedgerRequirements) { + var ret []interface{} + return ret + } + return o.LedgerRequirements +} + +// GetLedgerRequirementsOk returns a tuple with the LedgerRequirements field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetProfile) GetLedgerRequirementsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.LedgerRequirements) { + return nil, false + } + return o.LedgerRequirements, true +} + +// HasLedgerRequirements returns a boolean if a field has been set. +func (o *AssetProfile) HasLedgerRequirements() bool { + if o != nil && !IsNil(o.LedgerRequirements) { + return true + } + + return false +} + +// SetLedgerRequirements gets a reference to the given []interface{} and assigns it to the LedgerRequirements field. +func (o *AssetProfile) SetLedgerRequirements(v []interface{}) { + o.LedgerRequirements = v +} + +func (o AssetProfile) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AssetProfile) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Issuer) { + toSerialize["issuer"] = o.Issuer + } + if !IsNil(o.AssetCode) { + toSerialize["assetCode"] = o.AssetCode + } + if !IsNil(o.AssetCodeType) { + toSerialize["assetCodeType"] = o.AssetCodeType + } + if !IsNil(o.IssuanceDate) { + toSerialize["issuanceDate"] = o.IssuanceDate + } + toSerialize["expirationDate"] = o.ExpirationDate + if !IsNil(o.VerificationEndPoint) { + toSerialize["verificationEndPoint"] = o.VerificationEndPoint + } + if !IsNil(o.DigitalSignature) { + toSerialize["digitalSignature"] = o.DigitalSignature + } + if !IsNil(o.ProspectusLink) { + toSerialize["prospectusLink"] = o.ProspectusLink + } + if !IsNil(o.KeyInformationLink) { + toSerialize["keyInformationLink"] = o.KeyInformationLink + } + if !IsNil(o.KeyWord) { + toSerialize["keyWord"] = o.KeyWord + } + if !IsNil(o.TransferRestriction) { + toSerialize["transferRestriction"] = o.TransferRestriction + } + if !IsNil(o.LedgerRequirements) { + toSerialize["ledgerRequirements"] = o.LedgerRequirements + } + return toSerialize, nil +} + +type NullableAssetProfile struct { + value *AssetProfile + isSet bool +} + +func (v NullableAssetProfile) Get() *AssetProfile { + return v.value +} + +func (v *NullableAssetProfile) Set(val *AssetProfile) { + v.value = val + v.isSet = true +} + +func (v NullableAssetProfile) IsSet() bool { + return v.isSet +} + +func (v *NullableAssetProfile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAssetProfile(val *AssetProfile) *NullableAssetProfile { + return &NullableAssetProfile{value: val, isSet: true} +} + +func (v NullableAssetProfile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAssetProfile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request.go new file mode 100644 index 00000000000..b16a18eadb5 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request.go @@ -0,0 +1,684 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the ClientV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClientV1Request{} + +// ClientV1Request struct for ClientV1Request +type ClientV1Request struct { + Version string `json:"version"` + LoggingProfile string `json:"loggingProfile"` + AccessControlProfile string `json:"accessControlProfile"` + AssetControlProfile string `json:"assetControlProfile"` + ApplicationProfile string `json:"applicationProfile"` + AssetProfile AssetProfile `json:"assetProfile"` + PayloadProfile PayloadProfile `json:"payloadProfile"` + SourceGatewayDltSystem string `json:"sourceGatewayDltSystem"` + RecipientGatewayDltSystem string `json:"recipientGatewayDltSystem"` + RecipientGatewayPubkey string `json:"recipientGatewayPubkey"` + OriginatorPubkey string `json:"originatorPubkey"` + BeneficiaryPubkey string `json:"beneficiaryPubkey"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + ClientDltSystem string `json:"clientDltSystem"` + ServerDltSystem string `json:"serverDltSystem"` + ClientGatewayConfiguration ClientV1RequestClientGatewayConfiguration `json:"clientGatewayConfiguration"` + ServerGatewayConfiguration ClientV1RequestClientGatewayConfiguration `json:"serverGatewayConfiguration"` + MaxRetries float32 `json:"maxRetries"` + MaxTimeout float32 `json:"maxTimeout"` + SourceLedgerAssetID string `json:"sourceLedgerAssetID"` + RecipientLedgerAssetID string `json:"recipientLedgerAssetID"` +} + +// NewClientV1Request instantiates a new ClientV1Request 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 +// will change when the set of required properties is changed +func NewClientV1Request(version string, loggingProfile string, accessControlProfile string, assetControlProfile string, applicationProfile string, assetProfile AssetProfile, payloadProfile PayloadProfile, sourceGatewayDltSystem string, recipientGatewayDltSystem string, recipientGatewayPubkey string, originatorPubkey string, beneficiaryPubkey string, clientIdentityPubkey string, serverIdentityPubkey string, clientDltSystem string, serverDltSystem string, clientGatewayConfiguration ClientV1RequestClientGatewayConfiguration, serverGatewayConfiguration ClientV1RequestClientGatewayConfiguration, maxRetries float32, maxTimeout float32, sourceLedgerAssetID string, recipientLedgerAssetID string) *ClientV1Request { + this := ClientV1Request{} + this.Version = version + this.LoggingProfile = loggingProfile + this.AccessControlProfile = accessControlProfile + this.AssetControlProfile = assetControlProfile + this.ApplicationProfile = applicationProfile + this.AssetProfile = assetProfile + this.PayloadProfile = payloadProfile + this.SourceGatewayDltSystem = sourceGatewayDltSystem + this.RecipientGatewayDltSystem = recipientGatewayDltSystem + this.RecipientGatewayPubkey = recipientGatewayPubkey + this.OriginatorPubkey = originatorPubkey + this.BeneficiaryPubkey = beneficiaryPubkey + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.ClientDltSystem = clientDltSystem + this.ServerDltSystem = serverDltSystem + this.ClientGatewayConfiguration = clientGatewayConfiguration + this.ServerGatewayConfiguration = serverGatewayConfiguration + this.MaxRetries = maxRetries + this.MaxTimeout = maxTimeout + this.SourceLedgerAssetID = sourceLedgerAssetID + this.RecipientLedgerAssetID = recipientLedgerAssetID + return &this +} + +// NewClientV1RequestWithDefaults instantiates a new ClientV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClientV1RequestWithDefaults() *ClientV1Request { + this := ClientV1Request{} + return &this +} + +// GetVersion returns the Version field value +func (o *ClientV1Request) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *ClientV1Request) SetVersion(v string) { + o.Version = v +} + +// GetLoggingProfile returns the LoggingProfile field value +func (o *ClientV1Request) GetLoggingProfile() string { + if o == nil { + var ret string + return ret + } + + return o.LoggingProfile +} + +// GetLoggingProfileOk returns a tuple with the LoggingProfile field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetLoggingProfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LoggingProfile, true +} + +// SetLoggingProfile sets field value +func (o *ClientV1Request) SetLoggingProfile(v string) { + o.LoggingProfile = v +} + +// GetAccessControlProfile returns the AccessControlProfile field value +func (o *ClientV1Request) GetAccessControlProfile() string { + if o == nil { + var ret string + return ret + } + + return o.AccessControlProfile +} + +// GetAccessControlProfileOk returns a tuple with the AccessControlProfile field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetAccessControlProfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccessControlProfile, true +} + +// SetAccessControlProfile sets field value +func (o *ClientV1Request) SetAccessControlProfile(v string) { + o.AccessControlProfile = v +} + +// GetAssetControlProfile returns the AssetControlProfile field value +func (o *ClientV1Request) GetAssetControlProfile() string { + if o == nil { + var ret string + return ret + } + + return o.AssetControlProfile +} + +// GetAssetControlProfileOk returns a tuple with the AssetControlProfile field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetAssetControlProfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssetControlProfile, true +} + +// SetAssetControlProfile sets field value +func (o *ClientV1Request) SetAssetControlProfile(v string) { + o.AssetControlProfile = v +} + +// GetApplicationProfile returns the ApplicationProfile field value +func (o *ClientV1Request) GetApplicationProfile() string { + if o == nil { + var ret string + return ret + } + + return o.ApplicationProfile +} + +// GetApplicationProfileOk returns a tuple with the ApplicationProfile field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetApplicationProfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ApplicationProfile, true +} + +// SetApplicationProfile sets field value +func (o *ClientV1Request) SetApplicationProfile(v string) { + o.ApplicationProfile = v +} + +// GetAssetProfile returns the AssetProfile field value +func (o *ClientV1Request) GetAssetProfile() AssetProfile { + if o == nil { + var ret AssetProfile + return ret + } + + return o.AssetProfile +} + +// GetAssetProfileOk returns a tuple with the AssetProfile field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetAssetProfileOk() (*AssetProfile, bool) { + if o == nil { + return nil, false + } + return &o.AssetProfile, true +} + +// SetAssetProfile sets field value +func (o *ClientV1Request) SetAssetProfile(v AssetProfile) { + o.AssetProfile = v +} + +// GetPayloadProfile returns the PayloadProfile field value +func (o *ClientV1Request) GetPayloadProfile() PayloadProfile { + if o == nil { + var ret PayloadProfile + return ret + } + + return o.PayloadProfile +} + +// GetPayloadProfileOk returns a tuple with the PayloadProfile field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetPayloadProfileOk() (*PayloadProfile, bool) { + if o == nil { + return nil, false + } + return &o.PayloadProfile, true +} + +// SetPayloadProfile sets field value +func (o *ClientV1Request) SetPayloadProfile(v PayloadProfile) { + o.PayloadProfile = v +} + +// GetSourceGatewayDltSystem returns the SourceGatewayDltSystem field value +func (o *ClientV1Request) GetSourceGatewayDltSystem() string { + if o == nil { + var ret string + return ret + } + + return o.SourceGatewayDltSystem +} + +// GetSourceGatewayDltSystemOk returns a tuple with the SourceGatewayDltSystem field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetSourceGatewayDltSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SourceGatewayDltSystem, true +} + +// SetSourceGatewayDltSystem sets field value +func (o *ClientV1Request) SetSourceGatewayDltSystem(v string) { + o.SourceGatewayDltSystem = v +} + +// GetRecipientGatewayDltSystem returns the RecipientGatewayDltSystem field value +func (o *ClientV1Request) GetRecipientGatewayDltSystem() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientGatewayDltSystem +} + +// GetRecipientGatewayDltSystemOk returns a tuple with the RecipientGatewayDltSystem field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetRecipientGatewayDltSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientGatewayDltSystem, true +} + +// SetRecipientGatewayDltSystem sets field value +func (o *ClientV1Request) SetRecipientGatewayDltSystem(v string) { + o.RecipientGatewayDltSystem = v +} + +// GetRecipientGatewayPubkey returns the RecipientGatewayPubkey field value +func (o *ClientV1Request) GetRecipientGatewayPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientGatewayPubkey +} + +// GetRecipientGatewayPubkeyOk returns a tuple with the RecipientGatewayPubkey field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetRecipientGatewayPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientGatewayPubkey, true +} + +// SetRecipientGatewayPubkey sets field value +func (o *ClientV1Request) SetRecipientGatewayPubkey(v string) { + o.RecipientGatewayPubkey = v +} + +// GetOriginatorPubkey returns the OriginatorPubkey field value +func (o *ClientV1Request) GetOriginatorPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.OriginatorPubkey +} + +// GetOriginatorPubkeyOk returns a tuple with the OriginatorPubkey field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetOriginatorPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OriginatorPubkey, true +} + +// SetOriginatorPubkey sets field value +func (o *ClientV1Request) SetOriginatorPubkey(v string) { + o.OriginatorPubkey = v +} + +// GetBeneficiaryPubkey returns the BeneficiaryPubkey field value +func (o *ClientV1Request) GetBeneficiaryPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.BeneficiaryPubkey +} + +// GetBeneficiaryPubkeyOk returns a tuple with the BeneficiaryPubkey field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetBeneficiaryPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BeneficiaryPubkey, true +} + +// SetBeneficiaryPubkey sets field value +func (o *ClientV1Request) SetBeneficiaryPubkey(v string) { + o.BeneficiaryPubkey = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *ClientV1Request) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *ClientV1Request) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *ClientV1Request) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *ClientV1Request) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetClientDltSystem returns the ClientDltSystem field value +func (o *ClientV1Request) GetClientDltSystem() string { + if o == nil { + var ret string + return ret + } + + return o.ClientDltSystem +} + +// GetClientDltSystemOk returns a tuple with the ClientDltSystem field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetClientDltSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientDltSystem, true +} + +// SetClientDltSystem sets field value +func (o *ClientV1Request) SetClientDltSystem(v string) { + o.ClientDltSystem = v +} + +// GetServerDltSystem returns the ServerDltSystem field value +func (o *ClientV1Request) GetServerDltSystem() string { + if o == nil { + var ret string + return ret + } + + return o.ServerDltSystem +} + +// GetServerDltSystemOk returns a tuple with the ServerDltSystem field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetServerDltSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerDltSystem, true +} + +// SetServerDltSystem sets field value +func (o *ClientV1Request) SetServerDltSystem(v string) { + o.ServerDltSystem = v +} + +// GetClientGatewayConfiguration returns the ClientGatewayConfiguration field value +func (o *ClientV1Request) GetClientGatewayConfiguration() ClientV1RequestClientGatewayConfiguration { + if o == nil { + var ret ClientV1RequestClientGatewayConfiguration + return ret + } + + return o.ClientGatewayConfiguration +} + +// GetClientGatewayConfigurationOk returns a tuple with the ClientGatewayConfiguration field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetClientGatewayConfigurationOk() (*ClientV1RequestClientGatewayConfiguration, bool) { + if o == nil { + return nil, false + } + return &o.ClientGatewayConfiguration, true +} + +// SetClientGatewayConfiguration sets field value +func (o *ClientV1Request) SetClientGatewayConfiguration(v ClientV1RequestClientGatewayConfiguration) { + o.ClientGatewayConfiguration = v +} + +// GetServerGatewayConfiguration returns the ServerGatewayConfiguration field value +func (o *ClientV1Request) GetServerGatewayConfiguration() ClientV1RequestClientGatewayConfiguration { + if o == nil { + var ret ClientV1RequestClientGatewayConfiguration + return ret + } + + return o.ServerGatewayConfiguration +} + +// GetServerGatewayConfigurationOk returns a tuple with the ServerGatewayConfiguration field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetServerGatewayConfigurationOk() (*ClientV1RequestClientGatewayConfiguration, bool) { + if o == nil { + return nil, false + } + return &o.ServerGatewayConfiguration, true +} + +// SetServerGatewayConfiguration sets field value +func (o *ClientV1Request) SetServerGatewayConfiguration(v ClientV1RequestClientGatewayConfiguration) { + o.ServerGatewayConfiguration = v +} + +// GetMaxRetries returns the MaxRetries field value +func (o *ClientV1Request) GetMaxRetries() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxRetries +} + +// GetMaxRetriesOk returns a tuple with the MaxRetries field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetMaxRetriesOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxRetries, true +} + +// SetMaxRetries sets field value +func (o *ClientV1Request) SetMaxRetries(v float32) { + o.MaxRetries = v +} + +// GetMaxTimeout returns the MaxTimeout field value +func (o *ClientV1Request) GetMaxTimeout() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxTimeout +} + +// GetMaxTimeoutOk returns a tuple with the MaxTimeout field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetMaxTimeoutOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxTimeout, true +} + +// SetMaxTimeout sets field value +func (o *ClientV1Request) SetMaxTimeout(v float32) { + o.MaxTimeout = v +} + +// GetSourceLedgerAssetID returns the SourceLedgerAssetID field value +func (o *ClientV1Request) GetSourceLedgerAssetID() string { + if o == nil { + var ret string + return ret + } + + return o.SourceLedgerAssetID +} + +// GetSourceLedgerAssetIDOk returns a tuple with the SourceLedgerAssetID field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetSourceLedgerAssetIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SourceLedgerAssetID, true +} + +// SetSourceLedgerAssetID sets field value +func (o *ClientV1Request) SetSourceLedgerAssetID(v string) { + o.SourceLedgerAssetID = v +} + +// GetRecipientLedgerAssetID returns the RecipientLedgerAssetID field value +func (o *ClientV1Request) GetRecipientLedgerAssetID() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientLedgerAssetID +} + +// GetRecipientLedgerAssetIDOk returns a tuple with the RecipientLedgerAssetID field value +// and a boolean to check if the value has been set. +func (o *ClientV1Request) GetRecipientLedgerAssetIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientLedgerAssetID, true +} + +// SetRecipientLedgerAssetID sets field value +func (o *ClientV1Request) SetRecipientLedgerAssetID(v string) { + o.RecipientLedgerAssetID = v +} + +func (o ClientV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClientV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["version"] = o.Version + toSerialize["loggingProfile"] = o.LoggingProfile + toSerialize["accessControlProfile"] = o.AccessControlProfile + toSerialize["assetControlProfile"] = o.AssetControlProfile + toSerialize["applicationProfile"] = o.ApplicationProfile + toSerialize["assetProfile"] = o.AssetProfile + toSerialize["payloadProfile"] = o.PayloadProfile + toSerialize["sourceGatewayDltSystem"] = o.SourceGatewayDltSystem + toSerialize["recipientGatewayDltSystem"] = o.RecipientGatewayDltSystem + toSerialize["recipientGatewayPubkey"] = o.RecipientGatewayPubkey + toSerialize["originatorPubkey"] = o.OriginatorPubkey + toSerialize["beneficiaryPubkey"] = o.BeneficiaryPubkey + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["clientDltSystem"] = o.ClientDltSystem + toSerialize["serverDltSystem"] = o.ServerDltSystem + toSerialize["clientGatewayConfiguration"] = o.ClientGatewayConfiguration + toSerialize["serverGatewayConfiguration"] = o.ServerGatewayConfiguration + toSerialize["maxRetries"] = o.MaxRetries + toSerialize["maxTimeout"] = o.MaxTimeout + toSerialize["sourceLedgerAssetID"] = o.SourceLedgerAssetID + toSerialize["recipientLedgerAssetID"] = o.RecipientLedgerAssetID + return toSerialize, nil +} + +type NullableClientV1Request struct { + value *ClientV1Request + isSet bool +} + +func (v NullableClientV1Request) Get() *ClientV1Request { + return v.value +} + +func (v *NullableClientV1Request) Set(val *ClientV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableClientV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableClientV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClientV1Request(val *ClientV1Request) *NullableClientV1Request { + return &NullableClientV1Request{value: val, isSet: true} +} + +func (v NullableClientV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClientV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request_client_gateway_configuration.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request_client_gateway_configuration.go new file mode 100644 index 00000000000..1a1e737714a --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request_client_gateway_configuration.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the ClientV1RequestClientGatewayConfiguration type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClientV1RequestClientGatewayConfiguration{} + +// ClientV1RequestClientGatewayConfiguration struct for ClientV1RequestClientGatewayConfiguration +type ClientV1RequestClientGatewayConfiguration struct { + ApiHost string `json:"apiHost"` +} + +// NewClientV1RequestClientGatewayConfiguration instantiates a new ClientV1RequestClientGatewayConfiguration 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 +// will change when the set of required properties is changed +func NewClientV1RequestClientGatewayConfiguration(apiHost string) *ClientV1RequestClientGatewayConfiguration { + this := ClientV1RequestClientGatewayConfiguration{} + this.ApiHost = apiHost + return &this +} + +// NewClientV1RequestClientGatewayConfigurationWithDefaults instantiates a new ClientV1RequestClientGatewayConfiguration object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClientV1RequestClientGatewayConfigurationWithDefaults() *ClientV1RequestClientGatewayConfiguration { + this := ClientV1RequestClientGatewayConfiguration{} + return &this +} + +// GetApiHost returns the ApiHost field value +func (o *ClientV1RequestClientGatewayConfiguration) GetApiHost() string { + if o == nil { + var ret string + return ret + } + + return o.ApiHost +} + +// GetApiHostOk returns a tuple with the ApiHost field value +// and a boolean to check if the value has been set. +func (o *ClientV1RequestClientGatewayConfiguration) GetApiHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ApiHost, true +} + +// SetApiHost sets field value +func (o *ClientV1RequestClientGatewayConfiguration) SetApiHost(v string) { + o.ApiHost = v +} + +func (o ClientV1RequestClientGatewayConfiguration) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClientV1RequestClientGatewayConfiguration) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["apiHost"] = o.ApiHost + return toSerialize, nil +} + +type NullableClientV1RequestClientGatewayConfiguration struct { + value *ClientV1RequestClientGatewayConfiguration + isSet bool +} + +func (v NullableClientV1RequestClientGatewayConfiguration) Get() *ClientV1RequestClientGatewayConfiguration { + return v.value +} + +func (v *NullableClientV1RequestClientGatewayConfiguration) Set(val *ClientV1RequestClientGatewayConfiguration) { + v.value = val + v.isSet = true +} + +func (v NullableClientV1RequestClientGatewayConfiguration) IsSet() bool { + return v.isSet +} + +func (v *NullableClientV1RequestClientGatewayConfiguration) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClientV1RequestClientGatewayConfiguration(val *ClientV1RequestClientGatewayConfiguration) *NullableClientV1RequestClientGatewayConfiguration { + return &NullableClientV1RequestClientGatewayConfiguration{value: val, isSet: true} +} + +func (v NullableClientV1RequestClientGatewayConfiguration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClientV1RequestClientGatewayConfiguration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_request.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_request.go new file mode 100644 index 00000000000..6c036e8854f --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_request.go @@ -0,0 +1,388 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the CommitFinalV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CommitFinalV1Request{} + +// CommitFinalV1Request struct for CommitFinalV1Request +type CommitFinalV1Request struct { + SessionID string `json:"sessionID"` + MessageType string `json:"messageType"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + CommitFinalClaim string `json:"commitFinalClaim"` + CommitFinalClaimFormat map[string]interface{} `json:"commitFinalClaimFormat,omitempty"` + HashCommitPrepareAck string `json:"hashCommitPrepareAck"` + ClientTransferNumber NullableInt32 `json:"clientTransferNumber,omitempty"` + Signature string `json:"signature"` + SequenceNumber float32 `json:"sequenceNumber"` +} + +// NewCommitFinalV1Request instantiates a new CommitFinalV1Request 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 +// will change when the set of required properties is changed +func NewCommitFinalV1Request(sessionID string, messageType string, clientIdentityPubkey string, serverIdentityPubkey string, commitFinalClaim string, hashCommitPrepareAck string, signature string, sequenceNumber float32) *CommitFinalV1Request { + this := CommitFinalV1Request{} + this.SessionID = sessionID + this.MessageType = messageType + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.CommitFinalClaim = commitFinalClaim + this.HashCommitPrepareAck = hashCommitPrepareAck + this.Signature = signature + this.SequenceNumber = sequenceNumber + return &this +} + +// NewCommitFinalV1RequestWithDefaults instantiates a new CommitFinalV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCommitFinalV1RequestWithDefaults() *CommitFinalV1Request { + this := CommitFinalV1Request{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *CommitFinalV1Request) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *CommitFinalV1Request) SetSessionID(v string) { + o.SessionID = v +} + +// GetMessageType returns the MessageType field value +func (o *CommitFinalV1Request) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *CommitFinalV1Request) SetMessageType(v string) { + o.MessageType = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *CommitFinalV1Request) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *CommitFinalV1Request) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *CommitFinalV1Request) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *CommitFinalV1Request) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetCommitFinalClaim returns the CommitFinalClaim field value +func (o *CommitFinalV1Request) GetCommitFinalClaim() string { + if o == nil { + var ret string + return ret + } + + return o.CommitFinalClaim +} + +// GetCommitFinalClaimOk returns a tuple with the CommitFinalClaim field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetCommitFinalClaimOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CommitFinalClaim, true +} + +// SetCommitFinalClaim sets field value +func (o *CommitFinalV1Request) SetCommitFinalClaim(v string) { + o.CommitFinalClaim = v +} + +// GetCommitFinalClaimFormat returns the CommitFinalClaimFormat field value if set, zero value otherwise. +func (o *CommitFinalV1Request) GetCommitFinalClaimFormat() map[string]interface{} { + if o == nil || IsNil(o.CommitFinalClaimFormat) { + var ret map[string]interface{} + return ret + } + return o.CommitFinalClaimFormat +} + +// GetCommitFinalClaimFormatOk returns a tuple with the CommitFinalClaimFormat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetCommitFinalClaimFormatOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CommitFinalClaimFormat) { + return map[string]interface{}{}, false + } + return o.CommitFinalClaimFormat, true +} + +// HasCommitFinalClaimFormat returns a boolean if a field has been set. +func (o *CommitFinalV1Request) HasCommitFinalClaimFormat() bool { + if o != nil && !IsNil(o.CommitFinalClaimFormat) { + return true + } + + return false +} + +// SetCommitFinalClaimFormat gets a reference to the given map[string]interface{} and assigns it to the CommitFinalClaimFormat field. +func (o *CommitFinalV1Request) SetCommitFinalClaimFormat(v map[string]interface{}) { + o.CommitFinalClaimFormat = v +} + +// GetHashCommitPrepareAck returns the HashCommitPrepareAck field value +func (o *CommitFinalV1Request) GetHashCommitPrepareAck() string { + if o == nil { + var ret string + return ret + } + + return o.HashCommitPrepareAck +} + +// GetHashCommitPrepareAckOk returns a tuple with the HashCommitPrepareAck field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetHashCommitPrepareAckOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashCommitPrepareAck, true +} + +// SetHashCommitPrepareAck sets field value +func (o *CommitFinalV1Request) SetHashCommitPrepareAck(v string) { + o.HashCommitPrepareAck = v +} + +// GetClientTransferNumber returns the ClientTransferNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CommitFinalV1Request) GetClientTransferNumber() int32 { + if o == nil || IsNil(o.ClientTransferNumber.Get()) { + var ret int32 + return ret + } + return *o.ClientTransferNumber.Get() +} + +// GetClientTransferNumberOk returns a tuple with the ClientTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CommitFinalV1Request) GetClientTransferNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ClientTransferNumber.Get(), o.ClientTransferNumber.IsSet() +} + +// HasClientTransferNumber returns a boolean if a field has been set. +func (o *CommitFinalV1Request) HasClientTransferNumber() bool { + if o != nil && o.ClientTransferNumber.IsSet() { + return true + } + + return false +} + +// SetClientTransferNumber gets a reference to the given NullableInt32 and assigns it to the ClientTransferNumber field. +func (o *CommitFinalV1Request) SetClientTransferNumber(v int32) { + o.ClientTransferNumber.Set(&v) +} +// SetClientTransferNumberNil sets the value for ClientTransferNumber to be an explicit nil +func (o *CommitFinalV1Request) SetClientTransferNumberNil() { + o.ClientTransferNumber.Set(nil) +} + +// UnsetClientTransferNumber ensures that no value is present for ClientTransferNumber, not even an explicit nil +func (o *CommitFinalV1Request) UnsetClientTransferNumber() { + o.ClientTransferNumber.Unset() +} + +// GetSignature returns the Signature field value +func (o *CommitFinalV1Request) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *CommitFinalV1Request) SetSignature(v string) { + o.Signature = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *CommitFinalV1Request) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Request) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *CommitFinalV1Request) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +func (o CommitFinalV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CommitFinalV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["messageType"] = o.MessageType + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["commitFinalClaim"] = o.CommitFinalClaim + if !IsNil(o.CommitFinalClaimFormat) { + toSerialize["commitFinalClaimFormat"] = o.CommitFinalClaimFormat + } + toSerialize["hashCommitPrepareAck"] = o.HashCommitPrepareAck + if o.ClientTransferNumber.IsSet() { + toSerialize["clientTransferNumber"] = o.ClientTransferNumber.Get() + } + toSerialize["signature"] = o.Signature + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableCommitFinalV1Request struct { + value *CommitFinalV1Request + isSet bool +} + +func (v NullableCommitFinalV1Request) Get() *CommitFinalV1Request { + return v.value +} + +func (v *NullableCommitFinalV1Request) Set(val *CommitFinalV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableCommitFinalV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableCommitFinalV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommitFinalV1Request(val *CommitFinalV1Request) *NullableCommitFinalV1Request { + return &NullableCommitFinalV1Request{value: val, isSet: true} +} + +func (v NullableCommitFinalV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommitFinalV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_response.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_response.go new file mode 100644 index 00000000000..1a4a77487f2 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_response.go @@ -0,0 +1,378 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the CommitFinalV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CommitFinalV1Response{} + +// CommitFinalV1Response struct for CommitFinalV1Response +type CommitFinalV1Response struct { + SessionID string `json:"sessionID"` + MessageType string `json:"messageType"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + CommitAcknowledgementClaim string `json:"commitAcknowledgementClaim"` + CommitAcknowledgementClaimFormat map[string]interface{} `json:"commitAcknowledgementClaimFormat,omitempty"` + HashCommitFinal string `json:"hashCommitFinal"` + ServerTransferNumber *int32 `json:"serverTransferNumber,omitempty"` + Signature string `json:"signature"` + SequenceNumber float32 `json:"sequenceNumber"` +} + +// NewCommitFinalV1Response instantiates a new CommitFinalV1Response 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 +// will change when the set of required properties is changed +func NewCommitFinalV1Response(sessionID string, messageType string, clientIdentityPubkey string, serverIdentityPubkey string, commitAcknowledgementClaim string, hashCommitFinal string, signature string, sequenceNumber float32) *CommitFinalV1Response { + this := CommitFinalV1Response{} + this.SessionID = sessionID + this.MessageType = messageType + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.CommitAcknowledgementClaim = commitAcknowledgementClaim + this.HashCommitFinal = hashCommitFinal + this.Signature = signature + this.SequenceNumber = sequenceNumber + return &this +} + +// NewCommitFinalV1ResponseWithDefaults instantiates a new CommitFinalV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCommitFinalV1ResponseWithDefaults() *CommitFinalV1Response { + this := CommitFinalV1Response{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *CommitFinalV1Response) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *CommitFinalV1Response) SetSessionID(v string) { + o.SessionID = v +} + +// GetMessageType returns the MessageType field value +func (o *CommitFinalV1Response) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *CommitFinalV1Response) SetMessageType(v string) { + o.MessageType = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *CommitFinalV1Response) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *CommitFinalV1Response) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *CommitFinalV1Response) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *CommitFinalV1Response) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetCommitAcknowledgementClaim returns the CommitAcknowledgementClaim field value +func (o *CommitFinalV1Response) GetCommitAcknowledgementClaim() string { + if o == nil { + var ret string + return ret + } + + return o.CommitAcknowledgementClaim +} + +// GetCommitAcknowledgementClaimOk returns a tuple with the CommitAcknowledgementClaim field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetCommitAcknowledgementClaimOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CommitAcknowledgementClaim, true +} + +// SetCommitAcknowledgementClaim sets field value +func (o *CommitFinalV1Response) SetCommitAcknowledgementClaim(v string) { + o.CommitAcknowledgementClaim = v +} + +// GetCommitAcknowledgementClaimFormat returns the CommitAcknowledgementClaimFormat field value if set, zero value otherwise. +func (o *CommitFinalV1Response) GetCommitAcknowledgementClaimFormat() map[string]interface{} { + if o == nil || IsNil(o.CommitAcknowledgementClaimFormat) { + var ret map[string]interface{} + return ret + } + return o.CommitAcknowledgementClaimFormat +} + +// GetCommitAcknowledgementClaimFormatOk returns a tuple with the CommitAcknowledgementClaimFormat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetCommitAcknowledgementClaimFormatOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CommitAcknowledgementClaimFormat) { + return map[string]interface{}{}, false + } + return o.CommitAcknowledgementClaimFormat, true +} + +// HasCommitAcknowledgementClaimFormat returns a boolean if a field has been set. +func (o *CommitFinalV1Response) HasCommitAcknowledgementClaimFormat() bool { + if o != nil && !IsNil(o.CommitAcknowledgementClaimFormat) { + return true + } + + return false +} + +// SetCommitAcknowledgementClaimFormat gets a reference to the given map[string]interface{} and assigns it to the CommitAcknowledgementClaimFormat field. +func (o *CommitFinalV1Response) SetCommitAcknowledgementClaimFormat(v map[string]interface{}) { + o.CommitAcknowledgementClaimFormat = v +} + +// GetHashCommitFinal returns the HashCommitFinal field value +func (o *CommitFinalV1Response) GetHashCommitFinal() string { + if o == nil { + var ret string + return ret + } + + return o.HashCommitFinal +} + +// GetHashCommitFinalOk returns a tuple with the HashCommitFinal field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetHashCommitFinalOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashCommitFinal, true +} + +// SetHashCommitFinal sets field value +func (o *CommitFinalV1Response) SetHashCommitFinal(v string) { + o.HashCommitFinal = v +} + +// GetServerTransferNumber returns the ServerTransferNumber field value if set, zero value otherwise. +func (o *CommitFinalV1Response) GetServerTransferNumber() int32 { + if o == nil || IsNil(o.ServerTransferNumber) { + var ret int32 + return ret + } + return *o.ServerTransferNumber +} + +// GetServerTransferNumberOk returns a tuple with the ServerTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetServerTransferNumberOk() (*int32, bool) { + if o == nil || IsNil(o.ServerTransferNumber) { + return nil, false + } + return o.ServerTransferNumber, true +} + +// HasServerTransferNumber returns a boolean if a field has been set. +func (o *CommitFinalV1Response) HasServerTransferNumber() bool { + if o != nil && !IsNil(o.ServerTransferNumber) { + return true + } + + return false +} + +// SetServerTransferNumber gets a reference to the given int32 and assigns it to the ServerTransferNumber field. +func (o *CommitFinalV1Response) SetServerTransferNumber(v int32) { + o.ServerTransferNumber = &v +} + +// GetSignature returns the Signature field value +func (o *CommitFinalV1Response) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *CommitFinalV1Response) SetSignature(v string) { + o.Signature = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *CommitFinalV1Response) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *CommitFinalV1Response) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *CommitFinalV1Response) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +func (o CommitFinalV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CommitFinalV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["messageType"] = o.MessageType + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["commitAcknowledgementClaim"] = o.CommitAcknowledgementClaim + if !IsNil(o.CommitAcknowledgementClaimFormat) { + toSerialize["commitAcknowledgementClaimFormat"] = o.CommitAcknowledgementClaimFormat + } + toSerialize["hashCommitFinal"] = o.HashCommitFinal + if !IsNil(o.ServerTransferNumber) { + toSerialize["serverTransferNumber"] = o.ServerTransferNumber + } + toSerialize["signature"] = o.Signature + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableCommitFinalV1Response struct { + value *CommitFinalV1Response + isSet bool +} + +func (v NullableCommitFinalV1Response) Get() *CommitFinalV1Response { + return v.value +} + +func (v *NullableCommitFinalV1Response) Set(val *CommitFinalV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableCommitFinalV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableCommitFinalV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommitFinalV1Response(val *CommitFinalV1Response) *NullableCommitFinalV1Response { + return &NullableCommitFinalV1Response{value: val, isSet: true} +} + +func (v NullableCommitFinalV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommitFinalV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_request.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_request.go new file mode 100644 index 00000000000..ccfbc71a2ba --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_request.go @@ -0,0 +1,315 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the CommitPreparationV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CommitPreparationV1Request{} + +// CommitPreparationV1Request struct for CommitPreparationV1Request +type CommitPreparationV1Request struct { + SessionID string `json:"sessionID"` + MessageType string `json:"messageType"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + HashLockEvidenceAck string `json:"hashLockEvidenceAck"` + ClientTransferNumber *int32 `json:"clientTransferNumber,omitempty"` + Signature string `json:"signature"` + SequenceNumber float32 `json:"sequenceNumber"` +} + +// NewCommitPreparationV1Request instantiates a new CommitPreparationV1Request 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 +// will change when the set of required properties is changed +func NewCommitPreparationV1Request(sessionID string, messageType string, clientIdentityPubkey string, serverIdentityPubkey string, hashLockEvidenceAck string, signature string, sequenceNumber float32) *CommitPreparationV1Request { + this := CommitPreparationV1Request{} + this.SessionID = sessionID + this.MessageType = messageType + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.HashLockEvidenceAck = hashLockEvidenceAck + this.Signature = signature + this.SequenceNumber = sequenceNumber + return &this +} + +// NewCommitPreparationV1RequestWithDefaults instantiates a new CommitPreparationV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCommitPreparationV1RequestWithDefaults() *CommitPreparationV1Request { + this := CommitPreparationV1Request{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *CommitPreparationV1Request) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Request) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *CommitPreparationV1Request) SetSessionID(v string) { + o.SessionID = v +} + +// GetMessageType returns the MessageType field value +func (o *CommitPreparationV1Request) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Request) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *CommitPreparationV1Request) SetMessageType(v string) { + o.MessageType = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *CommitPreparationV1Request) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Request) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *CommitPreparationV1Request) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *CommitPreparationV1Request) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Request) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *CommitPreparationV1Request) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetHashLockEvidenceAck returns the HashLockEvidenceAck field value +func (o *CommitPreparationV1Request) GetHashLockEvidenceAck() string { + if o == nil { + var ret string + return ret + } + + return o.HashLockEvidenceAck +} + +// GetHashLockEvidenceAckOk returns a tuple with the HashLockEvidenceAck field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Request) GetHashLockEvidenceAckOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashLockEvidenceAck, true +} + +// SetHashLockEvidenceAck sets field value +func (o *CommitPreparationV1Request) SetHashLockEvidenceAck(v string) { + o.HashLockEvidenceAck = v +} + +// GetClientTransferNumber returns the ClientTransferNumber field value if set, zero value otherwise. +func (o *CommitPreparationV1Request) GetClientTransferNumber() int32 { + if o == nil || IsNil(o.ClientTransferNumber) { + var ret int32 + return ret + } + return *o.ClientTransferNumber +} + +// GetClientTransferNumberOk returns a tuple with the ClientTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Request) GetClientTransferNumberOk() (*int32, bool) { + if o == nil || IsNil(o.ClientTransferNumber) { + return nil, false + } + return o.ClientTransferNumber, true +} + +// HasClientTransferNumber returns a boolean if a field has been set. +func (o *CommitPreparationV1Request) HasClientTransferNumber() bool { + if o != nil && !IsNil(o.ClientTransferNumber) { + return true + } + + return false +} + +// SetClientTransferNumber gets a reference to the given int32 and assigns it to the ClientTransferNumber field. +func (o *CommitPreparationV1Request) SetClientTransferNumber(v int32) { + o.ClientTransferNumber = &v +} + +// GetSignature returns the Signature field value +func (o *CommitPreparationV1Request) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Request) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *CommitPreparationV1Request) SetSignature(v string) { + o.Signature = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *CommitPreparationV1Request) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Request) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *CommitPreparationV1Request) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +func (o CommitPreparationV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CommitPreparationV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["messageType"] = o.MessageType + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["hashLockEvidenceAck"] = o.HashLockEvidenceAck + if !IsNil(o.ClientTransferNumber) { + toSerialize["clientTransferNumber"] = o.ClientTransferNumber + } + toSerialize["signature"] = o.Signature + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableCommitPreparationV1Request struct { + value *CommitPreparationV1Request + isSet bool +} + +func (v NullableCommitPreparationV1Request) Get() *CommitPreparationV1Request { + return v.value +} + +func (v *NullableCommitPreparationV1Request) Set(val *CommitPreparationV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableCommitPreparationV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableCommitPreparationV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommitPreparationV1Request(val *CommitPreparationV1Request) *NullableCommitPreparationV1Request { + return &NullableCommitPreparationV1Request{value: val, isSet: true} +} + +func (v NullableCommitPreparationV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommitPreparationV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_response.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_response.go new file mode 100644 index 00000000000..d64428d0916 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_response.go @@ -0,0 +1,315 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the CommitPreparationV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CommitPreparationV1Response{} + +// CommitPreparationV1Response struct for CommitPreparationV1Response +type CommitPreparationV1Response struct { + SessionID string `json:"sessionID"` + MessageType string `json:"messageType"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + HashCommitPrep string `json:"hashCommitPrep"` + ServerTransferNumber *string `json:"serverTransferNumber,omitempty"` + Signature string `json:"signature"` + SequenceNumber float32 `json:"sequenceNumber"` +} + +// NewCommitPreparationV1Response instantiates a new CommitPreparationV1Response 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 +// will change when the set of required properties is changed +func NewCommitPreparationV1Response(sessionID string, messageType string, clientIdentityPubkey string, serverIdentityPubkey string, hashCommitPrep string, signature string, sequenceNumber float32) *CommitPreparationV1Response { + this := CommitPreparationV1Response{} + this.SessionID = sessionID + this.MessageType = messageType + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.HashCommitPrep = hashCommitPrep + this.Signature = signature + this.SequenceNumber = sequenceNumber + return &this +} + +// NewCommitPreparationV1ResponseWithDefaults instantiates a new CommitPreparationV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCommitPreparationV1ResponseWithDefaults() *CommitPreparationV1Response { + this := CommitPreparationV1Response{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *CommitPreparationV1Response) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Response) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *CommitPreparationV1Response) SetSessionID(v string) { + o.SessionID = v +} + +// GetMessageType returns the MessageType field value +func (o *CommitPreparationV1Response) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Response) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *CommitPreparationV1Response) SetMessageType(v string) { + o.MessageType = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *CommitPreparationV1Response) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Response) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *CommitPreparationV1Response) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *CommitPreparationV1Response) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Response) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *CommitPreparationV1Response) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetHashCommitPrep returns the HashCommitPrep field value +func (o *CommitPreparationV1Response) GetHashCommitPrep() string { + if o == nil { + var ret string + return ret + } + + return o.HashCommitPrep +} + +// GetHashCommitPrepOk returns a tuple with the HashCommitPrep field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Response) GetHashCommitPrepOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashCommitPrep, true +} + +// SetHashCommitPrep sets field value +func (o *CommitPreparationV1Response) SetHashCommitPrep(v string) { + o.HashCommitPrep = v +} + +// GetServerTransferNumber returns the ServerTransferNumber field value if set, zero value otherwise. +func (o *CommitPreparationV1Response) GetServerTransferNumber() string { + if o == nil || IsNil(o.ServerTransferNumber) { + var ret string + return ret + } + return *o.ServerTransferNumber +} + +// GetServerTransferNumberOk returns a tuple with the ServerTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Response) GetServerTransferNumberOk() (*string, bool) { + if o == nil || IsNil(o.ServerTransferNumber) { + return nil, false + } + return o.ServerTransferNumber, true +} + +// HasServerTransferNumber returns a boolean if a field has been set. +func (o *CommitPreparationV1Response) HasServerTransferNumber() bool { + if o != nil && !IsNil(o.ServerTransferNumber) { + return true + } + + return false +} + +// SetServerTransferNumber gets a reference to the given string and assigns it to the ServerTransferNumber field. +func (o *CommitPreparationV1Response) SetServerTransferNumber(v string) { + o.ServerTransferNumber = &v +} + +// GetSignature returns the Signature field value +func (o *CommitPreparationV1Response) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Response) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *CommitPreparationV1Response) SetSignature(v string) { + o.Signature = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *CommitPreparationV1Response) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *CommitPreparationV1Response) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *CommitPreparationV1Response) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +func (o CommitPreparationV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CommitPreparationV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["messageType"] = o.MessageType + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["hashCommitPrep"] = o.HashCommitPrep + if !IsNil(o.ServerTransferNumber) { + toSerialize["serverTransferNumber"] = o.ServerTransferNumber + } + toSerialize["signature"] = o.Signature + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableCommitPreparationV1Response struct { + value *CommitPreparationV1Response + isSet bool +} + +func (v NullableCommitPreparationV1Response) Get() *CommitPreparationV1Response { + return v.value +} + +func (v *NullableCommitPreparationV1Response) Set(val *CommitPreparationV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableCommitPreparationV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableCommitPreparationV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommitPreparationV1Response(val *CommitPreparationV1Response) *NullableCommitPreparationV1Response { + return &NullableCommitPreparationV1Response{value: val, isSet: true} +} + +func (v NullableCommitPreparationV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommitPreparationV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_credential_profile.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_credential_profile.go new file mode 100644 index 00000000000..183b47aa2f0 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_credential_profile.go @@ -0,0 +1,113 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" + "fmt" +) + +// CredentialProfile the model 'CredentialProfile' +type CredentialProfile string + +// List of CredentialProfile +const ( + SAML CredentialProfile = "SAML" + OAUTH CredentialProfile = "OAUTH" + X509 CredentialProfile = "X509" +) + +// All allowed values of CredentialProfile enum +var AllowedCredentialProfileEnumValues = []CredentialProfile{ + "SAML", + "OAUTH", + "X509", +} + +func (v *CredentialProfile) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CredentialProfile(value) + for _, existing := range AllowedCredentialProfileEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CredentialProfile", value) +} + +// NewCredentialProfileFromValue returns a pointer to a valid CredentialProfile +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCredentialProfileFromValue(v string) (*CredentialProfile, error) { + ev := CredentialProfile(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CredentialProfile: valid values are %v", v, AllowedCredentialProfileEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CredentialProfile) IsValid() bool { + for _, existing := range AllowedCredentialProfileEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CredentialProfile value +func (v CredentialProfile) Ptr() *CredentialProfile { + return &v +} + +type NullableCredentialProfile struct { + value *CredentialProfile + isSet bool +} + +func (v NullableCredentialProfile) Get() *CredentialProfile { + return v.value +} + +func (v *NullableCredentialProfile) Set(val *CredentialProfile) { + v.value = val + v.isSet = true +} + +func (v NullableCredentialProfile) IsSet() bool { + return v.isSet +} + +func (v *NullableCredentialProfile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCredentialProfile(val *CredentialProfile) *NullableCredentialProfile { + return &NullableCredentialProfile{value: val, isSet: true} +} + +func (v NullableCredentialProfile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCredentialProfile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_history.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_history.go new file mode 100644 index 00000000000..e1a9084f896 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_history.go @@ -0,0 +1,342 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the History type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &History{} + +// History struct for History +type History struct { + Transactions []map[string]interface{} `json:"Transactions,omitempty"` + Actions []map[string]interface{} `json:"Actions,omitempty"` + Origin *string `json:"Origin,omitempty"` + Destination *string `json:"Destination,omitempty"` + Balance *string `json:"Balance,omitempty"` + CurrentStatus map[string]interface{} `json:"CurrentStatus,omitempty"` + ApplicationSpecificParameters map[string]interface{} `json:"ApplicationSpecificParameters,omitempty"` +} + +// NewHistory instantiates a new History 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 +// will change when the set of required properties is changed +func NewHistory() *History { + this := History{} + return &this +} + +// NewHistoryWithDefaults instantiates a new History object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHistoryWithDefaults() *History { + this := History{} + return &this +} + +// GetTransactions returns the Transactions field value if set, zero value otherwise. +func (o *History) GetTransactions() []map[string]interface{} { + if o == nil || IsNil(o.Transactions) { + var ret []map[string]interface{} + return ret + } + return o.Transactions +} + +// GetTransactionsOk returns a tuple with the Transactions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *History) GetTransactionsOk() ([]map[string]interface{}, bool) { + if o == nil || IsNil(o.Transactions) { + return nil, false + } + return o.Transactions, true +} + +// HasTransactions returns a boolean if a field has been set. +func (o *History) HasTransactions() bool { + if o != nil && !IsNil(o.Transactions) { + return true + } + + return false +} + +// SetTransactions gets a reference to the given []map[string]interface{} and assigns it to the Transactions field. +func (o *History) SetTransactions(v []map[string]interface{}) { + o.Transactions = v +} + +// GetActions returns the Actions field value if set, zero value otherwise. +func (o *History) GetActions() []map[string]interface{} { + if o == nil || IsNil(o.Actions) { + var ret []map[string]interface{} + return ret + } + return o.Actions +} + +// GetActionsOk returns a tuple with the Actions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *History) GetActionsOk() ([]map[string]interface{}, bool) { + if o == nil || IsNil(o.Actions) { + return nil, false + } + return o.Actions, true +} + +// HasActions returns a boolean if a field has been set. +func (o *History) HasActions() bool { + if o != nil && !IsNil(o.Actions) { + return true + } + + return false +} + +// SetActions gets a reference to the given []map[string]interface{} and assigns it to the Actions field. +func (o *History) SetActions(v []map[string]interface{}) { + o.Actions = v +} + +// GetOrigin returns the Origin field value if set, zero value otherwise. +func (o *History) GetOrigin() string { + if o == nil || IsNil(o.Origin) { + var ret string + return ret + } + return *o.Origin +} + +// GetOriginOk returns a tuple with the Origin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *History) GetOriginOk() (*string, bool) { + if o == nil || IsNil(o.Origin) { + return nil, false + } + return o.Origin, true +} + +// HasOrigin returns a boolean if a field has been set. +func (o *History) HasOrigin() bool { + if o != nil && !IsNil(o.Origin) { + return true + } + + return false +} + +// SetOrigin gets a reference to the given string and assigns it to the Origin field. +func (o *History) SetOrigin(v string) { + o.Origin = &v +} + +// GetDestination returns the Destination field value if set, zero value otherwise. +func (o *History) GetDestination() string { + if o == nil || IsNil(o.Destination) { + var ret string + return ret + } + return *o.Destination +} + +// GetDestinationOk returns a tuple with the Destination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *History) GetDestinationOk() (*string, bool) { + if o == nil || IsNil(o.Destination) { + return nil, false + } + return o.Destination, true +} + +// HasDestination returns a boolean if a field has been set. +func (o *History) HasDestination() bool { + if o != nil && !IsNil(o.Destination) { + return true + } + + return false +} + +// SetDestination gets a reference to the given string and assigns it to the Destination field. +func (o *History) SetDestination(v string) { + o.Destination = &v +} + +// GetBalance returns the Balance field value if set, zero value otherwise. +func (o *History) GetBalance() string { + if o == nil || IsNil(o.Balance) { + var ret string + return ret + } + return *o.Balance +} + +// GetBalanceOk returns a tuple with the Balance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *History) GetBalanceOk() (*string, bool) { + if o == nil || IsNil(o.Balance) { + return nil, false + } + return o.Balance, true +} + +// HasBalance returns a boolean if a field has been set. +func (o *History) HasBalance() bool { + if o != nil && !IsNil(o.Balance) { + return true + } + + return false +} + +// SetBalance gets a reference to the given string and assigns it to the Balance field. +func (o *History) SetBalance(v string) { + o.Balance = &v +} + +// GetCurrentStatus returns the CurrentStatus field value if set, zero value otherwise. +func (o *History) GetCurrentStatus() map[string]interface{} { + if o == nil || IsNil(o.CurrentStatus) { + var ret map[string]interface{} + return ret + } + return o.CurrentStatus +} + +// GetCurrentStatusOk returns a tuple with the CurrentStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *History) GetCurrentStatusOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.CurrentStatus) { + return map[string]interface{}{}, false + } + return o.CurrentStatus, true +} + +// HasCurrentStatus returns a boolean if a field has been set. +func (o *History) HasCurrentStatus() bool { + if o != nil && !IsNil(o.CurrentStatus) { + return true + } + + return false +} + +// SetCurrentStatus gets a reference to the given map[string]interface{} and assigns it to the CurrentStatus field. +func (o *History) SetCurrentStatus(v map[string]interface{}) { + o.CurrentStatus = v +} + +// GetApplicationSpecificParameters returns the ApplicationSpecificParameters field value if set, zero value otherwise. +func (o *History) GetApplicationSpecificParameters() map[string]interface{} { + if o == nil || IsNil(o.ApplicationSpecificParameters) { + var ret map[string]interface{} + return ret + } + return o.ApplicationSpecificParameters +} + +// GetApplicationSpecificParametersOk returns a tuple with the ApplicationSpecificParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *History) GetApplicationSpecificParametersOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.ApplicationSpecificParameters) { + return map[string]interface{}{}, false + } + return o.ApplicationSpecificParameters, true +} + +// HasApplicationSpecificParameters returns a boolean if a field has been set. +func (o *History) HasApplicationSpecificParameters() bool { + if o != nil && !IsNil(o.ApplicationSpecificParameters) { + return true + } + + return false +} + +// SetApplicationSpecificParameters gets a reference to the given map[string]interface{} and assigns it to the ApplicationSpecificParameters field. +func (o *History) SetApplicationSpecificParameters(v map[string]interface{}) { + o.ApplicationSpecificParameters = v +} + +func (o History) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o History) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Transactions) { + toSerialize["Transactions"] = o.Transactions + } + if !IsNil(o.Actions) { + toSerialize["Actions"] = o.Actions + } + if !IsNil(o.Origin) { + toSerialize["Origin"] = o.Origin + } + if !IsNil(o.Destination) { + toSerialize["Destination"] = o.Destination + } + if !IsNil(o.Balance) { + toSerialize["Balance"] = o.Balance + } + if !IsNil(o.CurrentStatus) { + toSerialize["CurrentStatus"] = o.CurrentStatus + } + if !IsNil(o.ApplicationSpecificParameters) { + toSerialize["ApplicationSpecificParameters"] = o.ApplicationSpecificParameters + } + return toSerialize, nil +} + +type NullableHistory struct { + value *History + isSet bool +} + +func (v NullableHistory) Get() *History { + return v.value +} + +func (v *NullableHistory) Set(val *History) { + v.value = val + v.isSet = true +} + +func (v NullableHistory) IsSet() bool { + return v.isSet +} + +func (v *NullableHistory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHistory(val *History) *NullableHistory { + return &NullableHistory{value: val, isSet: true} +} + +func (v NullableHistory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHistory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_request.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_request.go new file mode 100644 index 00000000000..f969a663b72 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_request.go @@ -0,0 +1,451 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the LockEvidenceV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LockEvidenceV1Request{} + +// LockEvidenceV1Request struct for LockEvidenceV1Request +type LockEvidenceV1Request struct { + SessionID string `json:"sessionID"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + LockEvidenceClaim string `json:"lockEvidenceClaim"` + LockEvidenceFormat map[string]interface{} `json:"lockEvidenceFormat,omitempty"` + LockEvidenceExpiration string `json:"lockEvidenceExpiration"` + HashCommenceAckRequest string `json:"hashCommenceAckRequest"` + ClientTransferNumber NullableInt32 `json:"clientTransferNumber,omitempty"` + Signature string `json:"signature"` + MessageType string `json:"messageType"` + MessageHash *string `json:"messageHash,omitempty"` + SequenceNumber float32 `json:"sequenceNumber"` +} + +// NewLockEvidenceV1Request instantiates a new LockEvidenceV1Request 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 +// will change when the set of required properties is changed +func NewLockEvidenceV1Request(sessionID string, clientIdentityPubkey string, serverIdentityPubkey string, lockEvidenceClaim string, lockEvidenceExpiration string, hashCommenceAckRequest string, signature string, messageType string, sequenceNumber float32) *LockEvidenceV1Request { + this := LockEvidenceV1Request{} + this.SessionID = sessionID + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.LockEvidenceClaim = lockEvidenceClaim + this.LockEvidenceExpiration = lockEvidenceExpiration + this.HashCommenceAckRequest = hashCommenceAckRequest + this.Signature = signature + this.MessageType = messageType + this.SequenceNumber = sequenceNumber + return &this +} + +// NewLockEvidenceV1RequestWithDefaults instantiates a new LockEvidenceV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLockEvidenceV1RequestWithDefaults() *LockEvidenceV1Request { + this := LockEvidenceV1Request{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *LockEvidenceV1Request) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *LockEvidenceV1Request) SetSessionID(v string) { + o.SessionID = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *LockEvidenceV1Request) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *LockEvidenceV1Request) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *LockEvidenceV1Request) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *LockEvidenceV1Request) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetLockEvidenceClaim returns the LockEvidenceClaim field value +func (o *LockEvidenceV1Request) GetLockEvidenceClaim() string { + if o == nil { + var ret string + return ret + } + + return o.LockEvidenceClaim +} + +// GetLockEvidenceClaimOk returns a tuple with the LockEvidenceClaim field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetLockEvidenceClaimOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LockEvidenceClaim, true +} + +// SetLockEvidenceClaim sets field value +func (o *LockEvidenceV1Request) SetLockEvidenceClaim(v string) { + o.LockEvidenceClaim = v +} + +// GetLockEvidenceFormat returns the LockEvidenceFormat field value if set, zero value otherwise. +func (o *LockEvidenceV1Request) GetLockEvidenceFormat() map[string]interface{} { + if o == nil || IsNil(o.LockEvidenceFormat) { + var ret map[string]interface{} + return ret + } + return o.LockEvidenceFormat +} + +// GetLockEvidenceFormatOk returns a tuple with the LockEvidenceFormat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetLockEvidenceFormatOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.LockEvidenceFormat) { + return map[string]interface{}{}, false + } + return o.LockEvidenceFormat, true +} + +// HasLockEvidenceFormat returns a boolean if a field has been set. +func (o *LockEvidenceV1Request) HasLockEvidenceFormat() bool { + if o != nil && !IsNil(o.LockEvidenceFormat) { + return true + } + + return false +} + +// SetLockEvidenceFormat gets a reference to the given map[string]interface{} and assigns it to the LockEvidenceFormat field. +func (o *LockEvidenceV1Request) SetLockEvidenceFormat(v map[string]interface{}) { + o.LockEvidenceFormat = v +} + +// GetLockEvidenceExpiration returns the LockEvidenceExpiration field value +func (o *LockEvidenceV1Request) GetLockEvidenceExpiration() string { + if o == nil { + var ret string + return ret + } + + return o.LockEvidenceExpiration +} + +// GetLockEvidenceExpirationOk returns a tuple with the LockEvidenceExpiration field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetLockEvidenceExpirationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LockEvidenceExpiration, true +} + +// SetLockEvidenceExpiration sets field value +func (o *LockEvidenceV1Request) SetLockEvidenceExpiration(v string) { + o.LockEvidenceExpiration = v +} + +// GetHashCommenceAckRequest returns the HashCommenceAckRequest field value +func (o *LockEvidenceV1Request) GetHashCommenceAckRequest() string { + if o == nil { + var ret string + return ret + } + + return o.HashCommenceAckRequest +} + +// GetHashCommenceAckRequestOk returns a tuple with the HashCommenceAckRequest field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetHashCommenceAckRequestOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashCommenceAckRequest, true +} + +// SetHashCommenceAckRequest sets field value +func (o *LockEvidenceV1Request) SetHashCommenceAckRequest(v string) { + o.HashCommenceAckRequest = v +} + +// GetClientTransferNumber returns the ClientTransferNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LockEvidenceV1Request) GetClientTransferNumber() int32 { + if o == nil || IsNil(o.ClientTransferNumber.Get()) { + var ret int32 + return ret + } + return *o.ClientTransferNumber.Get() +} + +// GetClientTransferNumberOk returns a tuple with the ClientTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LockEvidenceV1Request) GetClientTransferNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ClientTransferNumber.Get(), o.ClientTransferNumber.IsSet() +} + +// HasClientTransferNumber returns a boolean if a field has been set. +func (o *LockEvidenceV1Request) HasClientTransferNumber() bool { + if o != nil && o.ClientTransferNumber.IsSet() { + return true + } + + return false +} + +// SetClientTransferNumber gets a reference to the given NullableInt32 and assigns it to the ClientTransferNumber field. +func (o *LockEvidenceV1Request) SetClientTransferNumber(v int32) { + o.ClientTransferNumber.Set(&v) +} +// SetClientTransferNumberNil sets the value for ClientTransferNumber to be an explicit nil +func (o *LockEvidenceV1Request) SetClientTransferNumberNil() { + o.ClientTransferNumber.Set(nil) +} + +// UnsetClientTransferNumber ensures that no value is present for ClientTransferNumber, not even an explicit nil +func (o *LockEvidenceV1Request) UnsetClientTransferNumber() { + o.ClientTransferNumber.Unset() +} + +// GetSignature returns the Signature field value +func (o *LockEvidenceV1Request) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *LockEvidenceV1Request) SetSignature(v string) { + o.Signature = v +} + +// GetMessageType returns the MessageType field value +func (o *LockEvidenceV1Request) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *LockEvidenceV1Request) SetMessageType(v string) { + o.MessageType = v +} + +// GetMessageHash returns the MessageHash field value if set, zero value otherwise. +func (o *LockEvidenceV1Request) GetMessageHash() string { + if o == nil || IsNil(o.MessageHash) { + var ret string + return ret + } + return *o.MessageHash +} + +// GetMessageHashOk returns a tuple with the MessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.MessageHash) { + return nil, false + } + return o.MessageHash, true +} + +// HasMessageHash returns a boolean if a field has been set. +func (o *LockEvidenceV1Request) HasMessageHash() bool { + if o != nil && !IsNil(o.MessageHash) { + return true + } + + return false +} + +// SetMessageHash gets a reference to the given string and assigns it to the MessageHash field. +func (o *LockEvidenceV1Request) SetMessageHash(v string) { + o.MessageHash = &v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *LockEvidenceV1Request) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Request) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *LockEvidenceV1Request) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +func (o LockEvidenceV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LockEvidenceV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["lockEvidenceClaim"] = o.LockEvidenceClaim + if !IsNil(o.LockEvidenceFormat) { + toSerialize["lockEvidenceFormat"] = o.LockEvidenceFormat + } + toSerialize["lockEvidenceExpiration"] = o.LockEvidenceExpiration + toSerialize["hashCommenceAckRequest"] = o.HashCommenceAckRequest + if o.ClientTransferNumber.IsSet() { + toSerialize["clientTransferNumber"] = o.ClientTransferNumber.Get() + } + toSerialize["signature"] = o.Signature + toSerialize["messageType"] = o.MessageType + if !IsNil(o.MessageHash) { + toSerialize["messageHash"] = o.MessageHash + } + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableLockEvidenceV1Request struct { + value *LockEvidenceV1Request + isSet bool +} + +func (v NullableLockEvidenceV1Request) Get() *LockEvidenceV1Request { + return v.value +} + +func (v *NullableLockEvidenceV1Request) Set(val *LockEvidenceV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableLockEvidenceV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableLockEvidenceV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLockEvidenceV1Request(val *LockEvidenceV1Request) *NullableLockEvidenceV1Request { + return &NullableLockEvidenceV1Request{value: val, isSet: true} +} + +func (v NullableLockEvidenceV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLockEvidenceV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_response.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_response.go new file mode 100644 index 00000000000..18e342aacd2 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_response.go @@ -0,0 +1,325 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the LockEvidenceV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LockEvidenceV1Response{} + +// LockEvidenceV1Response struct for LockEvidenceV1Response +type LockEvidenceV1Response struct { + SessionID string `json:"sessionID"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + HashLockEvidenceRequest string `json:"hashLockEvidenceRequest"` + ServerTransferNumber NullableInt32 `json:"serverTransferNumber,omitempty"` + Signature string `json:"signature"` + MessageType string `json:"messageType"` + SequenceNumber float32 `json:"sequenceNumber"` +} + +// NewLockEvidenceV1Response instantiates a new LockEvidenceV1Response 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 +// will change when the set of required properties is changed +func NewLockEvidenceV1Response(sessionID string, clientIdentityPubkey string, serverIdentityPubkey string, hashLockEvidenceRequest string, signature string, messageType string, sequenceNumber float32) *LockEvidenceV1Response { + this := LockEvidenceV1Response{} + this.SessionID = sessionID + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.HashLockEvidenceRequest = hashLockEvidenceRequest + this.Signature = signature + this.MessageType = messageType + this.SequenceNumber = sequenceNumber + return &this +} + +// NewLockEvidenceV1ResponseWithDefaults instantiates a new LockEvidenceV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLockEvidenceV1ResponseWithDefaults() *LockEvidenceV1Response { + this := LockEvidenceV1Response{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *LockEvidenceV1Response) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Response) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *LockEvidenceV1Response) SetSessionID(v string) { + o.SessionID = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *LockEvidenceV1Response) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Response) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *LockEvidenceV1Response) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *LockEvidenceV1Response) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Response) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *LockEvidenceV1Response) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetHashLockEvidenceRequest returns the HashLockEvidenceRequest field value +func (o *LockEvidenceV1Response) GetHashLockEvidenceRequest() string { + if o == nil { + var ret string + return ret + } + + return o.HashLockEvidenceRequest +} + +// GetHashLockEvidenceRequestOk returns a tuple with the HashLockEvidenceRequest field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Response) GetHashLockEvidenceRequestOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashLockEvidenceRequest, true +} + +// SetHashLockEvidenceRequest sets field value +func (o *LockEvidenceV1Response) SetHashLockEvidenceRequest(v string) { + o.HashLockEvidenceRequest = v +} + +// GetServerTransferNumber returns the ServerTransferNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LockEvidenceV1Response) GetServerTransferNumber() int32 { + if o == nil || IsNil(o.ServerTransferNumber.Get()) { + var ret int32 + return ret + } + return *o.ServerTransferNumber.Get() +} + +// GetServerTransferNumberOk returns a tuple with the ServerTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LockEvidenceV1Response) GetServerTransferNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ServerTransferNumber.Get(), o.ServerTransferNumber.IsSet() +} + +// HasServerTransferNumber returns a boolean if a field has been set. +func (o *LockEvidenceV1Response) HasServerTransferNumber() bool { + if o != nil && o.ServerTransferNumber.IsSet() { + return true + } + + return false +} + +// SetServerTransferNumber gets a reference to the given NullableInt32 and assigns it to the ServerTransferNumber field. +func (o *LockEvidenceV1Response) SetServerTransferNumber(v int32) { + o.ServerTransferNumber.Set(&v) +} +// SetServerTransferNumberNil sets the value for ServerTransferNumber to be an explicit nil +func (o *LockEvidenceV1Response) SetServerTransferNumberNil() { + o.ServerTransferNumber.Set(nil) +} + +// UnsetServerTransferNumber ensures that no value is present for ServerTransferNumber, not even an explicit nil +func (o *LockEvidenceV1Response) UnsetServerTransferNumber() { + o.ServerTransferNumber.Unset() +} + +// GetSignature returns the Signature field value +func (o *LockEvidenceV1Response) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Response) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *LockEvidenceV1Response) SetSignature(v string) { + o.Signature = v +} + +// GetMessageType returns the MessageType field value +func (o *LockEvidenceV1Response) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Response) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *LockEvidenceV1Response) SetMessageType(v string) { + o.MessageType = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *LockEvidenceV1Response) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *LockEvidenceV1Response) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *LockEvidenceV1Response) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +func (o LockEvidenceV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LockEvidenceV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["hashLockEvidenceRequest"] = o.HashLockEvidenceRequest + if o.ServerTransferNumber.IsSet() { + toSerialize["serverTransferNumber"] = o.ServerTransferNumber.Get() + } + toSerialize["signature"] = o.Signature + toSerialize["messageType"] = o.MessageType + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableLockEvidenceV1Response struct { + value *LockEvidenceV1Response + isSet bool +} + +func (v NullableLockEvidenceV1Response) Get() *LockEvidenceV1Response { + return v.value +} + +func (v *NullableLockEvidenceV1Response) Set(val *LockEvidenceV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableLockEvidenceV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableLockEvidenceV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLockEvidenceV1Response(val *LockEvidenceV1Response) *NullableLockEvidenceV1Response { + return &NullableLockEvidenceV1Response{value: val, isSet: true} +} + +func (v NullableLockEvidenceV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLockEvidenceV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_local_log.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_local_log.go new file mode 100644 index 00000000000..14d5fc34e12 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_local_log.go @@ -0,0 +1,279 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the OdapLocalLog type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OdapLocalLog{} + +// OdapLocalLog struct for OdapLocalLog +type OdapLocalLog struct { + Key *string `json:"key,omitempty"` + SessionID string `json:"sessionID"` + Data *string `json:"data,omitempty"` + Type string `json:"type"` + Operation string `json:"operation"` + Timestamp *string `json:"timestamp,omitempty"` +} + +// NewOdapLocalLog instantiates a new OdapLocalLog 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 +// will change when the set of required properties is changed +func NewOdapLocalLog(sessionID string, type_ string, operation string) *OdapLocalLog { + this := OdapLocalLog{} + this.SessionID = sessionID + this.Type = type_ + this.Operation = operation + return &this +} + +// NewOdapLocalLogWithDefaults instantiates a new OdapLocalLog object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOdapLocalLogWithDefaults() *OdapLocalLog { + this := OdapLocalLog{} + return &this +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *OdapLocalLog) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapLocalLog) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *OdapLocalLog) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *OdapLocalLog) SetKey(v string) { + o.Key = &v +} + +// GetSessionID returns the SessionID field value +func (o *OdapLocalLog) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *OdapLocalLog) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *OdapLocalLog) SetSessionID(v string) { + o.SessionID = v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *OdapLocalLog) GetData() string { + if o == nil || IsNil(o.Data) { + var ret string + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapLocalLog) GetDataOk() (*string, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *OdapLocalLog) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given string and assigns it to the Data field. +func (o *OdapLocalLog) SetData(v string) { + o.Data = &v +} + +// GetType returns the Type field value +func (o *OdapLocalLog) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *OdapLocalLog) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *OdapLocalLog) SetType(v string) { + o.Type = v +} + +// GetOperation returns the Operation field value +func (o *OdapLocalLog) GetOperation() string { + if o == nil { + var ret string + return ret + } + + return o.Operation +} + +// GetOperationOk returns a tuple with the Operation field value +// and a boolean to check if the value has been set. +func (o *OdapLocalLog) GetOperationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Operation, true +} + +// SetOperation sets field value +func (o *OdapLocalLog) SetOperation(v string) { + o.Operation = v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *OdapLocalLog) GetTimestamp() string { + if o == nil || IsNil(o.Timestamp) { + var ret string + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapLocalLog) GetTimestampOk() (*string, bool) { + if o == nil || IsNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *OdapLocalLog) HasTimestamp() bool { + if o != nil && !IsNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. +func (o *OdapLocalLog) SetTimestamp(v string) { + o.Timestamp = &v +} + +func (o OdapLocalLog) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OdapLocalLog) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + toSerialize["sessionID"] = o.SessionID + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + toSerialize["type"] = o.Type + toSerialize["operation"] = o.Operation + if !IsNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return toSerialize, nil +} + +type NullableOdapLocalLog struct { + value *OdapLocalLog + isSet bool +} + +func (v NullableOdapLocalLog) Get() *OdapLocalLog { + return v.value +} + +func (v *NullableOdapLocalLog) Set(val *OdapLocalLog) { + v.value = val + v.isSet = true +} + +func (v NullableOdapLocalLog) IsSet() bool { + return v.isSet +} + +func (v *NullableOdapLocalLog) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOdapLocalLog(val *OdapLocalLog) *NullableOdapLocalLog { + return &NullableOdapLocalLog{value: val, isSet: true} +} + +func (v NullableOdapLocalLog) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOdapLocalLog) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_message.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_message.go new file mode 100644 index 00000000000..4182a088a96 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_message.go @@ -0,0 +1,522 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the OdapMessage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OdapMessage{} + +// OdapMessage struct for OdapMessage +type OdapMessage struct { + SequenceNumber *float32 `json:"SequenceNumber,omitempty"` + Phase *string `json:"Phase,omitempty"` + ResourceURL *string `json:"ResourceURL,omitempty"` + DeveloperURN *string `json:"DeveloperURN,omitempty"` + ActionResponse *OdapMessageActionResponse `json:"ActionResponse,omitempty"` + CredentialProfile *string `json:"CredentialProfile,omitempty"` + CredentialBlock []interface{} `json:"CredentialBlock,omitempty"` + CredentialsProfile *PayloadProfile `json:"CredentialsProfile,omitempty"` + ApplicationProfile map[string]interface{} `json:"ApplicationProfile,omitempty"` + Payload map[string]interface{} `json:"Payload,omitempty"` + PayloadHash *string `json:"PayloadHash,omitempty"` + MessageSignature *string `json:"MessageSignature,omitempty"` +} + +// NewOdapMessage instantiates a new OdapMessage 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 +// will change when the set of required properties is changed +func NewOdapMessage() *OdapMessage { + this := OdapMessage{} + return &this +} + +// NewOdapMessageWithDefaults instantiates a new OdapMessage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOdapMessageWithDefaults() *OdapMessage { + this := OdapMessage{} + return &this +} + +// GetSequenceNumber returns the SequenceNumber field value if set, zero value otherwise. +func (o *OdapMessage) GetSequenceNumber() float32 { + if o == nil || IsNil(o.SequenceNumber) { + var ret float32 + return ret + } + return *o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetSequenceNumberOk() (*float32, bool) { + if o == nil || IsNil(o.SequenceNumber) { + return nil, false + } + return o.SequenceNumber, true +} + +// HasSequenceNumber returns a boolean if a field has been set. +func (o *OdapMessage) HasSequenceNumber() bool { + if o != nil && !IsNil(o.SequenceNumber) { + return true + } + + return false +} + +// SetSequenceNumber gets a reference to the given float32 and assigns it to the SequenceNumber field. +func (o *OdapMessage) SetSequenceNumber(v float32) { + o.SequenceNumber = &v +} + +// GetPhase returns the Phase field value if set, zero value otherwise. +func (o *OdapMessage) GetPhase() string { + if o == nil || IsNil(o.Phase) { + var ret string + return ret + } + return *o.Phase +} + +// GetPhaseOk returns a tuple with the Phase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetPhaseOk() (*string, bool) { + if o == nil || IsNil(o.Phase) { + return nil, false + } + return o.Phase, true +} + +// HasPhase returns a boolean if a field has been set. +func (o *OdapMessage) HasPhase() bool { + if o != nil && !IsNil(o.Phase) { + return true + } + + return false +} + +// SetPhase gets a reference to the given string and assigns it to the Phase field. +func (o *OdapMessage) SetPhase(v string) { + o.Phase = &v +} + +// GetResourceURL returns the ResourceURL field value if set, zero value otherwise. +func (o *OdapMessage) GetResourceURL() string { + if o == nil || IsNil(o.ResourceURL) { + var ret string + return ret + } + return *o.ResourceURL +} + +// GetResourceURLOk returns a tuple with the ResourceURL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetResourceURLOk() (*string, bool) { + if o == nil || IsNil(o.ResourceURL) { + return nil, false + } + return o.ResourceURL, true +} + +// HasResourceURL returns a boolean if a field has been set. +func (o *OdapMessage) HasResourceURL() bool { + if o != nil && !IsNil(o.ResourceURL) { + return true + } + + return false +} + +// SetResourceURL gets a reference to the given string and assigns it to the ResourceURL field. +func (o *OdapMessage) SetResourceURL(v string) { + o.ResourceURL = &v +} + +// GetDeveloperURN returns the DeveloperURN field value if set, zero value otherwise. +func (o *OdapMessage) GetDeveloperURN() string { + if o == nil || IsNil(o.DeveloperURN) { + var ret string + return ret + } + return *o.DeveloperURN +} + +// GetDeveloperURNOk returns a tuple with the DeveloperURN field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetDeveloperURNOk() (*string, bool) { + if o == nil || IsNil(o.DeveloperURN) { + return nil, false + } + return o.DeveloperURN, true +} + +// HasDeveloperURN returns a boolean if a field has been set. +func (o *OdapMessage) HasDeveloperURN() bool { + if o != nil && !IsNil(o.DeveloperURN) { + return true + } + + return false +} + +// SetDeveloperURN gets a reference to the given string and assigns it to the DeveloperURN field. +func (o *OdapMessage) SetDeveloperURN(v string) { + o.DeveloperURN = &v +} + +// GetActionResponse returns the ActionResponse field value if set, zero value otherwise. +func (o *OdapMessage) GetActionResponse() OdapMessageActionResponse { + if o == nil || IsNil(o.ActionResponse) { + var ret OdapMessageActionResponse + return ret + } + return *o.ActionResponse +} + +// GetActionResponseOk returns a tuple with the ActionResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetActionResponseOk() (*OdapMessageActionResponse, bool) { + if o == nil || IsNil(o.ActionResponse) { + return nil, false + } + return o.ActionResponse, true +} + +// HasActionResponse returns a boolean if a field has been set. +func (o *OdapMessage) HasActionResponse() bool { + if o != nil && !IsNil(o.ActionResponse) { + return true + } + + return false +} + +// SetActionResponse gets a reference to the given OdapMessageActionResponse and assigns it to the ActionResponse field. +func (o *OdapMessage) SetActionResponse(v OdapMessageActionResponse) { + o.ActionResponse = &v +} + +// GetCredentialProfile returns the CredentialProfile field value if set, zero value otherwise. +func (o *OdapMessage) GetCredentialProfile() string { + if o == nil || IsNil(o.CredentialProfile) { + var ret string + return ret + } + return *o.CredentialProfile +} + +// GetCredentialProfileOk returns a tuple with the CredentialProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetCredentialProfileOk() (*string, bool) { + if o == nil || IsNil(o.CredentialProfile) { + return nil, false + } + return o.CredentialProfile, true +} + +// HasCredentialProfile returns a boolean if a field has been set. +func (o *OdapMessage) HasCredentialProfile() bool { + if o != nil && !IsNil(o.CredentialProfile) { + return true + } + + return false +} + +// SetCredentialProfile gets a reference to the given string and assigns it to the CredentialProfile field. +func (o *OdapMessage) SetCredentialProfile(v string) { + o.CredentialProfile = &v +} + +// GetCredentialBlock returns the CredentialBlock field value if set, zero value otherwise. +func (o *OdapMessage) GetCredentialBlock() []interface{} { + if o == nil || IsNil(o.CredentialBlock) { + var ret []interface{} + return ret + } + return o.CredentialBlock +} + +// GetCredentialBlockOk returns a tuple with the CredentialBlock field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetCredentialBlockOk() ([]interface{}, bool) { + if o == nil || IsNil(o.CredentialBlock) { + return nil, false + } + return o.CredentialBlock, true +} + +// HasCredentialBlock returns a boolean if a field has been set. +func (o *OdapMessage) HasCredentialBlock() bool { + if o != nil && !IsNil(o.CredentialBlock) { + return true + } + + return false +} + +// SetCredentialBlock gets a reference to the given []interface{} and assigns it to the CredentialBlock field. +func (o *OdapMessage) SetCredentialBlock(v []interface{}) { + o.CredentialBlock = v +} + +// GetCredentialsProfile returns the CredentialsProfile field value if set, zero value otherwise. +func (o *OdapMessage) GetCredentialsProfile() PayloadProfile { + if o == nil || IsNil(o.CredentialsProfile) { + var ret PayloadProfile + return ret + } + return *o.CredentialsProfile +} + +// GetCredentialsProfileOk returns a tuple with the CredentialsProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetCredentialsProfileOk() (*PayloadProfile, bool) { + if o == nil || IsNil(o.CredentialsProfile) { + return nil, false + } + return o.CredentialsProfile, true +} + +// HasCredentialsProfile returns a boolean if a field has been set. +func (o *OdapMessage) HasCredentialsProfile() bool { + if o != nil && !IsNil(o.CredentialsProfile) { + return true + } + + return false +} + +// SetCredentialsProfile gets a reference to the given PayloadProfile and assigns it to the CredentialsProfile field. +func (o *OdapMessage) SetCredentialsProfile(v PayloadProfile) { + o.CredentialsProfile = &v +} + +// GetApplicationProfile returns the ApplicationProfile field value if set, zero value otherwise. +func (o *OdapMessage) GetApplicationProfile() map[string]interface{} { + if o == nil || IsNil(o.ApplicationProfile) { + var ret map[string]interface{} + return ret + } + return o.ApplicationProfile +} + +// GetApplicationProfileOk returns a tuple with the ApplicationProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetApplicationProfileOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.ApplicationProfile) { + return map[string]interface{}{}, false + } + return o.ApplicationProfile, true +} + +// HasApplicationProfile returns a boolean if a field has been set. +func (o *OdapMessage) HasApplicationProfile() bool { + if o != nil && !IsNil(o.ApplicationProfile) { + return true + } + + return false +} + +// SetApplicationProfile gets a reference to the given map[string]interface{} and assigns it to the ApplicationProfile field. +func (o *OdapMessage) SetApplicationProfile(v map[string]interface{}) { + o.ApplicationProfile = v +} + +// GetPayload returns the Payload field value if set, zero value otherwise. +func (o *OdapMessage) GetPayload() map[string]interface{} { + if o == nil || IsNil(o.Payload) { + var ret map[string]interface{} + return ret + } + return o.Payload +} + +// GetPayloadOk returns a tuple with the Payload field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetPayloadOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Payload) { + return map[string]interface{}{}, false + } + return o.Payload, true +} + +// HasPayload returns a boolean if a field has been set. +func (o *OdapMessage) HasPayload() bool { + if o != nil && !IsNil(o.Payload) { + return true + } + + return false +} + +// SetPayload gets a reference to the given map[string]interface{} and assigns it to the Payload field. +func (o *OdapMessage) SetPayload(v map[string]interface{}) { + o.Payload = v +} + +// GetPayloadHash returns the PayloadHash field value if set, zero value otherwise. +func (o *OdapMessage) GetPayloadHash() string { + if o == nil || IsNil(o.PayloadHash) { + var ret string + return ret + } + return *o.PayloadHash +} + +// GetPayloadHashOk returns a tuple with the PayloadHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetPayloadHashOk() (*string, bool) { + if o == nil || IsNil(o.PayloadHash) { + return nil, false + } + return o.PayloadHash, true +} + +// HasPayloadHash returns a boolean if a field has been set. +func (o *OdapMessage) HasPayloadHash() bool { + if o != nil && !IsNil(o.PayloadHash) { + return true + } + + return false +} + +// SetPayloadHash gets a reference to the given string and assigns it to the PayloadHash field. +func (o *OdapMessage) SetPayloadHash(v string) { + o.PayloadHash = &v +} + +// GetMessageSignature returns the MessageSignature field value if set, zero value otherwise. +func (o *OdapMessage) GetMessageSignature() string { + if o == nil || IsNil(o.MessageSignature) { + var ret string + return ret + } + return *o.MessageSignature +} + +// GetMessageSignatureOk returns a tuple with the MessageSignature field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessage) GetMessageSignatureOk() (*string, bool) { + if o == nil || IsNil(o.MessageSignature) { + return nil, false + } + return o.MessageSignature, true +} + +// HasMessageSignature returns a boolean if a field has been set. +func (o *OdapMessage) HasMessageSignature() bool { + if o != nil && !IsNil(o.MessageSignature) { + return true + } + + return false +} + +// SetMessageSignature gets a reference to the given string and assigns it to the MessageSignature field. +func (o *OdapMessage) SetMessageSignature(v string) { + o.MessageSignature = &v +} + +func (o OdapMessage) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OdapMessage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SequenceNumber) { + toSerialize["SequenceNumber"] = o.SequenceNumber + } + if !IsNil(o.Phase) { + toSerialize["Phase"] = o.Phase + } + if !IsNil(o.ResourceURL) { + toSerialize["ResourceURL"] = o.ResourceURL + } + if !IsNil(o.DeveloperURN) { + toSerialize["DeveloperURN"] = o.DeveloperURN + } + if !IsNil(o.ActionResponse) { + toSerialize["ActionResponse"] = o.ActionResponse + } + if !IsNil(o.CredentialProfile) { + toSerialize["CredentialProfile"] = o.CredentialProfile + } + if !IsNil(o.CredentialBlock) { + toSerialize["CredentialBlock"] = o.CredentialBlock + } + if !IsNil(o.CredentialsProfile) { + toSerialize["CredentialsProfile"] = o.CredentialsProfile + } + if !IsNil(o.ApplicationProfile) { + toSerialize["ApplicationProfile"] = o.ApplicationProfile + } + if !IsNil(o.Payload) { + toSerialize["Payload"] = o.Payload + } + if !IsNil(o.PayloadHash) { + toSerialize["PayloadHash"] = o.PayloadHash + } + if !IsNil(o.MessageSignature) { + toSerialize["MessageSignature"] = o.MessageSignature + } + return toSerialize, nil +} + +type NullableOdapMessage struct { + value *OdapMessage + isSet bool +} + +func (v NullableOdapMessage) Get() *OdapMessage { + return v.value +} + +func (v *NullableOdapMessage) Set(val *OdapMessage) { + v.value = val + v.isSet = true +} + +func (v NullableOdapMessage) IsSet() bool { + return v.isSet +} + +func (v *NullableOdapMessage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOdapMessage(val *OdapMessage) *NullableOdapMessage { + return &NullableOdapMessage{value: val, isSet: true} +} + +func (v NullableOdapMessage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOdapMessage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_message_action_response.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_message_action_response.go new file mode 100644 index 00000000000..13c79a657fe --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_odap_message_action_response.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the OdapMessageActionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OdapMessageActionResponse{} + +// OdapMessageActionResponse struct for OdapMessageActionResponse +type OdapMessageActionResponse struct { + ResponseCode *string `json:"ResponseCode,omitempty"` + Arguments []interface{} `json:"Arguments,omitempty"` +} + +// NewOdapMessageActionResponse instantiates a new OdapMessageActionResponse 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 +// will change when the set of required properties is changed +func NewOdapMessageActionResponse() *OdapMessageActionResponse { + this := OdapMessageActionResponse{} + return &this +} + +// NewOdapMessageActionResponseWithDefaults instantiates a new OdapMessageActionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOdapMessageActionResponseWithDefaults() *OdapMessageActionResponse { + this := OdapMessageActionResponse{} + return &this +} + +// GetResponseCode returns the ResponseCode field value if set, zero value otherwise. +func (o *OdapMessageActionResponse) GetResponseCode() string { + if o == nil || IsNil(o.ResponseCode) { + var ret string + return ret + } + return *o.ResponseCode +} + +// GetResponseCodeOk returns a tuple with the ResponseCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessageActionResponse) GetResponseCodeOk() (*string, bool) { + if o == nil || IsNil(o.ResponseCode) { + return nil, false + } + return o.ResponseCode, true +} + +// HasResponseCode returns a boolean if a field has been set. +func (o *OdapMessageActionResponse) HasResponseCode() bool { + if o != nil && !IsNil(o.ResponseCode) { + return true + } + + return false +} + +// SetResponseCode gets a reference to the given string and assigns it to the ResponseCode field. +func (o *OdapMessageActionResponse) SetResponseCode(v string) { + o.ResponseCode = &v +} + +// GetArguments returns the Arguments field value if set, zero value otherwise. +func (o *OdapMessageActionResponse) GetArguments() []interface{} { + if o == nil || IsNil(o.Arguments) { + var ret []interface{} + return ret + } + return o.Arguments +} + +// GetArgumentsOk returns a tuple with the Arguments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OdapMessageActionResponse) GetArgumentsOk() ([]interface{}, bool) { + if o == nil || IsNil(o.Arguments) { + return nil, false + } + return o.Arguments, true +} + +// HasArguments returns a boolean if a field has been set. +func (o *OdapMessageActionResponse) HasArguments() bool { + if o != nil && !IsNil(o.Arguments) { + return true + } + + return false +} + +// SetArguments gets a reference to the given []interface{} and assigns it to the Arguments field. +func (o *OdapMessageActionResponse) SetArguments(v []interface{}) { + o.Arguments = v +} + +func (o OdapMessageActionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OdapMessageActionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ResponseCode) { + toSerialize["ResponseCode"] = o.ResponseCode + } + if !IsNil(o.Arguments) { + toSerialize["Arguments"] = o.Arguments + } + return toSerialize, nil +} + +type NullableOdapMessageActionResponse struct { + value *OdapMessageActionResponse + isSet bool +} + +func (v NullableOdapMessageActionResponse) Get() *OdapMessageActionResponse { + return v.value +} + +func (v *NullableOdapMessageActionResponse) Set(val *OdapMessageActionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableOdapMessageActionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableOdapMessageActionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOdapMessageActionResponse(val *OdapMessageActionResponse) *NullableOdapMessageActionResponse { + return &NullableOdapMessageActionResponse{value: val, isSet: true} +} + +func (v NullableOdapMessageActionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOdapMessageActionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_payload_profile.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_payload_profile.go new file mode 100644 index 00000000000..d6304a92148 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_payload_profile.go @@ -0,0 +1,153 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the PayloadProfile type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PayloadProfile{} + +// PayloadProfile struct for PayloadProfile +type PayloadProfile struct { + AssetProfile AssetProfile `json:"assetProfile"` + Capabilities *string `json:"capabilities,omitempty"` +} + +// NewPayloadProfile instantiates a new PayloadProfile 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 +// will change when the set of required properties is changed +func NewPayloadProfile(assetProfile AssetProfile) *PayloadProfile { + this := PayloadProfile{} + this.AssetProfile = assetProfile + return &this +} + +// NewPayloadProfileWithDefaults instantiates a new PayloadProfile object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPayloadProfileWithDefaults() *PayloadProfile { + this := PayloadProfile{} + return &this +} + +// GetAssetProfile returns the AssetProfile field value +func (o *PayloadProfile) GetAssetProfile() AssetProfile { + if o == nil { + var ret AssetProfile + return ret + } + + return o.AssetProfile +} + +// GetAssetProfileOk returns a tuple with the AssetProfile field value +// and a boolean to check if the value has been set. +func (o *PayloadProfile) GetAssetProfileOk() (*AssetProfile, bool) { + if o == nil { + return nil, false + } + return &o.AssetProfile, true +} + +// SetAssetProfile sets field value +func (o *PayloadProfile) SetAssetProfile(v AssetProfile) { + o.AssetProfile = v +} + +// GetCapabilities returns the Capabilities field value if set, zero value otherwise. +func (o *PayloadProfile) GetCapabilities() string { + if o == nil || IsNil(o.Capabilities) { + var ret string + return ret + } + return *o.Capabilities +} + +// GetCapabilitiesOk returns a tuple with the Capabilities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayloadProfile) GetCapabilitiesOk() (*string, bool) { + if o == nil || IsNil(o.Capabilities) { + return nil, false + } + return o.Capabilities, true +} + +// HasCapabilities returns a boolean if a field has been set. +func (o *PayloadProfile) HasCapabilities() bool { + if o != nil && !IsNil(o.Capabilities) { + return true + } + + return false +} + +// SetCapabilities gets a reference to the given string and assigns it to the Capabilities field. +func (o *PayloadProfile) SetCapabilities(v string) { + o.Capabilities = &v +} + +func (o PayloadProfile) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PayloadProfile) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["assetProfile"] = o.AssetProfile + if !IsNil(o.Capabilities) { + toSerialize["capabilities"] = o.Capabilities + } + return toSerialize, nil +} + +type NullablePayloadProfile struct { + value *PayloadProfile + isSet bool +} + +func (v NullablePayloadProfile) Get() *PayloadProfile { + return v.value +} + +func (v *NullablePayloadProfile) Set(val *PayloadProfile) { + v.value = val + v.isSet = true +} + +func (v NullablePayloadProfile) IsSet() bool { + return v.isSet +} + +func (v *NullablePayloadProfile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePayloadProfile(val *PayloadProfile) *NullablePayloadProfile { + return &NullablePayloadProfile{value: val, isSet: true} +} + +func (v NullablePayloadProfile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePayloadProfile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_success_v1_message.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_success_v1_message.go new file mode 100644 index 00000000000..f7369b839d2 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_success_v1_message.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the RecoverSuccessV1Message type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RecoverSuccessV1Message{} + +// RecoverSuccessV1Message struct for RecoverSuccessV1Message +type RecoverSuccessV1Message struct { + SessionID string `json:"sessionID"` + Success bool `json:"success"` + Signature string `json:"signature"` +} + +// NewRecoverSuccessV1Message instantiates a new RecoverSuccessV1Message 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 +// will change when the set of required properties is changed +func NewRecoverSuccessV1Message(sessionID string, success bool, signature string) *RecoverSuccessV1Message { + this := RecoverSuccessV1Message{} + this.SessionID = sessionID + this.Success = success + this.Signature = signature + return &this +} + +// NewRecoverSuccessV1MessageWithDefaults instantiates a new RecoverSuccessV1Message object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRecoverSuccessV1MessageWithDefaults() *RecoverSuccessV1Message { + this := RecoverSuccessV1Message{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *RecoverSuccessV1Message) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *RecoverSuccessV1Message) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *RecoverSuccessV1Message) SetSessionID(v string) { + o.SessionID = v +} + +// GetSuccess returns the Success field value +func (o *RecoverSuccessV1Message) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *RecoverSuccessV1Message) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *RecoverSuccessV1Message) SetSuccess(v bool) { + o.Success = v +} + +// GetSignature returns the Signature field value +func (o *RecoverSuccessV1Message) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *RecoverSuccessV1Message) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *RecoverSuccessV1Message) SetSignature(v string) { + o.Signature = v +} + +func (o RecoverSuccessV1Message) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RecoverSuccessV1Message) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["success"] = o.Success + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableRecoverSuccessV1Message struct { + value *RecoverSuccessV1Message + isSet bool +} + +func (v NullableRecoverSuccessV1Message) Get() *RecoverSuccessV1Message { + return v.value +} + +func (v *NullableRecoverSuccessV1Message) Set(val *RecoverSuccessV1Message) { + v.value = val + v.isSet = true +} + +func (v NullableRecoverSuccessV1Message) IsSet() bool { + return v.isSet +} + +func (v *NullableRecoverSuccessV1Message) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRecoverSuccessV1Message(val *RecoverSuccessV1Message) *NullableRecoverSuccessV1Message { + return &NullableRecoverSuccessV1Message{value: val, isSet: true} +} + +func (v NullableRecoverSuccessV1Message) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRecoverSuccessV1Message) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_update_ack_v1_message.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_update_ack_v1_message.go new file mode 100644 index 00000000000..fbce34db526 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_update_ack_v1_message.go @@ -0,0 +1,198 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the RecoverUpdateAckV1Message type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RecoverUpdateAckV1Message{} + +// RecoverUpdateAckV1Message struct for RecoverUpdateAckV1Message +type RecoverUpdateAckV1Message struct { + SessionID string `json:"sessionID"` + Success bool `json:"success"` + ChangedEntriesHash []string `json:"changedEntriesHash"` + Signature string `json:"signature"` +} + +// NewRecoverUpdateAckV1Message instantiates a new RecoverUpdateAckV1Message 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 +// will change when the set of required properties is changed +func NewRecoverUpdateAckV1Message(sessionID string, success bool, changedEntriesHash []string, signature string) *RecoverUpdateAckV1Message { + this := RecoverUpdateAckV1Message{} + this.SessionID = sessionID + this.Success = success + this.ChangedEntriesHash = changedEntriesHash + this.Signature = signature + return &this +} + +// NewRecoverUpdateAckV1MessageWithDefaults instantiates a new RecoverUpdateAckV1Message object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRecoverUpdateAckV1MessageWithDefaults() *RecoverUpdateAckV1Message { + this := RecoverUpdateAckV1Message{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *RecoverUpdateAckV1Message) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *RecoverUpdateAckV1Message) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *RecoverUpdateAckV1Message) SetSessionID(v string) { + o.SessionID = v +} + +// GetSuccess returns the Success field value +func (o *RecoverUpdateAckV1Message) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *RecoverUpdateAckV1Message) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *RecoverUpdateAckV1Message) SetSuccess(v bool) { + o.Success = v +} + +// GetChangedEntriesHash returns the ChangedEntriesHash field value +func (o *RecoverUpdateAckV1Message) GetChangedEntriesHash() []string { + if o == nil { + var ret []string + return ret + } + + return o.ChangedEntriesHash +} + +// GetChangedEntriesHashOk returns a tuple with the ChangedEntriesHash field value +// and a boolean to check if the value has been set. +func (o *RecoverUpdateAckV1Message) GetChangedEntriesHashOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ChangedEntriesHash, true +} + +// SetChangedEntriesHash sets field value +func (o *RecoverUpdateAckV1Message) SetChangedEntriesHash(v []string) { + o.ChangedEntriesHash = v +} + +// GetSignature returns the Signature field value +func (o *RecoverUpdateAckV1Message) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *RecoverUpdateAckV1Message) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *RecoverUpdateAckV1Message) SetSignature(v string) { + o.Signature = v +} + +func (o RecoverUpdateAckV1Message) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RecoverUpdateAckV1Message) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["success"] = o.Success + toSerialize["changedEntriesHash"] = o.ChangedEntriesHash + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableRecoverUpdateAckV1Message struct { + value *RecoverUpdateAckV1Message + isSet bool +} + +func (v NullableRecoverUpdateAckV1Message) Get() *RecoverUpdateAckV1Message { + return v.value +} + +func (v *NullableRecoverUpdateAckV1Message) Set(val *RecoverUpdateAckV1Message) { + v.value = val + v.isSet = true +} + +func (v NullableRecoverUpdateAckV1Message) IsSet() bool { + return v.isSet +} + +func (v *NullableRecoverUpdateAckV1Message) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRecoverUpdateAckV1Message(val *RecoverUpdateAckV1Message) *NullableRecoverUpdateAckV1Message { + return &NullableRecoverUpdateAckV1Message{value: val, isSet: true} +} + +func (v NullableRecoverUpdateAckV1Message) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRecoverUpdateAckV1Message) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_update_v1_message.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_update_v1_message.go new file mode 100644 index 00000000000..44bc5ac1966 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_update_v1_message.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the RecoverUpdateV1Message type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RecoverUpdateV1Message{} + +// RecoverUpdateV1Message struct for RecoverUpdateV1Message +type RecoverUpdateV1Message struct { + SessionID string `json:"sessionID"` + RecoveredLogs []OdapLocalLog `json:"recoveredLogs"` + Signature string `json:"signature"` +} + +// NewRecoverUpdateV1Message instantiates a new RecoverUpdateV1Message 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 +// will change when the set of required properties is changed +func NewRecoverUpdateV1Message(sessionID string, recoveredLogs []OdapLocalLog, signature string) *RecoverUpdateV1Message { + this := RecoverUpdateV1Message{} + this.SessionID = sessionID + this.RecoveredLogs = recoveredLogs + this.Signature = signature + return &this +} + +// NewRecoverUpdateV1MessageWithDefaults instantiates a new RecoverUpdateV1Message object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRecoverUpdateV1MessageWithDefaults() *RecoverUpdateV1Message { + this := RecoverUpdateV1Message{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *RecoverUpdateV1Message) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *RecoverUpdateV1Message) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *RecoverUpdateV1Message) SetSessionID(v string) { + o.SessionID = v +} + +// GetRecoveredLogs returns the RecoveredLogs field value +func (o *RecoverUpdateV1Message) GetRecoveredLogs() []OdapLocalLog { + if o == nil { + var ret []OdapLocalLog + return ret + } + + return o.RecoveredLogs +} + +// GetRecoveredLogsOk returns a tuple with the RecoveredLogs field value +// and a boolean to check if the value has been set. +func (o *RecoverUpdateV1Message) GetRecoveredLogsOk() ([]OdapLocalLog, bool) { + if o == nil { + return nil, false + } + return o.RecoveredLogs, true +} + +// SetRecoveredLogs sets field value +func (o *RecoverUpdateV1Message) SetRecoveredLogs(v []OdapLocalLog) { + o.RecoveredLogs = v +} + +// GetSignature returns the Signature field value +func (o *RecoverUpdateV1Message) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *RecoverUpdateV1Message) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *RecoverUpdateV1Message) SetSignature(v string) { + o.Signature = v +} + +func (o RecoverUpdateV1Message) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RecoverUpdateV1Message) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["recoveredLogs"] = o.RecoveredLogs + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableRecoverUpdateV1Message struct { + value *RecoverUpdateV1Message + isSet bool +} + +func (v NullableRecoverUpdateV1Message) Get() *RecoverUpdateV1Message { + return v.value +} + +func (v *NullableRecoverUpdateV1Message) Set(val *RecoverUpdateV1Message) { + v.value = val + v.isSet = true +} + +func (v NullableRecoverUpdateV1Message) IsSet() bool { + return v.isSet +} + +func (v *NullableRecoverUpdateV1Message) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRecoverUpdateV1Message(val *RecoverUpdateV1Message) *NullableRecoverUpdateV1Message { + return &NullableRecoverUpdateV1Message{value: val, isSet: true} +} + +func (v NullableRecoverUpdateV1Message) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRecoverUpdateV1Message) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_v1_message.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_v1_message.go new file mode 100644 index 00000000000..09caa267aa4 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_recover_v1_message.go @@ -0,0 +1,315 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the RecoverV1Message type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RecoverV1Message{} + +// RecoverV1Message struct for RecoverV1Message +type RecoverV1Message struct { + SessionID string `json:"sessionID"` + OdapPhase string `json:"odapPhase"` + SequenceNumber float32 `json:"sequenceNumber"` + LastLogEntryTimestamp string `json:"lastLogEntryTimestamp"` + IsBackup bool `json:"isBackup"` + NewBasePath string `json:"newBasePath"` + NewGatewayPubKey *string `json:"newGatewayPubKey,omitempty"` + Signature string `json:"signature"` +} + +// NewRecoverV1Message instantiates a new RecoverV1Message 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 +// will change when the set of required properties is changed +func NewRecoverV1Message(sessionID string, odapPhase string, sequenceNumber float32, lastLogEntryTimestamp string, isBackup bool, newBasePath string, signature string) *RecoverV1Message { + this := RecoverV1Message{} + this.SessionID = sessionID + this.OdapPhase = odapPhase + this.SequenceNumber = sequenceNumber + this.LastLogEntryTimestamp = lastLogEntryTimestamp + this.IsBackup = isBackup + this.NewBasePath = newBasePath + this.Signature = signature + return &this +} + +// NewRecoverV1MessageWithDefaults instantiates a new RecoverV1Message object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRecoverV1MessageWithDefaults() *RecoverV1Message { + this := RecoverV1Message{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *RecoverV1Message) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *RecoverV1Message) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *RecoverV1Message) SetSessionID(v string) { + o.SessionID = v +} + +// GetOdapPhase returns the OdapPhase field value +func (o *RecoverV1Message) GetOdapPhase() string { + if o == nil { + var ret string + return ret + } + + return o.OdapPhase +} + +// GetOdapPhaseOk returns a tuple with the OdapPhase field value +// and a boolean to check if the value has been set. +func (o *RecoverV1Message) GetOdapPhaseOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OdapPhase, true +} + +// SetOdapPhase sets field value +func (o *RecoverV1Message) SetOdapPhase(v string) { + o.OdapPhase = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *RecoverV1Message) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *RecoverV1Message) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *RecoverV1Message) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +// GetLastLogEntryTimestamp returns the LastLogEntryTimestamp field value +func (o *RecoverV1Message) GetLastLogEntryTimestamp() string { + if o == nil { + var ret string + return ret + } + + return o.LastLogEntryTimestamp +} + +// GetLastLogEntryTimestampOk returns a tuple with the LastLogEntryTimestamp field value +// and a boolean to check if the value has been set. +func (o *RecoverV1Message) GetLastLogEntryTimestampOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LastLogEntryTimestamp, true +} + +// SetLastLogEntryTimestamp sets field value +func (o *RecoverV1Message) SetLastLogEntryTimestamp(v string) { + o.LastLogEntryTimestamp = v +} + +// GetIsBackup returns the IsBackup field value +func (o *RecoverV1Message) GetIsBackup() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsBackup +} + +// GetIsBackupOk returns a tuple with the IsBackup field value +// and a boolean to check if the value has been set. +func (o *RecoverV1Message) GetIsBackupOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsBackup, true +} + +// SetIsBackup sets field value +func (o *RecoverV1Message) SetIsBackup(v bool) { + o.IsBackup = v +} + +// GetNewBasePath returns the NewBasePath field value +func (o *RecoverV1Message) GetNewBasePath() string { + if o == nil { + var ret string + return ret + } + + return o.NewBasePath +} + +// GetNewBasePathOk returns a tuple with the NewBasePath field value +// and a boolean to check if the value has been set. +func (o *RecoverV1Message) GetNewBasePathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NewBasePath, true +} + +// SetNewBasePath sets field value +func (o *RecoverV1Message) SetNewBasePath(v string) { + o.NewBasePath = v +} + +// GetNewGatewayPubKey returns the NewGatewayPubKey field value if set, zero value otherwise. +func (o *RecoverV1Message) GetNewGatewayPubKey() string { + if o == nil || IsNil(o.NewGatewayPubKey) { + var ret string + return ret + } + return *o.NewGatewayPubKey +} + +// GetNewGatewayPubKeyOk returns a tuple with the NewGatewayPubKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RecoverV1Message) GetNewGatewayPubKeyOk() (*string, bool) { + if o == nil || IsNil(o.NewGatewayPubKey) { + return nil, false + } + return o.NewGatewayPubKey, true +} + +// HasNewGatewayPubKey returns a boolean if a field has been set. +func (o *RecoverV1Message) HasNewGatewayPubKey() bool { + if o != nil && !IsNil(o.NewGatewayPubKey) { + return true + } + + return false +} + +// SetNewGatewayPubKey gets a reference to the given string and assigns it to the NewGatewayPubKey field. +func (o *RecoverV1Message) SetNewGatewayPubKey(v string) { + o.NewGatewayPubKey = &v +} + +// GetSignature returns the Signature field value +func (o *RecoverV1Message) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *RecoverV1Message) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *RecoverV1Message) SetSignature(v string) { + o.Signature = v +} + +func (o RecoverV1Message) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RecoverV1Message) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["odapPhase"] = o.OdapPhase + toSerialize["sequenceNumber"] = o.SequenceNumber + toSerialize["lastLogEntryTimestamp"] = o.LastLogEntryTimestamp + toSerialize["isBackup"] = o.IsBackup + toSerialize["newBasePath"] = o.NewBasePath + if !IsNil(o.NewGatewayPubKey) { + toSerialize["newGatewayPubKey"] = o.NewGatewayPubKey + } + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableRecoverV1Message struct { + value *RecoverV1Message + isSet bool +} + +func (v NullableRecoverV1Message) Get() *RecoverV1Message { + return v.value +} + +func (v *NullableRecoverV1Message) Set(val *RecoverV1Message) { + v.value = val + v.isSet = true +} + +func (v NullableRecoverV1Message) IsSet() bool { + return v.isSet +} + +func (v *NullableRecoverV1Message) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRecoverV1Message(val *RecoverV1Message) *NullableRecoverV1Message { + return &NullableRecoverV1Message{value: val, isSet: true} +} + +func (v NullableRecoverV1Message) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRecoverV1Message) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_rollback_ack_v1_message.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_rollback_ack_v1_message.go new file mode 100644 index 00000000000..023dd96b6eb --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_rollback_ack_v1_message.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the RollbackAckV1Message type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RollbackAckV1Message{} + +// RollbackAckV1Message struct for RollbackAckV1Message +type RollbackAckV1Message struct { + SessionID string `json:"sessionID"` + Success bool `json:"success"` + Signature string `json:"signature"` +} + +// NewRollbackAckV1Message instantiates a new RollbackAckV1Message 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 +// will change when the set of required properties is changed +func NewRollbackAckV1Message(sessionID string, success bool, signature string) *RollbackAckV1Message { + this := RollbackAckV1Message{} + this.SessionID = sessionID + this.Success = success + this.Signature = signature + return &this +} + +// NewRollbackAckV1MessageWithDefaults instantiates a new RollbackAckV1Message object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRollbackAckV1MessageWithDefaults() *RollbackAckV1Message { + this := RollbackAckV1Message{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *RollbackAckV1Message) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *RollbackAckV1Message) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *RollbackAckV1Message) SetSessionID(v string) { + o.SessionID = v +} + +// GetSuccess returns the Success field value +func (o *RollbackAckV1Message) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *RollbackAckV1Message) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *RollbackAckV1Message) SetSuccess(v bool) { + o.Success = v +} + +// GetSignature returns the Signature field value +func (o *RollbackAckV1Message) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *RollbackAckV1Message) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *RollbackAckV1Message) SetSignature(v string) { + o.Signature = v +} + +func (o RollbackAckV1Message) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RollbackAckV1Message) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["success"] = o.Success + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableRollbackAckV1Message struct { + value *RollbackAckV1Message + isSet bool +} + +func (v NullableRollbackAckV1Message) Get() *RollbackAckV1Message { + return v.value +} + +func (v *NullableRollbackAckV1Message) Set(val *RollbackAckV1Message) { + v.value = val + v.isSet = true +} + +func (v NullableRollbackAckV1Message) IsSet() bool { + return v.isSet +} + +func (v *NullableRollbackAckV1Message) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRollbackAckV1Message(val *RollbackAckV1Message) *NullableRollbackAckV1Message { + return &NullableRollbackAckV1Message{value: val, isSet: true} +} + +func (v NullableRollbackAckV1Message) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRollbackAckV1Message) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_rollback_v1_message.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_rollback_v1_message.go new file mode 100644 index 00000000000..1187067463e --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_rollback_v1_message.go @@ -0,0 +1,225 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the RollbackV1Message type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RollbackV1Message{} + +// RollbackV1Message struct for RollbackV1Message +type RollbackV1Message struct { + SessionID string `json:"sessionID"` + Success bool `json:"success"` + ActionPerformed []string `json:"actionPerformed"` + Proofs []string `json:"proofs"` + Signature string `json:"signature"` +} + +// NewRollbackV1Message instantiates a new RollbackV1Message 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 +// will change when the set of required properties is changed +func NewRollbackV1Message(sessionID string, success bool, actionPerformed []string, proofs []string, signature string) *RollbackV1Message { + this := RollbackV1Message{} + this.SessionID = sessionID + this.Success = success + this.ActionPerformed = actionPerformed + this.Proofs = proofs + this.Signature = signature + return &this +} + +// NewRollbackV1MessageWithDefaults instantiates a new RollbackV1Message object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRollbackV1MessageWithDefaults() *RollbackV1Message { + this := RollbackV1Message{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *RollbackV1Message) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *RollbackV1Message) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *RollbackV1Message) SetSessionID(v string) { + o.SessionID = v +} + +// GetSuccess returns the Success field value +func (o *RollbackV1Message) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *RollbackV1Message) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *RollbackV1Message) SetSuccess(v bool) { + o.Success = v +} + +// GetActionPerformed returns the ActionPerformed field value +func (o *RollbackV1Message) GetActionPerformed() []string { + if o == nil { + var ret []string + return ret + } + + return o.ActionPerformed +} + +// GetActionPerformedOk returns a tuple with the ActionPerformed field value +// and a boolean to check if the value has been set. +func (o *RollbackV1Message) GetActionPerformedOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ActionPerformed, true +} + +// SetActionPerformed sets field value +func (o *RollbackV1Message) SetActionPerformed(v []string) { + o.ActionPerformed = v +} + +// GetProofs returns the Proofs field value +func (o *RollbackV1Message) GetProofs() []string { + if o == nil { + var ret []string + return ret + } + + return o.Proofs +} + +// GetProofsOk returns a tuple with the Proofs field value +// and a boolean to check if the value has been set. +func (o *RollbackV1Message) GetProofsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Proofs, true +} + +// SetProofs sets field value +func (o *RollbackV1Message) SetProofs(v []string) { + o.Proofs = v +} + +// GetSignature returns the Signature field value +func (o *RollbackV1Message) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *RollbackV1Message) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *RollbackV1Message) SetSignature(v string) { + o.Signature = v +} + +func (o RollbackV1Message) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RollbackV1Message) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["success"] = o.Success + toSerialize["actionPerformed"] = o.ActionPerformed + toSerialize["proofs"] = o.Proofs + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableRollbackV1Message struct { + value *RollbackV1Message + isSet bool +} + +func (v NullableRollbackV1Message) Get() *RollbackV1Message { + return v.value +} + +func (v *NullableRollbackV1Message) Set(val *RollbackV1Message) { + v.value = val + v.isSet = true +} + +func (v NullableRollbackV1Message) IsSet() bool { + return v.isSet +} + +func (v *NullableRollbackV1Message) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRollbackV1Message(val *RollbackV1Message) *NullableRollbackV1Message { + return &NullableRollbackV1Message{value: val, isSet: true} +} + +func (v NullableRollbackV1Message) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRollbackV1Message) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_session_data.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_session_data.go new file mode 100644 index 00000000000..33655779f66 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_session_data.go @@ -0,0 +1,2286 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the SessionData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SessionData{} + +// SessionData struct for SessionData +type SessionData struct { + Id *string `json:"id,omitempty"` + Step *float32 `json:"step,omitempty"` + Version *string `json:"version,omitempty"` + LastSequenceNumber *float32 `json:"lastSequenceNumber,omitempty"` + LoggingProfile *string `json:"loggingProfile,omitempty"` + AccessControlProfile *string `json:"accessControlProfile,omitempty"` + ApplicationProfile *string `json:"applicationProfile,omitempty"` + PayloadProfile *PayloadProfile `json:"payloadProfile,omitempty"` + AssetProfile *AssetProfile `json:"assetProfile,omitempty"` + AllowedSourceBackupGateways []string `json:"allowedSourceBackupGateways,omitempty"` + AllowedRecipientBackupGateways []string `json:"allowedRecipientBackupGateways,omitempty"` + SourceBasePath *string `json:"sourceBasePath,omitempty"` + RecipientBasePath *string `json:"recipientBasePath,omitempty"` + OriginatorPubkey *string `json:"originatorPubkey,omitempty"` + BeneficiaryPubkey *string `json:"beneficiaryPubkey,omitempty"` + SourceGatewayPubkey *string `json:"sourceGatewayPubkey,omitempty"` + SourceGatewayDltSystem *string `json:"sourceGatewayDltSystem,omitempty"` + RecipientGatewayPubkey *string `json:"recipientGatewayPubkey,omitempty"` + RecipientGatewayDltSystem *string `json:"recipientGatewayDltSystem,omitempty"` + InitializationRequestMessageHash *string `json:"initializationRequestMessageHash,omitempty"` + InitializationResponseMessageHash *string `json:"initializationResponseMessageHash,omitempty"` + InitializationRequestMessageRcvTimeStamp *string `json:"initializationRequestMessageRcvTimeStamp,omitempty"` + InitializationRequestMessageProcessedTimeStamp *string `json:"initializationRequestMessageProcessedTimeStamp,omitempty"` + ClientSignatureInitializationRequestMessage *string `json:"clientSignatureInitializationRequestMessage,omitempty"` + ServerSignatureInitializationResponseMessage *string `json:"serverSignatureInitializationResponseMessage,omitempty"` + TransferCommenceMessageRequestHash *string `json:"transferCommenceMessageRequestHash,omitempty"` + TransferCommenceMessageResponseHash *string `json:"transferCommenceMessageResponseHash,omitempty"` + ClientSignatureTransferCommenceRequestMessage *string `json:"clientSignatureTransferCommenceRequestMessage,omitempty"` + ServerSignatureTransferCommenceResponseMessage *string `json:"serverSignatureTransferCommenceResponseMessage,omitempty"` + LockEvidenceRequestMessageHash *string `json:"lockEvidenceRequestMessageHash,omitempty"` + LockEvidenceResponseMessageHash *string `json:"lockEvidenceResponseMessageHash,omitempty"` + ClientSignatureLockEvidenceRequestMessage *string `json:"clientSignatureLockEvidenceRequestMessage,omitempty"` + ServerSignatureLockEvidenceResponseMessage *string `json:"serverSignatureLockEvidenceResponseMessage,omitempty"` + LockEvidenceClaim *string `json:"lockEvidenceClaim,omitempty"` + CommitPrepareRequestMessageHash *string `json:"commitPrepareRequestMessageHash,omitempty"` + CommitPrepareResponseMessageHash *string `json:"commitPrepareResponseMessageHash,omitempty"` + ClientSignatureCommitPreparationRequestMessage *string `json:"clientSignatureCommitPreparationRequestMessage,omitempty"` + ServerSignatureCommitPreparationResponseMessage *string `json:"serverSignatureCommitPreparationResponseMessage,omitempty"` + CommitFinalRequestMessageHash *string `json:"commitFinalRequestMessageHash,omitempty"` + CommitFinalResponseMessageHash *string `json:"commitFinalResponseMessageHash,omitempty"` + CommitFinalClaim *string `json:"commitFinalClaim,omitempty"` + CommitFinalClaimFormat *string `json:"commitFinalClaimFormat,omitempty"` + CommitAcknowledgementClaim *string `json:"commitAcknowledgementClaim,omitempty"` + CommitAcknowledgementClaimFormat *string `json:"commitAcknowledgementClaimFormat,omitempty"` + ClientSignatureCommitFinalRequestMessage *string `json:"clientSignatureCommitFinalRequestMessage,omitempty"` + ServerSignatureCommitFinalResponseMessage *string `json:"serverSignatureCommitFinalResponseMessage,omitempty"` + TransferCompleteMessageHash *string `json:"transferCompleteMessageHash,omitempty"` + ClientSignatureTransferCompleteMessage *string `json:"clientSignatureTransferCompleteMessage,omitempty"` + MaxRetries *float32 `json:"maxRetries,omitempty"` + RecipientLedgerAssetID *string `json:"recipientLedgerAssetID,omitempty"` + SourceLedgerAssetID *string `json:"sourceLedgerAssetID,omitempty"` + MaxTimeout *float32 `json:"maxTimeout,omitempty"` + LastLogEntryTimestamp *string `json:"lastLogEntryTimestamp,omitempty"` + UnlockAssetClaim *string `json:"unlockAssetClaim,omitempty"` + RecreateAssetClaim *string `json:"recreateAssetClaim,omitempty"` + DeleteAssetClaim *string `json:"deleteAssetClaim,omitempty"` + LastMessageReceivedTimestamp *string `json:"lastMessageReceivedTimestamp,omitempty"` + Rollback *bool `json:"rollback,omitempty"` + RollbackMessageHash *string `json:"rollbackMessageHash,omitempty"` + RollbackProofs []string `json:"rollbackProofs,omitempty"` + RollbackActionsPerformed []string `json:"rollbackActionsPerformed,omitempty"` +} + +// NewSessionData instantiates a new SessionData 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 +// will change when the set of required properties is changed +func NewSessionData() *SessionData { + this := SessionData{} + return &this +} + +// NewSessionDataWithDefaults instantiates a new SessionData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSessionDataWithDefaults() *SessionData { + this := SessionData{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SessionData) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SessionData) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SessionData) SetId(v string) { + o.Id = &v +} + +// GetStep returns the Step field value if set, zero value otherwise. +func (o *SessionData) GetStep() float32 { + if o == nil || IsNil(o.Step) { + var ret float32 + return ret + } + return *o.Step +} + +// GetStepOk returns a tuple with the Step field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetStepOk() (*float32, bool) { + if o == nil || IsNil(o.Step) { + return nil, false + } + return o.Step, true +} + +// HasStep returns a boolean if a field has been set. +func (o *SessionData) HasStep() bool { + if o != nil && !IsNil(o.Step) { + return true + } + + return false +} + +// SetStep gets a reference to the given float32 and assigns it to the Step field. +func (o *SessionData) SetStep(v float32) { + o.Step = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *SessionData) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *SessionData) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *SessionData) SetVersion(v string) { + o.Version = &v +} + +// GetLastSequenceNumber returns the LastSequenceNumber field value if set, zero value otherwise. +func (o *SessionData) GetLastSequenceNumber() float32 { + if o == nil || IsNil(o.LastSequenceNumber) { + var ret float32 + return ret + } + return *o.LastSequenceNumber +} + +// GetLastSequenceNumberOk returns a tuple with the LastSequenceNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetLastSequenceNumberOk() (*float32, bool) { + if o == nil || IsNil(o.LastSequenceNumber) { + return nil, false + } + return o.LastSequenceNumber, true +} + +// HasLastSequenceNumber returns a boolean if a field has been set. +func (o *SessionData) HasLastSequenceNumber() bool { + if o != nil && !IsNil(o.LastSequenceNumber) { + return true + } + + return false +} + +// SetLastSequenceNumber gets a reference to the given float32 and assigns it to the LastSequenceNumber field. +func (o *SessionData) SetLastSequenceNumber(v float32) { + o.LastSequenceNumber = &v +} + +// GetLoggingProfile returns the LoggingProfile field value if set, zero value otherwise. +func (o *SessionData) GetLoggingProfile() string { + if o == nil || IsNil(o.LoggingProfile) { + var ret string + return ret + } + return *o.LoggingProfile +} + +// GetLoggingProfileOk returns a tuple with the LoggingProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetLoggingProfileOk() (*string, bool) { + if o == nil || IsNil(o.LoggingProfile) { + return nil, false + } + return o.LoggingProfile, true +} + +// HasLoggingProfile returns a boolean if a field has been set. +func (o *SessionData) HasLoggingProfile() bool { + if o != nil && !IsNil(o.LoggingProfile) { + return true + } + + return false +} + +// SetLoggingProfile gets a reference to the given string and assigns it to the LoggingProfile field. +func (o *SessionData) SetLoggingProfile(v string) { + o.LoggingProfile = &v +} + +// GetAccessControlProfile returns the AccessControlProfile field value if set, zero value otherwise. +func (o *SessionData) GetAccessControlProfile() string { + if o == nil || IsNil(o.AccessControlProfile) { + var ret string + return ret + } + return *o.AccessControlProfile +} + +// GetAccessControlProfileOk returns a tuple with the AccessControlProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetAccessControlProfileOk() (*string, bool) { + if o == nil || IsNil(o.AccessControlProfile) { + return nil, false + } + return o.AccessControlProfile, true +} + +// HasAccessControlProfile returns a boolean if a field has been set. +func (o *SessionData) HasAccessControlProfile() bool { + if o != nil && !IsNil(o.AccessControlProfile) { + return true + } + + return false +} + +// SetAccessControlProfile gets a reference to the given string and assigns it to the AccessControlProfile field. +func (o *SessionData) SetAccessControlProfile(v string) { + o.AccessControlProfile = &v +} + +// GetApplicationProfile returns the ApplicationProfile field value if set, zero value otherwise. +func (o *SessionData) GetApplicationProfile() string { + if o == nil || IsNil(o.ApplicationProfile) { + var ret string + return ret + } + return *o.ApplicationProfile +} + +// GetApplicationProfileOk returns a tuple with the ApplicationProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetApplicationProfileOk() (*string, bool) { + if o == nil || IsNil(o.ApplicationProfile) { + return nil, false + } + return o.ApplicationProfile, true +} + +// HasApplicationProfile returns a boolean if a field has been set. +func (o *SessionData) HasApplicationProfile() bool { + if o != nil && !IsNil(o.ApplicationProfile) { + return true + } + + return false +} + +// SetApplicationProfile gets a reference to the given string and assigns it to the ApplicationProfile field. +func (o *SessionData) SetApplicationProfile(v string) { + o.ApplicationProfile = &v +} + +// GetPayloadProfile returns the PayloadProfile field value if set, zero value otherwise. +func (o *SessionData) GetPayloadProfile() PayloadProfile { + if o == nil || IsNil(o.PayloadProfile) { + var ret PayloadProfile + return ret + } + return *o.PayloadProfile +} + +// GetPayloadProfileOk returns a tuple with the PayloadProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetPayloadProfileOk() (*PayloadProfile, bool) { + if o == nil || IsNil(o.PayloadProfile) { + return nil, false + } + return o.PayloadProfile, true +} + +// HasPayloadProfile returns a boolean if a field has been set. +func (o *SessionData) HasPayloadProfile() bool { + if o != nil && !IsNil(o.PayloadProfile) { + return true + } + + return false +} + +// SetPayloadProfile gets a reference to the given PayloadProfile and assigns it to the PayloadProfile field. +func (o *SessionData) SetPayloadProfile(v PayloadProfile) { + o.PayloadProfile = &v +} + +// GetAssetProfile returns the AssetProfile field value if set, zero value otherwise. +func (o *SessionData) GetAssetProfile() AssetProfile { + if o == nil || IsNil(o.AssetProfile) { + var ret AssetProfile + return ret + } + return *o.AssetProfile +} + +// GetAssetProfileOk returns a tuple with the AssetProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetAssetProfileOk() (*AssetProfile, bool) { + if o == nil || IsNil(o.AssetProfile) { + return nil, false + } + return o.AssetProfile, true +} + +// HasAssetProfile returns a boolean if a field has been set. +func (o *SessionData) HasAssetProfile() bool { + if o != nil && !IsNil(o.AssetProfile) { + return true + } + + return false +} + +// SetAssetProfile gets a reference to the given AssetProfile and assigns it to the AssetProfile field. +func (o *SessionData) SetAssetProfile(v AssetProfile) { + o.AssetProfile = &v +} + +// GetAllowedSourceBackupGateways returns the AllowedSourceBackupGateways field value if set, zero value otherwise. +func (o *SessionData) GetAllowedSourceBackupGateways() []string { + if o == nil || IsNil(o.AllowedSourceBackupGateways) { + var ret []string + return ret + } + return o.AllowedSourceBackupGateways +} + +// GetAllowedSourceBackupGatewaysOk returns a tuple with the AllowedSourceBackupGateways field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetAllowedSourceBackupGatewaysOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedSourceBackupGateways) { + return nil, false + } + return o.AllowedSourceBackupGateways, true +} + +// HasAllowedSourceBackupGateways returns a boolean if a field has been set. +func (o *SessionData) HasAllowedSourceBackupGateways() bool { + if o != nil && !IsNil(o.AllowedSourceBackupGateways) { + return true + } + + return false +} + +// SetAllowedSourceBackupGateways gets a reference to the given []string and assigns it to the AllowedSourceBackupGateways field. +func (o *SessionData) SetAllowedSourceBackupGateways(v []string) { + o.AllowedSourceBackupGateways = v +} + +// GetAllowedRecipientBackupGateways returns the AllowedRecipientBackupGateways field value if set, zero value otherwise. +func (o *SessionData) GetAllowedRecipientBackupGateways() []string { + if o == nil || IsNil(o.AllowedRecipientBackupGateways) { + var ret []string + return ret + } + return o.AllowedRecipientBackupGateways +} + +// GetAllowedRecipientBackupGatewaysOk returns a tuple with the AllowedRecipientBackupGateways field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetAllowedRecipientBackupGatewaysOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedRecipientBackupGateways) { + return nil, false + } + return o.AllowedRecipientBackupGateways, true +} + +// HasAllowedRecipientBackupGateways returns a boolean if a field has been set. +func (o *SessionData) HasAllowedRecipientBackupGateways() bool { + if o != nil && !IsNil(o.AllowedRecipientBackupGateways) { + return true + } + + return false +} + +// SetAllowedRecipientBackupGateways gets a reference to the given []string and assigns it to the AllowedRecipientBackupGateways field. +func (o *SessionData) SetAllowedRecipientBackupGateways(v []string) { + o.AllowedRecipientBackupGateways = v +} + +// GetSourceBasePath returns the SourceBasePath field value if set, zero value otherwise. +func (o *SessionData) GetSourceBasePath() string { + if o == nil || IsNil(o.SourceBasePath) { + var ret string + return ret + } + return *o.SourceBasePath +} + +// GetSourceBasePathOk returns a tuple with the SourceBasePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetSourceBasePathOk() (*string, bool) { + if o == nil || IsNil(o.SourceBasePath) { + return nil, false + } + return o.SourceBasePath, true +} + +// HasSourceBasePath returns a boolean if a field has been set. +func (o *SessionData) HasSourceBasePath() bool { + if o != nil && !IsNil(o.SourceBasePath) { + return true + } + + return false +} + +// SetSourceBasePath gets a reference to the given string and assigns it to the SourceBasePath field. +func (o *SessionData) SetSourceBasePath(v string) { + o.SourceBasePath = &v +} + +// GetRecipientBasePath returns the RecipientBasePath field value if set, zero value otherwise. +func (o *SessionData) GetRecipientBasePath() string { + if o == nil || IsNil(o.RecipientBasePath) { + var ret string + return ret + } + return *o.RecipientBasePath +} + +// GetRecipientBasePathOk returns a tuple with the RecipientBasePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRecipientBasePathOk() (*string, bool) { + if o == nil || IsNil(o.RecipientBasePath) { + return nil, false + } + return o.RecipientBasePath, true +} + +// HasRecipientBasePath returns a boolean if a field has been set. +func (o *SessionData) HasRecipientBasePath() bool { + if o != nil && !IsNil(o.RecipientBasePath) { + return true + } + + return false +} + +// SetRecipientBasePath gets a reference to the given string and assigns it to the RecipientBasePath field. +func (o *SessionData) SetRecipientBasePath(v string) { + o.RecipientBasePath = &v +} + +// GetOriginatorPubkey returns the OriginatorPubkey field value if set, zero value otherwise. +func (o *SessionData) GetOriginatorPubkey() string { + if o == nil || IsNil(o.OriginatorPubkey) { + var ret string + return ret + } + return *o.OriginatorPubkey +} + +// GetOriginatorPubkeyOk returns a tuple with the OriginatorPubkey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetOriginatorPubkeyOk() (*string, bool) { + if o == nil || IsNil(o.OriginatorPubkey) { + return nil, false + } + return o.OriginatorPubkey, true +} + +// HasOriginatorPubkey returns a boolean if a field has been set. +func (o *SessionData) HasOriginatorPubkey() bool { + if o != nil && !IsNil(o.OriginatorPubkey) { + return true + } + + return false +} + +// SetOriginatorPubkey gets a reference to the given string and assigns it to the OriginatorPubkey field. +func (o *SessionData) SetOriginatorPubkey(v string) { + o.OriginatorPubkey = &v +} + +// GetBeneficiaryPubkey returns the BeneficiaryPubkey field value if set, zero value otherwise. +func (o *SessionData) GetBeneficiaryPubkey() string { + if o == nil || IsNil(o.BeneficiaryPubkey) { + var ret string + return ret + } + return *o.BeneficiaryPubkey +} + +// GetBeneficiaryPubkeyOk returns a tuple with the BeneficiaryPubkey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetBeneficiaryPubkeyOk() (*string, bool) { + if o == nil || IsNil(o.BeneficiaryPubkey) { + return nil, false + } + return o.BeneficiaryPubkey, true +} + +// HasBeneficiaryPubkey returns a boolean if a field has been set. +func (o *SessionData) HasBeneficiaryPubkey() bool { + if o != nil && !IsNil(o.BeneficiaryPubkey) { + return true + } + + return false +} + +// SetBeneficiaryPubkey gets a reference to the given string and assigns it to the BeneficiaryPubkey field. +func (o *SessionData) SetBeneficiaryPubkey(v string) { + o.BeneficiaryPubkey = &v +} + +// GetSourceGatewayPubkey returns the SourceGatewayPubkey field value if set, zero value otherwise. +func (o *SessionData) GetSourceGatewayPubkey() string { + if o == nil || IsNil(o.SourceGatewayPubkey) { + var ret string + return ret + } + return *o.SourceGatewayPubkey +} + +// GetSourceGatewayPubkeyOk returns a tuple with the SourceGatewayPubkey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetSourceGatewayPubkeyOk() (*string, bool) { + if o == nil || IsNil(o.SourceGatewayPubkey) { + return nil, false + } + return o.SourceGatewayPubkey, true +} + +// HasSourceGatewayPubkey returns a boolean if a field has been set. +func (o *SessionData) HasSourceGatewayPubkey() bool { + if o != nil && !IsNil(o.SourceGatewayPubkey) { + return true + } + + return false +} + +// SetSourceGatewayPubkey gets a reference to the given string and assigns it to the SourceGatewayPubkey field. +func (o *SessionData) SetSourceGatewayPubkey(v string) { + o.SourceGatewayPubkey = &v +} + +// GetSourceGatewayDltSystem returns the SourceGatewayDltSystem field value if set, zero value otherwise. +func (o *SessionData) GetSourceGatewayDltSystem() string { + if o == nil || IsNil(o.SourceGatewayDltSystem) { + var ret string + return ret + } + return *o.SourceGatewayDltSystem +} + +// GetSourceGatewayDltSystemOk returns a tuple with the SourceGatewayDltSystem field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetSourceGatewayDltSystemOk() (*string, bool) { + if o == nil || IsNil(o.SourceGatewayDltSystem) { + return nil, false + } + return o.SourceGatewayDltSystem, true +} + +// HasSourceGatewayDltSystem returns a boolean if a field has been set. +func (o *SessionData) HasSourceGatewayDltSystem() bool { + if o != nil && !IsNil(o.SourceGatewayDltSystem) { + return true + } + + return false +} + +// SetSourceGatewayDltSystem gets a reference to the given string and assigns it to the SourceGatewayDltSystem field. +func (o *SessionData) SetSourceGatewayDltSystem(v string) { + o.SourceGatewayDltSystem = &v +} + +// GetRecipientGatewayPubkey returns the RecipientGatewayPubkey field value if set, zero value otherwise. +func (o *SessionData) GetRecipientGatewayPubkey() string { + if o == nil || IsNil(o.RecipientGatewayPubkey) { + var ret string + return ret + } + return *o.RecipientGatewayPubkey +} + +// GetRecipientGatewayPubkeyOk returns a tuple with the RecipientGatewayPubkey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRecipientGatewayPubkeyOk() (*string, bool) { + if o == nil || IsNil(o.RecipientGatewayPubkey) { + return nil, false + } + return o.RecipientGatewayPubkey, true +} + +// HasRecipientGatewayPubkey returns a boolean if a field has been set. +func (o *SessionData) HasRecipientGatewayPubkey() bool { + if o != nil && !IsNil(o.RecipientGatewayPubkey) { + return true + } + + return false +} + +// SetRecipientGatewayPubkey gets a reference to the given string and assigns it to the RecipientGatewayPubkey field. +func (o *SessionData) SetRecipientGatewayPubkey(v string) { + o.RecipientGatewayPubkey = &v +} + +// GetRecipientGatewayDltSystem returns the RecipientGatewayDltSystem field value if set, zero value otherwise. +func (o *SessionData) GetRecipientGatewayDltSystem() string { + if o == nil || IsNil(o.RecipientGatewayDltSystem) { + var ret string + return ret + } + return *o.RecipientGatewayDltSystem +} + +// GetRecipientGatewayDltSystemOk returns a tuple with the RecipientGatewayDltSystem field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRecipientGatewayDltSystemOk() (*string, bool) { + if o == nil || IsNil(o.RecipientGatewayDltSystem) { + return nil, false + } + return o.RecipientGatewayDltSystem, true +} + +// HasRecipientGatewayDltSystem returns a boolean if a field has been set. +func (o *SessionData) HasRecipientGatewayDltSystem() bool { + if o != nil && !IsNil(o.RecipientGatewayDltSystem) { + return true + } + + return false +} + +// SetRecipientGatewayDltSystem gets a reference to the given string and assigns it to the RecipientGatewayDltSystem field. +func (o *SessionData) SetRecipientGatewayDltSystem(v string) { + o.RecipientGatewayDltSystem = &v +} + +// GetInitializationRequestMessageHash returns the InitializationRequestMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetInitializationRequestMessageHash() string { + if o == nil || IsNil(o.InitializationRequestMessageHash) { + var ret string + return ret + } + return *o.InitializationRequestMessageHash +} + +// GetInitializationRequestMessageHashOk returns a tuple with the InitializationRequestMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetInitializationRequestMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.InitializationRequestMessageHash) { + return nil, false + } + return o.InitializationRequestMessageHash, true +} + +// HasInitializationRequestMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasInitializationRequestMessageHash() bool { + if o != nil && !IsNil(o.InitializationRequestMessageHash) { + return true + } + + return false +} + +// SetInitializationRequestMessageHash gets a reference to the given string and assigns it to the InitializationRequestMessageHash field. +func (o *SessionData) SetInitializationRequestMessageHash(v string) { + o.InitializationRequestMessageHash = &v +} + +// GetInitializationResponseMessageHash returns the InitializationResponseMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetInitializationResponseMessageHash() string { + if o == nil || IsNil(o.InitializationResponseMessageHash) { + var ret string + return ret + } + return *o.InitializationResponseMessageHash +} + +// GetInitializationResponseMessageHashOk returns a tuple with the InitializationResponseMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetInitializationResponseMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.InitializationResponseMessageHash) { + return nil, false + } + return o.InitializationResponseMessageHash, true +} + +// HasInitializationResponseMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasInitializationResponseMessageHash() bool { + if o != nil && !IsNil(o.InitializationResponseMessageHash) { + return true + } + + return false +} + +// SetInitializationResponseMessageHash gets a reference to the given string and assigns it to the InitializationResponseMessageHash field. +func (o *SessionData) SetInitializationResponseMessageHash(v string) { + o.InitializationResponseMessageHash = &v +} + +// GetInitializationRequestMessageRcvTimeStamp returns the InitializationRequestMessageRcvTimeStamp field value if set, zero value otherwise. +func (o *SessionData) GetInitializationRequestMessageRcvTimeStamp() string { + if o == nil || IsNil(o.InitializationRequestMessageRcvTimeStamp) { + var ret string + return ret + } + return *o.InitializationRequestMessageRcvTimeStamp +} + +// GetInitializationRequestMessageRcvTimeStampOk returns a tuple with the InitializationRequestMessageRcvTimeStamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetInitializationRequestMessageRcvTimeStampOk() (*string, bool) { + if o == nil || IsNil(o.InitializationRequestMessageRcvTimeStamp) { + return nil, false + } + return o.InitializationRequestMessageRcvTimeStamp, true +} + +// HasInitializationRequestMessageRcvTimeStamp returns a boolean if a field has been set. +func (o *SessionData) HasInitializationRequestMessageRcvTimeStamp() bool { + if o != nil && !IsNil(o.InitializationRequestMessageRcvTimeStamp) { + return true + } + + return false +} + +// SetInitializationRequestMessageRcvTimeStamp gets a reference to the given string and assigns it to the InitializationRequestMessageRcvTimeStamp field. +func (o *SessionData) SetInitializationRequestMessageRcvTimeStamp(v string) { + o.InitializationRequestMessageRcvTimeStamp = &v +} + +// GetInitializationRequestMessageProcessedTimeStamp returns the InitializationRequestMessageProcessedTimeStamp field value if set, zero value otherwise. +func (o *SessionData) GetInitializationRequestMessageProcessedTimeStamp() string { + if o == nil || IsNil(o.InitializationRequestMessageProcessedTimeStamp) { + var ret string + return ret + } + return *o.InitializationRequestMessageProcessedTimeStamp +} + +// GetInitializationRequestMessageProcessedTimeStampOk returns a tuple with the InitializationRequestMessageProcessedTimeStamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetInitializationRequestMessageProcessedTimeStampOk() (*string, bool) { + if o == nil || IsNil(o.InitializationRequestMessageProcessedTimeStamp) { + return nil, false + } + return o.InitializationRequestMessageProcessedTimeStamp, true +} + +// HasInitializationRequestMessageProcessedTimeStamp returns a boolean if a field has been set. +func (o *SessionData) HasInitializationRequestMessageProcessedTimeStamp() bool { + if o != nil && !IsNil(o.InitializationRequestMessageProcessedTimeStamp) { + return true + } + + return false +} + +// SetInitializationRequestMessageProcessedTimeStamp gets a reference to the given string and assigns it to the InitializationRequestMessageProcessedTimeStamp field. +func (o *SessionData) SetInitializationRequestMessageProcessedTimeStamp(v string) { + o.InitializationRequestMessageProcessedTimeStamp = &v +} + +// GetClientSignatureInitializationRequestMessage returns the ClientSignatureInitializationRequestMessage field value if set, zero value otherwise. +func (o *SessionData) GetClientSignatureInitializationRequestMessage() string { + if o == nil || IsNil(o.ClientSignatureInitializationRequestMessage) { + var ret string + return ret + } + return *o.ClientSignatureInitializationRequestMessage +} + +// GetClientSignatureInitializationRequestMessageOk returns a tuple with the ClientSignatureInitializationRequestMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetClientSignatureInitializationRequestMessageOk() (*string, bool) { + if o == nil || IsNil(o.ClientSignatureInitializationRequestMessage) { + return nil, false + } + return o.ClientSignatureInitializationRequestMessage, true +} + +// HasClientSignatureInitializationRequestMessage returns a boolean if a field has been set. +func (o *SessionData) HasClientSignatureInitializationRequestMessage() bool { + if o != nil && !IsNil(o.ClientSignatureInitializationRequestMessage) { + return true + } + + return false +} + +// SetClientSignatureInitializationRequestMessage gets a reference to the given string and assigns it to the ClientSignatureInitializationRequestMessage field. +func (o *SessionData) SetClientSignatureInitializationRequestMessage(v string) { + o.ClientSignatureInitializationRequestMessage = &v +} + +// GetServerSignatureInitializationResponseMessage returns the ServerSignatureInitializationResponseMessage field value if set, zero value otherwise. +func (o *SessionData) GetServerSignatureInitializationResponseMessage() string { + if o == nil || IsNil(o.ServerSignatureInitializationResponseMessage) { + var ret string + return ret + } + return *o.ServerSignatureInitializationResponseMessage +} + +// GetServerSignatureInitializationResponseMessageOk returns a tuple with the ServerSignatureInitializationResponseMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetServerSignatureInitializationResponseMessageOk() (*string, bool) { + if o == nil || IsNil(o.ServerSignatureInitializationResponseMessage) { + return nil, false + } + return o.ServerSignatureInitializationResponseMessage, true +} + +// HasServerSignatureInitializationResponseMessage returns a boolean if a field has been set. +func (o *SessionData) HasServerSignatureInitializationResponseMessage() bool { + if o != nil && !IsNil(o.ServerSignatureInitializationResponseMessage) { + return true + } + + return false +} + +// SetServerSignatureInitializationResponseMessage gets a reference to the given string and assigns it to the ServerSignatureInitializationResponseMessage field. +func (o *SessionData) SetServerSignatureInitializationResponseMessage(v string) { + o.ServerSignatureInitializationResponseMessage = &v +} + +// GetTransferCommenceMessageRequestHash returns the TransferCommenceMessageRequestHash field value if set, zero value otherwise. +func (o *SessionData) GetTransferCommenceMessageRequestHash() string { + if o == nil || IsNil(o.TransferCommenceMessageRequestHash) { + var ret string + return ret + } + return *o.TransferCommenceMessageRequestHash +} + +// GetTransferCommenceMessageRequestHashOk returns a tuple with the TransferCommenceMessageRequestHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetTransferCommenceMessageRequestHashOk() (*string, bool) { + if o == nil || IsNil(o.TransferCommenceMessageRequestHash) { + return nil, false + } + return o.TransferCommenceMessageRequestHash, true +} + +// HasTransferCommenceMessageRequestHash returns a boolean if a field has been set. +func (o *SessionData) HasTransferCommenceMessageRequestHash() bool { + if o != nil && !IsNil(o.TransferCommenceMessageRequestHash) { + return true + } + + return false +} + +// SetTransferCommenceMessageRequestHash gets a reference to the given string and assigns it to the TransferCommenceMessageRequestHash field. +func (o *SessionData) SetTransferCommenceMessageRequestHash(v string) { + o.TransferCommenceMessageRequestHash = &v +} + +// GetTransferCommenceMessageResponseHash returns the TransferCommenceMessageResponseHash field value if set, zero value otherwise. +func (o *SessionData) GetTransferCommenceMessageResponseHash() string { + if o == nil || IsNil(o.TransferCommenceMessageResponseHash) { + var ret string + return ret + } + return *o.TransferCommenceMessageResponseHash +} + +// GetTransferCommenceMessageResponseHashOk returns a tuple with the TransferCommenceMessageResponseHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetTransferCommenceMessageResponseHashOk() (*string, bool) { + if o == nil || IsNil(o.TransferCommenceMessageResponseHash) { + return nil, false + } + return o.TransferCommenceMessageResponseHash, true +} + +// HasTransferCommenceMessageResponseHash returns a boolean if a field has been set. +func (o *SessionData) HasTransferCommenceMessageResponseHash() bool { + if o != nil && !IsNil(o.TransferCommenceMessageResponseHash) { + return true + } + + return false +} + +// SetTransferCommenceMessageResponseHash gets a reference to the given string and assigns it to the TransferCommenceMessageResponseHash field. +func (o *SessionData) SetTransferCommenceMessageResponseHash(v string) { + o.TransferCommenceMessageResponseHash = &v +} + +// GetClientSignatureTransferCommenceRequestMessage returns the ClientSignatureTransferCommenceRequestMessage field value if set, zero value otherwise. +func (o *SessionData) GetClientSignatureTransferCommenceRequestMessage() string { + if o == nil || IsNil(o.ClientSignatureTransferCommenceRequestMessage) { + var ret string + return ret + } + return *o.ClientSignatureTransferCommenceRequestMessage +} + +// GetClientSignatureTransferCommenceRequestMessageOk returns a tuple with the ClientSignatureTransferCommenceRequestMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetClientSignatureTransferCommenceRequestMessageOk() (*string, bool) { + if o == nil || IsNil(o.ClientSignatureTransferCommenceRequestMessage) { + return nil, false + } + return o.ClientSignatureTransferCommenceRequestMessage, true +} + +// HasClientSignatureTransferCommenceRequestMessage returns a boolean if a field has been set. +func (o *SessionData) HasClientSignatureTransferCommenceRequestMessage() bool { + if o != nil && !IsNil(o.ClientSignatureTransferCommenceRequestMessage) { + return true + } + + return false +} + +// SetClientSignatureTransferCommenceRequestMessage gets a reference to the given string and assigns it to the ClientSignatureTransferCommenceRequestMessage field. +func (o *SessionData) SetClientSignatureTransferCommenceRequestMessage(v string) { + o.ClientSignatureTransferCommenceRequestMessage = &v +} + +// GetServerSignatureTransferCommenceResponseMessage returns the ServerSignatureTransferCommenceResponseMessage field value if set, zero value otherwise. +func (o *SessionData) GetServerSignatureTransferCommenceResponseMessage() string { + if o == nil || IsNil(o.ServerSignatureTransferCommenceResponseMessage) { + var ret string + return ret + } + return *o.ServerSignatureTransferCommenceResponseMessage +} + +// GetServerSignatureTransferCommenceResponseMessageOk returns a tuple with the ServerSignatureTransferCommenceResponseMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetServerSignatureTransferCommenceResponseMessageOk() (*string, bool) { + if o == nil || IsNil(o.ServerSignatureTransferCommenceResponseMessage) { + return nil, false + } + return o.ServerSignatureTransferCommenceResponseMessage, true +} + +// HasServerSignatureTransferCommenceResponseMessage returns a boolean if a field has been set. +func (o *SessionData) HasServerSignatureTransferCommenceResponseMessage() bool { + if o != nil && !IsNil(o.ServerSignatureTransferCommenceResponseMessage) { + return true + } + + return false +} + +// SetServerSignatureTransferCommenceResponseMessage gets a reference to the given string and assigns it to the ServerSignatureTransferCommenceResponseMessage field. +func (o *SessionData) SetServerSignatureTransferCommenceResponseMessage(v string) { + o.ServerSignatureTransferCommenceResponseMessage = &v +} + +// GetLockEvidenceRequestMessageHash returns the LockEvidenceRequestMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetLockEvidenceRequestMessageHash() string { + if o == nil || IsNil(o.LockEvidenceRequestMessageHash) { + var ret string + return ret + } + return *o.LockEvidenceRequestMessageHash +} + +// GetLockEvidenceRequestMessageHashOk returns a tuple with the LockEvidenceRequestMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetLockEvidenceRequestMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.LockEvidenceRequestMessageHash) { + return nil, false + } + return o.LockEvidenceRequestMessageHash, true +} + +// HasLockEvidenceRequestMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasLockEvidenceRequestMessageHash() bool { + if o != nil && !IsNil(o.LockEvidenceRequestMessageHash) { + return true + } + + return false +} + +// SetLockEvidenceRequestMessageHash gets a reference to the given string and assigns it to the LockEvidenceRequestMessageHash field. +func (o *SessionData) SetLockEvidenceRequestMessageHash(v string) { + o.LockEvidenceRequestMessageHash = &v +} + +// GetLockEvidenceResponseMessageHash returns the LockEvidenceResponseMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetLockEvidenceResponseMessageHash() string { + if o == nil || IsNil(o.LockEvidenceResponseMessageHash) { + var ret string + return ret + } + return *o.LockEvidenceResponseMessageHash +} + +// GetLockEvidenceResponseMessageHashOk returns a tuple with the LockEvidenceResponseMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetLockEvidenceResponseMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.LockEvidenceResponseMessageHash) { + return nil, false + } + return o.LockEvidenceResponseMessageHash, true +} + +// HasLockEvidenceResponseMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasLockEvidenceResponseMessageHash() bool { + if o != nil && !IsNil(o.LockEvidenceResponseMessageHash) { + return true + } + + return false +} + +// SetLockEvidenceResponseMessageHash gets a reference to the given string and assigns it to the LockEvidenceResponseMessageHash field. +func (o *SessionData) SetLockEvidenceResponseMessageHash(v string) { + o.LockEvidenceResponseMessageHash = &v +} + +// GetClientSignatureLockEvidenceRequestMessage returns the ClientSignatureLockEvidenceRequestMessage field value if set, zero value otherwise. +func (o *SessionData) GetClientSignatureLockEvidenceRequestMessage() string { + if o == nil || IsNil(o.ClientSignatureLockEvidenceRequestMessage) { + var ret string + return ret + } + return *o.ClientSignatureLockEvidenceRequestMessage +} + +// GetClientSignatureLockEvidenceRequestMessageOk returns a tuple with the ClientSignatureLockEvidenceRequestMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetClientSignatureLockEvidenceRequestMessageOk() (*string, bool) { + if o == nil || IsNil(o.ClientSignatureLockEvidenceRequestMessage) { + return nil, false + } + return o.ClientSignatureLockEvidenceRequestMessage, true +} + +// HasClientSignatureLockEvidenceRequestMessage returns a boolean if a field has been set. +func (o *SessionData) HasClientSignatureLockEvidenceRequestMessage() bool { + if o != nil && !IsNil(o.ClientSignatureLockEvidenceRequestMessage) { + return true + } + + return false +} + +// SetClientSignatureLockEvidenceRequestMessage gets a reference to the given string and assigns it to the ClientSignatureLockEvidenceRequestMessage field. +func (o *SessionData) SetClientSignatureLockEvidenceRequestMessage(v string) { + o.ClientSignatureLockEvidenceRequestMessage = &v +} + +// GetServerSignatureLockEvidenceResponseMessage returns the ServerSignatureLockEvidenceResponseMessage field value if set, zero value otherwise. +func (o *SessionData) GetServerSignatureLockEvidenceResponseMessage() string { + if o == nil || IsNil(o.ServerSignatureLockEvidenceResponseMessage) { + var ret string + return ret + } + return *o.ServerSignatureLockEvidenceResponseMessage +} + +// GetServerSignatureLockEvidenceResponseMessageOk returns a tuple with the ServerSignatureLockEvidenceResponseMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetServerSignatureLockEvidenceResponseMessageOk() (*string, bool) { + if o == nil || IsNil(o.ServerSignatureLockEvidenceResponseMessage) { + return nil, false + } + return o.ServerSignatureLockEvidenceResponseMessage, true +} + +// HasServerSignatureLockEvidenceResponseMessage returns a boolean if a field has been set. +func (o *SessionData) HasServerSignatureLockEvidenceResponseMessage() bool { + if o != nil && !IsNil(o.ServerSignatureLockEvidenceResponseMessage) { + return true + } + + return false +} + +// SetServerSignatureLockEvidenceResponseMessage gets a reference to the given string and assigns it to the ServerSignatureLockEvidenceResponseMessage field. +func (o *SessionData) SetServerSignatureLockEvidenceResponseMessage(v string) { + o.ServerSignatureLockEvidenceResponseMessage = &v +} + +// GetLockEvidenceClaim returns the LockEvidenceClaim field value if set, zero value otherwise. +func (o *SessionData) GetLockEvidenceClaim() string { + if o == nil || IsNil(o.LockEvidenceClaim) { + var ret string + return ret + } + return *o.LockEvidenceClaim +} + +// GetLockEvidenceClaimOk returns a tuple with the LockEvidenceClaim field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetLockEvidenceClaimOk() (*string, bool) { + if o == nil || IsNil(o.LockEvidenceClaim) { + return nil, false + } + return o.LockEvidenceClaim, true +} + +// HasLockEvidenceClaim returns a boolean if a field has been set. +func (o *SessionData) HasLockEvidenceClaim() bool { + if o != nil && !IsNil(o.LockEvidenceClaim) { + return true + } + + return false +} + +// SetLockEvidenceClaim gets a reference to the given string and assigns it to the LockEvidenceClaim field. +func (o *SessionData) SetLockEvidenceClaim(v string) { + o.LockEvidenceClaim = &v +} + +// GetCommitPrepareRequestMessageHash returns the CommitPrepareRequestMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetCommitPrepareRequestMessageHash() string { + if o == nil || IsNil(o.CommitPrepareRequestMessageHash) { + var ret string + return ret + } + return *o.CommitPrepareRequestMessageHash +} + +// GetCommitPrepareRequestMessageHashOk returns a tuple with the CommitPrepareRequestMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetCommitPrepareRequestMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.CommitPrepareRequestMessageHash) { + return nil, false + } + return o.CommitPrepareRequestMessageHash, true +} + +// HasCommitPrepareRequestMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasCommitPrepareRequestMessageHash() bool { + if o != nil && !IsNil(o.CommitPrepareRequestMessageHash) { + return true + } + + return false +} + +// SetCommitPrepareRequestMessageHash gets a reference to the given string and assigns it to the CommitPrepareRequestMessageHash field. +func (o *SessionData) SetCommitPrepareRequestMessageHash(v string) { + o.CommitPrepareRequestMessageHash = &v +} + +// GetCommitPrepareResponseMessageHash returns the CommitPrepareResponseMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetCommitPrepareResponseMessageHash() string { + if o == nil || IsNil(o.CommitPrepareResponseMessageHash) { + var ret string + return ret + } + return *o.CommitPrepareResponseMessageHash +} + +// GetCommitPrepareResponseMessageHashOk returns a tuple with the CommitPrepareResponseMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetCommitPrepareResponseMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.CommitPrepareResponseMessageHash) { + return nil, false + } + return o.CommitPrepareResponseMessageHash, true +} + +// HasCommitPrepareResponseMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasCommitPrepareResponseMessageHash() bool { + if o != nil && !IsNil(o.CommitPrepareResponseMessageHash) { + return true + } + + return false +} + +// SetCommitPrepareResponseMessageHash gets a reference to the given string and assigns it to the CommitPrepareResponseMessageHash field. +func (o *SessionData) SetCommitPrepareResponseMessageHash(v string) { + o.CommitPrepareResponseMessageHash = &v +} + +// GetClientSignatureCommitPreparationRequestMessage returns the ClientSignatureCommitPreparationRequestMessage field value if set, zero value otherwise. +func (o *SessionData) GetClientSignatureCommitPreparationRequestMessage() string { + if o == nil || IsNil(o.ClientSignatureCommitPreparationRequestMessage) { + var ret string + return ret + } + return *o.ClientSignatureCommitPreparationRequestMessage +} + +// GetClientSignatureCommitPreparationRequestMessageOk returns a tuple with the ClientSignatureCommitPreparationRequestMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetClientSignatureCommitPreparationRequestMessageOk() (*string, bool) { + if o == nil || IsNil(o.ClientSignatureCommitPreparationRequestMessage) { + return nil, false + } + return o.ClientSignatureCommitPreparationRequestMessage, true +} + +// HasClientSignatureCommitPreparationRequestMessage returns a boolean if a field has been set. +func (o *SessionData) HasClientSignatureCommitPreparationRequestMessage() bool { + if o != nil && !IsNil(o.ClientSignatureCommitPreparationRequestMessage) { + return true + } + + return false +} + +// SetClientSignatureCommitPreparationRequestMessage gets a reference to the given string and assigns it to the ClientSignatureCommitPreparationRequestMessage field. +func (o *SessionData) SetClientSignatureCommitPreparationRequestMessage(v string) { + o.ClientSignatureCommitPreparationRequestMessage = &v +} + +// GetServerSignatureCommitPreparationResponseMessage returns the ServerSignatureCommitPreparationResponseMessage field value if set, zero value otherwise. +func (o *SessionData) GetServerSignatureCommitPreparationResponseMessage() string { + if o == nil || IsNil(o.ServerSignatureCommitPreparationResponseMessage) { + var ret string + return ret + } + return *o.ServerSignatureCommitPreparationResponseMessage +} + +// GetServerSignatureCommitPreparationResponseMessageOk returns a tuple with the ServerSignatureCommitPreparationResponseMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetServerSignatureCommitPreparationResponseMessageOk() (*string, bool) { + if o == nil || IsNil(o.ServerSignatureCommitPreparationResponseMessage) { + return nil, false + } + return o.ServerSignatureCommitPreparationResponseMessage, true +} + +// HasServerSignatureCommitPreparationResponseMessage returns a boolean if a field has been set. +func (o *SessionData) HasServerSignatureCommitPreparationResponseMessage() bool { + if o != nil && !IsNil(o.ServerSignatureCommitPreparationResponseMessage) { + return true + } + + return false +} + +// SetServerSignatureCommitPreparationResponseMessage gets a reference to the given string and assigns it to the ServerSignatureCommitPreparationResponseMessage field. +func (o *SessionData) SetServerSignatureCommitPreparationResponseMessage(v string) { + o.ServerSignatureCommitPreparationResponseMessage = &v +} + +// GetCommitFinalRequestMessageHash returns the CommitFinalRequestMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetCommitFinalRequestMessageHash() string { + if o == nil || IsNil(o.CommitFinalRequestMessageHash) { + var ret string + return ret + } + return *o.CommitFinalRequestMessageHash +} + +// GetCommitFinalRequestMessageHashOk returns a tuple with the CommitFinalRequestMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetCommitFinalRequestMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.CommitFinalRequestMessageHash) { + return nil, false + } + return o.CommitFinalRequestMessageHash, true +} + +// HasCommitFinalRequestMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasCommitFinalRequestMessageHash() bool { + if o != nil && !IsNil(o.CommitFinalRequestMessageHash) { + return true + } + + return false +} + +// SetCommitFinalRequestMessageHash gets a reference to the given string and assigns it to the CommitFinalRequestMessageHash field. +func (o *SessionData) SetCommitFinalRequestMessageHash(v string) { + o.CommitFinalRequestMessageHash = &v +} + +// GetCommitFinalResponseMessageHash returns the CommitFinalResponseMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetCommitFinalResponseMessageHash() string { + if o == nil || IsNil(o.CommitFinalResponseMessageHash) { + var ret string + return ret + } + return *o.CommitFinalResponseMessageHash +} + +// GetCommitFinalResponseMessageHashOk returns a tuple with the CommitFinalResponseMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetCommitFinalResponseMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.CommitFinalResponseMessageHash) { + return nil, false + } + return o.CommitFinalResponseMessageHash, true +} + +// HasCommitFinalResponseMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasCommitFinalResponseMessageHash() bool { + if o != nil && !IsNil(o.CommitFinalResponseMessageHash) { + return true + } + + return false +} + +// SetCommitFinalResponseMessageHash gets a reference to the given string and assigns it to the CommitFinalResponseMessageHash field. +func (o *SessionData) SetCommitFinalResponseMessageHash(v string) { + o.CommitFinalResponseMessageHash = &v +} + +// GetCommitFinalClaim returns the CommitFinalClaim field value if set, zero value otherwise. +func (o *SessionData) GetCommitFinalClaim() string { + if o == nil || IsNil(o.CommitFinalClaim) { + var ret string + return ret + } + return *o.CommitFinalClaim +} + +// GetCommitFinalClaimOk returns a tuple with the CommitFinalClaim field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetCommitFinalClaimOk() (*string, bool) { + if o == nil || IsNil(o.CommitFinalClaim) { + return nil, false + } + return o.CommitFinalClaim, true +} + +// HasCommitFinalClaim returns a boolean if a field has been set. +func (o *SessionData) HasCommitFinalClaim() bool { + if o != nil && !IsNil(o.CommitFinalClaim) { + return true + } + + return false +} + +// SetCommitFinalClaim gets a reference to the given string and assigns it to the CommitFinalClaim field. +func (o *SessionData) SetCommitFinalClaim(v string) { + o.CommitFinalClaim = &v +} + +// GetCommitFinalClaimFormat returns the CommitFinalClaimFormat field value if set, zero value otherwise. +func (o *SessionData) GetCommitFinalClaimFormat() string { + if o == nil || IsNil(o.CommitFinalClaimFormat) { + var ret string + return ret + } + return *o.CommitFinalClaimFormat +} + +// GetCommitFinalClaimFormatOk returns a tuple with the CommitFinalClaimFormat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetCommitFinalClaimFormatOk() (*string, bool) { + if o == nil || IsNil(o.CommitFinalClaimFormat) { + return nil, false + } + return o.CommitFinalClaimFormat, true +} + +// HasCommitFinalClaimFormat returns a boolean if a field has been set. +func (o *SessionData) HasCommitFinalClaimFormat() bool { + if o != nil && !IsNil(o.CommitFinalClaimFormat) { + return true + } + + return false +} + +// SetCommitFinalClaimFormat gets a reference to the given string and assigns it to the CommitFinalClaimFormat field. +func (o *SessionData) SetCommitFinalClaimFormat(v string) { + o.CommitFinalClaimFormat = &v +} + +// GetCommitAcknowledgementClaim returns the CommitAcknowledgementClaim field value if set, zero value otherwise. +func (o *SessionData) GetCommitAcknowledgementClaim() string { + if o == nil || IsNil(o.CommitAcknowledgementClaim) { + var ret string + return ret + } + return *o.CommitAcknowledgementClaim +} + +// GetCommitAcknowledgementClaimOk returns a tuple with the CommitAcknowledgementClaim field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetCommitAcknowledgementClaimOk() (*string, bool) { + if o == nil || IsNil(o.CommitAcknowledgementClaim) { + return nil, false + } + return o.CommitAcknowledgementClaim, true +} + +// HasCommitAcknowledgementClaim returns a boolean if a field has been set. +func (o *SessionData) HasCommitAcknowledgementClaim() bool { + if o != nil && !IsNil(o.CommitAcknowledgementClaim) { + return true + } + + return false +} + +// SetCommitAcknowledgementClaim gets a reference to the given string and assigns it to the CommitAcknowledgementClaim field. +func (o *SessionData) SetCommitAcknowledgementClaim(v string) { + o.CommitAcknowledgementClaim = &v +} + +// GetCommitAcknowledgementClaimFormat returns the CommitAcknowledgementClaimFormat field value if set, zero value otherwise. +func (o *SessionData) GetCommitAcknowledgementClaimFormat() string { + if o == nil || IsNil(o.CommitAcknowledgementClaimFormat) { + var ret string + return ret + } + return *o.CommitAcknowledgementClaimFormat +} + +// GetCommitAcknowledgementClaimFormatOk returns a tuple with the CommitAcknowledgementClaimFormat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetCommitAcknowledgementClaimFormatOk() (*string, bool) { + if o == nil || IsNil(o.CommitAcknowledgementClaimFormat) { + return nil, false + } + return o.CommitAcknowledgementClaimFormat, true +} + +// HasCommitAcknowledgementClaimFormat returns a boolean if a field has been set. +func (o *SessionData) HasCommitAcknowledgementClaimFormat() bool { + if o != nil && !IsNil(o.CommitAcknowledgementClaimFormat) { + return true + } + + return false +} + +// SetCommitAcknowledgementClaimFormat gets a reference to the given string and assigns it to the CommitAcknowledgementClaimFormat field. +func (o *SessionData) SetCommitAcknowledgementClaimFormat(v string) { + o.CommitAcknowledgementClaimFormat = &v +} + +// GetClientSignatureCommitFinalRequestMessage returns the ClientSignatureCommitFinalRequestMessage field value if set, zero value otherwise. +func (o *SessionData) GetClientSignatureCommitFinalRequestMessage() string { + if o == nil || IsNil(o.ClientSignatureCommitFinalRequestMessage) { + var ret string + return ret + } + return *o.ClientSignatureCommitFinalRequestMessage +} + +// GetClientSignatureCommitFinalRequestMessageOk returns a tuple with the ClientSignatureCommitFinalRequestMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetClientSignatureCommitFinalRequestMessageOk() (*string, bool) { + if o == nil || IsNil(o.ClientSignatureCommitFinalRequestMessage) { + return nil, false + } + return o.ClientSignatureCommitFinalRequestMessage, true +} + +// HasClientSignatureCommitFinalRequestMessage returns a boolean if a field has been set. +func (o *SessionData) HasClientSignatureCommitFinalRequestMessage() bool { + if o != nil && !IsNil(o.ClientSignatureCommitFinalRequestMessage) { + return true + } + + return false +} + +// SetClientSignatureCommitFinalRequestMessage gets a reference to the given string and assigns it to the ClientSignatureCommitFinalRequestMessage field. +func (o *SessionData) SetClientSignatureCommitFinalRequestMessage(v string) { + o.ClientSignatureCommitFinalRequestMessage = &v +} + +// GetServerSignatureCommitFinalResponseMessage returns the ServerSignatureCommitFinalResponseMessage field value if set, zero value otherwise. +func (o *SessionData) GetServerSignatureCommitFinalResponseMessage() string { + if o == nil || IsNil(o.ServerSignatureCommitFinalResponseMessage) { + var ret string + return ret + } + return *o.ServerSignatureCommitFinalResponseMessage +} + +// GetServerSignatureCommitFinalResponseMessageOk returns a tuple with the ServerSignatureCommitFinalResponseMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetServerSignatureCommitFinalResponseMessageOk() (*string, bool) { + if o == nil || IsNil(o.ServerSignatureCommitFinalResponseMessage) { + return nil, false + } + return o.ServerSignatureCommitFinalResponseMessage, true +} + +// HasServerSignatureCommitFinalResponseMessage returns a boolean if a field has been set. +func (o *SessionData) HasServerSignatureCommitFinalResponseMessage() bool { + if o != nil && !IsNil(o.ServerSignatureCommitFinalResponseMessage) { + return true + } + + return false +} + +// SetServerSignatureCommitFinalResponseMessage gets a reference to the given string and assigns it to the ServerSignatureCommitFinalResponseMessage field. +func (o *SessionData) SetServerSignatureCommitFinalResponseMessage(v string) { + o.ServerSignatureCommitFinalResponseMessage = &v +} + +// GetTransferCompleteMessageHash returns the TransferCompleteMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetTransferCompleteMessageHash() string { + if o == nil || IsNil(o.TransferCompleteMessageHash) { + var ret string + return ret + } + return *o.TransferCompleteMessageHash +} + +// GetTransferCompleteMessageHashOk returns a tuple with the TransferCompleteMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetTransferCompleteMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.TransferCompleteMessageHash) { + return nil, false + } + return o.TransferCompleteMessageHash, true +} + +// HasTransferCompleteMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasTransferCompleteMessageHash() bool { + if o != nil && !IsNil(o.TransferCompleteMessageHash) { + return true + } + + return false +} + +// SetTransferCompleteMessageHash gets a reference to the given string and assigns it to the TransferCompleteMessageHash field. +func (o *SessionData) SetTransferCompleteMessageHash(v string) { + o.TransferCompleteMessageHash = &v +} + +// GetClientSignatureTransferCompleteMessage returns the ClientSignatureTransferCompleteMessage field value if set, zero value otherwise. +func (o *SessionData) GetClientSignatureTransferCompleteMessage() string { + if o == nil || IsNil(o.ClientSignatureTransferCompleteMessage) { + var ret string + return ret + } + return *o.ClientSignatureTransferCompleteMessage +} + +// GetClientSignatureTransferCompleteMessageOk returns a tuple with the ClientSignatureTransferCompleteMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetClientSignatureTransferCompleteMessageOk() (*string, bool) { + if o == nil || IsNil(o.ClientSignatureTransferCompleteMessage) { + return nil, false + } + return o.ClientSignatureTransferCompleteMessage, true +} + +// HasClientSignatureTransferCompleteMessage returns a boolean if a field has been set. +func (o *SessionData) HasClientSignatureTransferCompleteMessage() bool { + if o != nil && !IsNil(o.ClientSignatureTransferCompleteMessage) { + return true + } + + return false +} + +// SetClientSignatureTransferCompleteMessage gets a reference to the given string and assigns it to the ClientSignatureTransferCompleteMessage field. +func (o *SessionData) SetClientSignatureTransferCompleteMessage(v string) { + o.ClientSignatureTransferCompleteMessage = &v +} + +// GetMaxRetries returns the MaxRetries field value if set, zero value otherwise. +func (o *SessionData) GetMaxRetries() float32 { + if o == nil || IsNil(o.MaxRetries) { + var ret float32 + return ret + } + return *o.MaxRetries +} + +// GetMaxRetriesOk returns a tuple with the MaxRetries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetMaxRetriesOk() (*float32, bool) { + if o == nil || IsNil(o.MaxRetries) { + return nil, false + } + return o.MaxRetries, true +} + +// HasMaxRetries returns a boolean if a field has been set. +func (o *SessionData) HasMaxRetries() bool { + if o != nil && !IsNil(o.MaxRetries) { + return true + } + + return false +} + +// SetMaxRetries gets a reference to the given float32 and assigns it to the MaxRetries field. +func (o *SessionData) SetMaxRetries(v float32) { + o.MaxRetries = &v +} + +// GetRecipientLedgerAssetID returns the RecipientLedgerAssetID field value if set, zero value otherwise. +func (o *SessionData) GetRecipientLedgerAssetID() string { + if o == nil || IsNil(o.RecipientLedgerAssetID) { + var ret string + return ret + } + return *o.RecipientLedgerAssetID +} + +// GetRecipientLedgerAssetIDOk returns a tuple with the RecipientLedgerAssetID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRecipientLedgerAssetIDOk() (*string, bool) { + if o == nil || IsNil(o.RecipientLedgerAssetID) { + return nil, false + } + return o.RecipientLedgerAssetID, true +} + +// HasRecipientLedgerAssetID returns a boolean if a field has been set. +func (o *SessionData) HasRecipientLedgerAssetID() bool { + if o != nil && !IsNil(o.RecipientLedgerAssetID) { + return true + } + + return false +} + +// SetRecipientLedgerAssetID gets a reference to the given string and assigns it to the RecipientLedgerAssetID field. +func (o *SessionData) SetRecipientLedgerAssetID(v string) { + o.RecipientLedgerAssetID = &v +} + +// GetSourceLedgerAssetID returns the SourceLedgerAssetID field value if set, zero value otherwise. +func (o *SessionData) GetSourceLedgerAssetID() string { + if o == nil || IsNil(o.SourceLedgerAssetID) { + var ret string + return ret + } + return *o.SourceLedgerAssetID +} + +// GetSourceLedgerAssetIDOk returns a tuple with the SourceLedgerAssetID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetSourceLedgerAssetIDOk() (*string, bool) { + if o == nil || IsNil(o.SourceLedgerAssetID) { + return nil, false + } + return o.SourceLedgerAssetID, true +} + +// HasSourceLedgerAssetID returns a boolean if a field has been set. +func (o *SessionData) HasSourceLedgerAssetID() bool { + if o != nil && !IsNil(o.SourceLedgerAssetID) { + return true + } + + return false +} + +// SetSourceLedgerAssetID gets a reference to the given string and assigns it to the SourceLedgerAssetID field. +func (o *SessionData) SetSourceLedgerAssetID(v string) { + o.SourceLedgerAssetID = &v +} + +// GetMaxTimeout returns the MaxTimeout field value if set, zero value otherwise. +func (o *SessionData) GetMaxTimeout() float32 { + if o == nil || IsNil(o.MaxTimeout) { + var ret float32 + return ret + } + return *o.MaxTimeout +} + +// GetMaxTimeoutOk returns a tuple with the MaxTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetMaxTimeoutOk() (*float32, bool) { + if o == nil || IsNil(o.MaxTimeout) { + return nil, false + } + return o.MaxTimeout, true +} + +// HasMaxTimeout returns a boolean if a field has been set. +func (o *SessionData) HasMaxTimeout() bool { + if o != nil && !IsNil(o.MaxTimeout) { + return true + } + + return false +} + +// SetMaxTimeout gets a reference to the given float32 and assigns it to the MaxTimeout field. +func (o *SessionData) SetMaxTimeout(v float32) { + o.MaxTimeout = &v +} + +// GetLastLogEntryTimestamp returns the LastLogEntryTimestamp field value if set, zero value otherwise. +func (o *SessionData) GetLastLogEntryTimestamp() string { + if o == nil || IsNil(o.LastLogEntryTimestamp) { + var ret string + return ret + } + return *o.LastLogEntryTimestamp +} + +// GetLastLogEntryTimestampOk returns a tuple with the LastLogEntryTimestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetLastLogEntryTimestampOk() (*string, bool) { + if o == nil || IsNil(o.LastLogEntryTimestamp) { + return nil, false + } + return o.LastLogEntryTimestamp, true +} + +// HasLastLogEntryTimestamp returns a boolean if a field has been set. +func (o *SessionData) HasLastLogEntryTimestamp() bool { + if o != nil && !IsNil(o.LastLogEntryTimestamp) { + return true + } + + return false +} + +// SetLastLogEntryTimestamp gets a reference to the given string and assigns it to the LastLogEntryTimestamp field. +func (o *SessionData) SetLastLogEntryTimestamp(v string) { + o.LastLogEntryTimestamp = &v +} + +// GetUnlockAssetClaim returns the UnlockAssetClaim field value if set, zero value otherwise. +func (o *SessionData) GetUnlockAssetClaim() string { + if o == nil || IsNil(o.UnlockAssetClaim) { + var ret string + return ret + } + return *o.UnlockAssetClaim +} + +// GetUnlockAssetClaimOk returns a tuple with the UnlockAssetClaim field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetUnlockAssetClaimOk() (*string, bool) { + if o == nil || IsNil(o.UnlockAssetClaim) { + return nil, false + } + return o.UnlockAssetClaim, true +} + +// HasUnlockAssetClaim returns a boolean if a field has been set. +func (o *SessionData) HasUnlockAssetClaim() bool { + if o != nil && !IsNil(o.UnlockAssetClaim) { + return true + } + + return false +} + +// SetUnlockAssetClaim gets a reference to the given string and assigns it to the UnlockAssetClaim field. +func (o *SessionData) SetUnlockAssetClaim(v string) { + o.UnlockAssetClaim = &v +} + +// GetRecreateAssetClaim returns the RecreateAssetClaim field value if set, zero value otherwise. +func (o *SessionData) GetRecreateAssetClaim() string { + if o == nil || IsNil(o.RecreateAssetClaim) { + var ret string + return ret + } + return *o.RecreateAssetClaim +} + +// GetRecreateAssetClaimOk returns a tuple with the RecreateAssetClaim field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRecreateAssetClaimOk() (*string, bool) { + if o == nil || IsNil(o.RecreateAssetClaim) { + return nil, false + } + return o.RecreateAssetClaim, true +} + +// HasRecreateAssetClaim returns a boolean if a field has been set. +func (o *SessionData) HasRecreateAssetClaim() bool { + if o != nil && !IsNil(o.RecreateAssetClaim) { + return true + } + + return false +} + +// SetRecreateAssetClaim gets a reference to the given string and assigns it to the RecreateAssetClaim field. +func (o *SessionData) SetRecreateAssetClaim(v string) { + o.RecreateAssetClaim = &v +} + +// GetDeleteAssetClaim returns the DeleteAssetClaim field value if set, zero value otherwise. +func (o *SessionData) GetDeleteAssetClaim() string { + if o == nil || IsNil(o.DeleteAssetClaim) { + var ret string + return ret + } + return *o.DeleteAssetClaim +} + +// GetDeleteAssetClaimOk returns a tuple with the DeleteAssetClaim field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetDeleteAssetClaimOk() (*string, bool) { + if o == nil || IsNil(o.DeleteAssetClaim) { + return nil, false + } + return o.DeleteAssetClaim, true +} + +// HasDeleteAssetClaim returns a boolean if a field has been set. +func (o *SessionData) HasDeleteAssetClaim() bool { + if o != nil && !IsNil(o.DeleteAssetClaim) { + return true + } + + return false +} + +// SetDeleteAssetClaim gets a reference to the given string and assigns it to the DeleteAssetClaim field. +func (o *SessionData) SetDeleteAssetClaim(v string) { + o.DeleteAssetClaim = &v +} + +// GetLastMessageReceivedTimestamp returns the LastMessageReceivedTimestamp field value if set, zero value otherwise. +func (o *SessionData) GetLastMessageReceivedTimestamp() string { + if o == nil || IsNil(o.LastMessageReceivedTimestamp) { + var ret string + return ret + } + return *o.LastMessageReceivedTimestamp +} + +// GetLastMessageReceivedTimestampOk returns a tuple with the LastMessageReceivedTimestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetLastMessageReceivedTimestampOk() (*string, bool) { + if o == nil || IsNil(o.LastMessageReceivedTimestamp) { + return nil, false + } + return o.LastMessageReceivedTimestamp, true +} + +// HasLastMessageReceivedTimestamp returns a boolean if a field has been set. +func (o *SessionData) HasLastMessageReceivedTimestamp() bool { + if o != nil && !IsNil(o.LastMessageReceivedTimestamp) { + return true + } + + return false +} + +// SetLastMessageReceivedTimestamp gets a reference to the given string and assigns it to the LastMessageReceivedTimestamp field. +func (o *SessionData) SetLastMessageReceivedTimestamp(v string) { + o.LastMessageReceivedTimestamp = &v +} + +// GetRollback returns the Rollback field value if set, zero value otherwise. +func (o *SessionData) GetRollback() bool { + if o == nil || IsNil(o.Rollback) { + var ret bool + return ret + } + return *o.Rollback +} + +// GetRollbackOk returns a tuple with the Rollback field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRollbackOk() (*bool, bool) { + if o == nil || IsNil(o.Rollback) { + return nil, false + } + return o.Rollback, true +} + +// HasRollback returns a boolean if a field has been set. +func (o *SessionData) HasRollback() bool { + if o != nil && !IsNil(o.Rollback) { + return true + } + + return false +} + +// SetRollback gets a reference to the given bool and assigns it to the Rollback field. +func (o *SessionData) SetRollback(v bool) { + o.Rollback = &v +} + +// GetRollbackMessageHash returns the RollbackMessageHash field value if set, zero value otherwise. +func (o *SessionData) GetRollbackMessageHash() string { + if o == nil || IsNil(o.RollbackMessageHash) { + var ret string + return ret + } + return *o.RollbackMessageHash +} + +// GetRollbackMessageHashOk returns a tuple with the RollbackMessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRollbackMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.RollbackMessageHash) { + return nil, false + } + return o.RollbackMessageHash, true +} + +// HasRollbackMessageHash returns a boolean if a field has been set. +func (o *SessionData) HasRollbackMessageHash() bool { + if o != nil && !IsNil(o.RollbackMessageHash) { + return true + } + + return false +} + +// SetRollbackMessageHash gets a reference to the given string and assigns it to the RollbackMessageHash field. +func (o *SessionData) SetRollbackMessageHash(v string) { + o.RollbackMessageHash = &v +} + +// GetRollbackProofs returns the RollbackProofs field value if set, zero value otherwise. +func (o *SessionData) GetRollbackProofs() []string { + if o == nil || IsNil(o.RollbackProofs) { + var ret []string + return ret + } + return o.RollbackProofs +} + +// GetRollbackProofsOk returns a tuple with the RollbackProofs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRollbackProofsOk() ([]string, bool) { + if o == nil || IsNil(o.RollbackProofs) { + return nil, false + } + return o.RollbackProofs, true +} + +// HasRollbackProofs returns a boolean if a field has been set. +func (o *SessionData) HasRollbackProofs() bool { + if o != nil && !IsNil(o.RollbackProofs) { + return true + } + + return false +} + +// SetRollbackProofs gets a reference to the given []string and assigns it to the RollbackProofs field. +func (o *SessionData) SetRollbackProofs(v []string) { + o.RollbackProofs = v +} + +// GetRollbackActionsPerformed returns the RollbackActionsPerformed field value if set, zero value otherwise. +func (o *SessionData) GetRollbackActionsPerformed() []string { + if o == nil || IsNil(o.RollbackActionsPerformed) { + var ret []string + return ret + } + return o.RollbackActionsPerformed +} + +// GetRollbackActionsPerformedOk returns a tuple with the RollbackActionsPerformed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionData) GetRollbackActionsPerformedOk() ([]string, bool) { + if o == nil || IsNil(o.RollbackActionsPerformed) { + return nil, false + } + return o.RollbackActionsPerformed, true +} + +// HasRollbackActionsPerformed returns a boolean if a field has been set. +func (o *SessionData) HasRollbackActionsPerformed() bool { + if o != nil && !IsNil(o.RollbackActionsPerformed) { + return true + } + + return false +} + +// SetRollbackActionsPerformed gets a reference to the given []string and assigns it to the RollbackActionsPerformed field. +func (o *SessionData) SetRollbackActionsPerformed(v []string) { + o.RollbackActionsPerformed = v +} + +func (o SessionData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SessionData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Step) { + toSerialize["step"] = o.Step + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + if !IsNil(o.LastSequenceNumber) { + toSerialize["lastSequenceNumber"] = o.LastSequenceNumber + } + if !IsNil(o.LoggingProfile) { + toSerialize["loggingProfile"] = o.LoggingProfile + } + if !IsNil(o.AccessControlProfile) { + toSerialize["accessControlProfile"] = o.AccessControlProfile + } + if !IsNil(o.ApplicationProfile) { + toSerialize["applicationProfile"] = o.ApplicationProfile + } + if !IsNil(o.PayloadProfile) { + toSerialize["payloadProfile"] = o.PayloadProfile + } + if !IsNil(o.AssetProfile) { + toSerialize["assetProfile"] = o.AssetProfile + } + if !IsNil(o.AllowedSourceBackupGateways) { + toSerialize["allowedSourceBackupGateways"] = o.AllowedSourceBackupGateways + } + if !IsNil(o.AllowedRecipientBackupGateways) { + toSerialize["allowedRecipientBackupGateways"] = o.AllowedRecipientBackupGateways + } + if !IsNil(o.SourceBasePath) { + toSerialize["sourceBasePath"] = o.SourceBasePath + } + if !IsNil(o.RecipientBasePath) { + toSerialize["recipientBasePath"] = o.RecipientBasePath + } + if !IsNil(o.OriginatorPubkey) { + toSerialize["originatorPubkey"] = o.OriginatorPubkey + } + if !IsNil(o.BeneficiaryPubkey) { + toSerialize["beneficiaryPubkey"] = o.BeneficiaryPubkey + } + if !IsNil(o.SourceGatewayPubkey) { + toSerialize["sourceGatewayPubkey"] = o.SourceGatewayPubkey + } + if !IsNil(o.SourceGatewayDltSystem) { + toSerialize["sourceGatewayDltSystem"] = o.SourceGatewayDltSystem + } + if !IsNil(o.RecipientGatewayPubkey) { + toSerialize["recipientGatewayPubkey"] = o.RecipientGatewayPubkey + } + if !IsNil(o.RecipientGatewayDltSystem) { + toSerialize["recipientGatewayDltSystem"] = o.RecipientGatewayDltSystem + } + if !IsNil(o.InitializationRequestMessageHash) { + toSerialize["initializationRequestMessageHash"] = o.InitializationRequestMessageHash + } + if !IsNil(o.InitializationResponseMessageHash) { + toSerialize["initializationResponseMessageHash"] = o.InitializationResponseMessageHash + } + if !IsNil(o.InitializationRequestMessageRcvTimeStamp) { + toSerialize["initializationRequestMessageRcvTimeStamp"] = o.InitializationRequestMessageRcvTimeStamp + } + if !IsNil(o.InitializationRequestMessageProcessedTimeStamp) { + toSerialize["initializationRequestMessageProcessedTimeStamp"] = o.InitializationRequestMessageProcessedTimeStamp + } + if !IsNil(o.ClientSignatureInitializationRequestMessage) { + toSerialize["clientSignatureInitializationRequestMessage"] = o.ClientSignatureInitializationRequestMessage + } + if !IsNil(o.ServerSignatureInitializationResponseMessage) { + toSerialize["serverSignatureInitializationResponseMessage"] = o.ServerSignatureInitializationResponseMessage + } + if !IsNil(o.TransferCommenceMessageRequestHash) { + toSerialize["transferCommenceMessageRequestHash"] = o.TransferCommenceMessageRequestHash + } + if !IsNil(o.TransferCommenceMessageResponseHash) { + toSerialize["transferCommenceMessageResponseHash"] = o.TransferCommenceMessageResponseHash + } + if !IsNil(o.ClientSignatureTransferCommenceRequestMessage) { + toSerialize["clientSignatureTransferCommenceRequestMessage"] = o.ClientSignatureTransferCommenceRequestMessage + } + if !IsNil(o.ServerSignatureTransferCommenceResponseMessage) { + toSerialize["serverSignatureTransferCommenceResponseMessage"] = o.ServerSignatureTransferCommenceResponseMessage + } + if !IsNil(o.LockEvidenceRequestMessageHash) { + toSerialize["lockEvidenceRequestMessageHash"] = o.LockEvidenceRequestMessageHash + } + if !IsNil(o.LockEvidenceResponseMessageHash) { + toSerialize["lockEvidenceResponseMessageHash"] = o.LockEvidenceResponseMessageHash + } + if !IsNil(o.ClientSignatureLockEvidenceRequestMessage) { + toSerialize["clientSignatureLockEvidenceRequestMessage"] = o.ClientSignatureLockEvidenceRequestMessage + } + if !IsNil(o.ServerSignatureLockEvidenceResponseMessage) { + toSerialize["serverSignatureLockEvidenceResponseMessage"] = o.ServerSignatureLockEvidenceResponseMessage + } + if !IsNil(o.LockEvidenceClaim) { + toSerialize["lockEvidenceClaim"] = o.LockEvidenceClaim + } + if !IsNil(o.CommitPrepareRequestMessageHash) { + toSerialize["commitPrepareRequestMessageHash"] = o.CommitPrepareRequestMessageHash + } + if !IsNil(o.CommitPrepareResponseMessageHash) { + toSerialize["commitPrepareResponseMessageHash"] = o.CommitPrepareResponseMessageHash + } + if !IsNil(o.ClientSignatureCommitPreparationRequestMessage) { + toSerialize["clientSignatureCommitPreparationRequestMessage"] = o.ClientSignatureCommitPreparationRequestMessage + } + if !IsNil(o.ServerSignatureCommitPreparationResponseMessage) { + toSerialize["serverSignatureCommitPreparationResponseMessage"] = o.ServerSignatureCommitPreparationResponseMessage + } + if !IsNil(o.CommitFinalRequestMessageHash) { + toSerialize["commitFinalRequestMessageHash"] = o.CommitFinalRequestMessageHash + } + if !IsNil(o.CommitFinalResponseMessageHash) { + toSerialize["commitFinalResponseMessageHash"] = o.CommitFinalResponseMessageHash + } + if !IsNil(o.CommitFinalClaim) { + toSerialize["commitFinalClaim"] = o.CommitFinalClaim + } + if !IsNil(o.CommitFinalClaimFormat) { + toSerialize["commitFinalClaimFormat"] = o.CommitFinalClaimFormat + } + if !IsNil(o.CommitAcknowledgementClaim) { + toSerialize["commitAcknowledgementClaim"] = o.CommitAcknowledgementClaim + } + if !IsNil(o.CommitAcknowledgementClaimFormat) { + toSerialize["commitAcknowledgementClaimFormat"] = o.CommitAcknowledgementClaimFormat + } + if !IsNil(o.ClientSignatureCommitFinalRequestMessage) { + toSerialize["clientSignatureCommitFinalRequestMessage"] = o.ClientSignatureCommitFinalRequestMessage + } + if !IsNil(o.ServerSignatureCommitFinalResponseMessage) { + toSerialize["serverSignatureCommitFinalResponseMessage"] = o.ServerSignatureCommitFinalResponseMessage + } + if !IsNil(o.TransferCompleteMessageHash) { + toSerialize["transferCompleteMessageHash"] = o.TransferCompleteMessageHash + } + if !IsNil(o.ClientSignatureTransferCompleteMessage) { + toSerialize["clientSignatureTransferCompleteMessage"] = o.ClientSignatureTransferCompleteMessage + } + if !IsNil(o.MaxRetries) { + toSerialize["maxRetries"] = o.MaxRetries + } + if !IsNil(o.RecipientLedgerAssetID) { + toSerialize["recipientLedgerAssetID"] = o.RecipientLedgerAssetID + } + if !IsNil(o.SourceLedgerAssetID) { + toSerialize["sourceLedgerAssetID"] = o.SourceLedgerAssetID + } + if !IsNil(o.MaxTimeout) { + toSerialize["maxTimeout"] = o.MaxTimeout + } + if !IsNil(o.LastLogEntryTimestamp) { + toSerialize["lastLogEntryTimestamp"] = o.LastLogEntryTimestamp + } + if !IsNil(o.UnlockAssetClaim) { + toSerialize["unlockAssetClaim"] = o.UnlockAssetClaim + } + if !IsNil(o.RecreateAssetClaim) { + toSerialize["recreateAssetClaim"] = o.RecreateAssetClaim + } + if !IsNil(o.DeleteAssetClaim) { + toSerialize["deleteAssetClaim"] = o.DeleteAssetClaim + } + if !IsNil(o.LastMessageReceivedTimestamp) { + toSerialize["lastMessageReceivedTimestamp"] = o.LastMessageReceivedTimestamp + } + if !IsNil(o.Rollback) { + toSerialize["rollback"] = o.Rollback + } + if !IsNil(o.RollbackMessageHash) { + toSerialize["rollbackMessageHash"] = o.RollbackMessageHash + } + if !IsNil(o.RollbackProofs) { + toSerialize["rollbackProofs"] = o.RollbackProofs + } + if !IsNil(o.RollbackActionsPerformed) { + toSerialize["rollbackActionsPerformed"] = o.RollbackActionsPerformed + } + return toSerialize, nil +} + +type NullableSessionData struct { + value *SessionData + isSet bool +} + +func (v NullableSessionData) Get() *SessionData { + return v.value +} + +func (v *NullableSessionData) Set(val *SessionData) { + v.value = val + v.isSet = true +} + +func (v NullableSessionData) IsSet() bool { + return v.isSet +} + +func (v *NullableSessionData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSessionData(val *SessionData) *NullableSessionData { + return &NullableSessionData{value: val, isSet: true} +} + +func (v NullableSessionData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSessionData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_request.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_request.go new file mode 100644 index 00000000000..9dc12f5ce51 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_request.go @@ -0,0 +1,496 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the TransferCommenceV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransferCommenceV1Request{} + +// TransferCommenceV1Request struct for TransferCommenceV1Request +type TransferCommenceV1Request struct { + SessionID string `json:"sessionID"` + MessageType string `json:"messageType"` + OriginatorPubkey string `json:"originatorPubkey"` + BeneficiaryPubkey string `json:"beneficiaryPubkey"` + SenderDltSystem string `json:"senderDltSystem"` + RecipientDltSystem string `json:"recipientDltSystem"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + HashAssetProfile string `json:"hashAssetProfile"` + AssetUnit *int32 `json:"assetUnit,omitempty"` + HashPrevMessage string `json:"hashPrevMessage"` + ClientTransferNumber NullableInt32 `json:"clientTransferNumber,omitempty"` + Signature string `json:"signature"` + SequenceNumber int32 `json:"sequenceNumber"` +} + +// NewTransferCommenceV1Request instantiates a new TransferCommenceV1Request 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 +// will change when the set of required properties is changed +func NewTransferCommenceV1Request(sessionID string, messageType string, originatorPubkey string, beneficiaryPubkey string, senderDltSystem string, recipientDltSystem string, clientIdentityPubkey string, serverIdentityPubkey string, hashAssetProfile string, hashPrevMessage string, signature string, sequenceNumber int32) *TransferCommenceV1Request { + this := TransferCommenceV1Request{} + this.SessionID = sessionID + this.MessageType = messageType + this.OriginatorPubkey = originatorPubkey + this.BeneficiaryPubkey = beneficiaryPubkey + this.SenderDltSystem = senderDltSystem + this.RecipientDltSystem = recipientDltSystem + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.HashAssetProfile = hashAssetProfile + this.HashPrevMessage = hashPrevMessage + this.Signature = signature + this.SequenceNumber = sequenceNumber + return &this +} + +// NewTransferCommenceV1RequestWithDefaults instantiates a new TransferCommenceV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferCommenceV1RequestWithDefaults() *TransferCommenceV1Request { + this := TransferCommenceV1Request{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *TransferCommenceV1Request) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *TransferCommenceV1Request) SetSessionID(v string) { + o.SessionID = v +} + +// GetMessageType returns the MessageType field value +func (o *TransferCommenceV1Request) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *TransferCommenceV1Request) SetMessageType(v string) { + o.MessageType = v +} + +// GetOriginatorPubkey returns the OriginatorPubkey field value +func (o *TransferCommenceV1Request) GetOriginatorPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.OriginatorPubkey +} + +// GetOriginatorPubkeyOk returns a tuple with the OriginatorPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetOriginatorPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OriginatorPubkey, true +} + +// SetOriginatorPubkey sets field value +func (o *TransferCommenceV1Request) SetOriginatorPubkey(v string) { + o.OriginatorPubkey = v +} + +// GetBeneficiaryPubkey returns the BeneficiaryPubkey field value +func (o *TransferCommenceV1Request) GetBeneficiaryPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.BeneficiaryPubkey +} + +// GetBeneficiaryPubkeyOk returns a tuple with the BeneficiaryPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetBeneficiaryPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BeneficiaryPubkey, true +} + +// SetBeneficiaryPubkey sets field value +func (o *TransferCommenceV1Request) SetBeneficiaryPubkey(v string) { + o.BeneficiaryPubkey = v +} + +// GetSenderDltSystem returns the SenderDltSystem field value +func (o *TransferCommenceV1Request) GetSenderDltSystem() string { + if o == nil { + var ret string + return ret + } + + return o.SenderDltSystem +} + +// GetSenderDltSystemOk returns a tuple with the SenderDltSystem field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetSenderDltSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SenderDltSystem, true +} + +// SetSenderDltSystem sets field value +func (o *TransferCommenceV1Request) SetSenderDltSystem(v string) { + o.SenderDltSystem = v +} + +// GetRecipientDltSystem returns the RecipientDltSystem field value +func (o *TransferCommenceV1Request) GetRecipientDltSystem() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientDltSystem +} + +// GetRecipientDltSystemOk returns a tuple with the RecipientDltSystem field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetRecipientDltSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientDltSystem, true +} + +// SetRecipientDltSystem sets field value +func (o *TransferCommenceV1Request) SetRecipientDltSystem(v string) { + o.RecipientDltSystem = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *TransferCommenceV1Request) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *TransferCommenceV1Request) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *TransferCommenceV1Request) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *TransferCommenceV1Request) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetHashAssetProfile returns the HashAssetProfile field value +func (o *TransferCommenceV1Request) GetHashAssetProfile() string { + if o == nil { + var ret string + return ret + } + + return o.HashAssetProfile +} + +// GetHashAssetProfileOk returns a tuple with the HashAssetProfile field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetHashAssetProfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashAssetProfile, true +} + +// SetHashAssetProfile sets field value +func (o *TransferCommenceV1Request) SetHashAssetProfile(v string) { + o.HashAssetProfile = v +} + +// GetAssetUnit returns the AssetUnit field value if set, zero value otherwise. +func (o *TransferCommenceV1Request) GetAssetUnit() int32 { + if o == nil || IsNil(o.AssetUnit) { + var ret int32 + return ret + } + return *o.AssetUnit +} + +// GetAssetUnitOk returns a tuple with the AssetUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetAssetUnitOk() (*int32, bool) { + if o == nil || IsNil(o.AssetUnit) { + return nil, false + } + return o.AssetUnit, true +} + +// HasAssetUnit returns a boolean if a field has been set. +func (o *TransferCommenceV1Request) HasAssetUnit() bool { + if o != nil && !IsNil(o.AssetUnit) { + return true + } + + return false +} + +// SetAssetUnit gets a reference to the given int32 and assigns it to the AssetUnit field. +func (o *TransferCommenceV1Request) SetAssetUnit(v int32) { + o.AssetUnit = &v +} + +// GetHashPrevMessage returns the HashPrevMessage field value +func (o *TransferCommenceV1Request) GetHashPrevMessage() string { + if o == nil { + var ret string + return ret + } + + return o.HashPrevMessage +} + +// GetHashPrevMessageOk returns a tuple with the HashPrevMessage field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetHashPrevMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashPrevMessage, true +} + +// SetHashPrevMessage sets field value +func (o *TransferCommenceV1Request) SetHashPrevMessage(v string) { + o.HashPrevMessage = v +} + +// GetClientTransferNumber returns the ClientTransferNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TransferCommenceV1Request) GetClientTransferNumber() int32 { + if o == nil || IsNil(o.ClientTransferNumber.Get()) { + var ret int32 + return ret + } + return *o.ClientTransferNumber.Get() +} + +// GetClientTransferNumberOk returns a tuple with the ClientTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TransferCommenceV1Request) GetClientTransferNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ClientTransferNumber.Get(), o.ClientTransferNumber.IsSet() +} + +// HasClientTransferNumber returns a boolean if a field has been set. +func (o *TransferCommenceV1Request) HasClientTransferNumber() bool { + if o != nil && o.ClientTransferNumber.IsSet() { + return true + } + + return false +} + +// SetClientTransferNumber gets a reference to the given NullableInt32 and assigns it to the ClientTransferNumber field. +func (o *TransferCommenceV1Request) SetClientTransferNumber(v int32) { + o.ClientTransferNumber.Set(&v) +} +// SetClientTransferNumberNil sets the value for ClientTransferNumber to be an explicit nil +func (o *TransferCommenceV1Request) SetClientTransferNumberNil() { + o.ClientTransferNumber.Set(nil) +} + +// UnsetClientTransferNumber ensures that no value is present for ClientTransferNumber, not even an explicit nil +func (o *TransferCommenceV1Request) UnsetClientTransferNumber() { + o.ClientTransferNumber.Unset() +} + +// GetSignature returns the Signature field value +func (o *TransferCommenceV1Request) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *TransferCommenceV1Request) SetSignature(v string) { + o.Signature = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *TransferCommenceV1Request) GetSequenceNumber() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Request) GetSequenceNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *TransferCommenceV1Request) SetSequenceNumber(v int32) { + o.SequenceNumber = v +} + +func (o TransferCommenceV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferCommenceV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["messageType"] = o.MessageType + toSerialize["originatorPubkey"] = o.OriginatorPubkey + toSerialize["beneficiaryPubkey"] = o.BeneficiaryPubkey + toSerialize["senderDltSystem"] = o.SenderDltSystem + toSerialize["recipientDltSystem"] = o.RecipientDltSystem + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["hashAssetProfile"] = o.HashAssetProfile + if !IsNil(o.AssetUnit) { + toSerialize["assetUnit"] = o.AssetUnit + } + toSerialize["hashPrevMessage"] = o.HashPrevMessage + if o.ClientTransferNumber.IsSet() { + toSerialize["clientTransferNumber"] = o.ClientTransferNumber.Get() + } + toSerialize["signature"] = o.Signature + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableTransferCommenceV1Request struct { + value *TransferCommenceV1Request + isSet bool +} + +func (v NullableTransferCommenceV1Request) Get() *TransferCommenceV1Request { + return v.value +} + +func (v *NullableTransferCommenceV1Request) Set(val *TransferCommenceV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableTransferCommenceV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferCommenceV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferCommenceV1Request(val *TransferCommenceV1Request) *NullableTransferCommenceV1Request { + return &NullableTransferCommenceV1Request{value: val, isSet: true} +} + +func (v NullableTransferCommenceV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferCommenceV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_response.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_response.go new file mode 100644 index 00000000000..941bfddb2df --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_response.go @@ -0,0 +1,361 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the TransferCommenceV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransferCommenceV1Response{} + +// TransferCommenceV1Response struct for TransferCommenceV1Response +type TransferCommenceV1Response struct { + SessionID string `json:"sessionID"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + HashCommenceRequest string `json:"hashCommenceRequest"` + ServerTransferNumber NullableInt32 `json:"serverTransferNumber,omitempty"` + Signature string `json:"signature"` + MessageType string `json:"messageType"` + MessageHash *string `json:"messageHash,omitempty"` + SequenceNumber float32 `json:"sequenceNumber"` +} + +// NewTransferCommenceV1Response instantiates a new TransferCommenceV1Response 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 +// will change when the set of required properties is changed +func NewTransferCommenceV1Response(sessionID string, clientIdentityPubkey string, serverIdentityPubkey string, hashCommenceRequest string, signature string, messageType string, sequenceNumber float32) *TransferCommenceV1Response { + this := TransferCommenceV1Response{} + this.SessionID = sessionID + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.HashCommenceRequest = hashCommenceRequest + this.Signature = signature + this.MessageType = messageType + this.SequenceNumber = sequenceNumber + return &this +} + +// NewTransferCommenceV1ResponseWithDefaults instantiates a new TransferCommenceV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferCommenceV1ResponseWithDefaults() *TransferCommenceV1Response { + this := TransferCommenceV1Response{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *TransferCommenceV1Response) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Response) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *TransferCommenceV1Response) SetSessionID(v string) { + o.SessionID = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *TransferCommenceV1Response) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Response) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *TransferCommenceV1Response) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *TransferCommenceV1Response) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Response) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *TransferCommenceV1Response) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetHashCommenceRequest returns the HashCommenceRequest field value +func (o *TransferCommenceV1Response) GetHashCommenceRequest() string { + if o == nil { + var ret string + return ret + } + + return o.HashCommenceRequest +} + +// GetHashCommenceRequestOk returns a tuple with the HashCommenceRequest field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Response) GetHashCommenceRequestOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashCommenceRequest, true +} + +// SetHashCommenceRequest sets field value +func (o *TransferCommenceV1Response) SetHashCommenceRequest(v string) { + o.HashCommenceRequest = v +} + +// GetServerTransferNumber returns the ServerTransferNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TransferCommenceV1Response) GetServerTransferNumber() int32 { + if o == nil || IsNil(o.ServerTransferNumber.Get()) { + var ret int32 + return ret + } + return *o.ServerTransferNumber.Get() +} + +// GetServerTransferNumberOk returns a tuple with the ServerTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TransferCommenceV1Response) GetServerTransferNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ServerTransferNumber.Get(), o.ServerTransferNumber.IsSet() +} + +// HasServerTransferNumber returns a boolean if a field has been set. +func (o *TransferCommenceV1Response) HasServerTransferNumber() bool { + if o != nil && o.ServerTransferNumber.IsSet() { + return true + } + + return false +} + +// SetServerTransferNumber gets a reference to the given NullableInt32 and assigns it to the ServerTransferNumber field. +func (o *TransferCommenceV1Response) SetServerTransferNumber(v int32) { + o.ServerTransferNumber.Set(&v) +} +// SetServerTransferNumberNil sets the value for ServerTransferNumber to be an explicit nil +func (o *TransferCommenceV1Response) SetServerTransferNumberNil() { + o.ServerTransferNumber.Set(nil) +} + +// UnsetServerTransferNumber ensures that no value is present for ServerTransferNumber, not even an explicit nil +func (o *TransferCommenceV1Response) UnsetServerTransferNumber() { + o.ServerTransferNumber.Unset() +} + +// GetSignature returns the Signature field value +func (o *TransferCommenceV1Response) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Response) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *TransferCommenceV1Response) SetSignature(v string) { + o.Signature = v +} + +// GetMessageType returns the MessageType field value +func (o *TransferCommenceV1Response) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Response) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *TransferCommenceV1Response) SetMessageType(v string) { + o.MessageType = v +} + +// GetMessageHash returns the MessageHash field value if set, zero value otherwise. +func (o *TransferCommenceV1Response) GetMessageHash() string { + if o == nil || IsNil(o.MessageHash) { + var ret string + return ret + } + return *o.MessageHash +} + +// GetMessageHashOk returns a tuple with the MessageHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Response) GetMessageHashOk() (*string, bool) { + if o == nil || IsNil(o.MessageHash) { + return nil, false + } + return o.MessageHash, true +} + +// HasMessageHash returns a boolean if a field has been set. +func (o *TransferCommenceV1Response) HasMessageHash() bool { + if o != nil && !IsNil(o.MessageHash) { + return true + } + + return false +} + +// SetMessageHash gets a reference to the given string and assigns it to the MessageHash field. +func (o *TransferCommenceV1Response) SetMessageHash(v string) { + o.MessageHash = &v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *TransferCommenceV1Response) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *TransferCommenceV1Response) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *TransferCommenceV1Response) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +func (o TransferCommenceV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferCommenceV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["hashCommenceRequest"] = o.HashCommenceRequest + if o.ServerTransferNumber.IsSet() { + toSerialize["serverTransferNumber"] = o.ServerTransferNumber.Get() + } + toSerialize["signature"] = o.Signature + toSerialize["messageType"] = o.MessageType + if !IsNil(o.MessageHash) { + toSerialize["messageHash"] = o.MessageHash + } + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableTransferCommenceV1Response struct { + value *TransferCommenceV1Response + isSet bool +} + +func (v NullableTransferCommenceV1Response) Get() *TransferCommenceV1Response { + return v.value +} + +func (v *NullableTransferCommenceV1Response) Set(val *TransferCommenceV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableTransferCommenceV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferCommenceV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferCommenceV1Response(val *TransferCommenceV1Response) *NullableTransferCommenceV1Response { + return &NullableTransferCommenceV1Response{value: val, isSet: true} +} + +func (v NullableTransferCommenceV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferCommenceV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_complete_v1_request.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_complete_v1_request.go new file mode 100644 index 00000000000..08ddec02038 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_complete_v1_request.go @@ -0,0 +1,352 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the TransferCompleteV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransferCompleteV1Request{} + +// TransferCompleteV1Request struct for TransferCompleteV1Request +type TransferCompleteV1Request struct { + SessionID string `json:"sessionID"` + MessageType string `json:"messageType"` + ClientIdentityPubkey string `json:"clientIdentityPubkey"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + HashCommitFinalAck string `json:"hashCommitFinalAck"` + ClientTransferNumber NullableInt32 `json:"clientTransferNumber,omitempty"` + Signature string `json:"signature"` + HashTransferCommence string `json:"hashTransferCommence"` + SequenceNumber float32 `json:"sequenceNumber"` +} + +// NewTransferCompleteV1Request instantiates a new TransferCompleteV1Request 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 +// will change when the set of required properties is changed +func NewTransferCompleteV1Request(sessionID string, messageType string, clientIdentityPubkey string, serverIdentityPubkey string, hashCommitFinalAck string, signature string, hashTransferCommence string, sequenceNumber float32) *TransferCompleteV1Request { + this := TransferCompleteV1Request{} + this.SessionID = sessionID + this.MessageType = messageType + this.ClientIdentityPubkey = clientIdentityPubkey + this.ServerIdentityPubkey = serverIdentityPubkey + this.HashCommitFinalAck = hashCommitFinalAck + this.Signature = signature + this.HashTransferCommence = hashTransferCommence + this.SequenceNumber = sequenceNumber + return &this +} + +// NewTransferCompleteV1RequestWithDefaults instantiates a new TransferCompleteV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferCompleteV1RequestWithDefaults() *TransferCompleteV1Request { + this := TransferCompleteV1Request{} + return &this +} + +// GetSessionID returns the SessionID field value +func (o *TransferCompleteV1Request) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *TransferCompleteV1Request) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *TransferCompleteV1Request) SetSessionID(v string) { + o.SessionID = v +} + +// GetMessageType returns the MessageType field value +func (o *TransferCompleteV1Request) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *TransferCompleteV1Request) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *TransferCompleteV1Request) SetMessageType(v string) { + o.MessageType = v +} + +// GetClientIdentityPubkey returns the ClientIdentityPubkey field value +func (o *TransferCompleteV1Request) GetClientIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ClientIdentityPubkey +} + +// GetClientIdentityPubkeyOk returns a tuple with the ClientIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferCompleteV1Request) GetClientIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientIdentityPubkey, true +} + +// SetClientIdentityPubkey sets field value +func (o *TransferCompleteV1Request) SetClientIdentityPubkey(v string) { + o.ClientIdentityPubkey = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *TransferCompleteV1Request) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferCompleteV1Request) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *TransferCompleteV1Request) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetHashCommitFinalAck returns the HashCommitFinalAck field value +func (o *TransferCompleteV1Request) GetHashCommitFinalAck() string { + if o == nil { + var ret string + return ret + } + + return o.HashCommitFinalAck +} + +// GetHashCommitFinalAckOk returns a tuple with the HashCommitFinalAck field value +// and a boolean to check if the value has been set. +func (o *TransferCompleteV1Request) GetHashCommitFinalAckOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashCommitFinalAck, true +} + +// SetHashCommitFinalAck sets field value +func (o *TransferCompleteV1Request) SetHashCommitFinalAck(v string) { + o.HashCommitFinalAck = v +} + +// GetClientTransferNumber returns the ClientTransferNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TransferCompleteV1Request) GetClientTransferNumber() int32 { + if o == nil || IsNil(o.ClientTransferNumber.Get()) { + var ret int32 + return ret + } + return *o.ClientTransferNumber.Get() +} + +// GetClientTransferNumberOk returns a tuple with the ClientTransferNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TransferCompleteV1Request) GetClientTransferNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.ClientTransferNumber.Get(), o.ClientTransferNumber.IsSet() +} + +// HasClientTransferNumber returns a boolean if a field has been set. +func (o *TransferCompleteV1Request) HasClientTransferNumber() bool { + if o != nil && o.ClientTransferNumber.IsSet() { + return true + } + + return false +} + +// SetClientTransferNumber gets a reference to the given NullableInt32 and assigns it to the ClientTransferNumber field. +func (o *TransferCompleteV1Request) SetClientTransferNumber(v int32) { + o.ClientTransferNumber.Set(&v) +} +// SetClientTransferNumberNil sets the value for ClientTransferNumber to be an explicit nil +func (o *TransferCompleteV1Request) SetClientTransferNumberNil() { + o.ClientTransferNumber.Set(nil) +} + +// UnsetClientTransferNumber ensures that no value is present for ClientTransferNumber, not even an explicit nil +func (o *TransferCompleteV1Request) UnsetClientTransferNumber() { + o.ClientTransferNumber.Unset() +} + +// GetSignature returns the Signature field value +func (o *TransferCompleteV1Request) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *TransferCompleteV1Request) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *TransferCompleteV1Request) SetSignature(v string) { + o.Signature = v +} + +// GetHashTransferCommence returns the HashTransferCommence field value +func (o *TransferCompleteV1Request) GetHashTransferCommence() string { + if o == nil { + var ret string + return ret + } + + return o.HashTransferCommence +} + +// GetHashTransferCommenceOk returns a tuple with the HashTransferCommence field value +// and a boolean to check if the value has been set. +func (o *TransferCompleteV1Request) GetHashTransferCommenceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HashTransferCommence, true +} + +// SetHashTransferCommence sets field value +func (o *TransferCompleteV1Request) SetHashTransferCommence(v string) { + o.HashTransferCommence = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *TransferCompleteV1Request) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *TransferCompleteV1Request) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *TransferCompleteV1Request) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +func (o TransferCompleteV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferCompleteV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sessionID"] = o.SessionID + toSerialize["messageType"] = o.MessageType + toSerialize["clientIdentityPubkey"] = o.ClientIdentityPubkey + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["hashCommitFinalAck"] = o.HashCommitFinalAck + if o.ClientTransferNumber.IsSet() { + toSerialize["clientTransferNumber"] = o.ClientTransferNumber.Get() + } + toSerialize["signature"] = o.Signature + toSerialize["hashTransferCommence"] = o.HashTransferCommence + toSerialize["sequenceNumber"] = o.SequenceNumber + return toSerialize, nil +} + +type NullableTransferCompleteV1Request struct { + value *TransferCompleteV1Request + isSet bool +} + +func (v NullableTransferCompleteV1Request) Get() *TransferCompleteV1Request { + return v.value +} + +func (v *NullableTransferCompleteV1Request) Set(val *TransferCompleteV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableTransferCompleteV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferCompleteV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferCompleteV1Request(val *TransferCompleteV1Request) *NullableTransferCompleteV1Request { + return &NullableTransferCompleteV1Request{value: val, isSet: true} +} + +func (v NullableTransferCompleteV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferCompleteV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_request.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_request.go new file mode 100644 index 00000000000..e488dc74181 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_request.go @@ -0,0 +1,1035 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the TransferInitializationV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransferInitializationV1Request{} + +// TransferInitializationV1Request struct for TransferInitializationV1Request +type TransferInitializationV1Request struct { + MessageType string `json:"messageType"` + SessionID string `json:"sessionID"` + Version *string `json:"version,omitempty"` + DeveloperURN *string `json:"developerURN,omitempty"` + CredentialProfile *CredentialProfile `json:"credentialProfile,omitempty"` + PayloadProfile PayloadProfile `json:"payloadProfile"` + ApplicationProfile string `json:"applicationProfile"` + LoggingProfile string `json:"loggingProfile"` + AccessControlProfile string `json:"accessControlProfile"` + Signature string `json:"signature"` + SourceGatewayPubkey string `json:"sourceGatewayPubkey"` + SourceGatewayDltSystem string `json:"sourceGatewayDltSystem"` + RecipientGatewayPubkey string `json:"recipientGatewayPubkey"` + RecipientGatewayDltSystem string `json:"recipientGatewayDltSystem"` + EscrowType *string `json:"escrowType,omitempty"` + ExpiryTime *string `json:"expiryTime,omitempty"` + MultipleClaimsAllowed *bool `json:"multipleClaimsAllowed,omitempty"` + MultipleCancelsAllowed *bool `json:"multipleCancelsAllowed,omitempty"` + Permissions map[string]interface{} `json:"permissions,omitempty"` + Origin *string `json:"origin,omitempty"` + Destination *string `json:"destination,omitempty"` + SubsequentCalls map[string]interface{} `json:"subsequentCalls,omitempty"` + Histories []History `json:"histories,omitempty"` + SequenceNumber int32 `json:"sequenceNumber"` + SourceBasePath string `json:"sourceBasePath"` + RecipientBasePath string `json:"recipientBasePath"` + MaxRetries float32 `json:"maxRetries"` + MaxTimeout float32 `json:"maxTimeout"` + BackupGatewaysAllowed []string `json:"backupGatewaysAllowed"` + RecipientLedgerAssetID string `json:"recipientLedgerAssetID"` + SourceLedgerAssetID string `json:"sourceLedgerAssetID"` +} + +// NewTransferInitializationV1Request instantiates a new TransferInitializationV1Request 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 +// will change when the set of required properties is changed +func NewTransferInitializationV1Request(messageType string, sessionID string, payloadProfile PayloadProfile, applicationProfile string, loggingProfile string, accessControlProfile string, signature string, sourceGatewayPubkey string, sourceGatewayDltSystem string, recipientGatewayPubkey string, recipientGatewayDltSystem string, sequenceNumber int32, sourceBasePath string, recipientBasePath string, maxRetries float32, maxTimeout float32, backupGatewaysAllowed []string, recipientLedgerAssetID string, sourceLedgerAssetID string) *TransferInitializationV1Request { + this := TransferInitializationV1Request{} + this.MessageType = messageType + this.SessionID = sessionID + this.PayloadProfile = payloadProfile + this.ApplicationProfile = applicationProfile + this.LoggingProfile = loggingProfile + this.AccessControlProfile = accessControlProfile + this.Signature = signature + this.SourceGatewayPubkey = sourceGatewayPubkey + this.SourceGatewayDltSystem = sourceGatewayDltSystem + this.RecipientGatewayPubkey = recipientGatewayPubkey + this.RecipientGatewayDltSystem = recipientGatewayDltSystem + this.SequenceNumber = sequenceNumber + this.SourceBasePath = sourceBasePath + this.RecipientBasePath = recipientBasePath + this.MaxRetries = maxRetries + this.MaxTimeout = maxTimeout + this.BackupGatewaysAllowed = backupGatewaysAllowed + this.RecipientLedgerAssetID = recipientLedgerAssetID + this.SourceLedgerAssetID = sourceLedgerAssetID + return &this +} + +// NewTransferInitializationV1RequestWithDefaults instantiates a new TransferInitializationV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferInitializationV1RequestWithDefaults() *TransferInitializationV1Request { + this := TransferInitializationV1Request{} + return &this +} + +// GetMessageType returns the MessageType field value +func (o *TransferInitializationV1Request) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *TransferInitializationV1Request) SetMessageType(v string) { + o.MessageType = v +} + +// GetSessionID returns the SessionID field value +func (o *TransferInitializationV1Request) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *TransferInitializationV1Request) SetSessionID(v string) { + o.SessionID = v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *TransferInitializationV1Request) SetVersion(v string) { + o.Version = &v +} + +// GetDeveloperURN returns the DeveloperURN field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetDeveloperURN() string { + if o == nil || IsNil(o.DeveloperURN) { + var ret string + return ret + } + return *o.DeveloperURN +} + +// GetDeveloperURNOk returns a tuple with the DeveloperURN field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetDeveloperURNOk() (*string, bool) { + if o == nil || IsNil(o.DeveloperURN) { + return nil, false + } + return o.DeveloperURN, true +} + +// HasDeveloperURN returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasDeveloperURN() bool { + if o != nil && !IsNil(o.DeveloperURN) { + return true + } + + return false +} + +// SetDeveloperURN gets a reference to the given string and assigns it to the DeveloperURN field. +func (o *TransferInitializationV1Request) SetDeveloperURN(v string) { + o.DeveloperURN = &v +} + +// GetCredentialProfile returns the CredentialProfile field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetCredentialProfile() CredentialProfile { + if o == nil || IsNil(o.CredentialProfile) { + var ret CredentialProfile + return ret + } + return *o.CredentialProfile +} + +// GetCredentialProfileOk returns a tuple with the CredentialProfile field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetCredentialProfileOk() (*CredentialProfile, bool) { + if o == nil || IsNil(o.CredentialProfile) { + return nil, false + } + return o.CredentialProfile, true +} + +// HasCredentialProfile returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasCredentialProfile() bool { + if o != nil && !IsNil(o.CredentialProfile) { + return true + } + + return false +} + +// SetCredentialProfile gets a reference to the given CredentialProfile and assigns it to the CredentialProfile field. +func (o *TransferInitializationV1Request) SetCredentialProfile(v CredentialProfile) { + o.CredentialProfile = &v +} + +// GetPayloadProfile returns the PayloadProfile field value +func (o *TransferInitializationV1Request) GetPayloadProfile() PayloadProfile { + if o == nil { + var ret PayloadProfile + return ret + } + + return o.PayloadProfile +} + +// GetPayloadProfileOk returns a tuple with the PayloadProfile field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetPayloadProfileOk() (*PayloadProfile, bool) { + if o == nil { + return nil, false + } + return &o.PayloadProfile, true +} + +// SetPayloadProfile sets field value +func (o *TransferInitializationV1Request) SetPayloadProfile(v PayloadProfile) { + o.PayloadProfile = v +} + +// GetApplicationProfile returns the ApplicationProfile field value +func (o *TransferInitializationV1Request) GetApplicationProfile() string { + if o == nil { + var ret string + return ret + } + + return o.ApplicationProfile +} + +// GetApplicationProfileOk returns a tuple with the ApplicationProfile field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetApplicationProfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ApplicationProfile, true +} + +// SetApplicationProfile sets field value +func (o *TransferInitializationV1Request) SetApplicationProfile(v string) { + o.ApplicationProfile = v +} + +// GetLoggingProfile returns the LoggingProfile field value +func (o *TransferInitializationV1Request) GetLoggingProfile() string { + if o == nil { + var ret string + return ret + } + + return o.LoggingProfile +} + +// GetLoggingProfileOk returns a tuple with the LoggingProfile field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetLoggingProfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LoggingProfile, true +} + +// SetLoggingProfile sets field value +func (o *TransferInitializationV1Request) SetLoggingProfile(v string) { + o.LoggingProfile = v +} + +// GetAccessControlProfile returns the AccessControlProfile field value +func (o *TransferInitializationV1Request) GetAccessControlProfile() string { + if o == nil { + var ret string + return ret + } + + return o.AccessControlProfile +} + +// GetAccessControlProfileOk returns a tuple with the AccessControlProfile field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetAccessControlProfileOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccessControlProfile, true +} + +// SetAccessControlProfile sets field value +func (o *TransferInitializationV1Request) SetAccessControlProfile(v string) { + o.AccessControlProfile = v +} + +// GetSignature returns the Signature field value +func (o *TransferInitializationV1Request) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *TransferInitializationV1Request) SetSignature(v string) { + o.Signature = v +} + +// GetSourceGatewayPubkey returns the SourceGatewayPubkey field value +func (o *TransferInitializationV1Request) GetSourceGatewayPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.SourceGatewayPubkey +} + +// GetSourceGatewayPubkeyOk returns a tuple with the SourceGatewayPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetSourceGatewayPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SourceGatewayPubkey, true +} + +// SetSourceGatewayPubkey sets field value +func (o *TransferInitializationV1Request) SetSourceGatewayPubkey(v string) { + o.SourceGatewayPubkey = v +} + +// GetSourceGatewayDltSystem returns the SourceGatewayDltSystem field value +func (o *TransferInitializationV1Request) GetSourceGatewayDltSystem() string { + if o == nil { + var ret string + return ret + } + + return o.SourceGatewayDltSystem +} + +// GetSourceGatewayDltSystemOk returns a tuple with the SourceGatewayDltSystem field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetSourceGatewayDltSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SourceGatewayDltSystem, true +} + +// SetSourceGatewayDltSystem sets field value +func (o *TransferInitializationV1Request) SetSourceGatewayDltSystem(v string) { + o.SourceGatewayDltSystem = v +} + +// GetRecipientGatewayPubkey returns the RecipientGatewayPubkey field value +func (o *TransferInitializationV1Request) GetRecipientGatewayPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientGatewayPubkey +} + +// GetRecipientGatewayPubkeyOk returns a tuple with the RecipientGatewayPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetRecipientGatewayPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientGatewayPubkey, true +} + +// SetRecipientGatewayPubkey sets field value +func (o *TransferInitializationV1Request) SetRecipientGatewayPubkey(v string) { + o.RecipientGatewayPubkey = v +} + +// GetRecipientGatewayDltSystem returns the RecipientGatewayDltSystem field value +func (o *TransferInitializationV1Request) GetRecipientGatewayDltSystem() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientGatewayDltSystem +} + +// GetRecipientGatewayDltSystemOk returns a tuple with the RecipientGatewayDltSystem field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetRecipientGatewayDltSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientGatewayDltSystem, true +} + +// SetRecipientGatewayDltSystem sets field value +func (o *TransferInitializationV1Request) SetRecipientGatewayDltSystem(v string) { + o.RecipientGatewayDltSystem = v +} + +// GetEscrowType returns the EscrowType field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetEscrowType() string { + if o == nil || IsNil(o.EscrowType) { + var ret string + return ret + } + return *o.EscrowType +} + +// GetEscrowTypeOk returns a tuple with the EscrowType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetEscrowTypeOk() (*string, bool) { + if o == nil || IsNil(o.EscrowType) { + return nil, false + } + return o.EscrowType, true +} + +// HasEscrowType returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasEscrowType() bool { + if o != nil && !IsNil(o.EscrowType) { + return true + } + + return false +} + +// SetEscrowType gets a reference to the given string and assigns it to the EscrowType field. +func (o *TransferInitializationV1Request) SetEscrowType(v string) { + o.EscrowType = &v +} + +// GetExpiryTime returns the ExpiryTime field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetExpiryTime() string { + if o == nil || IsNil(o.ExpiryTime) { + var ret string + return ret + } + return *o.ExpiryTime +} + +// GetExpiryTimeOk returns a tuple with the ExpiryTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetExpiryTimeOk() (*string, bool) { + if o == nil || IsNil(o.ExpiryTime) { + return nil, false + } + return o.ExpiryTime, true +} + +// HasExpiryTime returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasExpiryTime() bool { + if o != nil && !IsNil(o.ExpiryTime) { + return true + } + + return false +} + +// SetExpiryTime gets a reference to the given string and assigns it to the ExpiryTime field. +func (o *TransferInitializationV1Request) SetExpiryTime(v string) { + o.ExpiryTime = &v +} + +// GetMultipleClaimsAllowed returns the MultipleClaimsAllowed field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetMultipleClaimsAllowed() bool { + if o == nil || IsNil(o.MultipleClaimsAllowed) { + var ret bool + return ret + } + return *o.MultipleClaimsAllowed +} + +// GetMultipleClaimsAllowedOk returns a tuple with the MultipleClaimsAllowed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetMultipleClaimsAllowedOk() (*bool, bool) { + if o == nil || IsNil(o.MultipleClaimsAllowed) { + return nil, false + } + return o.MultipleClaimsAllowed, true +} + +// HasMultipleClaimsAllowed returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasMultipleClaimsAllowed() bool { + if o != nil && !IsNil(o.MultipleClaimsAllowed) { + return true + } + + return false +} + +// SetMultipleClaimsAllowed gets a reference to the given bool and assigns it to the MultipleClaimsAllowed field. +func (o *TransferInitializationV1Request) SetMultipleClaimsAllowed(v bool) { + o.MultipleClaimsAllowed = &v +} + +// GetMultipleCancelsAllowed returns the MultipleCancelsAllowed field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetMultipleCancelsAllowed() bool { + if o == nil || IsNil(o.MultipleCancelsAllowed) { + var ret bool + return ret + } + return *o.MultipleCancelsAllowed +} + +// GetMultipleCancelsAllowedOk returns a tuple with the MultipleCancelsAllowed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetMultipleCancelsAllowedOk() (*bool, bool) { + if o == nil || IsNil(o.MultipleCancelsAllowed) { + return nil, false + } + return o.MultipleCancelsAllowed, true +} + +// HasMultipleCancelsAllowed returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasMultipleCancelsAllowed() bool { + if o != nil && !IsNil(o.MultipleCancelsAllowed) { + return true + } + + return false +} + +// SetMultipleCancelsAllowed gets a reference to the given bool and assigns it to the MultipleCancelsAllowed field. +func (o *TransferInitializationV1Request) SetMultipleCancelsAllowed(v bool) { + o.MultipleCancelsAllowed = &v +} + +// GetPermissions returns the Permissions field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetPermissions() map[string]interface{} { + if o == nil || IsNil(o.Permissions) { + var ret map[string]interface{} + return ret + } + return o.Permissions +} + +// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetPermissionsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Permissions) { + return map[string]interface{}{}, false + } + return o.Permissions, true +} + +// HasPermissions returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasPermissions() bool { + if o != nil && !IsNil(o.Permissions) { + return true + } + + return false +} + +// SetPermissions gets a reference to the given map[string]interface{} and assigns it to the Permissions field. +func (o *TransferInitializationV1Request) SetPermissions(v map[string]interface{}) { + o.Permissions = v +} + +// GetOrigin returns the Origin field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetOrigin() string { + if o == nil || IsNil(o.Origin) { + var ret string + return ret + } + return *o.Origin +} + +// GetOriginOk returns a tuple with the Origin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetOriginOk() (*string, bool) { + if o == nil || IsNil(o.Origin) { + return nil, false + } + return o.Origin, true +} + +// HasOrigin returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasOrigin() bool { + if o != nil && !IsNil(o.Origin) { + return true + } + + return false +} + +// SetOrigin gets a reference to the given string and assigns it to the Origin field. +func (o *TransferInitializationV1Request) SetOrigin(v string) { + o.Origin = &v +} + +// GetDestination returns the Destination field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetDestination() string { + if o == nil || IsNil(o.Destination) { + var ret string + return ret + } + return *o.Destination +} + +// GetDestinationOk returns a tuple with the Destination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetDestinationOk() (*string, bool) { + if o == nil || IsNil(o.Destination) { + return nil, false + } + return o.Destination, true +} + +// HasDestination returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasDestination() bool { + if o != nil && !IsNil(o.Destination) { + return true + } + + return false +} + +// SetDestination gets a reference to the given string and assigns it to the Destination field. +func (o *TransferInitializationV1Request) SetDestination(v string) { + o.Destination = &v +} + +// GetSubsequentCalls returns the SubsequentCalls field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetSubsequentCalls() map[string]interface{} { + if o == nil || IsNil(o.SubsequentCalls) { + var ret map[string]interface{} + return ret + } + return o.SubsequentCalls +} + +// GetSubsequentCallsOk returns a tuple with the SubsequentCalls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetSubsequentCallsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.SubsequentCalls) { + return map[string]interface{}{}, false + } + return o.SubsequentCalls, true +} + +// HasSubsequentCalls returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasSubsequentCalls() bool { + if o != nil && !IsNil(o.SubsequentCalls) { + return true + } + + return false +} + +// SetSubsequentCalls gets a reference to the given map[string]interface{} and assigns it to the SubsequentCalls field. +func (o *TransferInitializationV1Request) SetSubsequentCalls(v map[string]interface{}) { + o.SubsequentCalls = v +} + +// GetHistories returns the Histories field value if set, zero value otherwise. +func (o *TransferInitializationV1Request) GetHistories() []History { + if o == nil || IsNil(o.Histories) { + var ret []History + return ret + } + return o.Histories +} + +// GetHistoriesOk returns a tuple with the Histories field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetHistoriesOk() ([]History, bool) { + if o == nil || IsNil(o.Histories) { + return nil, false + } + return o.Histories, true +} + +// HasHistories returns a boolean if a field has been set. +func (o *TransferInitializationV1Request) HasHistories() bool { + if o != nil && !IsNil(o.Histories) { + return true + } + + return false +} + +// SetHistories gets a reference to the given []History and assigns it to the Histories field. +func (o *TransferInitializationV1Request) SetHistories(v []History) { + o.Histories = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *TransferInitializationV1Request) GetSequenceNumber() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetSequenceNumberOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *TransferInitializationV1Request) SetSequenceNumber(v int32) { + o.SequenceNumber = v +} + +// GetSourceBasePath returns the SourceBasePath field value +func (o *TransferInitializationV1Request) GetSourceBasePath() string { + if o == nil { + var ret string + return ret + } + + return o.SourceBasePath +} + +// GetSourceBasePathOk returns a tuple with the SourceBasePath field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetSourceBasePathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SourceBasePath, true +} + +// SetSourceBasePath sets field value +func (o *TransferInitializationV1Request) SetSourceBasePath(v string) { + o.SourceBasePath = v +} + +// GetRecipientBasePath returns the RecipientBasePath field value +func (o *TransferInitializationV1Request) GetRecipientBasePath() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientBasePath +} + +// GetRecipientBasePathOk returns a tuple with the RecipientBasePath field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetRecipientBasePathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientBasePath, true +} + +// SetRecipientBasePath sets field value +func (o *TransferInitializationV1Request) SetRecipientBasePath(v string) { + o.RecipientBasePath = v +} + +// GetMaxRetries returns the MaxRetries field value +func (o *TransferInitializationV1Request) GetMaxRetries() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxRetries +} + +// GetMaxRetriesOk returns a tuple with the MaxRetries field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetMaxRetriesOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxRetries, true +} + +// SetMaxRetries sets field value +func (o *TransferInitializationV1Request) SetMaxRetries(v float32) { + o.MaxRetries = v +} + +// GetMaxTimeout returns the MaxTimeout field value +func (o *TransferInitializationV1Request) GetMaxTimeout() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MaxTimeout +} + +// GetMaxTimeoutOk returns a tuple with the MaxTimeout field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetMaxTimeoutOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MaxTimeout, true +} + +// SetMaxTimeout sets field value +func (o *TransferInitializationV1Request) SetMaxTimeout(v float32) { + o.MaxTimeout = v +} + +// GetBackupGatewaysAllowed returns the BackupGatewaysAllowed field value +func (o *TransferInitializationV1Request) GetBackupGatewaysAllowed() []string { + if o == nil { + var ret []string + return ret + } + + return o.BackupGatewaysAllowed +} + +// GetBackupGatewaysAllowedOk returns a tuple with the BackupGatewaysAllowed field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetBackupGatewaysAllowedOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.BackupGatewaysAllowed, true +} + +// SetBackupGatewaysAllowed sets field value +func (o *TransferInitializationV1Request) SetBackupGatewaysAllowed(v []string) { + o.BackupGatewaysAllowed = v +} + +// GetRecipientLedgerAssetID returns the RecipientLedgerAssetID field value +func (o *TransferInitializationV1Request) GetRecipientLedgerAssetID() string { + if o == nil { + var ret string + return ret + } + + return o.RecipientLedgerAssetID +} + +// GetRecipientLedgerAssetIDOk returns a tuple with the RecipientLedgerAssetID field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetRecipientLedgerAssetIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RecipientLedgerAssetID, true +} + +// SetRecipientLedgerAssetID sets field value +func (o *TransferInitializationV1Request) SetRecipientLedgerAssetID(v string) { + o.RecipientLedgerAssetID = v +} + +// GetSourceLedgerAssetID returns the SourceLedgerAssetID field value +func (o *TransferInitializationV1Request) GetSourceLedgerAssetID() string { + if o == nil { + var ret string + return ret + } + + return o.SourceLedgerAssetID +} + +// GetSourceLedgerAssetIDOk returns a tuple with the SourceLedgerAssetID field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Request) GetSourceLedgerAssetIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SourceLedgerAssetID, true +} + +// SetSourceLedgerAssetID sets field value +func (o *TransferInitializationV1Request) SetSourceLedgerAssetID(v string) { + o.SourceLedgerAssetID = v +} + +func (o TransferInitializationV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferInitializationV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["messageType"] = o.MessageType + toSerialize["sessionID"] = o.SessionID + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + if !IsNil(o.DeveloperURN) { + toSerialize["developerURN"] = o.DeveloperURN + } + if !IsNil(o.CredentialProfile) { + toSerialize["credentialProfile"] = o.CredentialProfile + } + toSerialize["payloadProfile"] = o.PayloadProfile + toSerialize["applicationProfile"] = o.ApplicationProfile + toSerialize["loggingProfile"] = o.LoggingProfile + toSerialize["accessControlProfile"] = o.AccessControlProfile + toSerialize["signature"] = o.Signature + toSerialize["sourceGatewayPubkey"] = o.SourceGatewayPubkey + toSerialize["sourceGatewayDltSystem"] = o.SourceGatewayDltSystem + toSerialize["recipientGatewayPubkey"] = o.RecipientGatewayPubkey + toSerialize["recipientGatewayDltSystem"] = o.RecipientGatewayDltSystem + if !IsNil(o.EscrowType) { + toSerialize["escrowType"] = o.EscrowType + } + if !IsNil(o.ExpiryTime) { + toSerialize["expiryTime"] = o.ExpiryTime + } + if !IsNil(o.MultipleClaimsAllowed) { + toSerialize["multipleClaimsAllowed"] = o.MultipleClaimsAllowed + } + if !IsNil(o.MultipleCancelsAllowed) { + toSerialize["multipleCancelsAllowed"] = o.MultipleCancelsAllowed + } + if !IsNil(o.Permissions) { + toSerialize["permissions"] = o.Permissions + } + if !IsNil(o.Origin) { + toSerialize["origin"] = o.Origin + } + if !IsNil(o.Destination) { + toSerialize["destination"] = o.Destination + } + if !IsNil(o.SubsequentCalls) { + toSerialize["subsequentCalls"] = o.SubsequentCalls + } + if !IsNil(o.Histories) { + toSerialize["histories"] = o.Histories + } + toSerialize["sequenceNumber"] = o.SequenceNumber + toSerialize["sourceBasePath"] = o.SourceBasePath + toSerialize["recipientBasePath"] = o.RecipientBasePath + toSerialize["maxRetries"] = o.MaxRetries + toSerialize["maxTimeout"] = o.MaxTimeout + toSerialize["backupGatewaysAllowed"] = o.BackupGatewaysAllowed + toSerialize["recipientLedgerAssetID"] = o.RecipientLedgerAssetID + toSerialize["sourceLedgerAssetID"] = o.SourceLedgerAssetID + return toSerialize, nil +} + +type NullableTransferInitializationV1Request struct { + value *TransferInitializationV1Request + isSet bool +} + +func (v NullableTransferInitializationV1Request) Get() *TransferInitializationV1Request { + return v.value +} + +func (v *NullableTransferInitializationV1Request) Set(val *TransferInitializationV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableTransferInitializationV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferInitializationV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferInitializationV1Request(val *TransferInitializationV1Request) *NullableTransferInitializationV1Request { + return &NullableTransferInitializationV1Request{value: val, isSet: true} +} + +func (v NullableTransferInitializationV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferInitializationV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_response.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_response.go new file mode 100644 index 00000000000..8c10c1f3c29 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_response.go @@ -0,0 +1,405 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" +) + +// checks if the TransferInitializationV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransferInitializationV1Response{} + +// TransferInitializationV1Response struct for TransferInitializationV1Response +type TransferInitializationV1Response struct { + MessageType string `json:"messageType"` + SessionID string `json:"sessionID"` + SequenceNumber float32 `json:"sequenceNumber"` + OdapPhase *string `json:"odapPhase,omitempty"` + InitialRequestMessageHash string `json:"initialRequestMessageHash"` + Destination *string `json:"destination,omitempty"` + TimeStamp string `json:"timeStamp"` + ProcessedTimeStamp string `json:"processedTimeStamp"` + ServerIdentityPubkey string `json:"serverIdentityPubkey"` + Signature string `json:"signature"` + BackupGatewaysAllowed []string `json:"backupGatewaysAllowed"` +} + +// NewTransferInitializationV1Response instantiates a new TransferInitializationV1Response 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 +// will change when the set of required properties is changed +func NewTransferInitializationV1Response(messageType string, sessionID string, sequenceNumber float32, initialRequestMessageHash string, timeStamp string, processedTimeStamp string, serverIdentityPubkey string, signature string, backupGatewaysAllowed []string) *TransferInitializationV1Response { + this := TransferInitializationV1Response{} + this.MessageType = messageType + this.SessionID = sessionID + this.SequenceNumber = sequenceNumber + this.InitialRequestMessageHash = initialRequestMessageHash + this.TimeStamp = timeStamp + this.ProcessedTimeStamp = processedTimeStamp + this.ServerIdentityPubkey = serverIdentityPubkey + this.Signature = signature + this.BackupGatewaysAllowed = backupGatewaysAllowed + return &this +} + +// NewTransferInitializationV1ResponseWithDefaults instantiates a new TransferInitializationV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferInitializationV1ResponseWithDefaults() *TransferInitializationV1Response { + this := TransferInitializationV1Response{} + return &this +} + +// GetMessageType returns the MessageType field value +func (o *TransferInitializationV1Response) GetMessageType() string { + if o == nil { + var ret string + return ret + } + + return o.MessageType +} + +// GetMessageTypeOk returns a tuple with the MessageType field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetMessageTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageType, true +} + +// SetMessageType sets field value +func (o *TransferInitializationV1Response) SetMessageType(v string) { + o.MessageType = v +} + +// GetSessionID returns the SessionID field value +func (o *TransferInitializationV1Response) GetSessionID() string { + if o == nil { + var ret string + return ret + } + + return o.SessionID +} + +// GetSessionIDOk returns a tuple with the SessionID field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *TransferInitializationV1Response) SetSessionID(v string) { + o.SessionID = v +} + +// GetSequenceNumber returns the SequenceNumber field value +func (o *TransferInitializationV1Response) GetSequenceNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.SequenceNumber +} + +// GetSequenceNumberOk returns a tuple with the SequenceNumber field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetSequenceNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.SequenceNumber, true +} + +// SetSequenceNumber sets field value +func (o *TransferInitializationV1Response) SetSequenceNumber(v float32) { + o.SequenceNumber = v +} + +// GetOdapPhase returns the OdapPhase field value if set, zero value otherwise. +func (o *TransferInitializationV1Response) GetOdapPhase() string { + if o == nil || IsNil(o.OdapPhase) { + var ret string + return ret + } + return *o.OdapPhase +} + +// GetOdapPhaseOk returns a tuple with the OdapPhase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetOdapPhaseOk() (*string, bool) { + if o == nil || IsNil(o.OdapPhase) { + return nil, false + } + return o.OdapPhase, true +} + +// HasOdapPhase returns a boolean if a field has been set. +func (o *TransferInitializationV1Response) HasOdapPhase() bool { + if o != nil && !IsNil(o.OdapPhase) { + return true + } + + return false +} + +// SetOdapPhase gets a reference to the given string and assigns it to the OdapPhase field. +func (o *TransferInitializationV1Response) SetOdapPhase(v string) { + o.OdapPhase = &v +} + +// GetInitialRequestMessageHash returns the InitialRequestMessageHash field value +func (o *TransferInitializationV1Response) GetInitialRequestMessageHash() string { + if o == nil { + var ret string + return ret + } + + return o.InitialRequestMessageHash +} + +// GetInitialRequestMessageHashOk returns a tuple with the InitialRequestMessageHash field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetInitialRequestMessageHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InitialRequestMessageHash, true +} + +// SetInitialRequestMessageHash sets field value +func (o *TransferInitializationV1Response) SetInitialRequestMessageHash(v string) { + o.InitialRequestMessageHash = v +} + +// GetDestination returns the Destination field value if set, zero value otherwise. +func (o *TransferInitializationV1Response) GetDestination() string { + if o == nil || IsNil(o.Destination) { + var ret string + return ret + } + return *o.Destination +} + +// GetDestinationOk returns a tuple with the Destination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetDestinationOk() (*string, bool) { + if o == nil || IsNil(o.Destination) { + return nil, false + } + return o.Destination, true +} + +// HasDestination returns a boolean if a field has been set. +func (o *TransferInitializationV1Response) HasDestination() bool { + if o != nil && !IsNil(o.Destination) { + return true + } + + return false +} + +// SetDestination gets a reference to the given string and assigns it to the Destination field. +func (o *TransferInitializationV1Response) SetDestination(v string) { + o.Destination = &v +} + +// GetTimeStamp returns the TimeStamp field value +func (o *TransferInitializationV1Response) GetTimeStamp() string { + if o == nil { + var ret string + return ret + } + + return o.TimeStamp +} + +// GetTimeStampOk returns a tuple with the TimeStamp field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetTimeStampOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TimeStamp, true +} + +// SetTimeStamp sets field value +func (o *TransferInitializationV1Response) SetTimeStamp(v string) { + o.TimeStamp = v +} + +// GetProcessedTimeStamp returns the ProcessedTimeStamp field value +func (o *TransferInitializationV1Response) GetProcessedTimeStamp() string { + if o == nil { + var ret string + return ret + } + + return o.ProcessedTimeStamp +} + +// GetProcessedTimeStampOk returns a tuple with the ProcessedTimeStamp field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetProcessedTimeStampOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProcessedTimeStamp, true +} + +// SetProcessedTimeStamp sets field value +func (o *TransferInitializationV1Response) SetProcessedTimeStamp(v string) { + o.ProcessedTimeStamp = v +} + +// GetServerIdentityPubkey returns the ServerIdentityPubkey field value +func (o *TransferInitializationV1Response) GetServerIdentityPubkey() string { + if o == nil { + var ret string + return ret + } + + return o.ServerIdentityPubkey +} + +// GetServerIdentityPubkeyOk returns a tuple with the ServerIdentityPubkey field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetServerIdentityPubkeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerIdentityPubkey, true +} + +// SetServerIdentityPubkey sets field value +func (o *TransferInitializationV1Response) SetServerIdentityPubkey(v string) { + o.ServerIdentityPubkey = v +} + +// GetSignature returns the Signature field value +func (o *TransferInitializationV1Response) GetSignature() string { + if o == nil { + var ret string + return ret + } + + return o.Signature +} + +// GetSignatureOk returns a tuple with the Signature field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *TransferInitializationV1Response) SetSignature(v string) { + o.Signature = v +} + +// GetBackupGatewaysAllowed returns the BackupGatewaysAllowed field value +func (o *TransferInitializationV1Response) GetBackupGatewaysAllowed() []string { + if o == nil { + var ret []string + return ret + } + + return o.BackupGatewaysAllowed +} + +// GetBackupGatewaysAllowedOk returns a tuple with the BackupGatewaysAllowed field value +// and a boolean to check if the value has been set. +func (o *TransferInitializationV1Response) GetBackupGatewaysAllowedOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.BackupGatewaysAllowed, true +} + +// SetBackupGatewaysAllowed sets field value +func (o *TransferInitializationV1Response) SetBackupGatewaysAllowed(v []string) { + o.BackupGatewaysAllowed = v +} + +func (o TransferInitializationV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferInitializationV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["messageType"] = o.MessageType + toSerialize["sessionID"] = o.SessionID + toSerialize["sequenceNumber"] = o.SequenceNumber + if !IsNil(o.OdapPhase) { + toSerialize["odapPhase"] = o.OdapPhase + } + toSerialize["initialRequestMessageHash"] = o.InitialRequestMessageHash + if !IsNil(o.Destination) { + toSerialize["destination"] = o.Destination + } + toSerialize["timeStamp"] = o.TimeStamp + toSerialize["processedTimeStamp"] = o.ProcessedTimeStamp + toSerialize["serverIdentityPubkey"] = o.ServerIdentityPubkey + toSerialize["signature"] = o.Signature + toSerialize["backupGatewaysAllowed"] = o.BackupGatewaysAllowed + return toSerialize, nil +} + +type NullableTransferInitializationV1Response struct { + value *TransferInitializationV1Response + isSet bool +} + +func (v NullableTransferInitializationV1Response) Get() *TransferInitializationV1Response { + return v.value +} + +func (v *NullableTransferInitializationV1Response) Set(val *TransferInitializationV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableTransferInitializationV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferInitializationV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferInitializationV1Response(val *TransferInitializationV1Response) *NullableTransferInitializationV1Response { + return &NullableTransferInitializationV1Response{value: val, isSet: true} +} + +func (v NullableTransferInitializationV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferInitializationV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..aeea8281054 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..b9b0d7cfcf2 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,224 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-odap-hermes + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-odap-hermes_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService ClientRequestV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.ClientRequestV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase1TransferInitiationRequestV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase1TransferInitiationRequestV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase1TransferInitiationResponseV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase1TransferInitiationResponseV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase2LockEvidenceRequestV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase2LockEvidenceRequestV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase2LockEvidenceResponseV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase2LockEvidenceResponseV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase2TransferCommenceRequestV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase2TransferCommenceRequestV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase2TransferCommenceResponseV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase2TransferCommenceResponseV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase3CommitFinalRequestV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase3CommitFinalRequestV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase3CommitFinalResponseV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase3CommitFinalResponseV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase3CommitPreparationRequestV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase3CommitPreparationRequestV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase3CommitPreparationResponseV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase3CommitPreparationResponseV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService Phase3TransferCompleteRequestV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.Phase3TransferCompleteRequestV1(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RecoverUpdateAckV1Message", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.RecoverUpdateAckV1Message(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RecoverUpdateV1Message", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.RecoverUpdateV1Message(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RecoverV1Message", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.RecoverV1Message(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RecoverV1Success", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.RecoverV1Success(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RollbackAckV1Message", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.RollbackAckV1Message(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RollbackV1Message", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.DefaultApi.RollbackV1Message(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..dc24222e86b --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-odap-hermes + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..ce060be4012 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - Odap Hermes + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..682e250c88d --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,86 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/AssetProfile.java +src/main/java/org/openapitools/client/model/ClientV1Request.java +src/main/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfiguration.java +src/main/java/org/openapitools/client/model/CommitFinalV1Request.java +src/main/java/org/openapitools/client/model/CommitFinalV1Response.java +src/main/java/org/openapitools/client/model/CommitPreparationV1Request.java +src/main/java/org/openapitools/client/model/CommitPreparationV1Response.java +src/main/java/org/openapitools/client/model/CredentialProfile.java +src/main/java/org/openapitools/client/model/History.java +src/main/java/org/openapitools/client/model/LockEvidenceV1Request.java +src/main/java/org/openapitools/client/model/LockEvidenceV1Response.java +src/main/java/org/openapitools/client/model/OdapLocalLog.java +src/main/java/org/openapitools/client/model/OdapMessage.java +src/main/java/org/openapitools/client/model/OdapMessageActionResponse.java +src/main/java/org/openapitools/client/model/PayloadProfile.java +src/main/java/org/openapitools/client/model/RecoverSuccessV1Message.java +src/main/java/org/openapitools/client/model/RecoverUpdateAckV1Message.java +src/main/java/org/openapitools/client/model/RecoverUpdateV1Message.java +src/main/java/org/openapitools/client/model/RecoverV1Message.java +src/main/java/org/openapitools/client/model/RollbackAckV1Message.java +src/main/java/org/openapitools/client/model/RollbackV1Message.java +src/main/java/org/openapitools/client/model/SessionData.java +src/main/java/org/openapitools/client/model/TransferCommenceV1Request.java +src/main/java/org/openapitools/client/model/TransferCommenceV1Response.java +src/main/java/org/openapitools/client/model/TransferCompleteV1Request.java +src/main/java/org/openapitools/client/model/TransferInitializationV1Request.java +src/main/java/org/openapitools/client/model/TransferInitializationV1Response.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/AssetProfileTest.java +src/test/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfigurationTest.java +src/test/java/org/openapitools/client/model/ClientV1RequestTest.java +src/test/java/org/openapitools/client/model/CommitFinalV1RequestTest.java +src/test/java/org/openapitools/client/model/CommitFinalV1ResponseTest.java +src/test/java/org/openapitools/client/model/CommitPreparationV1RequestTest.java +src/test/java/org/openapitools/client/model/CommitPreparationV1ResponseTest.java +src/test/java/org/openapitools/client/model/CredentialProfileTest.java +src/test/java/org/openapitools/client/model/HistoryTest.java +src/test/java/org/openapitools/client/model/LockEvidenceV1RequestTest.java +src/test/java/org/openapitools/client/model/LockEvidenceV1ResponseTest.java +src/test/java/org/openapitools/client/model/OdapLocalLogTest.java +src/test/java/org/openapitools/client/model/OdapMessageActionResponseTest.java +src/test/java/org/openapitools/client/model/OdapMessageTest.java +src/test/java/org/openapitools/client/model/PayloadProfileTest.java +src/test/java/org/openapitools/client/model/RecoverSuccessV1MessageTest.java +src/test/java/org/openapitools/client/model/RecoverUpdateAckV1MessageTest.java +src/test/java/org/openapitools/client/model/RecoverUpdateV1MessageTest.java +src/test/java/org/openapitools/client/model/RecoverV1MessageTest.java +src/test/java/org/openapitools/client/model/RollbackAckV1MessageTest.java +src/test/java/org/openapitools/client/model/RollbackV1MessageTest.java +src/test/java/org/openapitools/client/model/SessionDataTest.java +src/test/java/org/openapitools/client/model/TransferCommenceV1RequestTest.java +src/test/java/org/openapitools/client/model/TransferCommenceV1ResponseTest.java +src/test/java/org/openapitools/client/model/TransferCompleteV1RequestTest.java +src/test/java/org/openapitools/client/model/TransferInitializationV1RequestTest.java +src/test/java/org/openapitools/client/model/TransferInitializationV1ResponseTest.java diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..7602359f311 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,180 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Odap Hermes +- API version: v2.0.0-alpha.2 + +Implementation for Odap and Hermes + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + ClientV1Request clientV1Request = new ClientV1Request(); // ClientV1Request | + try { + Object result = apiInstance.clientRequestV1(clientV1Request); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#clientRequestV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**clientRequestV1**](docs/DefaultApi.md#clientRequestV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest | +*DefaultApi* | [**phase1TransferInitiationRequestV1**](docs/DefaultApi.md#phase1TransferInitiationRequestV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest | +*DefaultApi* | [**phase1TransferInitiationResponseV1**](docs/DefaultApi.md#phase1TransferInitiationResponseV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse | +*DefaultApi* | [**phase2LockEvidenceRequestV1**](docs/DefaultApi.md#phase2LockEvidenceRequestV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest | +*DefaultApi* | [**phase2LockEvidenceResponseV1**](docs/DefaultApi.md#phase2LockEvidenceResponseV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse | +*DefaultApi* | [**phase2TransferCommenceRequestV1**](docs/DefaultApi.md#phase2TransferCommenceRequestV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest | +*DefaultApi* | [**phase2TransferCommenceResponseV1**](docs/DefaultApi.md#phase2TransferCommenceResponseV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse | +*DefaultApi* | [**phase3CommitFinalRequestV1**](docs/DefaultApi.md#phase3CommitFinalRequestV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest | +*DefaultApi* | [**phase3CommitFinalResponseV1**](docs/DefaultApi.md#phase3CommitFinalResponseV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse | +*DefaultApi* | [**phase3CommitPreparationRequestV1**](docs/DefaultApi.md#phase3CommitPreparationRequestV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest | +*DefaultApi* | [**phase3CommitPreparationResponseV1**](docs/DefaultApi.md#phase3CommitPreparationResponseV1) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse | +*DefaultApi* | [**phase3TransferCompleteRequestV1**](docs/DefaultApi.md#phase3TransferCompleteRequestV1) | **GET** /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest | +*DefaultApi* | [**recoverUpdateAckV1Message**](docs/DefaultApi.md#recoverUpdateAckV1Message) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage | +*DefaultApi* | [**recoverUpdateV1Message**](docs/DefaultApi.md#recoverUpdateV1Message) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage | +*DefaultApi* | [**recoverV1Message**](docs/DefaultApi.md#recoverV1Message) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage | +*DefaultApi* | [**recoverV1Success**](docs/DefaultApi.md#recoverV1Success) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage | +*DefaultApi* | [**rollbackAckV1Message**](docs/DefaultApi.md#rollbackAckV1Message) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage | +*DefaultApi* | [**rollbackV1Message**](docs/DefaultApi.md#rollbackV1Message) | **POST** /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage | + + +## Documentation for Models + + - [AssetProfile](docs/AssetProfile.md) + - [ClientV1Request](docs/ClientV1Request.md) + - [ClientV1RequestClientGatewayConfiguration](docs/ClientV1RequestClientGatewayConfiguration.md) + - [CommitFinalV1Request](docs/CommitFinalV1Request.md) + - [CommitFinalV1Response](docs/CommitFinalV1Response.md) + - [CommitPreparationV1Request](docs/CommitPreparationV1Request.md) + - [CommitPreparationV1Response](docs/CommitPreparationV1Response.md) + - [CredentialProfile](docs/CredentialProfile.md) + - [History](docs/History.md) + - [LockEvidenceV1Request](docs/LockEvidenceV1Request.md) + - [LockEvidenceV1Response](docs/LockEvidenceV1Response.md) + - [OdapLocalLog](docs/OdapLocalLog.md) + - [OdapMessage](docs/OdapMessage.md) + - [OdapMessageActionResponse](docs/OdapMessageActionResponse.md) + - [PayloadProfile](docs/PayloadProfile.md) + - [RecoverSuccessV1Message](docs/RecoverSuccessV1Message.md) + - [RecoverUpdateAckV1Message](docs/RecoverUpdateAckV1Message.md) + - [RecoverUpdateV1Message](docs/RecoverUpdateV1Message.md) + - [RecoverV1Message](docs/RecoverV1Message.md) + - [RollbackAckV1Message](docs/RollbackAckV1Message.md) + - [RollbackV1Message](docs/RollbackV1Message.md) + - [SessionData](docs/SessionData.md) + - [TransferCommenceV1Request](docs/TransferCommenceV1Request.md) + - [TransferCommenceV1Response](docs/TransferCommenceV1Response.md) + - [TransferCompleteV1Request](docs/TransferCompleteV1Request.md) + - [TransferInitializationV1Request](docs/TransferInitializationV1Request.md) + - [TransferInitializationV1Response](docs/TransferInitializationV1Response.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..6f509e90b97 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,1637 @@ +openapi: 3.0.3 +info: + description: Implementation for Odap and Hermes + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Odap Hermes + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest: + post: + description: "" + operationId: phase1TransferInitiationRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferInitializationV1Request' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest: + post: + description: "" + operationId: phase2TransferCommenceRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferCommenceV1Request' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest: + post: + description: "" + operationId: phase2LockEvidenceRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LockEvidenceV1Request' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest: + post: + description: "" + operationId: phase3CommitPreparationRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitPreparationV1Request' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest: + post: + description: "" + operationId: phase3CommitFinalRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitFinalV1Request' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest: + get: + description: "" + operationId: phase3TransferCompleteRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferCompleteV1Request' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest: + post: + description: "" + operationId: clientRequestV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClientV1Request' + responses: + "200": + content: + application/json: + schema: {} + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse: + post: + description: "" + operationId: phase1TransferInitiationResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferInitializationV1Response' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse: + post: + description: "" + operationId: phase2TransferCommenceResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferCommenceV1Response' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse: + post: + description: "" + operationId: phase2LockEvidenceResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LockEvidenceV1Response' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse: + post: + description: "" + operationId: phase3CommitPreparationResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitPreparationV1Response' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse: + post: + description: "" + operationId: phase3CommitFinalResponseV1 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CommitFinalV1Response' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage: + post: + description: "" + operationId: RecoverV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverV1Message' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage: + post: + description: "" + operationId: RecoverUpdateV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverUpdateV1Message' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage: + post: + description: "" + operationId: RecoverUpdateAckV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverUpdateAckV1Message' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage: + post: + description: "" + operationId: RecoverV1Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RecoverSuccessV1Message' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage: + post: + description: "" + operationId: RollbackV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RollbackV1Message' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage + x-content-type: application/json + x-accepts: application/json + /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage: + post: + description: "" + operationId: RollbackAckV1Message + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RollbackAckV1Message' + responses: + "200": + description: OK + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage + x-content-type: application/json + x-accepts: application/json +components: + schemas: + CredentialProfile: + enum: + - SAML + - OAUTH + - X509 + type: string + PayloadProfile: + example: + assetProfile: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + capabilities: capabilities + properties: + assetProfile: + $ref: '#/components/schemas/AssetProfile' + capabilities: + type: string + required: + - assetProfile + type: object + ApplicationProfile: + type: object + Payload: + type: object + AssetProfile: + example: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + properties: + issuer: + type: string + assetCode: + type: string + assetCodeType: + type: string + issuanceDate: + type: string + expirationDate: + type: string + verificationEndPoint: + type: string + digitalSignature: + type: string + prospectusLink: + type: string + keyInformationLink: + items: {} + type: array + keyWord: + items: {} + type: array + transferRestriction: + items: {} + type: array + ledgerRequirements: + items: {} + type: array + required: + - expirationDate + type: object + LoggingProfile: + items: + type: string + type: array + AccessControlProfile: + items: + type: string + type: array + Permissions: + type: object + Transaction: + type: object + ActionCategory: + type: object + History: + example: + Origin: Origin + Transactions: + - null + - null + Destination: Destination + Actions: + - null + - null + CurrentStatus: "{}" + ApplicationSpecificParameters: "{}" + Balance: Balance + properties: + Transactions: + items: + $ref: '#/components/schemas/Transaction' + type: array + Actions: + items: + $ref: '#/components/schemas/ActionCategory' + type: array + Origin: + type: string + Destination: + type: string + Balance: + type: string + CurrentStatus: + type: object + ApplicationSpecificParameters: + type: object + type: object + SenderDltSystem: + type: object + RecipientDltSystem: + type: object + LockEvidenceClaim: + type: object + LockClaimFormat: + type: object + CommitFinalClaim: + type: object + CommitFinalClaimFormat: + type: object + CommitAcknowledgementClaim: + type: object + CommitAcknowledgementClaimFormat: + type: object + SessionData: + properties: + id: + type: string + step: + type: number + version: + type: string + lastSequenceNumber: + type: number + loggingProfile: + type: string + accessControlProfile: + type: string + applicationProfile: + type: string + payloadProfile: + $ref: '#/components/schemas/PayloadProfile' + assetProfile: + $ref: '#/components/schemas/AssetProfile' + allowedSourceBackupGateways: + items: + type: string + type: array + allowedRecipientBackupGateways: + items: + type: string + type: array + sourceBasePath: + type: string + recipientBasePath: + type: string + originatorPubkey: + type: string + beneficiaryPubkey: + type: string + sourceGatewayPubkey: + type: string + sourceGatewayDltSystem: + type: string + recipientGatewayPubkey: + type: string + recipientGatewayDltSystem: + type: string + initializationRequestMessageHash: + type: string + initializationResponseMessageHash: + type: string + initializationRequestMessageRcvTimeStamp: + type: string + initializationRequestMessageProcessedTimeStamp: + type: string + clientSignatureInitializationRequestMessage: + type: string + serverSignatureInitializationResponseMessage: + type: string + transferCommenceMessageRequestHash: + type: string + transferCommenceMessageResponseHash: + type: string + clientSignatureTransferCommenceRequestMessage: + type: string + serverSignatureTransferCommenceResponseMessage: + type: string + lockEvidenceRequestMessageHash: + type: string + lockEvidenceResponseMessageHash: + type: string + clientSignatureLockEvidenceRequestMessage: + type: string + serverSignatureLockEvidenceResponseMessage: + type: string + lockEvidenceClaim: + type: string + commitPrepareRequestMessageHash: + type: string + commitPrepareResponseMessageHash: + type: string + clientSignatureCommitPreparationRequestMessage: + type: string + serverSignatureCommitPreparationResponseMessage: + type: string + commitFinalRequestMessageHash: + type: string + commitFinalResponseMessageHash: + type: string + commitFinalClaim: + type: string + commitFinalClaimFormat: + type: string + commitAcknowledgementClaim: + type: string + commitAcknowledgementClaimFormat: + type: string + clientSignatureCommitFinalRequestMessage: + type: string + serverSignatureCommitFinalResponseMessage: + type: string + transferCompleteMessageHash: + type: string + clientSignatureTransferCompleteMessage: + type: string + maxRetries: + type: number + recipientLedgerAssetID: + type: string + sourceLedgerAssetID: + type: string + maxTimeout: + type: number + lastLogEntryTimestamp: + type: string + unlockAssetClaim: + type: string + recreateAssetClaim: + type: string + deleteAssetClaim: + type: string + lastMessageReceivedTimestamp: + type: string + rollback: + type: boolean + rollbackMessageHash: + type: string + rollbackProofs: + items: + type: string + type: array + rollbackActionsPerformed: + items: + enum: + - CREATE + - DELETE + - LOCK + - UNLOCK + type: string + type: array + type: object + TransferInitializationV1Request: + example: + recipientLedgerAssetID: recipientLedgerAssetID + subsequentCalls: "{}" + backupGatewaysAllowed: + - backupGatewaysAllowed + - backupGatewaysAllowed + signature: signature + credentialProfile: null + origin: origin + destination: destination + recipientGatewayPubkey: recipientGatewayPubkey + sessionID: sessionID + sourceBasePath: sourceBasePath + loggingProfile: loggingProfile + sourceLedgerAssetID: sourceLedgerAssetID + messageType: messageType + permissions: "{}" + multipleClaimsAllowed: true + payloadProfile: + assetProfile: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + capabilities: capabilities + applicationProfile: applicationProfile + sourceGatewayPubkey: sourceGatewayPubkey + recipientGatewayDltSystem: recipientGatewayDltSystem + sequenceNumber: 0 + accessControlProfile: accessControlProfile + developerURN: developerURN + histories: + - Origin: Origin + Transactions: + - null + - null + Destination: Destination + Actions: + - null + - null + CurrentStatus: "{}" + ApplicationSpecificParameters: "{}" + Balance: Balance + - Origin: Origin + Transactions: + - null + - null + Destination: Destination + Actions: + - null + - null + CurrentStatus: "{}" + ApplicationSpecificParameters: "{}" + Balance: Balance + version: version + multipleCancelsAllowed: true + escrowType: FAUCET + maxRetries: 6.027456183070403 + sourceGatewayDltSystem: sourceGatewayDltSystem + recipientBasePath: recipientBasePath + maxTimeout: 1.4658129805029452 + expiryTime: expiryTime + properties: + messageType: + type: string + sessionID: + type: string + version: + type: string + developerURN: + type: string + credentialProfile: + $ref: '#/components/schemas/CredentialProfile' + payloadProfile: + $ref: '#/components/schemas/PayloadProfile' + applicationProfile: + type: string + loggingProfile: + type: string + accessControlProfile: + type: string + signature: + type: string + sourceGatewayPubkey: + type: string + sourceGatewayDltSystem: + type: string + recipientGatewayPubkey: + type: string + recipientGatewayDltSystem: + type: string + escrowType: + enum: + - FAUCET + - TIMELOCK + - HASHLOCK + - HASHTIMELOCK + - MULTICLAIMPC + - DESTROY + - BURN + type: string + expiryTime: + type: string + multipleClaimsAllowed: + type: boolean + multipleCancelsAllowed: + type: boolean + permissions: + type: object + origin: + type: string + destination: + type: string + subsequentCalls: + type: object + histories: + items: + $ref: '#/components/schemas/History' + type: array + sequenceNumber: + type: integer + sourceBasePath: + type: string + recipientBasePath: + type: string + maxRetries: + type: number + maxTimeout: + type: number + backupGatewaysAllowed: + items: + type: string + type: array + recipientLedgerAssetID: + type: string + sourceLedgerAssetID: + type: string + required: + - accessControlProfile + - applicationProfile + - backupGatewaysAllowed + - loggingProfile + - maxRetries + - maxTimeout + - messageType + - payloadProfile + - recipientBasePath + - recipientGatewayDltSystem + - recipientGatewayPubkey + - recipientLedgerAssetID + - sequenceNumber + - sessionID + - signature + - sourceBasePath + - sourceGatewayDltSystem + - sourceGatewayPubkey + - sourceLedgerAssetID + type: object + TransferInitializationV1Response: + example: + timeStamp: timeStamp + sequenceNumber: 0.8008281904610115 + odapPhase: TransferInitialization + initialRequestMessageHash: initialRequestMessageHash + messageType: messageType + backupGatewaysAllowed: + - backupGatewaysAllowed + - backupGatewaysAllowed + processedTimeStamp: processedTimeStamp + signature: signature + destination: destination + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + messageType: + type: string + sessionID: + type: string + sequenceNumber: + type: number + odapPhase: + enum: + - TransferInitialization + - LockEvidenceVerification + - CommitmentEstablishment + type: string + initialRequestMessageHash: + type: string + destination: + type: string + timeStamp: + type: string + processedTimeStamp: + type: string + serverIdentityPubkey: + type: string + signature: + type: string + backupGatewaysAllowed: + items: + type: string + type: array + required: + - backupGatewaysAllowed + - initialRequestMessageHash + - messageType + - processedTimeStamp + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + - timeStamp + type: object + TransferCommenceV1Request: + example: + beneficiaryPubkey: beneficiaryPubkey + sequenceNumber: 1 + hashAssetProfile: hashAssetProfile + clientIdentityPubkey: clientIdentityPubkey + clientTransferNumber: 6 + signature: signature + recipientDltSystem: recipientDltSystem + sessionID: sessionID + hashPrevMessage: hashPrevMessage + serverIdentityPubkey: serverIdentityPubkey + assetUnit: 0 + messageType: messageType + senderDltSystem: senderDltSystem + originatorPubkey: originatorPubkey + properties: + sessionID: + type: string + messageType: + type: string + originatorPubkey: + type: string + beneficiaryPubkey: + type: string + senderDltSystem: + type: string + recipientDltSystem: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashAssetProfile: + type: string + assetUnit: + type: integer + hashPrevMessage: + type: string + clientTransferNumber: + nullable: true + type: integer + signature: + type: string + sequenceNumber: + type: integer + required: + - beneficiaryPubkey + - clientIdentityPubkey + - hashAssetProfile + - hashPrevMessage + - messageType + - originatorPubkey + - recipientDltSystem + - senderDltSystem + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + TransferCommenceV1Response: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + signature: signature + serverTransferNumber: 0 + messageHash: messageHash + sessionID: sessionID + hashCommenceRequest: hashCommenceRequest + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashCommenceRequest: + type: string + serverTransferNumber: + nullable: true + type: integer + signature: + type: string + messageType: + type: string + messageHash: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashCommenceRequest + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + LockEvidenceV1Request: + example: + sequenceNumber: 6.027456183070403 + lockEvidenceExpiration: lockEvidenceExpiration + clientIdentityPubkey: clientIdentityPubkey + clientTransferNumber: 0 + messageType: messageType + signature: signature + lockEvidenceClaim: lockEvidenceClaim + lockEvidenceFormat: "{}" + hashCommenceAckRequest: hashCommenceAckRequest + messageHash: messageHash + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + lockEvidenceClaim: + type: string + lockEvidenceFormat: + type: object + lockEvidenceExpiration: + type: string + hashCommenceAckRequest: + type: string + clientTransferNumber: + nullable: true + type: integer + signature: + type: string + messageType: + type: string + messageHash: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashCommenceAckRequest + - lockEvidenceClaim + - lockEvidenceExpiration + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + LockEvidenceV1Response: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + signature: signature + serverTransferNumber: 0 + hashLockEvidenceRequest: hashLockEvidenceRequest + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashLockEvidenceRequest: + type: string + serverTransferNumber: + nullable: true + type: integer + signature: + type: string + messageType: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashLockEvidenceRequest + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + CommitPreparationV1Request: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + hashLockEvidenceAck: hashLockEvidenceAck + messageType: messageType + clientTransferNumber: 0 + signature: signature + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashLockEvidenceAck: + type: string + clientTransferNumber: + type: integer + signature: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashLockEvidenceAck + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + CommitPreparationV1Response: + example: + sequenceNumber: 0.8008281904610115 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + hashCommitPrep: hashCommitPrep + signature: signature + serverTransferNumber: serverTransferNumber + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashCommitPrep: + type: string + serverTransferNumber: + type: string + signature: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashCommitPrep + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + CommitFinalV1Request: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + clientTransferNumber: 0 + signature: signature + commitFinalClaim: commitFinalClaim + commitFinalClaimFormat: "{}" + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + hashCommitPrepareAck: hashCommitPrepareAck + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + commitFinalClaim: + type: string + commitFinalClaimFormat: + type: object + hashCommitPrepareAck: + type: string + clientTransferNumber: + nullable: true + type: integer + signature: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - commitFinalClaim + - hashCommitPrepareAck + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + CommitFinalV1Response: + example: + sequenceNumber: 6.027456183070403 + clientIdentityPubkey: clientIdentityPubkey + messageType: messageType + commitAcknowledgementClaimFormat: "{}" + signature: signature + serverTransferNumber: 0 + commitAcknowledgementClaim: commitAcknowledgementClaim + hashCommitFinal: hashCommitFinal + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + commitAcknowledgementClaim: + type: string + commitAcknowledgementClaimFormat: + type: object + hashCommitFinal: + type: string + serverTransferNumber: + type: integer + signature: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - commitAcknowledgementClaim + - hashCommitFinal + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + TransferCompleteV1Request: + example: + sequenceNumber: 6.027456183070403 + hashCommitFinalAck: hashCommitFinalAck + clientIdentityPubkey: clientIdentityPubkey + hashTransferCommence: hashTransferCommence + messageType: messageType + clientTransferNumber: 0 + signature: signature + sessionID: sessionID + serverIdentityPubkey: serverIdentityPubkey + properties: + sessionID: + type: string + messageType: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + hashCommitFinalAck: + type: string + clientTransferNumber: + nullable: true + type: integer + signature: + type: string + hashTransferCommence: + type: string + sequenceNumber: + type: number + required: + - clientIdentityPubkey + - hashCommitFinalAck + - hashTransferCommence + - messageType + - sequenceNumber + - serverIdentityPubkey + - sessionID + - signature + type: object + ClientV1Request: + example: + assetProfile: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + beneficiaryPubkey: beneficiaryPubkey + recipientLedgerAssetID: recipientLedgerAssetID + clientIdentityPubkey: clientIdentityPubkey + serverDltSystem: serverDltSystem + accessControlProfile: accessControlProfile + recipientGatewayPubkey: recipientGatewayPubkey + assetControlProfile: assetControlProfile + version: version + serverIdentityPubkey: serverIdentityPubkey + loggingProfile: loggingProfile + serverGatewayConfiguration: + apiHost: apiHost + sourceLedgerAssetID: sourceLedgerAssetID + clientGatewayConfiguration: + apiHost: apiHost + maxRetries: 0.8008281904610115 + sourceGatewayDltSystem: sourceGatewayDltSystem + maxTimeout: 6.027456183070403 + applicationProfile: applicationProfile + payloadProfile: + assetProfile: + ledgerRequirements: + - "" + - "" + keyInformationLink: + - "" + - "" + assetCode: assetCode + issuanceDate: issuanceDate + digitalSignature: digitalSignature + verificationEndPoint: verificationEndPoint + prospectusLink: prospectusLink + issuer: issuer + assetCodeType: assetCodeType + transferRestriction: + - "" + - "" + expirationDate: expirationDate + keyWord: + - "" + - "" + capabilities: capabilities + originatorPubkey: originatorPubkey + clientDltSystem: clientDltSystem + recipientGatewayDltSystem: recipientGatewayDltSystem + properties: + version: + type: string + loggingProfile: + type: string + accessControlProfile: + type: string + assetControlProfile: + type: string + applicationProfile: + type: string + assetProfile: + $ref: '#/components/schemas/AssetProfile' + payloadProfile: + $ref: '#/components/schemas/PayloadProfile' + sourceGatewayDltSystem: + type: string + recipientGatewayDltSystem: + type: string + recipientGatewayPubkey: + type: string + originatorPubkey: + type: string + beneficiaryPubkey: + type: string + clientIdentityPubkey: + type: string + serverIdentityPubkey: + type: string + clientDltSystem: + type: string + serverDltSystem: + type: string + clientGatewayConfiguration: + $ref: '#/components/schemas/ClientV1Request_clientGatewayConfiguration' + serverGatewayConfiguration: + $ref: '#/components/schemas/ClientV1Request_clientGatewayConfiguration' + maxRetries: + type: number + maxTimeout: + type: number + sourceLedgerAssetID: + type: string + recipientLedgerAssetID: + type: string + required: + - accessControlProfile + - applicationProfile + - assetControlProfile + - assetProfile + - beneficiaryPubkey + - clientDltSystem + - clientGatewayConfiguration + - clientIdentityPubkey + - loggingProfile + - maxRetries + - maxTimeout + - originatorPubkey + - payloadProfile + - recipientGatewayDltSystem + - recipientGatewayPubkey + - recipientLedgerAssetID + - serverDltSystem + - serverGatewayConfiguration + - serverIdentityPubkey + - sourceGatewayDltSystem + - sourceLedgerAssetID + - version + type: object + RecoverV1Message: + example: + sequenceNumber: 0.8008281904610115 + isBackup: true + odapPhase: odapPhase + signature: signature + sessionID: sessionID + newGatewayPubKey: newGatewayPubKey + newBasePath: newBasePath + lastLogEntryTimestamp: lastLogEntryTimestamp + properties: + sessionID: + type: string + odapPhase: + type: string + sequenceNumber: + type: number + lastLogEntryTimestamp: + type: string + isBackup: + type: boolean + newBasePath: + type: string + newGatewayPubKey: + type: string + signature: + type: string + required: + - isBackup + - lastLogEntryTimestamp + - newBasePath + - odapPhase + - sequenceNumber + - sessionID + - signature + type: object + RecoverUpdateV1Message: + example: + signature: signature + sessionID: sessionID + recoveredLogs: + - data: data + sessionID: sessionID + type: type + operation: operation + key: key + timestamp: timestamp + - data: data + sessionID: sessionID + type: type + operation: operation + key: key + timestamp: timestamp + properties: + sessionID: + type: string + recoveredLogs: + items: + $ref: '#/components/schemas/OdapLocalLog' + type: array + signature: + type: string + required: + - recoveredLogs + - sessionID + - signature + type: object + RecoverUpdateAckV1Message: + example: + signature: signature + success: true + sessionID: sessionID + changedEntriesHash: + - changedEntriesHash + - changedEntriesHash + properties: + sessionID: + type: string + success: + type: boolean + changedEntriesHash: + items: + type: string + type: array + signature: + type: string + required: + - changedEntriesHash + - sessionID + - signature + - success + type: object + RecoverSuccessV1Message: + example: + signature: signature + success: true + sessionID: sessionID + properties: + sessionID: + type: string + success: + type: boolean + signature: + type: string + required: + - sessionID + - signature + - success + type: object + RollbackV1Message: + example: + actionPerformed: + - actionPerformed + - actionPerformed + signature: signature + success: true + proofs: + - proofs + - proofs + sessionID: sessionID + properties: + sessionID: + type: string + success: + type: boolean + actionPerformed: + items: + type: string + type: array + proofs: + items: + type: string + type: array + signature: + type: string + required: + - actionPerformed + - proofs + - sessionID + - signature + - success + type: object + RollbackAckV1Message: + example: + signature: signature + success: true + sessionID: sessionID + properties: + sessionID: + type: string + success: + type: boolean + signature: + type: string + required: + - sessionID + - signature + - success + type: object + OdapLocalLog: + example: + data: data + sessionID: sessionID + type: type + operation: operation + key: key + timestamp: timestamp + properties: + key: + type: string + sessionID: + type: string + data: + type: string + type: + type: string + operation: + type: string + timestamp: + type: string + required: + - operation + - sessionID + - type + type: object + OdapMessage: + properties: + SequenceNumber: + type: number + Phase: + enum: + - TransferInitialization + - LockEvidenceVerification + - CommitmentEstablishment + type: string + ResourceURL: + type: string + DeveloperURN: + type: string + ActionResponse: + $ref: '#/components/schemas/OdapMessage_ActionResponse' + CredentialProfile: + enum: + - SAML + - OAuth + - X509 + type: string + CredentialBlock: + items: {} + type: array + CredentialsProfile: + $ref: '#/components/schemas/PayloadProfile' + ApplicationProfile: + type: object + Payload: + type: object + PayloadHash: + type: string + MessageSignature: + type: string + type: object + ClientV1Request_clientGatewayConfiguration: + example: + apiHost: apiHost + properties: + apiHost: + type: string + required: + - apiHost + type: object + OdapMessage_ActionResponse: + properties: + ResponseCode: + enum: + - "200" + - "404" + type: string + x-enum-varnames: + - OK + - RESOURCE_NOT_FOUND + Arguments: + items: {} + type: array + type: object + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..63180fb6ed3 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..e01e52db128 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..7b8351dae88 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..72985702c34 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..8271c9bb9e8 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..a31a143124c --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..d3a98a7cce7 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,426 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.AssetProfile.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ClientV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ClientV1RequestClientGatewayConfiguration.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CommitFinalV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CommitFinalV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CommitPreparationV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.CommitPreparationV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.History.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.LockEvidenceV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.LockEvidenceV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OdapLocalLog.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OdapMessage.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OdapMessageActionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PayloadProfile.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RecoverSuccessV1Message.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RecoverUpdateAckV1Message.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RecoverUpdateV1Message.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RecoverV1Message.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RollbackAckV1Message.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.RollbackV1Message.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SessionData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransferCommenceV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransferCommenceV1Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransferCompleteV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransferInitializationV1Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransferInitializationV1Response.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); + } + } + } + + /** + * 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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..41f9de7a8cd --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..8641aa8337a --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..6c533444c1f --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..ab7fcbf94a1 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..0fa74bfe333 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,2132 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.ClientV1Request; +import org.openapitools.client.model.CommitFinalV1Request; +import org.openapitools.client.model.CommitFinalV1Response; +import org.openapitools.client.model.CommitPreparationV1Request; +import org.openapitools.client.model.CommitPreparationV1Response; +import org.openapitools.client.model.LockEvidenceV1Request; +import org.openapitools.client.model.LockEvidenceV1Response; +import org.openapitools.client.model.RecoverSuccessV1Message; +import org.openapitools.client.model.RecoverUpdateAckV1Message; +import org.openapitools.client.model.RecoverUpdateV1Message; +import org.openapitools.client.model.RecoverV1Message; +import org.openapitools.client.model.RollbackAckV1Message; +import org.openapitools.client.model.RollbackV1Message; +import org.openapitools.client.model.TransferCommenceV1Request; +import org.openapitools.client.model.TransferCommenceV1Response; +import org.openapitools.client.model.TransferCompleteV1Request; +import org.openapitools.client.model.TransferInitializationV1Request; +import org.openapitools.client.model.TransferInitializationV1Response; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 clientRequestV1 + * @param clientV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call clientRequestV1Call(ClientV1Request clientV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = clientV1Request; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/clientrequest"; + + 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 clientRequestV1ValidateBeforeCall(ClientV1Request clientV1Request, final ApiCallback _callback) throws ApiException { + return clientRequestV1Call(clientV1Request, _callback); + + } + + /** + * + * + * @param clientV1Request (optional) + * @return Object + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public Object clientRequestV1(ClientV1Request clientV1Request) throws ApiException { + ApiResponse localVarResp = clientRequestV1WithHttpInfo(clientV1Request); + return localVarResp.getData(); + } + + /** + * + * + * @param clientV1Request (optional) + * @return ApiResponse<Object> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse clientRequestV1WithHttpInfo(ClientV1Request clientV1Request) throws ApiException { + okhttp3.Call localVarCall = clientRequestV1ValidateBeforeCall(clientV1Request, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param clientV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call clientRequestV1Async(ClientV1Request clientV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = clientRequestV1ValidateBeforeCall(clientV1Request, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for phase1TransferInitiationRequestV1 + * @param transferInitializationV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase1TransferInitiationRequestV1Call(TransferInitializationV1Request transferInitializationV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = transferInitializationV1Request; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationrequest"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 phase1TransferInitiationRequestV1ValidateBeforeCall(TransferInitializationV1Request transferInitializationV1Request, final ApiCallback _callback) throws ApiException { + return phase1TransferInitiationRequestV1Call(transferInitializationV1Request, _callback); + + } + + /** + * + * + * @param transferInitializationV1Request (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase1TransferInitiationRequestV1(TransferInitializationV1Request transferInitializationV1Request) throws ApiException { + phase1TransferInitiationRequestV1WithHttpInfo(transferInitializationV1Request); + } + + /** + * + * + * @param transferInitializationV1Request (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase1TransferInitiationRequestV1WithHttpInfo(TransferInitializationV1Request transferInitializationV1Request) throws ApiException { + okhttp3.Call localVarCall = phase1TransferInitiationRequestV1ValidateBeforeCall(transferInitializationV1Request, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param transferInitializationV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase1TransferInitiationRequestV1Async(TransferInitializationV1Request transferInitializationV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase1TransferInitiationRequestV1ValidateBeforeCall(transferInitializationV1Request, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase1TransferInitiationResponseV1 + * @param transferInitializationV1Response (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase1TransferInitiationResponseV1Call(TransferInitializationV1Response transferInitializationV1Response, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = transferInitializationV1Response; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase1/transferinitiationresponse"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 phase1TransferInitiationResponseV1ValidateBeforeCall(TransferInitializationV1Response transferInitializationV1Response, final ApiCallback _callback) throws ApiException { + return phase1TransferInitiationResponseV1Call(transferInitializationV1Response, _callback); + + } + + /** + * + * + * @param transferInitializationV1Response (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase1TransferInitiationResponseV1(TransferInitializationV1Response transferInitializationV1Response) throws ApiException { + phase1TransferInitiationResponseV1WithHttpInfo(transferInitializationV1Response); + } + + /** + * + * + * @param transferInitializationV1Response (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase1TransferInitiationResponseV1WithHttpInfo(TransferInitializationV1Response transferInitializationV1Response) throws ApiException { + okhttp3.Call localVarCall = phase1TransferInitiationResponseV1ValidateBeforeCall(transferInitializationV1Response, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param transferInitializationV1Response (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase1TransferInitiationResponseV1Async(TransferInitializationV1Response transferInitializationV1Response, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase1TransferInitiationResponseV1ValidateBeforeCall(transferInitializationV1Response, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase2LockEvidenceRequestV1 + * @param lockEvidenceV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase2LockEvidenceRequestV1Call(LockEvidenceV1Request lockEvidenceV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = lockEvidenceV1Request; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidencerequest"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 phase2LockEvidenceRequestV1ValidateBeforeCall(LockEvidenceV1Request lockEvidenceV1Request, final ApiCallback _callback) throws ApiException { + return phase2LockEvidenceRequestV1Call(lockEvidenceV1Request, _callback); + + } + + /** + * + * + * @param lockEvidenceV1Request (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase2LockEvidenceRequestV1(LockEvidenceV1Request lockEvidenceV1Request) throws ApiException { + phase2LockEvidenceRequestV1WithHttpInfo(lockEvidenceV1Request); + } + + /** + * + * + * @param lockEvidenceV1Request (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase2LockEvidenceRequestV1WithHttpInfo(LockEvidenceV1Request lockEvidenceV1Request) throws ApiException { + okhttp3.Call localVarCall = phase2LockEvidenceRequestV1ValidateBeforeCall(lockEvidenceV1Request, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param lockEvidenceV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase2LockEvidenceRequestV1Async(LockEvidenceV1Request lockEvidenceV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase2LockEvidenceRequestV1ValidateBeforeCall(lockEvidenceV1Request, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase2LockEvidenceResponseV1 + * @param lockEvidenceV1Response (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase2LockEvidenceResponseV1Call(LockEvidenceV1Response lockEvidenceV1Response, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = lockEvidenceV1Response; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/lockevidenceresponse"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 phase2LockEvidenceResponseV1ValidateBeforeCall(LockEvidenceV1Response lockEvidenceV1Response, final ApiCallback _callback) throws ApiException { + return phase2LockEvidenceResponseV1Call(lockEvidenceV1Response, _callback); + + } + + /** + * + * + * @param lockEvidenceV1Response (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase2LockEvidenceResponseV1(LockEvidenceV1Response lockEvidenceV1Response) throws ApiException { + phase2LockEvidenceResponseV1WithHttpInfo(lockEvidenceV1Response); + } + + /** + * + * + * @param lockEvidenceV1Response (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase2LockEvidenceResponseV1WithHttpInfo(LockEvidenceV1Response lockEvidenceV1Response) throws ApiException { + okhttp3.Call localVarCall = phase2LockEvidenceResponseV1ValidateBeforeCall(lockEvidenceV1Response, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param lockEvidenceV1Response (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase2LockEvidenceResponseV1Async(LockEvidenceV1Response lockEvidenceV1Response, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase2LockEvidenceResponseV1ValidateBeforeCall(lockEvidenceV1Response, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase2TransferCommenceRequestV1 + * @param transferCommenceV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase2TransferCommenceRequestV1Call(TransferCommenceV1Request transferCommenceV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = transferCommenceV1Request; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommencerequest"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 phase2TransferCommenceRequestV1ValidateBeforeCall(TransferCommenceV1Request transferCommenceV1Request, final ApiCallback _callback) throws ApiException { + return phase2TransferCommenceRequestV1Call(transferCommenceV1Request, _callback); + + } + + /** + * + * + * @param transferCommenceV1Request (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase2TransferCommenceRequestV1(TransferCommenceV1Request transferCommenceV1Request) throws ApiException { + phase2TransferCommenceRequestV1WithHttpInfo(transferCommenceV1Request); + } + + /** + * + * + * @param transferCommenceV1Request (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase2TransferCommenceRequestV1WithHttpInfo(TransferCommenceV1Request transferCommenceV1Request) throws ApiException { + okhttp3.Call localVarCall = phase2TransferCommenceRequestV1ValidateBeforeCall(transferCommenceV1Request, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param transferCommenceV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase2TransferCommenceRequestV1Async(TransferCommenceV1Request transferCommenceV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase2TransferCommenceRequestV1ValidateBeforeCall(transferCommenceV1Request, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase2TransferCommenceResponseV1 + * @param transferCommenceV1Response (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase2TransferCommenceResponseV1Call(TransferCommenceV1Response transferCommenceV1Response, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = transferCommenceV1Response; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase2/transfercommenceresponse"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 phase2TransferCommenceResponseV1ValidateBeforeCall(TransferCommenceV1Response transferCommenceV1Response, final ApiCallback _callback) throws ApiException { + return phase2TransferCommenceResponseV1Call(transferCommenceV1Response, _callback); + + } + + /** + * + * + * @param transferCommenceV1Response (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase2TransferCommenceResponseV1(TransferCommenceV1Response transferCommenceV1Response) throws ApiException { + phase2TransferCommenceResponseV1WithHttpInfo(transferCommenceV1Response); + } + + /** + * + * + * @param transferCommenceV1Response (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase2TransferCommenceResponseV1WithHttpInfo(TransferCommenceV1Response transferCommenceV1Response) throws ApiException { + okhttp3.Call localVarCall = phase2TransferCommenceResponseV1ValidateBeforeCall(transferCommenceV1Response, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param transferCommenceV1Response (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase2TransferCommenceResponseV1Async(TransferCommenceV1Response transferCommenceV1Response, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase2TransferCommenceResponseV1ValidateBeforeCall(transferCommenceV1Response, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase3CommitFinalRequestV1 + * @param commitFinalV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3CommitFinalRequestV1Call(CommitFinalV1Request commitFinalV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = commitFinalV1Request; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalrequest"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 phase3CommitFinalRequestV1ValidateBeforeCall(CommitFinalV1Request commitFinalV1Request, final ApiCallback _callback) throws ApiException { + return phase3CommitFinalRequestV1Call(commitFinalV1Request, _callback); + + } + + /** + * + * + * @param commitFinalV1Request (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase3CommitFinalRequestV1(CommitFinalV1Request commitFinalV1Request) throws ApiException { + phase3CommitFinalRequestV1WithHttpInfo(commitFinalV1Request); + } + + /** + * + * + * @param commitFinalV1Request (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase3CommitFinalRequestV1WithHttpInfo(CommitFinalV1Request commitFinalV1Request) throws ApiException { + okhttp3.Call localVarCall = phase3CommitFinalRequestV1ValidateBeforeCall(commitFinalV1Request, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param commitFinalV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3CommitFinalRequestV1Async(CommitFinalV1Request commitFinalV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase3CommitFinalRequestV1ValidateBeforeCall(commitFinalV1Request, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase3CommitFinalResponseV1 + * @param commitFinalV1Response (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3CommitFinalResponseV1Call(CommitFinalV1Response commitFinalV1Response, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = commitFinalV1Response; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitfinalresponse"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 phase3CommitFinalResponseV1ValidateBeforeCall(CommitFinalV1Response commitFinalV1Response, final ApiCallback _callback) throws ApiException { + return phase3CommitFinalResponseV1Call(commitFinalV1Response, _callback); + + } + + /** + * + * + * @param commitFinalV1Response (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase3CommitFinalResponseV1(CommitFinalV1Response commitFinalV1Response) throws ApiException { + phase3CommitFinalResponseV1WithHttpInfo(commitFinalV1Response); + } + + /** + * + * + * @param commitFinalV1Response (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase3CommitFinalResponseV1WithHttpInfo(CommitFinalV1Response commitFinalV1Response) throws ApiException { + okhttp3.Call localVarCall = phase3CommitFinalResponseV1ValidateBeforeCall(commitFinalV1Response, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param commitFinalV1Response (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3CommitFinalResponseV1Async(CommitFinalV1Response commitFinalV1Response, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase3CommitFinalResponseV1ValidateBeforeCall(commitFinalV1Response, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase3CommitPreparationRequestV1 + * @param commitPreparationV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3CommitPreparationRequestV1Call(CommitPreparationV1Request commitPreparationV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = commitPreparationV1Request; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationrequest"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 phase3CommitPreparationRequestV1ValidateBeforeCall(CommitPreparationV1Request commitPreparationV1Request, final ApiCallback _callback) throws ApiException { + return phase3CommitPreparationRequestV1Call(commitPreparationV1Request, _callback); + + } + + /** + * + * + * @param commitPreparationV1Request (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase3CommitPreparationRequestV1(CommitPreparationV1Request commitPreparationV1Request) throws ApiException { + phase3CommitPreparationRequestV1WithHttpInfo(commitPreparationV1Request); + } + + /** + * + * + * @param commitPreparationV1Request (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase3CommitPreparationRequestV1WithHttpInfo(CommitPreparationV1Request commitPreparationV1Request) throws ApiException { + okhttp3.Call localVarCall = phase3CommitPreparationRequestV1ValidateBeforeCall(commitPreparationV1Request, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param commitPreparationV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3CommitPreparationRequestV1Async(CommitPreparationV1Request commitPreparationV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase3CommitPreparationRequestV1ValidateBeforeCall(commitPreparationV1Request, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase3CommitPreparationResponseV1 + * @param commitPreparationV1Response (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3CommitPreparationResponseV1Call(CommitPreparationV1Response commitPreparationV1Response, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = commitPreparationV1Response; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/commitpreparationresponse"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 phase3CommitPreparationResponseV1ValidateBeforeCall(CommitPreparationV1Response commitPreparationV1Response, final ApiCallback _callback) throws ApiException { + return phase3CommitPreparationResponseV1Call(commitPreparationV1Response, _callback); + + } + + /** + * + * + * @param commitPreparationV1Response (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase3CommitPreparationResponseV1(CommitPreparationV1Response commitPreparationV1Response) throws ApiException { + phase3CommitPreparationResponseV1WithHttpInfo(commitPreparationV1Response); + } + + /** + * + * + * @param commitPreparationV1Response (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase3CommitPreparationResponseV1WithHttpInfo(CommitPreparationV1Response commitPreparationV1Response) throws ApiException { + okhttp3.Call localVarCall = phase3CommitPreparationResponseV1ValidateBeforeCall(commitPreparationV1Response, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param commitPreparationV1Response (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3CommitPreparationResponseV1Async(CommitPreparationV1Response commitPreparationV1Response, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase3CommitPreparationResponseV1ValidateBeforeCall(commitPreparationV1Response, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for phase3TransferCompleteRequestV1 + * @param transferCompleteV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3TransferCompleteRequestV1Call(TransferCompleteV1Request transferCompleteV1Request, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = transferCompleteV1Request; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/phase3/transfercompleterequest"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call phase3TransferCompleteRequestV1ValidateBeforeCall(TransferCompleteV1Request transferCompleteV1Request, final ApiCallback _callback) throws ApiException { + return phase3TransferCompleteRequestV1Call(transferCompleteV1Request, _callback); + + } + + /** + * + * + * @param transferCompleteV1Request (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void phase3TransferCompleteRequestV1(TransferCompleteV1Request transferCompleteV1Request) throws ApiException { + phase3TransferCompleteRequestV1WithHttpInfo(transferCompleteV1Request); + } + + /** + * + * + * @param transferCompleteV1Request (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse phase3TransferCompleteRequestV1WithHttpInfo(TransferCompleteV1Request transferCompleteV1Request) throws ApiException { + okhttp3.Call localVarCall = phase3TransferCompleteRequestV1ValidateBeforeCall(transferCompleteV1Request, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param transferCompleteV1Request (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call phase3TransferCompleteRequestV1Async(TransferCompleteV1Request transferCompleteV1Request, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = phase3TransferCompleteRequestV1ValidateBeforeCall(transferCompleteV1Request, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for recoverUpdateAckV1Message + * @param recoverUpdateAckV1Message (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call recoverUpdateAckV1MessageCall(RecoverUpdateAckV1Message recoverUpdateAckV1Message, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = recoverUpdateAckV1Message; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdateackmessage"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 recoverUpdateAckV1MessageValidateBeforeCall(RecoverUpdateAckV1Message recoverUpdateAckV1Message, final ApiCallback _callback) throws ApiException { + return recoverUpdateAckV1MessageCall(recoverUpdateAckV1Message, _callback); + + } + + /** + * + * + * @param recoverUpdateAckV1Message (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void recoverUpdateAckV1Message(RecoverUpdateAckV1Message recoverUpdateAckV1Message) throws ApiException { + recoverUpdateAckV1MessageWithHttpInfo(recoverUpdateAckV1Message); + } + + /** + * + * + * @param recoverUpdateAckV1Message (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse recoverUpdateAckV1MessageWithHttpInfo(RecoverUpdateAckV1Message recoverUpdateAckV1Message) throws ApiException { + okhttp3.Call localVarCall = recoverUpdateAckV1MessageValidateBeforeCall(recoverUpdateAckV1Message, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param recoverUpdateAckV1Message (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call recoverUpdateAckV1MessageAsync(RecoverUpdateAckV1Message recoverUpdateAckV1Message, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = recoverUpdateAckV1MessageValidateBeforeCall(recoverUpdateAckV1Message, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for recoverUpdateV1Message + * @param recoverUpdateV1Message (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call recoverUpdateV1MessageCall(RecoverUpdateV1Message recoverUpdateV1Message, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = recoverUpdateV1Message; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoverupdatemessage"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 recoverUpdateV1MessageValidateBeforeCall(RecoverUpdateV1Message recoverUpdateV1Message, final ApiCallback _callback) throws ApiException { + return recoverUpdateV1MessageCall(recoverUpdateV1Message, _callback); + + } + + /** + * + * + * @param recoverUpdateV1Message (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void recoverUpdateV1Message(RecoverUpdateV1Message recoverUpdateV1Message) throws ApiException { + recoverUpdateV1MessageWithHttpInfo(recoverUpdateV1Message); + } + + /** + * + * + * @param recoverUpdateV1Message (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse recoverUpdateV1MessageWithHttpInfo(RecoverUpdateV1Message recoverUpdateV1Message) throws ApiException { + okhttp3.Call localVarCall = recoverUpdateV1MessageValidateBeforeCall(recoverUpdateV1Message, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param recoverUpdateV1Message (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call recoverUpdateV1MessageAsync(RecoverUpdateV1Message recoverUpdateV1Message, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = recoverUpdateV1MessageValidateBeforeCall(recoverUpdateV1Message, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for recoverV1Message + * @param recoverV1Message (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call recoverV1MessageCall(RecoverV1Message recoverV1Message, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = recoverV1Message; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recovermessage"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 recoverV1MessageValidateBeforeCall(RecoverV1Message recoverV1Message, final ApiCallback _callback) throws ApiException { + return recoverV1MessageCall(recoverV1Message, _callback); + + } + + /** + * + * + * @param recoverV1Message (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void recoverV1Message(RecoverV1Message recoverV1Message) throws ApiException { + recoverV1MessageWithHttpInfo(recoverV1Message); + } + + /** + * + * + * @param recoverV1Message (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse recoverV1MessageWithHttpInfo(RecoverV1Message recoverV1Message) throws ApiException { + okhttp3.Call localVarCall = recoverV1MessageValidateBeforeCall(recoverV1Message, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param recoverV1Message (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call recoverV1MessageAsync(RecoverV1Message recoverV1Message, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = recoverV1MessageValidateBeforeCall(recoverV1Message, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for recoverV1Success + * @param recoverSuccessV1Message (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call recoverV1SuccessCall(RecoverSuccessV1Message recoverSuccessV1Message, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = recoverSuccessV1Message; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/recoversuccessmessage"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 recoverV1SuccessValidateBeforeCall(RecoverSuccessV1Message recoverSuccessV1Message, final ApiCallback _callback) throws ApiException { + return recoverV1SuccessCall(recoverSuccessV1Message, _callback); + + } + + /** + * + * + * @param recoverSuccessV1Message (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void recoverV1Success(RecoverSuccessV1Message recoverSuccessV1Message) throws ApiException { + recoverV1SuccessWithHttpInfo(recoverSuccessV1Message); + } + + /** + * + * + * @param recoverSuccessV1Message (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse recoverV1SuccessWithHttpInfo(RecoverSuccessV1Message recoverSuccessV1Message) throws ApiException { + okhttp3.Call localVarCall = recoverV1SuccessValidateBeforeCall(recoverSuccessV1Message, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param recoverSuccessV1Message (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call recoverV1SuccessAsync(RecoverSuccessV1Message recoverSuccessV1Message, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = recoverV1SuccessValidateBeforeCall(recoverSuccessV1Message, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for rollbackAckV1Message + * @param rollbackAckV1Message (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call rollbackAckV1MessageCall(RollbackAckV1Message rollbackAckV1Message, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = rollbackAckV1Message; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackackmessage"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 rollbackAckV1MessageValidateBeforeCall(RollbackAckV1Message rollbackAckV1Message, final ApiCallback _callback) throws ApiException { + return rollbackAckV1MessageCall(rollbackAckV1Message, _callback); + + } + + /** + * + * + * @param rollbackAckV1Message (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void rollbackAckV1Message(RollbackAckV1Message rollbackAckV1Message) throws ApiException { + rollbackAckV1MessageWithHttpInfo(rollbackAckV1Message); + } + + /** + * + * + * @param rollbackAckV1Message (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse rollbackAckV1MessageWithHttpInfo(RollbackAckV1Message rollbackAckV1Message) throws ApiException { + okhttp3.Call localVarCall = rollbackAckV1MessageValidateBeforeCall(rollbackAckV1Message, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param rollbackAckV1Message (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call rollbackAckV1MessageAsync(RollbackAckV1Message rollbackAckV1Message, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = rollbackAckV1MessageValidateBeforeCall(rollbackAckV1Message, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for rollbackV1Message + * @param rollbackV1Message (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call rollbackV1MessageCall(RollbackV1Message rollbackV1Message, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = rollbackV1Message; + + // create path and map variables + String localVarPath = "/api/v1/@hyperledger/cactus-plugin-odap-hermes/rollbackmessage"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + 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 rollbackV1MessageValidateBeforeCall(RollbackV1Message rollbackV1Message, final ApiCallback _callback) throws ApiException { + return rollbackV1MessageCall(rollbackV1Message, _callback); + + } + + /** + * + * + * @param rollbackV1Message (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public void rollbackV1Message(RollbackV1Message rollbackV1Message) throws ApiException { + rollbackV1MessageWithHttpInfo(rollbackV1Message); + } + + /** + * + * + * @param rollbackV1Message (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 OK -
+ */ + public ApiResponse rollbackV1MessageWithHttpInfo(RollbackV1Message rollbackV1Message) throws ApiException { + okhttp3.Call localVarCall = rollbackV1MessageValidateBeforeCall(rollbackV1Message, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @param rollbackV1Message (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 + + + +
Status Code Description Response Headers
200 OK -
+ */ + public okhttp3.Call rollbackV1MessageAsync(RollbackV1Message rollbackV1Message, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = rollbackV1MessageValidateBeforeCall(rollbackV1Message, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..714e9b04412 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..a55e830c782 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..62643a0ee80 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..ed73077993e --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..08eadc4aab0 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AssetProfile.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AssetProfile.java new file mode 100644 index 00000000000..af87ad79417 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AssetProfile.java @@ -0,0 +1,595 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * AssetProfile + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AssetProfile { + public static final String SERIALIZED_NAME_ISSUER = "issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + private String issuer; + + public static final String SERIALIZED_NAME_ASSET_CODE = "assetCode"; + @SerializedName(SERIALIZED_NAME_ASSET_CODE) + private String assetCode; + + public static final String SERIALIZED_NAME_ASSET_CODE_TYPE = "assetCodeType"; + @SerializedName(SERIALIZED_NAME_ASSET_CODE_TYPE) + private String assetCodeType; + + public static final String SERIALIZED_NAME_ISSUANCE_DATE = "issuanceDate"; + @SerializedName(SERIALIZED_NAME_ISSUANCE_DATE) + private String issuanceDate; + + public static final String SERIALIZED_NAME_EXPIRATION_DATE = "expirationDate"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_DATE) + private String expirationDate; + + public static final String SERIALIZED_NAME_VERIFICATION_END_POINT = "verificationEndPoint"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_END_POINT) + private String verificationEndPoint; + + public static final String SERIALIZED_NAME_DIGITAL_SIGNATURE = "digitalSignature"; + @SerializedName(SERIALIZED_NAME_DIGITAL_SIGNATURE) + private String digitalSignature; + + public static final String SERIALIZED_NAME_PROSPECTUS_LINK = "prospectusLink"; + @SerializedName(SERIALIZED_NAME_PROSPECTUS_LINK) + private String prospectusLink; + + public static final String SERIALIZED_NAME_KEY_INFORMATION_LINK = "keyInformationLink"; + @SerializedName(SERIALIZED_NAME_KEY_INFORMATION_LINK) + private List keyInformationLink; + + public static final String SERIALIZED_NAME_KEY_WORD = "keyWord"; + @SerializedName(SERIALIZED_NAME_KEY_WORD) + private List keyWord; + + public static final String SERIALIZED_NAME_TRANSFER_RESTRICTION = "transferRestriction"; + @SerializedName(SERIALIZED_NAME_TRANSFER_RESTRICTION) + private List transferRestriction; + + public static final String SERIALIZED_NAME_LEDGER_REQUIREMENTS = "ledgerRequirements"; + @SerializedName(SERIALIZED_NAME_LEDGER_REQUIREMENTS) + private List ledgerRequirements; + + public AssetProfile() { + } + + public AssetProfile issuer(String issuer) { + + this.issuer = issuer; + return this; + } + + /** + * Get issuer + * @return issuer + **/ + @javax.annotation.Nullable + public String getIssuer() { + return issuer; + } + + + public void setIssuer(String issuer) { + this.issuer = issuer; + } + + + public AssetProfile assetCode(String assetCode) { + + this.assetCode = assetCode; + return this; + } + + /** + * Get assetCode + * @return assetCode + **/ + @javax.annotation.Nullable + public String getAssetCode() { + return assetCode; + } + + + public void setAssetCode(String assetCode) { + this.assetCode = assetCode; + } + + + public AssetProfile assetCodeType(String assetCodeType) { + + this.assetCodeType = assetCodeType; + return this; + } + + /** + * Get assetCodeType + * @return assetCodeType + **/ + @javax.annotation.Nullable + public String getAssetCodeType() { + return assetCodeType; + } + + + public void setAssetCodeType(String assetCodeType) { + this.assetCodeType = assetCodeType; + } + + + public AssetProfile issuanceDate(String issuanceDate) { + + this.issuanceDate = issuanceDate; + return this; + } + + /** + * Get issuanceDate + * @return issuanceDate + **/ + @javax.annotation.Nullable + public String getIssuanceDate() { + return issuanceDate; + } + + + public void setIssuanceDate(String issuanceDate) { + this.issuanceDate = issuanceDate; + } + + + public AssetProfile expirationDate(String expirationDate) { + + this.expirationDate = expirationDate; + return this; + } + + /** + * Get expirationDate + * @return expirationDate + **/ + @javax.annotation.Nonnull + public String getExpirationDate() { + return expirationDate; + } + + + public void setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + } + + + public AssetProfile verificationEndPoint(String verificationEndPoint) { + + this.verificationEndPoint = verificationEndPoint; + return this; + } + + /** + * Get verificationEndPoint + * @return verificationEndPoint + **/ + @javax.annotation.Nullable + public String getVerificationEndPoint() { + return verificationEndPoint; + } + + + public void setVerificationEndPoint(String verificationEndPoint) { + this.verificationEndPoint = verificationEndPoint; + } + + + public AssetProfile digitalSignature(String digitalSignature) { + + this.digitalSignature = digitalSignature; + return this; + } + + /** + * Get digitalSignature + * @return digitalSignature + **/ + @javax.annotation.Nullable + public String getDigitalSignature() { + return digitalSignature; + } + + + public void setDigitalSignature(String digitalSignature) { + this.digitalSignature = digitalSignature; + } + + + public AssetProfile prospectusLink(String prospectusLink) { + + this.prospectusLink = prospectusLink; + return this; + } + + /** + * Get prospectusLink + * @return prospectusLink + **/ + @javax.annotation.Nullable + public String getProspectusLink() { + return prospectusLink; + } + + + public void setProspectusLink(String prospectusLink) { + this.prospectusLink = prospectusLink; + } + + + public AssetProfile keyInformationLink(List keyInformationLink) { + + this.keyInformationLink = keyInformationLink; + return this; + } + + public AssetProfile addKeyInformationLinkItem(Object keyInformationLinkItem) { + if (this.keyInformationLink == null) { + this.keyInformationLink = new ArrayList<>(); + } + this.keyInformationLink.add(keyInformationLinkItem); + return this; + } + + /** + * Get keyInformationLink + * @return keyInformationLink + **/ + @javax.annotation.Nullable + public List getKeyInformationLink() { + return keyInformationLink; + } + + + public void setKeyInformationLink(List keyInformationLink) { + this.keyInformationLink = keyInformationLink; + } + + + public AssetProfile keyWord(List keyWord) { + + this.keyWord = keyWord; + return this; + } + + public AssetProfile addKeyWordItem(Object keyWordItem) { + if (this.keyWord == null) { + this.keyWord = new ArrayList<>(); + } + this.keyWord.add(keyWordItem); + return this; + } + + /** + * Get keyWord + * @return keyWord + **/ + @javax.annotation.Nullable + public List getKeyWord() { + return keyWord; + } + + + public void setKeyWord(List keyWord) { + this.keyWord = keyWord; + } + + + public AssetProfile transferRestriction(List transferRestriction) { + + this.transferRestriction = transferRestriction; + return this; + } + + public AssetProfile addTransferRestrictionItem(Object transferRestrictionItem) { + if (this.transferRestriction == null) { + this.transferRestriction = new ArrayList<>(); + } + this.transferRestriction.add(transferRestrictionItem); + return this; + } + + /** + * Get transferRestriction + * @return transferRestriction + **/ + @javax.annotation.Nullable + public List getTransferRestriction() { + return transferRestriction; + } + + + public void setTransferRestriction(List transferRestriction) { + this.transferRestriction = transferRestriction; + } + + + public AssetProfile ledgerRequirements(List ledgerRequirements) { + + this.ledgerRequirements = ledgerRequirements; + return this; + } + + public AssetProfile addLedgerRequirementsItem(Object ledgerRequirementsItem) { + if (this.ledgerRequirements == null) { + this.ledgerRequirements = new ArrayList<>(); + } + this.ledgerRequirements.add(ledgerRequirementsItem); + return this; + } + + /** + * Get ledgerRequirements + * @return ledgerRequirements + **/ + @javax.annotation.Nullable + public List getLedgerRequirements() { + return ledgerRequirements; + } + + + public void setLedgerRequirements(List ledgerRequirements) { + this.ledgerRequirements = ledgerRequirements; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssetProfile assetProfile = (AssetProfile) o; + return Objects.equals(this.issuer, assetProfile.issuer) && + Objects.equals(this.assetCode, assetProfile.assetCode) && + Objects.equals(this.assetCodeType, assetProfile.assetCodeType) && + Objects.equals(this.issuanceDate, assetProfile.issuanceDate) && + Objects.equals(this.expirationDate, assetProfile.expirationDate) && + Objects.equals(this.verificationEndPoint, assetProfile.verificationEndPoint) && + Objects.equals(this.digitalSignature, assetProfile.digitalSignature) && + Objects.equals(this.prospectusLink, assetProfile.prospectusLink) && + Objects.equals(this.keyInformationLink, assetProfile.keyInformationLink) && + Objects.equals(this.keyWord, assetProfile.keyWord) && + Objects.equals(this.transferRestriction, assetProfile.transferRestriction) && + Objects.equals(this.ledgerRequirements, assetProfile.ledgerRequirements); + } + + @Override + public int hashCode() { + return Objects.hash(issuer, assetCode, assetCodeType, issuanceDate, expirationDate, verificationEndPoint, digitalSignature, prospectusLink, keyInformationLink, keyWord, transferRestriction, ledgerRequirements); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssetProfile {\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" assetCode: ").append(toIndentedString(assetCode)).append("\n"); + sb.append(" assetCodeType: ").append(toIndentedString(assetCodeType)).append("\n"); + sb.append(" issuanceDate: ").append(toIndentedString(issuanceDate)).append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); + sb.append(" verificationEndPoint: ").append(toIndentedString(verificationEndPoint)).append("\n"); + sb.append(" digitalSignature: ").append(toIndentedString(digitalSignature)).append("\n"); + sb.append(" prospectusLink: ").append(toIndentedString(prospectusLink)).append("\n"); + sb.append(" keyInformationLink: ").append(toIndentedString(keyInformationLink)).append("\n"); + sb.append(" keyWord: ").append(toIndentedString(keyWord)).append("\n"); + sb.append(" transferRestriction: ").append(toIndentedString(transferRestriction)).append("\n"); + sb.append(" ledgerRequirements: ").append(toIndentedString(ledgerRequirements)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("issuer"); + openapiFields.add("assetCode"); + openapiFields.add("assetCodeType"); + openapiFields.add("issuanceDate"); + openapiFields.add("expirationDate"); + openapiFields.add("verificationEndPoint"); + openapiFields.add("digitalSignature"); + openapiFields.add("prospectusLink"); + openapiFields.add("keyInformationLink"); + openapiFields.add("keyWord"); + openapiFields.add("transferRestriction"); + openapiFields.add("ledgerRequirements"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("expirationDate"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AssetProfile + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!AssetProfile.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AssetProfile is not found in the empty JSON string", AssetProfile.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AssetProfile.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssetProfile` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AssetProfile.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("issuer") != null && !jsonObj.get("issuer").isJsonNull()) && !jsonObj.get("issuer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); + } + if ((jsonObj.get("assetCode") != null && !jsonObj.get("assetCode").isJsonNull()) && !jsonObj.get("assetCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetCode").toString())); + } + if ((jsonObj.get("assetCodeType") != null && !jsonObj.get("assetCodeType").isJsonNull()) && !jsonObj.get("assetCodeType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetCodeType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetCodeType").toString())); + } + if ((jsonObj.get("issuanceDate") != null && !jsonObj.get("issuanceDate").isJsonNull()) && !jsonObj.get("issuanceDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuanceDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuanceDate").toString())); + } + if (!jsonObj.get("expirationDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expirationDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expirationDate").toString())); + } + if ((jsonObj.get("verificationEndPoint") != null && !jsonObj.get("verificationEndPoint").isJsonNull()) && !jsonObj.get("verificationEndPoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verificationEndPoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verificationEndPoint").toString())); + } + if ((jsonObj.get("digitalSignature") != null && !jsonObj.get("digitalSignature").isJsonNull()) && !jsonObj.get("digitalSignature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `digitalSignature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("digitalSignature").toString())); + } + if ((jsonObj.get("prospectusLink") != null && !jsonObj.get("prospectusLink").isJsonNull()) && !jsonObj.get("prospectusLink").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `prospectusLink` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prospectusLink").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("keyInformationLink") != null && !jsonObj.get("keyInformationLink").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `keyInformationLink` to be an array in the JSON string but got `%s`", jsonObj.get("keyInformationLink").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("keyWord") != null && !jsonObj.get("keyWord").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `keyWord` to be an array in the JSON string but got `%s`", jsonObj.get("keyWord").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("transferRestriction") != null && !jsonObj.get("transferRestriction").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transferRestriction` to be an array in the JSON string but got `%s`", jsonObj.get("transferRestriction").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("ledgerRequirements") != null && !jsonObj.get("ledgerRequirements").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ledgerRequirements` to be an array in the JSON string but got `%s`", jsonObj.get("ledgerRequirements").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssetProfile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssetProfile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssetProfile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssetProfile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssetProfile read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssetProfile given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssetProfile + * @throws IOException if the JSON string is invalid with respect to AssetProfile + */ + public static AssetProfile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssetProfile.class); + } + + /** + * Convert an instance of AssetProfile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClientV1Request.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClientV1Request.java new file mode 100644 index 00000000000..1fbee776883 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClientV1Request.java @@ -0,0 +1,882 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.client.model.AssetProfile; +import org.openapitools.client.model.ClientV1RequestClientGatewayConfiguration; +import org.openapitools.client.model.PayloadProfile; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ClientV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ClientV1Request { + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public static final String SERIALIZED_NAME_LOGGING_PROFILE = "loggingProfile"; + @SerializedName(SERIALIZED_NAME_LOGGING_PROFILE) + private String loggingProfile; + + public static final String SERIALIZED_NAME_ACCESS_CONTROL_PROFILE = "accessControlProfile"; + @SerializedName(SERIALIZED_NAME_ACCESS_CONTROL_PROFILE) + private String accessControlProfile; + + public static final String SERIALIZED_NAME_ASSET_CONTROL_PROFILE = "assetControlProfile"; + @SerializedName(SERIALIZED_NAME_ASSET_CONTROL_PROFILE) + private String assetControlProfile; + + public static final String SERIALIZED_NAME_APPLICATION_PROFILE = "applicationProfile"; + @SerializedName(SERIALIZED_NAME_APPLICATION_PROFILE) + private String applicationProfile; + + public static final String SERIALIZED_NAME_ASSET_PROFILE = "assetProfile"; + @SerializedName(SERIALIZED_NAME_ASSET_PROFILE) + private AssetProfile assetProfile; + + public static final String SERIALIZED_NAME_PAYLOAD_PROFILE = "payloadProfile"; + @SerializedName(SERIALIZED_NAME_PAYLOAD_PROFILE) + private PayloadProfile payloadProfile; + + public static final String SERIALIZED_NAME_SOURCE_GATEWAY_DLT_SYSTEM = "sourceGatewayDltSystem"; + @SerializedName(SERIALIZED_NAME_SOURCE_GATEWAY_DLT_SYSTEM) + private String sourceGatewayDltSystem; + + public static final String SERIALIZED_NAME_RECIPIENT_GATEWAY_DLT_SYSTEM = "recipientGatewayDltSystem"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_GATEWAY_DLT_SYSTEM) + private String recipientGatewayDltSystem; + + public static final String SERIALIZED_NAME_RECIPIENT_GATEWAY_PUBKEY = "recipientGatewayPubkey"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_GATEWAY_PUBKEY) + private String recipientGatewayPubkey; + + public static final String SERIALIZED_NAME_ORIGINATOR_PUBKEY = "originatorPubkey"; + @SerializedName(SERIALIZED_NAME_ORIGINATOR_PUBKEY) + private String originatorPubkey; + + public static final String SERIALIZED_NAME_BENEFICIARY_PUBKEY = "beneficiaryPubkey"; + @SerializedName(SERIALIZED_NAME_BENEFICIARY_PUBKEY) + private String beneficiaryPubkey; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_CLIENT_DLT_SYSTEM = "clientDltSystem"; + @SerializedName(SERIALIZED_NAME_CLIENT_DLT_SYSTEM) + private String clientDltSystem; + + public static final String SERIALIZED_NAME_SERVER_DLT_SYSTEM = "serverDltSystem"; + @SerializedName(SERIALIZED_NAME_SERVER_DLT_SYSTEM) + private String serverDltSystem; + + public static final String SERIALIZED_NAME_CLIENT_GATEWAY_CONFIGURATION = "clientGatewayConfiguration"; + @SerializedName(SERIALIZED_NAME_CLIENT_GATEWAY_CONFIGURATION) + private ClientV1RequestClientGatewayConfiguration clientGatewayConfiguration; + + public static final String SERIALIZED_NAME_SERVER_GATEWAY_CONFIGURATION = "serverGatewayConfiguration"; + @SerializedName(SERIALIZED_NAME_SERVER_GATEWAY_CONFIGURATION) + private ClientV1RequestClientGatewayConfiguration serverGatewayConfiguration; + + public static final String SERIALIZED_NAME_MAX_RETRIES = "maxRetries"; + @SerializedName(SERIALIZED_NAME_MAX_RETRIES) + private BigDecimal maxRetries; + + public static final String SERIALIZED_NAME_MAX_TIMEOUT = "maxTimeout"; + @SerializedName(SERIALIZED_NAME_MAX_TIMEOUT) + private BigDecimal maxTimeout; + + public static final String SERIALIZED_NAME_SOURCE_LEDGER_ASSET_I_D = "sourceLedgerAssetID"; + @SerializedName(SERIALIZED_NAME_SOURCE_LEDGER_ASSET_I_D) + private String sourceLedgerAssetID; + + public static final String SERIALIZED_NAME_RECIPIENT_LEDGER_ASSET_I_D = "recipientLedgerAssetID"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_LEDGER_ASSET_I_D) + private String recipientLedgerAssetID; + + public ClientV1Request() { + } + + public ClientV1Request version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @javax.annotation.Nonnull + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + + public ClientV1Request loggingProfile(String loggingProfile) { + + this.loggingProfile = loggingProfile; + return this; + } + + /** + * Get loggingProfile + * @return loggingProfile + **/ + @javax.annotation.Nonnull + public String getLoggingProfile() { + return loggingProfile; + } + + + public void setLoggingProfile(String loggingProfile) { + this.loggingProfile = loggingProfile; + } + + + public ClientV1Request accessControlProfile(String accessControlProfile) { + + this.accessControlProfile = accessControlProfile; + return this; + } + + /** + * Get accessControlProfile + * @return accessControlProfile + **/ + @javax.annotation.Nonnull + public String getAccessControlProfile() { + return accessControlProfile; + } + + + public void setAccessControlProfile(String accessControlProfile) { + this.accessControlProfile = accessControlProfile; + } + + + public ClientV1Request assetControlProfile(String assetControlProfile) { + + this.assetControlProfile = assetControlProfile; + return this; + } + + /** + * Get assetControlProfile + * @return assetControlProfile + **/ + @javax.annotation.Nonnull + public String getAssetControlProfile() { + return assetControlProfile; + } + + + public void setAssetControlProfile(String assetControlProfile) { + this.assetControlProfile = assetControlProfile; + } + + + public ClientV1Request applicationProfile(String applicationProfile) { + + this.applicationProfile = applicationProfile; + return this; + } + + /** + * Get applicationProfile + * @return applicationProfile + **/ + @javax.annotation.Nonnull + public String getApplicationProfile() { + return applicationProfile; + } + + + public void setApplicationProfile(String applicationProfile) { + this.applicationProfile = applicationProfile; + } + + + public ClientV1Request assetProfile(AssetProfile assetProfile) { + + this.assetProfile = assetProfile; + return this; + } + + /** + * Get assetProfile + * @return assetProfile + **/ + @javax.annotation.Nonnull + public AssetProfile getAssetProfile() { + return assetProfile; + } + + + public void setAssetProfile(AssetProfile assetProfile) { + this.assetProfile = assetProfile; + } + + + public ClientV1Request payloadProfile(PayloadProfile payloadProfile) { + + this.payloadProfile = payloadProfile; + return this; + } + + /** + * Get payloadProfile + * @return payloadProfile + **/ + @javax.annotation.Nonnull + public PayloadProfile getPayloadProfile() { + return payloadProfile; + } + + + public void setPayloadProfile(PayloadProfile payloadProfile) { + this.payloadProfile = payloadProfile; + } + + + public ClientV1Request sourceGatewayDltSystem(String sourceGatewayDltSystem) { + + this.sourceGatewayDltSystem = sourceGatewayDltSystem; + return this; + } + + /** + * Get sourceGatewayDltSystem + * @return sourceGatewayDltSystem + **/ + @javax.annotation.Nonnull + public String getSourceGatewayDltSystem() { + return sourceGatewayDltSystem; + } + + + public void setSourceGatewayDltSystem(String sourceGatewayDltSystem) { + this.sourceGatewayDltSystem = sourceGatewayDltSystem; + } + + + public ClientV1Request recipientGatewayDltSystem(String recipientGatewayDltSystem) { + + this.recipientGatewayDltSystem = recipientGatewayDltSystem; + return this; + } + + /** + * Get recipientGatewayDltSystem + * @return recipientGatewayDltSystem + **/ + @javax.annotation.Nonnull + public String getRecipientGatewayDltSystem() { + return recipientGatewayDltSystem; + } + + + public void setRecipientGatewayDltSystem(String recipientGatewayDltSystem) { + this.recipientGatewayDltSystem = recipientGatewayDltSystem; + } + + + public ClientV1Request recipientGatewayPubkey(String recipientGatewayPubkey) { + + this.recipientGatewayPubkey = recipientGatewayPubkey; + return this; + } + + /** + * Get recipientGatewayPubkey + * @return recipientGatewayPubkey + **/ + @javax.annotation.Nonnull + public String getRecipientGatewayPubkey() { + return recipientGatewayPubkey; + } + + + public void setRecipientGatewayPubkey(String recipientGatewayPubkey) { + this.recipientGatewayPubkey = recipientGatewayPubkey; + } + + + public ClientV1Request originatorPubkey(String originatorPubkey) { + + this.originatorPubkey = originatorPubkey; + return this; + } + + /** + * Get originatorPubkey + * @return originatorPubkey + **/ + @javax.annotation.Nonnull + public String getOriginatorPubkey() { + return originatorPubkey; + } + + + public void setOriginatorPubkey(String originatorPubkey) { + this.originatorPubkey = originatorPubkey; + } + + + public ClientV1Request beneficiaryPubkey(String beneficiaryPubkey) { + + this.beneficiaryPubkey = beneficiaryPubkey; + return this; + } + + /** + * Get beneficiaryPubkey + * @return beneficiaryPubkey + **/ + @javax.annotation.Nonnull + public String getBeneficiaryPubkey() { + return beneficiaryPubkey; + } + + + public void setBeneficiaryPubkey(String beneficiaryPubkey) { + this.beneficiaryPubkey = beneficiaryPubkey; + } + + + public ClientV1Request clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public ClientV1Request serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public ClientV1Request clientDltSystem(String clientDltSystem) { + + this.clientDltSystem = clientDltSystem; + return this; + } + + /** + * Get clientDltSystem + * @return clientDltSystem + **/ + @javax.annotation.Nonnull + public String getClientDltSystem() { + return clientDltSystem; + } + + + public void setClientDltSystem(String clientDltSystem) { + this.clientDltSystem = clientDltSystem; + } + + + public ClientV1Request serverDltSystem(String serverDltSystem) { + + this.serverDltSystem = serverDltSystem; + return this; + } + + /** + * Get serverDltSystem + * @return serverDltSystem + **/ + @javax.annotation.Nonnull + public String getServerDltSystem() { + return serverDltSystem; + } + + + public void setServerDltSystem(String serverDltSystem) { + this.serverDltSystem = serverDltSystem; + } + + + public ClientV1Request clientGatewayConfiguration(ClientV1RequestClientGatewayConfiguration clientGatewayConfiguration) { + + this.clientGatewayConfiguration = clientGatewayConfiguration; + return this; + } + + /** + * Get clientGatewayConfiguration + * @return clientGatewayConfiguration + **/ + @javax.annotation.Nonnull + public ClientV1RequestClientGatewayConfiguration getClientGatewayConfiguration() { + return clientGatewayConfiguration; + } + + + public void setClientGatewayConfiguration(ClientV1RequestClientGatewayConfiguration clientGatewayConfiguration) { + this.clientGatewayConfiguration = clientGatewayConfiguration; + } + + + public ClientV1Request serverGatewayConfiguration(ClientV1RequestClientGatewayConfiguration serverGatewayConfiguration) { + + this.serverGatewayConfiguration = serverGatewayConfiguration; + return this; + } + + /** + * Get serverGatewayConfiguration + * @return serverGatewayConfiguration + **/ + @javax.annotation.Nonnull + public ClientV1RequestClientGatewayConfiguration getServerGatewayConfiguration() { + return serverGatewayConfiguration; + } + + + public void setServerGatewayConfiguration(ClientV1RequestClientGatewayConfiguration serverGatewayConfiguration) { + this.serverGatewayConfiguration = serverGatewayConfiguration; + } + + + public ClientV1Request maxRetries(BigDecimal maxRetries) { + + this.maxRetries = maxRetries; + return this; + } + + /** + * Get maxRetries + * @return maxRetries + **/ + @javax.annotation.Nonnull + public BigDecimal getMaxRetries() { + return maxRetries; + } + + + public void setMaxRetries(BigDecimal maxRetries) { + this.maxRetries = maxRetries; + } + + + public ClientV1Request maxTimeout(BigDecimal maxTimeout) { + + this.maxTimeout = maxTimeout; + return this; + } + + /** + * Get maxTimeout + * @return maxTimeout + **/ + @javax.annotation.Nonnull + public BigDecimal getMaxTimeout() { + return maxTimeout; + } + + + public void setMaxTimeout(BigDecimal maxTimeout) { + this.maxTimeout = maxTimeout; + } + + + public ClientV1Request sourceLedgerAssetID(String sourceLedgerAssetID) { + + this.sourceLedgerAssetID = sourceLedgerAssetID; + return this; + } + + /** + * Get sourceLedgerAssetID + * @return sourceLedgerAssetID + **/ + @javax.annotation.Nonnull + public String getSourceLedgerAssetID() { + return sourceLedgerAssetID; + } + + + public void setSourceLedgerAssetID(String sourceLedgerAssetID) { + this.sourceLedgerAssetID = sourceLedgerAssetID; + } + + + public ClientV1Request recipientLedgerAssetID(String recipientLedgerAssetID) { + + this.recipientLedgerAssetID = recipientLedgerAssetID; + return this; + } + + /** + * Get recipientLedgerAssetID + * @return recipientLedgerAssetID + **/ + @javax.annotation.Nonnull + public String getRecipientLedgerAssetID() { + return recipientLedgerAssetID; + } + + + public void setRecipientLedgerAssetID(String recipientLedgerAssetID) { + this.recipientLedgerAssetID = recipientLedgerAssetID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientV1Request clientV1Request = (ClientV1Request) o; + return Objects.equals(this.version, clientV1Request.version) && + Objects.equals(this.loggingProfile, clientV1Request.loggingProfile) && + Objects.equals(this.accessControlProfile, clientV1Request.accessControlProfile) && + Objects.equals(this.assetControlProfile, clientV1Request.assetControlProfile) && + Objects.equals(this.applicationProfile, clientV1Request.applicationProfile) && + Objects.equals(this.assetProfile, clientV1Request.assetProfile) && + Objects.equals(this.payloadProfile, clientV1Request.payloadProfile) && + Objects.equals(this.sourceGatewayDltSystem, clientV1Request.sourceGatewayDltSystem) && + Objects.equals(this.recipientGatewayDltSystem, clientV1Request.recipientGatewayDltSystem) && + Objects.equals(this.recipientGatewayPubkey, clientV1Request.recipientGatewayPubkey) && + Objects.equals(this.originatorPubkey, clientV1Request.originatorPubkey) && + Objects.equals(this.beneficiaryPubkey, clientV1Request.beneficiaryPubkey) && + Objects.equals(this.clientIdentityPubkey, clientV1Request.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, clientV1Request.serverIdentityPubkey) && + Objects.equals(this.clientDltSystem, clientV1Request.clientDltSystem) && + Objects.equals(this.serverDltSystem, clientV1Request.serverDltSystem) && + Objects.equals(this.clientGatewayConfiguration, clientV1Request.clientGatewayConfiguration) && + Objects.equals(this.serverGatewayConfiguration, clientV1Request.serverGatewayConfiguration) && + Objects.equals(this.maxRetries, clientV1Request.maxRetries) && + Objects.equals(this.maxTimeout, clientV1Request.maxTimeout) && + Objects.equals(this.sourceLedgerAssetID, clientV1Request.sourceLedgerAssetID) && + Objects.equals(this.recipientLedgerAssetID, clientV1Request.recipientLedgerAssetID); + } + + @Override + public int hashCode() { + return Objects.hash(version, loggingProfile, accessControlProfile, assetControlProfile, applicationProfile, assetProfile, payloadProfile, sourceGatewayDltSystem, recipientGatewayDltSystem, recipientGatewayPubkey, originatorPubkey, beneficiaryPubkey, clientIdentityPubkey, serverIdentityPubkey, clientDltSystem, serverDltSystem, clientGatewayConfiguration, serverGatewayConfiguration, maxRetries, maxTimeout, sourceLedgerAssetID, recipientLedgerAssetID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClientV1Request {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" loggingProfile: ").append(toIndentedString(loggingProfile)).append("\n"); + sb.append(" accessControlProfile: ").append(toIndentedString(accessControlProfile)).append("\n"); + sb.append(" assetControlProfile: ").append(toIndentedString(assetControlProfile)).append("\n"); + sb.append(" applicationProfile: ").append(toIndentedString(applicationProfile)).append("\n"); + sb.append(" assetProfile: ").append(toIndentedString(assetProfile)).append("\n"); + sb.append(" payloadProfile: ").append(toIndentedString(payloadProfile)).append("\n"); + sb.append(" sourceGatewayDltSystem: ").append(toIndentedString(sourceGatewayDltSystem)).append("\n"); + sb.append(" recipientGatewayDltSystem: ").append(toIndentedString(recipientGatewayDltSystem)).append("\n"); + sb.append(" recipientGatewayPubkey: ").append(toIndentedString(recipientGatewayPubkey)).append("\n"); + sb.append(" originatorPubkey: ").append(toIndentedString(originatorPubkey)).append("\n"); + sb.append(" beneficiaryPubkey: ").append(toIndentedString(beneficiaryPubkey)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" clientDltSystem: ").append(toIndentedString(clientDltSystem)).append("\n"); + sb.append(" serverDltSystem: ").append(toIndentedString(serverDltSystem)).append("\n"); + sb.append(" clientGatewayConfiguration: ").append(toIndentedString(clientGatewayConfiguration)).append("\n"); + sb.append(" serverGatewayConfiguration: ").append(toIndentedString(serverGatewayConfiguration)).append("\n"); + sb.append(" maxRetries: ").append(toIndentedString(maxRetries)).append("\n"); + sb.append(" maxTimeout: ").append(toIndentedString(maxTimeout)).append("\n"); + sb.append(" sourceLedgerAssetID: ").append(toIndentedString(sourceLedgerAssetID)).append("\n"); + sb.append(" recipientLedgerAssetID: ").append(toIndentedString(recipientLedgerAssetID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("version"); + openapiFields.add("loggingProfile"); + openapiFields.add("accessControlProfile"); + openapiFields.add("assetControlProfile"); + openapiFields.add("applicationProfile"); + openapiFields.add("assetProfile"); + openapiFields.add("payloadProfile"); + openapiFields.add("sourceGatewayDltSystem"); + openapiFields.add("recipientGatewayDltSystem"); + openapiFields.add("recipientGatewayPubkey"); + openapiFields.add("originatorPubkey"); + openapiFields.add("beneficiaryPubkey"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("clientDltSystem"); + openapiFields.add("serverDltSystem"); + openapiFields.add("clientGatewayConfiguration"); + openapiFields.add("serverGatewayConfiguration"); + openapiFields.add("maxRetries"); + openapiFields.add("maxTimeout"); + openapiFields.add("sourceLedgerAssetID"); + openapiFields.add("recipientLedgerAssetID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("version"); + openapiRequiredFields.add("loggingProfile"); + openapiRequiredFields.add("accessControlProfile"); + openapiRequiredFields.add("assetControlProfile"); + openapiRequiredFields.add("applicationProfile"); + openapiRequiredFields.add("assetProfile"); + openapiRequiredFields.add("payloadProfile"); + openapiRequiredFields.add("sourceGatewayDltSystem"); + openapiRequiredFields.add("recipientGatewayDltSystem"); + openapiRequiredFields.add("recipientGatewayPubkey"); + openapiRequiredFields.add("originatorPubkey"); + openapiRequiredFields.add("beneficiaryPubkey"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("clientDltSystem"); + openapiRequiredFields.add("serverDltSystem"); + openapiRequiredFields.add("clientGatewayConfiguration"); + openapiRequiredFields.add("serverGatewayConfiguration"); + openapiRequiredFields.add("maxRetries"); + openapiRequiredFields.add("maxTimeout"); + openapiRequiredFields.add("sourceLedgerAssetID"); + openapiRequiredFields.add("recipientLedgerAssetID"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ClientV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ClientV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ClientV1Request is not found in the empty JSON string", ClientV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ClientV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClientV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ClientV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + if (!jsonObj.get("loggingProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `loggingProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loggingProfile").toString())); + } + if (!jsonObj.get("accessControlProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accessControlProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accessControlProfile").toString())); + } + if (!jsonObj.get("assetControlProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assetControlProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assetControlProfile").toString())); + } + if (!jsonObj.get("applicationProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `applicationProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("applicationProfile").toString())); + } + // validate the required field `assetProfile` + AssetProfile.validateJsonObject(jsonObj.getAsJsonObject("assetProfile")); + // validate the required field `payloadProfile` + PayloadProfile.validateJsonObject(jsonObj.getAsJsonObject("payloadProfile")); + if (!jsonObj.get("sourceGatewayDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceGatewayDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceGatewayDltSystem").toString())); + } + if (!jsonObj.get("recipientGatewayDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientGatewayDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientGatewayDltSystem").toString())); + } + if (!jsonObj.get("recipientGatewayPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientGatewayPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientGatewayPubkey").toString())); + } + if (!jsonObj.get("originatorPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `originatorPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originatorPubkey").toString())); + } + if (!jsonObj.get("beneficiaryPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `beneficiaryPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("beneficiaryPubkey").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("clientDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientDltSystem").toString())); + } + if (!jsonObj.get("serverDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverDltSystem").toString())); + } + // validate the required field `clientGatewayConfiguration` + ClientV1RequestClientGatewayConfiguration.validateJsonObject(jsonObj.getAsJsonObject("clientGatewayConfiguration")); + // validate the required field `serverGatewayConfiguration` + ClientV1RequestClientGatewayConfiguration.validateJsonObject(jsonObj.getAsJsonObject("serverGatewayConfiguration")); + if (!jsonObj.get("sourceLedgerAssetID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceLedgerAssetID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceLedgerAssetID").toString())); + } + if (!jsonObj.get("recipientLedgerAssetID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientLedgerAssetID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientLedgerAssetID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ClientV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ClientV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ClientV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ClientV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ClientV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ClientV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClientV1Request + * @throws IOException if the JSON string is invalid with respect to ClientV1Request + */ + public static ClientV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClientV1Request.class); + } + + /** + * Convert an instance of ClientV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfiguration.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfiguration.java new file mode 100644 index 00000000000..8424559876b --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfiguration.java @@ -0,0 +1,216 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ClientV1RequestClientGatewayConfiguration + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ClientV1RequestClientGatewayConfiguration { + public static final String SERIALIZED_NAME_API_HOST = "apiHost"; + @SerializedName(SERIALIZED_NAME_API_HOST) + private String apiHost; + + public ClientV1RequestClientGatewayConfiguration() { + } + + public ClientV1RequestClientGatewayConfiguration apiHost(String apiHost) { + + this.apiHost = apiHost; + return this; + } + + /** + * Get apiHost + * @return apiHost + **/ + @javax.annotation.Nonnull + public String getApiHost() { + return apiHost; + } + + + public void setApiHost(String apiHost) { + this.apiHost = apiHost; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientV1RequestClientGatewayConfiguration clientV1RequestClientGatewayConfiguration = (ClientV1RequestClientGatewayConfiguration) o; + return Objects.equals(this.apiHost, clientV1RequestClientGatewayConfiguration.apiHost); + } + + @Override + public int hashCode() { + return Objects.hash(apiHost); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClientV1RequestClientGatewayConfiguration {\n"); + sb.append(" apiHost: ").append(toIndentedString(apiHost)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("apiHost"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("apiHost"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ClientV1RequestClientGatewayConfiguration + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ClientV1RequestClientGatewayConfiguration.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ClientV1RequestClientGatewayConfiguration is not found in the empty JSON string", ClientV1RequestClientGatewayConfiguration.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ClientV1RequestClientGatewayConfiguration.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClientV1RequestClientGatewayConfiguration` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ClientV1RequestClientGatewayConfiguration.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("apiHost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `apiHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiHost").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ClientV1RequestClientGatewayConfiguration.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ClientV1RequestClientGatewayConfiguration' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ClientV1RequestClientGatewayConfiguration.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ClientV1RequestClientGatewayConfiguration value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ClientV1RequestClientGatewayConfiguration read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ClientV1RequestClientGatewayConfiguration given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClientV1RequestClientGatewayConfiguration + * @throws IOException if the JSON string is invalid with respect to ClientV1RequestClientGatewayConfiguration + */ + public static ClientV1RequestClientGatewayConfiguration fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClientV1RequestClientGatewayConfiguration.class); + } + + /** + * Convert an instance of ClientV1RequestClientGatewayConfiguration to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitFinalV1Request.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitFinalV1Request.java new file mode 100644 index 00000000000..e5372c39e80 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitFinalV1Request.java @@ -0,0 +1,506 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CommitFinalV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CommitFinalV1Request { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_COMMIT_FINAL_CLAIM = "commitFinalClaim"; + @SerializedName(SERIALIZED_NAME_COMMIT_FINAL_CLAIM) + private String commitFinalClaim; + + public static final String SERIALIZED_NAME_COMMIT_FINAL_CLAIM_FORMAT = "commitFinalClaimFormat"; + @SerializedName(SERIALIZED_NAME_COMMIT_FINAL_CLAIM_FORMAT) + private Object commitFinalClaimFormat; + + public static final String SERIALIZED_NAME_HASH_COMMIT_PREPARE_ACK = "hashCommitPrepareAck"; + @SerializedName(SERIALIZED_NAME_HASH_COMMIT_PREPARE_ACK) + private String hashCommitPrepareAck; + + public static final String SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER = "clientTransferNumber"; + @SerializedName(SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER) + private Integer clientTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public CommitFinalV1Request() { + } + + public CommitFinalV1Request sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public CommitFinalV1Request messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public CommitFinalV1Request clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public CommitFinalV1Request serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public CommitFinalV1Request commitFinalClaim(String commitFinalClaim) { + + this.commitFinalClaim = commitFinalClaim; + return this; + } + + /** + * Get commitFinalClaim + * @return commitFinalClaim + **/ + @javax.annotation.Nonnull + public String getCommitFinalClaim() { + return commitFinalClaim; + } + + + public void setCommitFinalClaim(String commitFinalClaim) { + this.commitFinalClaim = commitFinalClaim; + } + + + public CommitFinalV1Request commitFinalClaimFormat(Object commitFinalClaimFormat) { + + this.commitFinalClaimFormat = commitFinalClaimFormat; + return this; + } + + /** + * Get commitFinalClaimFormat + * @return commitFinalClaimFormat + **/ + @javax.annotation.Nullable + public Object getCommitFinalClaimFormat() { + return commitFinalClaimFormat; + } + + + public void setCommitFinalClaimFormat(Object commitFinalClaimFormat) { + this.commitFinalClaimFormat = commitFinalClaimFormat; + } + + + public CommitFinalV1Request hashCommitPrepareAck(String hashCommitPrepareAck) { + + this.hashCommitPrepareAck = hashCommitPrepareAck; + return this; + } + + /** + * Get hashCommitPrepareAck + * @return hashCommitPrepareAck + **/ + @javax.annotation.Nonnull + public String getHashCommitPrepareAck() { + return hashCommitPrepareAck; + } + + + public void setHashCommitPrepareAck(String hashCommitPrepareAck) { + this.hashCommitPrepareAck = hashCommitPrepareAck; + } + + + public CommitFinalV1Request clientTransferNumber(Integer clientTransferNumber) { + + this.clientTransferNumber = clientTransferNumber; + return this; + } + + /** + * Get clientTransferNumber + * @return clientTransferNumber + **/ + @javax.annotation.Nullable + public Integer getClientTransferNumber() { + return clientTransferNumber; + } + + + public void setClientTransferNumber(Integer clientTransferNumber) { + this.clientTransferNumber = clientTransferNumber; + } + + + public CommitFinalV1Request signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public CommitFinalV1Request sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitFinalV1Request commitFinalV1Request = (CommitFinalV1Request) o; + return Objects.equals(this.sessionID, commitFinalV1Request.sessionID) && + Objects.equals(this.messageType, commitFinalV1Request.messageType) && + Objects.equals(this.clientIdentityPubkey, commitFinalV1Request.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, commitFinalV1Request.serverIdentityPubkey) && + Objects.equals(this.commitFinalClaim, commitFinalV1Request.commitFinalClaim) && + Objects.equals(this.commitFinalClaimFormat, commitFinalV1Request.commitFinalClaimFormat) && + Objects.equals(this.hashCommitPrepareAck, commitFinalV1Request.hashCommitPrepareAck) && + Objects.equals(this.clientTransferNumber, commitFinalV1Request.clientTransferNumber) && + Objects.equals(this.signature, commitFinalV1Request.signature) && + Objects.equals(this.sequenceNumber, commitFinalV1Request.sequenceNumber); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, messageType, clientIdentityPubkey, serverIdentityPubkey, commitFinalClaim, commitFinalClaimFormat, hashCommitPrepareAck, clientTransferNumber, signature, sequenceNumber); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitFinalV1Request {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" commitFinalClaim: ").append(toIndentedString(commitFinalClaim)).append("\n"); + sb.append(" commitFinalClaimFormat: ").append(toIndentedString(commitFinalClaimFormat)).append("\n"); + sb.append(" hashCommitPrepareAck: ").append(toIndentedString(hashCommitPrepareAck)).append("\n"); + sb.append(" clientTransferNumber: ").append(toIndentedString(clientTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("messageType"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("commitFinalClaim"); + openapiFields.add("commitFinalClaimFormat"); + openapiFields.add("hashCommitPrepareAck"); + openapiFields.add("clientTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("commitFinalClaim"); + openapiRequiredFields.add("hashCommitPrepareAck"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CommitFinalV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CommitFinalV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommitFinalV1Request is not found in the empty JSON string", CommitFinalV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CommitFinalV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CommitFinalV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CommitFinalV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("commitFinalClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitFinalClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitFinalClaim").toString())); + } + if (!jsonObj.get("hashCommitPrepareAck").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashCommitPrepareAck` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashCommitPrepareAck").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommitFinalV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommitFinalV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommitFinalV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommitFinalV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CommitFinalV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CommitFinalV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommitFinalV1Request + * @throws IOException if the JSON string is invalid with respect to CommitFinalV1Request + */ + public static CommitFinalV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommitFinalV1Request.class); + } + + /** + * Convert an instance of CommitFinalV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitFinalV1Response.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitFinalV1Response.java new file mode 100644 index 00000000000..c5c9a14f93c --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitFinalV1Response.java @@ -0,0 +1,494 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CommitFinalV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CommitFinalV1Response { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_COMMIT_ACKNOWLEDGEMENT_CLAIM = "commitAcknowledgementClaim"; + @SerializedName(SERIALIZED_NAME_COMMIT_ACKNOWLEDGEMENT_CLAIM) + private String commitAcknowledgementClaim; + + public static final String SERIALIZED_NAME_COMMIT_ACKNOWLEDGEMENT_CLAIM_FORMAT = "commitAcknowledgementClaimFormat"; + @SerializedName(SERIALIZED_NAME_COMMIT_ACKNOWLEDGEMENT_CLAIM_FORMAT) + private Object commitAcknowledgementClaimFormat; + + public static final String SERIALIZED_NAME_HASH_COMMIT_FINAL = "hashCommitFinal"; + @SerializedName(SERIALIZED_NAME_HASH_COMMIT_FINAL) + private String hashCommitFinal; + + public static final String SERIALIZED_NAME_SERVER_TRANSFER_NUMBER = "serverTransferNumber"; + @SerializedName(SERIALIZED_NAME_SERVER_TRANSFER_NUMBER) + private Integer serverTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public CommitFinalV1Response() { + } + + public CommitFinalV1Response sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public CommitFinalV1Response messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public CommitFinalV1Response clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public CommitFinalV1Response serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public CommitFinalV1Response commitAcknowledgementClaim(String commitAcknowledgementClaim) { + + this.commitAcknowledgementClaim = commitAcknowledgementClaim; + return this; + } + + /** + * Get commitAcknowledgementClaim + * @return commitAcknowledgementClaim + **/ + @javax.annotation.Nonnull + public String getCommitAcknowledgementClaim() { + return commitAcknowledgementClaim; + } + + + public void setCommitAcknowledgementClaim(String commitAcknowledgementClaim) { + this.commitAcknowledgementClaim = commitAcknowledgementClaim; + } + + + public CommitFinalV1Response commitAcknowledgementClaimFormat(Object commitAcknowledgementClaimFormat) { + + this.commitAcknowledgementClaimFormat = commitAcknowledgementClaimFormat; + return this; + } + + /** + * Get commitAcknowledgementClaimFormat + * @return commitAcknowledgementClaimFormat + **/ + @javax.annotation.Nullable + public Object getCommitAcknowledgementClaimFormat() { + return commitAcknowledgementClaimFormat; + } + + + public void setCommitAcknowledgementClaimFormat(Object commitAcknowledgementClaimFormat) { + this.commitAcknowledgementClaimFormat = commitAcknowledgementClaimFormat; + } + + + public CommitFinalV1Response hashCommitFinal(String hashCommitFinal) { + + this.hashCommitFinal = hashCommitFinal; + return this; + } + + /** + * Get hashCommitFinal + * @return hashCommitFinal + **/ + @javax.annotation.Nonnull + public String getHashCommitFinal() { + return hashCommitFinal; + } + + + public void setHashCommitFinal(String hashCommitFinal) { + this.hashCommitFinal = hashCommitFinal; + } + + + public CommitFinalV1Response serverTransferNumber(Integer serverTransferNumber) { + + this.serverTransferNumber = serverTransferNumber; + return this; + } + + /** + * Get serverTransferNumber + * @return serverTransferNumber + **/ + @javax.annotation.Nullable + public Integer getServerTransferNumber() { + return serverTransferNumber; + } + + + public void setServerTransferNumber(Integer serverTransferNumber) { + this.serverTransferNumber = serverTransferNumber; + } + + + public CommitFinalV1Response signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public CommitFinalV1Response sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitFinalV1Response commitFinalV1Response = (CommitFinalV1Response) o; + return Objects.equals(this.sessionID, commitFinalV1Response.sessionID) && + Objects.equals(this.messageType, commitFinalV1Response.messageType) && + Objects.equals(this.clientIdentityPubkey, commitFinalV1Response.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, commitFinalV1Response.serverIdentityPubkey) && + Objects.equals(this.commitAcknowledgementClaim, commitFinalV1Response.commitAcknowledgementClaim) && + Objects.equals(this.commitAcknowledgementClaimFormat, commitFinalV1Response.commitAcknowledgementClaimFormat) && + Objects.equals(this.hashCommitFinal, commitFinalV1Response.hashCommitFinal) && + Objects.equals(this.serverTransferNumber, commitFinalV1Response.serverTransferNumber) && + Objects.equals(this.signature, commitFinalV1Response.signature) && + Objects.equals(this.sequenceNumber, commitFinalV1Response.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, messageType, clientIdentityPubkey, serverIdentityPubkey, commitAcknowledgementClaim, commitAcknowledgementClaimFormat, hashCommitFinal, serverTransferNumber, signature, sequenceNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitFinalV1Response {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" commitAcknowledgementClaim: ").append(toIndentedString(commitAcknowledgementClaim)).append("\n"); + sb.append(" commitAcknowledgementClaimFormat: ").append(toIndentedString(commitAcknowledgementClaimFormat)).append("\n"); + sb.append(" hashCommitFinal: ").append(toIndentedString(hashCommitFinal)).append("\n"); + sb.append(" serverTransferNumber: ").append(toIndentedString(serverTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("messageType"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("commitAcknowledgementClaim"); + openapiFields.add("commitAcknowledgementClaimFormat"); + openapiFields.add("hashCommitFinal"); + openapiFields.add("serverTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("commitAcknowledgementClaim"); + openapiRequiredFields.add("hashCommitFinal"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CommitFinalV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CommitFinalV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommitFinalV1Response is not found in the empty JSON string", CommitFinalV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CommitFinalV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CommitFinalV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CommitFinalV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("commitAcknowledgementClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitAcknowledgementClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitAcknowledgementClaim").toString())); + } + if (!jsonObj.get("hashCommitFinal").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashCommitFinal` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashCommitFinal").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommitFinalV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommitFinalV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommitFinalV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommitFinalV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CommitFinalV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CommitFinalV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommitFinalV1Response + * @throws IOException if the JSON string is invalid with respect to CommitFinalV1Response + */ + public static CommitFinalV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommitFinalV1Response.class); + } + + /** + * Convert an instance of CommitFinalV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitPreparationV1Request.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitPreparationV1Request.java new file mode 100644 index 00000000000..d1416e54a44 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitPreparationV1Request.java @@ -0,0 +1,434 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CommitPreparationV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CommitPreparationV1Request { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_HASH_LOCK_EVIDENCE_ACK = "hashLockEvidenceAck"; + @SerializedName(SERIALIZED_NAME_HASH_LOCK_EVIDENCE_ACK) + private String hashLockEvidenceAck; + + public static final String SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER = "clientTransferNumber"; + @SerializedName(SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER) + private Integer clientTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public CommitPreparationV1Request() { + } + + public CommitPreparationV1Request sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public CommitPreparationV1Request messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public CommitPreparationV1Request clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public CommitPreparationV1Request serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public CommitPreparationV1Request hashLockEvidenceAck(String hashLockEvidenceAck) { + + this.hashLockEvidenceAck = hashLockEvidenceAck; + return this; + } + + /** + * Get hashLockEvidenceAck + * @return hashLockEvidenceAck + **/ + @javax.annotation.Nonnull + public String getHashLockEvidenceAck() { + return hashLockEvidenceAck; + } + + + public void setHashLockEvidenceAck(String hashLockEvidenceAck) { + this.hashLockEvidenceAck = hashLockEvidenceAck; + } + + + public CommitPreparationV1Request clientTransferNumber(Integer clientTransferNumber) { + + this.clientTransferNumber = clientTransferNumber; + return this; + } + + /** + * Get clientTransferNumber + * @return clientTransferNumber + **/ + @javax.annotation.Nullable + public Integer getClientTransferNumber() { + return clientTransferNumber; + } + + + public void setClientTransferNumber(Integer clientTransferNumber) { + this.clientTransferNumber = clientTransferNumber; + } + + + public CommitPreparationV1Request signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public CommitPreparationV1Request sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitPreparationV1Request commitPreparationV1Request = (CommitPreparationV1Request) o; + return Objects.equals(this.sessionID, commitPreparationV1Request.sessionID) && + Objects.equals(this.messageType, commitPreparationV1Request.messageType) && + Objects.equals(this.clientIdentityPubkey, commitPreparationV1Request.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, commitPreparationV1Request.serverIdentityPubkey) && + Objects.equals(this.hashLockEvidenceAck, commitPreparationV1Request.hashLockEvidenceAck) && + Objects.equals(this.clientTransferNumber, commitPreparationV1Request.clientTransferNumber) && + Objects.equals(this.signature, commitPreparationV1Request.signature) && + Objects.equals(this.sequenceNumber, commitPreparationV1Request.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, messageType, clientIdentityPubkey, serverIdentityPubkey, hashLockEvidenceAck, clientTransferNumber, signature, sequenceNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitPreparationV1Request {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" hashLockEvidenceAck: ").append(toIndentedString(hashLockEvidenceAck)).append("\n"); + sb.append(" clientTransferNumber: ").append(toIndentedString(clientTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("messageType"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("hashLockEvidenceAck"); + openapiFields.add("clientTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("hashLockEvidenceAck"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CommitPreparationV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CommitPreparationV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommitPreparationV1Request is not found in the empty JSON string", CommitPreparationV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CommitPreparationV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CommitPreparationV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CommitPreparationV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("hashLockEvidenceAck").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashLockEvidenceAck` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashLockEvidenceAck").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommitPreparationV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommitPreparationV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommitPreparationV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommitPreparationV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CommitPreparationV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CommitPreparationV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommitPreparationV1Request + * @throws IOException if the JSON string is invalid with respect to CommitPreparationV1Request + */ + public static CommitPreparationV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommitPreparationV1Request.class); + } + + /** + * Convert an instance of CommitPreparationV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitPreparationV1Response.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitPreparationV1Response.java new file mode 100644 index 00000000000..ec2ae067ddc --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CommitPreparationV1Response.java @@ -0,0 +1,437 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * CommitPreparationV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CommitPreparationV1Response { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_HASH_COMMIT_PREP = "hashCommitPrep"; + @SerializedName(SERIALIZED_NAME_HASH_COMMIT_PREP) + private String hashCommitPrep; + + public static final String SERIALIZED_NAME_SERVER_TRANSFER_NUMBER = "serverTransferNumber"; + @SerializedName(SERIALIZED_NAME_SERVER_TRANSFER_NUMBER) + private String serverTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public CommitPreparationV1Response() { + } + + public CommitPreparationV1Response sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public CommitPreparationV1Response messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public CommitPreparationV1Response clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public CommitPreparationV1Response serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public CommitPreparationV1Response hashCommitPrep(String hashCommitPrep) { + + this.hashCommitPrep = hashCommitPrep; + return this; + } + + /** + * Get hashCommitPrep + * @return hashCommitPrep + **/ + @javax.annotation.Nonnull + public String getHashCommitPrep() { + return hashCommitPrep; + } + + + public void setHashCommitPrep(String hashCommitPrep) { + this.hashCommitPrep = hashCommitPrep; + } + + + public CommitPreparationV1Response serverTransferNumber(String serverTransferNumber) { + + this.serverTransferNumber = serverTransferNumber; + return this; + } + + /** + * Get serverTransferNumber + * @return serverTransferNumber + **/ + @javax.annotation.Nullable + public String getServerTransferNumber() { + return serverTransferNumber; + } + + + public void setServerTransferNumber(String serverTransferNumber) { + this.serverTransferNumber = serverTransferNumber; + } + + + public CommitPreparationV1Response signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public CommitPreparationV1Response sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitPreparationV1Response commitPreparationV1Response = (CommitPreparationV1Response) o; + return Objects.equals(this.sessionID, commitPreparationV1Response.sessionID) && + Objects.equals(this.messageType, commitPreparationV1Response.messageType) && + Objects.equals(this.clientIdentityPubkey, commitPreparationV1Response.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, commitPreparationV1Response.serverIdentityPubkey) && + Objects.equals(this.hashCommitPrep, commitPreparationV1Response.hashCommitPrep) && + Objects.equals(this.serverTransferNumber, commitPreparationV1Response.serverTransferNumber) && + Objects.equals(this.signature, commitPreparationV1Response.signature) && + Objects.equals(this.sequenceNumber, commitPreparationV1Response.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, messageType, clientIdentityPubkey, serverIdentityPubkey, hashCommitPrep, serverTransferNumber, signature, sequenceNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitPreparationV1Response {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" hashCommitPrep: ").append(toIndentedString(hashCommitPrep)).append("\n"); + sb.append(" serverTransferNumber: ").append(toIndentedString(serverTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("messageType"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("hashCommitPrep"); + openapiFields.add("serverTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("hashCommitPrep"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CommitPreparationV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CommitPreparationV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommitPreparationV1Response is not found in the empty JSON string", CommitPreparationV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CommitPreparationV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CommitPreparationV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CommitPreparationV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("hashCommitPrep").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashCommitPrep` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashCommitPrep").toString())); + } + if ((jsonObj.get("serverTransferNumber") != null && !jsonObj.get("serverTransferNumber").isJsonNull()) && !jsonObj.get("serverTransferNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverTransferNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverTransferNumber").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommitPreparationV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommitPreparationV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommitPreparationV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommitPreparationV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CommitPreparationV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CommitPreparationV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommitPreparationV1Response + * @throws IOException if the JSON string is invalid with respect to CommitPreparationV1Response + */ + public static CommitPreparationV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommitPreparationV1Response.class); + } + + /** + * Convert an instance of CommitPreparationV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CredentialProfile.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CredentialProfile.java new file mode 100644 index 00000000000..3f76e13abcc --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/CredentialProfile.java @@ -0,0 +1,75 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets CredentialProfile + */ +@JsonAdapter(CredentialProfile.Adapter.class) +public enum CredentialProfile { + + SAML("SAML"), + + OAUTH("OAUTH"), + + X509("X509"); + + private String value; + + CredentialProfile(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CredentialProfile fromValue(String value) { + for (CredentialProfile b : CredentialProfile.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CredentialProfile enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CredentialProfile read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CredentialProfile.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/History.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/History.java new file mode 100644 index 00000000000..bcab549e6e2 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/History.java @@ -0,0 +1,408 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * History + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class History { + public static final String SERIALIZED_NAME_TRANSACTIONS = "Transactions"; + @SerializedName(SERIALIZED_NAME_TRANSACTIONS) + private List transactions; + + public static final String SERIALIZED_NAME_ACTIONS = "Actions"; + @SerializedName(SERIALIZED_NAME_ACTIONS) + private List actions; + + public static final String SERIALIZED_NAME_ORIGIN = "Origin"; + @SerializedName(SERIALIZED_NAME_ORIGIN) + private String origin; + + public static final String SERIALIZED_NAME_DESTINATION = "Destination"; + @SerializedName(SERIALIZED_NAME_DESTINATION) + private String destination; + + public static final String SERIALIZED_NAME_BALANCE = "Balance"; + @SerializedName(SERIALIZED_NAME_BALANCE) + private String balance; + + public static final String SERIALIZED_NAME_CURRENT_STATUS = "CurrentStatus"; + @SerializedName(SERIALIZED_NAME_CURRENT_STATUS) + private Object currentStatus; + + public static final String SERIALIZED_NAME_APPLICATION_SPECIFIC_PARAMETERS = "ApplicationSpecificParameters"; + @SerializedName(SERIALIZED_NAME_APPLICATION_SPECIFIC_PARAMETERS) + private Object applicationSpecificParameters; + + public History() { + } + + public History transactions(List transactions) { + + this.transactions = transactions; + return this; + } + + public History addTransactionsItem(Object transactionsItem) { + if (this.transactions == null) { + this.transactions = new ArrayList<>(); + } + this.transactions.add(transactionsItem); + return this; + } + + /** + * Get transactions + * @return transactions + **/ + @javax.annotation.Nullable + public List getTransactions() { + return transactions; + } + + + public void setTransactions(List transactions) { + this.transactions = transactions; + } + + + public History actions(List actions) { + + this.actions = actions; + return this; + } + + public History addActionsItem(Object actionsItem) { + if (this.actions == null) { + this.actions = new ArrayList<>(); + } + this.actions.add(actionsItem); + return this; + } + + /** + * Get actions + * @return actions + **/ + @javax.annotation.Nullable + public List getActions() { + return actions; + } + + + public void setActions(List actions) { + this.actions = actions; + } + + + public History origin(String origin) { + + this.origin = origin; + return this; + } + + /** + * Get origin + * @return origin + **/ + @javax.annotation.Nullable + public String getOrigin() { + return origin; + } + + + public void setOrigin(String origin) { + this.origin = origin; + } + + + public History destination(String destination) { + + this.destination = destination; + return this; + } + + /** + * Get destination + * @return destination + **/ + @javax.annotation.Nullable + public String getDestination() { + return destination; + } + + + public void setDestination(String destination) { + this.destination = destination; + } + + + public History balance(String balance) { + + this.balance = balance; + return this; + } + + /** + * Get balance + * @return balance + **/ + @javax.annotation.Nullable + public String getBalance() { + return balance; + } + + + public void setBalance(String balance) { + this.balance = balance; + } + + + public History currentStatus(Object currentStatus) { + + this.currentStatus = currentStatus; + return this; + } + + /** + * Get currentStatus + * @return currentStatus + **/ + @javax.annotation.Nullable + public Object getCurrentStatus() { + return currentStatus; + } + + + public void setCurrentStatus(Object currentStatus) { + this.currentStatus = currentStatus; + } + + + public History applicationSpecificParameters(Object applicationSpecificParameters) { + + this.applicationSpecificParameters = applicationSpecificParameters; + return this; + } + + /** + * Get applicationSpecificParameters + * @return applicationSpecificParameters + **/ + @javax.annotation.Nullable + public Object getApplicationSpecificParameters() { + return applicationSpecificParameters; + } + + + public void setApplicationSpecificParameters(Object applicationSpecificParameters) { + this.applicationSpecificParameters = applicationSpecificParameters; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + History history = (History) o; + return Objects.equals(this.transactions, history.transactions) && + Objects.equals(this.actions, history.actions) && + Objects.equals(this.origin, history.origin) && + Objects.equals(this.destination, history.destination) && + Objects.equals(this.balance, history.balance) && + Objects.equals(this.currentStatus, history.currentStatus) && + Objects.equals(this.applicationSpecificParameters, history.applicationSpecificParameters); + } + + @Override + public int hashCode() { + return Objects.hash(transactions, actions, origin, destination, balance, currentStatus, applicationSpecificParameters); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class History {\n"); + sb.append(" transactions: ").append(toIndentedString(transactions)).append("\n"); + sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" balance: ").append(toIndentedString(balance)).append("\n"); + sb.append(" currentStatus: ").append(toIndentedString(currentStatus)).append("\n"); + sb.append(" applicationSpecificParameters: ").append(toIndentedString(applicationSpecificParameters)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("Transactions"); + openapiFields.add("Actions"); + openapiFields.add("Origin"); + openapiFields.add("Destination"); + openapiFields.add("Balance"); + openapiFields.add("CurrentStatus"); + openapiFields.add("ApplicationSpecificParameters"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to History + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!History.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in History is not found in the empty JSON string", History.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!History.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `History` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("Transactions") != null && !jsonObj.get("Transactions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Transactions` to be an array in the JSON string but got `%s`", jsonObj.get("Transactions").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Actions") != null && !jsonObj.get("Actions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Actions` to be an array in the JSON string but got `%s`", jsonObj.get("Actions").toString())); + } + if ((jsonObj.get("Origin") != null && !jsonObj.get("Origin").isJsonNull()) && !jsonObj.get("Origin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Origin").toString())); + } + if ((jsonObj.get("Destination") != null && !jsonObj.get("Destination").isJsonNull()) && !jsonObj.get("Destination").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Destination` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Destination").toString())); + } + if ((jsonObj.get("Balance") != null && !jsonObj.get("Balance").isJsonNull()) && !jsonObj.get("Balance").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Balance` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Balance").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!History.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'History' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(History.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, History value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public History read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of History given an JSON string + * + * @param jsonString JSON string + * @return An instance of History + * @throws IOException if the JSON string is invalid with respect to History + */ + public static History fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, History.class); + } + + /** + * Convert an instance of History to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LockEvidenceV1Request.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LockEvidenceV1Request.java new file mode 100644 index 00000000000..2dbdc621bb8 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LockEvidenceV1Request.java @@ -0,0 +1,569 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * LockEvidenceV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class LockEvidenceV1Request { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_LOCK_EVIDENCE_CLAIM = "lockEvidenceClaim"; + @SerializedName(SERIALIZED_NAME_LOCK_EVIDENCE_CLAIM) + private String lockEvidenceClaim; + + public static final String SERIALIZED_NAME_LOCK_EVIDENCE_FORMAT = "lockEvidenceFormat"; + @SerializedName(SERIALIZED_NAME_LOCK_EVIDENCE_FORMAT) + private Object lockEvidenceFormat; + + public static final String SERIALIZED_NAME_LOCK_EVIDENCE_EXPIRATION = "lockEvidenceExpiration"; + @SerializedName(SERIALIZED_NAME_LOCK_EVIDENCE_EXPIRATION) + private String lockEvidenceExpiration; + + public static final String SERIALIZED_NAME_HASH_COMMENCE_ACK_REQUEST = "hashCommenceAckRequest"; + @SerializedName(SERIALIZED_NAME_HASH_COMMENCE_ACK_REQUEST) + private String hashCommenceAckRequest; + + public static final String SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER = "clientTransferNumber"; + @SerializedName(SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER) + private Integer clientTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_MESSAGE_HASH = "messageHash"; + @SerializedName(SERIALIZED_NAME_MESSAGE_HASH) + private String messageHash; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public LockEvidenceV1Request() { + } + + public LockEvidenceV1Request sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public LockEvidenceV1Request clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public LockEvidenceV1Request serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public LockEvidenceV1Request lockEvidenceClaim(String lockEvidenceClaim) { + + this.lockEvidenceClaim = lockEvidenceClaim; + return this; + } + + /** + * Get lockEvidenceClaim + * @return lockEvidenceClaim + **/ + @javax.annotation.Nonnull + public String getLockEvidenceClaim() { + return lockEvidenceClaim; + } + + + public void setLockEvidenceClaim(String lockEvidenceClaim) { + this.lockEvidenceClaim = lockEvidenceClaim; + } + + + public LockEvidenceV1Request lockEvidenceFormat(Object lockEvidenceFormat) { + + this.lockEvidenceFormat = lockEvidenceFormat; + return this; + } + + /** + * Get lockEvidenceFormat + * @return lockEvidenceFormat + **/ + @javax.annotation.Nullable + public Object getLockEvidenceFormat() { + return lockEvidenceFormat; + } + + + public void setLockEvidenceFormat(Object lockEvidenceFormat) { + this.lockEvidenceFormat = lockEvidenceFormat; + } + + + public LockEvidenceV1Request lockEvidenceExpiration(String lockEvidenceExpiration) { + + this.lockEvidenceExpiration = lockEvidenceExpiration; + return this; + } + + /** + * Get lockEvidenceExpiration + * @return lockEvidenceExpiration + **/ + @javax.annotation.Nonnull + public String getLockEvidenceExpiration() { + return lockEvidenceExpiration; + } + + + public void setLockEvidenceExpiration(String lockEvidenceExpiration) { + this.lockEvidenceExpiration = lockEvidenceExpiration; + } + + + public LockEvidenceV1Request hashCommenceAckRequest(String hashCommenceAckRequest) { + + this.hashCommenceAckRequest = hashCommenceAckRequest; + return this; + } + + /** + * Get hashCommenceAckRequest + * @return hashCommenceAckRequest + **/ + @javax.annotation.Nonnull + public String getHashCommenceAckRequest() { + return hashCommenceAckRequest; + } + + + public void setHashCommenceAckRequest(String hashCommenceAckRequest) { + this.hashCommenceAckRequest = hashCommenceAckRequest; + } + + + public LockEvidenceV1Request clientTransferNumber(Integer clientTransferNumber) { + + this.clientTransferNumber = clientTransferNumber; + return this; + } + + /** + * Get clientTransferNumber + * @return clientTransferNumber + **/ + @javax.annotation.Nullable + public Integer getClientTransferNumber() { + return clientTransferNumber; + } + + + public void setClientTransferNumber(Integer clientTransferNumber) { + this.clientTransferNumber = clientTransferNumber; + } + + + public LockEvidenceV1Request signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public LockEvidenceV1Request messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public LockEvidenceV1Request messageHash(String messageHash) { + + this.messageHash = messageHash; + return this; + } + + /** + * Get messageHash + * @return messageHash + **/ + @javax.annotation.Nullable + public String getMessageHash() { + return messageHash; + } + + + public void setMessageHash(String messageHash) { + this.messageHash = messageHash; + } + + + public LockEvidenceV1Request sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LockEvidenceV1Request lockEvidenceV1Request = (LockEvidenceV1Request) o; + return Objects.equals(this.sessionID, lockEvidenceV1Request.sessionID) && + Objects.equals(this.clientIdentityPubkey, lockEvidenceV1Request.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, lockEvidenceV1Request.serverIdentityPubkey) && + Objects.equals(this.lockEvidenceClaim, lockEvidenceV1Request.lockEvidenceClaim) && + Objects.equals(this.lockEvidenceFormat, lockEvidenceV1Request.lockEvidenceFormat) && + Objects.equals(this.lockEvidenceExpiration, lockEvidenceV1Request.lockEvidenceExpiration) && + Objects.equals(this.hashCommenceAckRequest, lockEvidenceV1Request.hashCommenceAckRequest) && + Objects.equals(this.clientTransferNumber, lockEvidenceV1Request.clientTransferNumber) && + Objects.equals(this.signature, lockEvidenceV1Request.signature) && + Objects.equals(this.messageType, lockEvidenceV1Request.messageType) && + Objects.equals(this.messageHash, lockEvidenceV1Request.messageHash) && + Objects.equals(this.sequenceNumber, lockEvidenceV1Request.sequenceNumber); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, clientIdentityPubkey, serverIdentityPubkey, lockEvidenceClaim, lockEvidenceFormat, lockEvidenceExpiration, hashCommenceAckRequest, clientTransferNumber, signature, messageType, messageHash, sequenceNumber); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LockEvidenceV1Request {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" lockEvidenceClaim: ").append(toIndentedString(lockEvidenceClaim)).append("\n"); + sb.append(" lockEvidenceFormat: ").append(toIndentedString(lockEvidenceFormat)).append("\n"); + sb.append(" lockEvidenceExpiration: ").append(toIndentedString(lockEvidenceExpiration)).append("\n"); + sb.append(" hashCommenceAckRequest: ").append(toIndentedString(hashCommenceAckRequest)).append("\n"); + sb.append(" clientTransferNumber: ").append(toIndentedString(clientTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" messageHash: ").append(toIndentedString(messageHash)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("lockEvidenceClaim"); + openapiFields.add("lockEvidenceFormat"); + openapiFields.add("lockEvidenceExpiration"); + openapiFields.add("hashCommenceAckRequest"); + openapiFields.add("clientTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("messageType"); + openapiFields.add("messageHash"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("lockEvidenceClaim"); + openapiRequiredFields.add("lockEvidenceExpiration"); + openapiRequiredFields.add("hashCommenceAckRequest"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to LockEvidenceV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!LockEvidenceV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LockEvidenceV1Request is not found in the empty JSON string", LockEvidenceV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!LockEvidenceV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LockEvidenceV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LockEvidenceV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("lockEvidenceClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lockEvidenceClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lockEvidenceClaim").toString())); + } + if (!jsonObj.get("lockEvidenceExpiration").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lockEvidenceExpiration` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lockEvidenceExpiration").toString())); + } + if (!jsonObj.get("hashCommenceAckRequest").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashCommenceAckRequest` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashCommenceAckRequest").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if ((jsonObj.get("messageHash") != null && !jsonObj.get("messageHash").isJsonNull()) && !jsonObj.get("messageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LockEvidenceV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LockEvidenceV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LockEvidenceV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LockEvidenceV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LockEvidenceV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LockEvidenceV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of LockEvidenceV1Request + * @throws IOException if the JSON string is invalid with respect to LockEvidenceV1Request + */ + public static LockEvidenceV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LockEvidenceV1Request.class); + } + + /** + * Convert an instance of LockEvidenceV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LockEvidenceV1Response.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LockEvidenceV1Response.java new file mode 100644 index 00000000000..c4c86fe2659 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/LockEvidenceV1Response.java @@ -0,0 +1,446 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * LockEvidenceV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class LockEvidenceV1Response { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_HASH_LOCK_EVIDENCE_REQUEST = "hashLockEvidenceRequest"; + @SerializedName(SERIALIZED_NAME_HASH_LOCK_EVIDENCE_REQUEST) + private String hashLockEvidenceRequest; + + public static final String SERIALIZED_NAME_SERVER_TRANSFER_NUMBER = "serverTransferNumber"; + @SerializedName(SERIALIZED_NAME_SERVER_TRANSFER_NUMBER) + private Integer serverTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public LockEvidenceV1Response() { + } + + public LockEvidenceV1Response sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public LockEvidenceV1Response clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public LockEvidenceV1Response serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public LockEvidenceV1Response hashLockEvidenceRequest(String hashLockEvidenceRequest) { + + this.hashLockEvidenceRequest = hashLockEvidenceRequest; + return this; + } + + /** + * Get hashLockEvidenceRequest + * @return hashLockEvidenceRequest + **/ + @javax.annotation.Nonnull + public String getHashLockEvidenceRequest() { + return hashLockEvidenceRequest; + } + + + public void setHashLockEvidenceRequest(String hashLockEvidenceRequest) { + this.hashLockEvidenceRequest = hashLockEvidenceRequest; + } + + + public LockEvidenceV1Response serverTransferNumber(Integer serverTransferNumber) { + + this.serverTransferNumber = serverTransferNumber; + return this; + } + + /** + * Get serverTransferNumber + * @return serverTransferNumber + **/ + @javax.annotation.Nullable + public Integer getServerTransferNumber() { + return serverTransferNumber; + } + + + public void setServerTransferNumber(Integer serverTransferNumber) { + this.serverTransferNumber = serverTransferNumber; + } + + + public LockEvidenceV1Response signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public LockEvidenceV1Response messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public LockEvidenceV1Response sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LockEvidenceV1Response lockEvidenceV1Response = (LockEvidenceV1Response) o; + return Objects.equals(this.sessionID, lockEvidenceV1Response.sessionID) && + Objects.equals(this.clientIdentityPubkey, lockEvidenceV1Response.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, lockEvidenceV1Response.serverIdentityPubkey) && + Objects.equals(this.hashLockEvidenceRequest, lockEvidenceV1Response.hashLockEvidenceRequest) && + Objects.equals(this.serverTransferNumber, lockEvidenceV1Response.serverTransferNumber) && + Objects.equals(this.signature, lockEvidenceV1Response.signature) && + Objects.equals(this.messageType, lockEvidenceV1Response.messageType) && + Objects.equals(this.sequenceNumber, lockEvidenceV1Response.sequenceNumber); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, clientIdentityPubkey, serverIdentityPubkey, hashLockEvidenceRequest, serverTransferNumber, signature, messageType, sequenceNumber); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LockEvidenceV1Response {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" hashLockEvidenceRequest: ").append(toIndentedString(hashLockEvidenceRequest)).append("\n"); + sb.append(" serverTransferNumber: ").append(toIndentedString(serverTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("hashLockEvidenceRequest"); + openapiFields.add("serverTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("messageType"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("hashLockEvidenceRequest"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to LockEvidenceV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!LockEvidenceV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LockEvidenceV1Response is not found in the empty JSON string", LockEvidenceV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!LockEvidenceV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LockEvidenceV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LockEvidenceV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("hashLockEvidenceRequest").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashLockEvidenceRequest` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashLockEvidenceRequest").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!LockEvidenceV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LockEvidenceV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LockEvidenceV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, LockEvidenceV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public LockEvidenceV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LockEvidenceV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of LockEvidenceV1Response + * @throws IOException if the JSON string is invalid with respect to LockEvidenceV1Response + */ + public static LockEvidenceV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LockEvidenceV1Response.class); + } + + /** + * Convert an instance of LockEvidenceV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapLocalLog.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapLocalLog.java new file mode 100644 index 00000000000..b261e428722 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapLocalLog.java @@ -0,0 +1,373 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * OdapLocalLog + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OdapLocalLog { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private String data; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_OPERATION = "operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + private String operation; + + public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp"; + @SerializedName(SERIALIZED_NAME_TIMESTAMP) + private String timestamp; + + public OdapLocalLog() { + } + + public OdapLocalLog key(String key) { + + this.key = key; + return this; + } + + /** + * Get key + * @return key + **/ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public OdapLocalLog sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public OdapLocalLog data(String data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + public String getData() { + return data; + } + + + public void setData(String data) { + this.data = data; + } + + + public OdapLocalLog type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public OdapLocalLog operation(String operation) { + + this.operation = operation; + return this; + } + + /** + * Get operation + * @return operation + **/ + @javax.annotation.Nonnull + public String getOperation() { + return operation; + } + + + public void setOperation(String operation) { + this.operation = operation; + } + + + public OdapLocalLog timestamp(String timestamp) { + + this.timestamp = timestamp; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @javax.annotation.Nullable + public String getTimestamp() { + return timestamp; + } + + + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OdapLocalLog odapLocalLog = (OdapLocalLog) o; + return Objects.equals(this.key, odapLocalLog.key) && + Objects.equals(this.sessionID, odapLocalLog.sessionID) && + Objects.equals(this.data, odapLocalLog.data) && + Objects.equals(this.type, odapLocalLog.type) && + Objects.equals(this.operation, odapLocalLog.operation) && + Objects.equals(this.timestamp, odapLocalLog.timestamp); + } + + @Override + public int hashCode() { + return Objects.hash(key, sessionID, data, type, operation, timestamp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OdapLocalLog {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" operation: ").append(toIndentedString(operation)).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(); + openapiFields.add("key"); + openapiFields.add("sessionID"); + openapiFields.add("data"); + openapiFields.add("type"); + openapiFields.add("operation"); + openapiFields.add("timestamp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("operation"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to OdapLocalLog + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!OdapLocalLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OdapLocalLog is not found in the empty JSON string", OdapLocalLog.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OdapLocalLog.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OdapLocalLog` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OdapLocalLog.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) && !jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if ((jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) && !jsonObj.get("data").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if (!jsonObj.get("operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation").toString())); + } + if ((jsonObj.get("timestamp") != null && !jsonObj.get("timestamp").isJsonNull()) && !jsonObj.get("timestamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timestamp").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OdapLocalLog.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OdapLocalLog' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OdapLocalLog.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OdapLocalLog value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OdapLocalLog read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OdapLocalLog given an JSON string + * + * @param jsonString JSON string + * @return An instance of OdapLocalLog + * @throws IOException if the JSON string is invalid with respect to OdapLocalLog + */ + public static OdapLocalLog fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OdapLocalLog.class); + } + + /** + * Convert an instance of OdapLocalLog to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapMessage.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapMessage.java new file mode 100644 index 00000000000..c54203195fd --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapMessage.java @@ -0,0 +1,654 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.OdapMessageActionResponse; +import org.openapitools.client.model.PayloadProfile; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * OdapMessage + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OdapMessage { + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "SequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + /** + * Gets or Sets phase + */ + @JsonAdapter(PhaseEnum.Adapter.class) + public enum PhaseEnum { + TRANSFERINITIALIZATION("TransferInitialization"), + + LOCKEVIDENCEVERIFICATION("LockEvidenceVerification"), + + COMMITMENTESTABLISHMENT("CommitmentEstablishment"); + + private String value; + + PhaseEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PhaseEnum fromValue(String value) { + for (PhaseEnum b : PhaseEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PhaseEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PhaseEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PhaseEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PHASE = "Phase"; + @SerializedName(SERIALIZED_NAME_PHASE) + private PhaseEnum phase; + + public static final String SERIALIZED_NAME_RESOURCE_U_R_L = "ResourceURL"; + @SerializedName(SERIALIZED_NAME_RESOURCE_U_R_L) + private String resourceURL; + + public static final String SERIALIZED_NAME_DEVELOPER_U_R_N = "DeveloperURN"; + @SerializedName(SERIALIZED_NAME_DEVELOPER_U_R_N) + private String developerURN; + + public static final String SERIALIZED_NAME_ACTION_RESPONSE = "ActionResponse"; + @SerializedName(SERIALIZED_NAME_ACTION_RESPONSE) + private OdapMessageActionResponse actionResponse; + + /** + * Gets or Sets credentialProfile + */ + @JsonAdapter(CredentialProfileEnum.Adapter.class) + public enum CredentialProfileEnum { + SAML("SAML"), + + OAUTH("OAuth"), + + X509("X509"); + + private String value; + + CredentialProfileEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CredentialProfileEnum fromValue(String value) { + for (CredentialProfileEnum b : CredentialProfileEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CredentialProfileEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CredentialProfileEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CredentialProfileEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_CREDENTIAL_PROFILE = "CredentialProfile"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_PROFILE) + private CredentialProfileEnum credentialProfile; + + public static final String SERIALIZED_NAME_CREDENTIAL_BLOCK = "CredentialBlock"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_BLOCK) + private List credentialBlock; + + public static final String SERIALIZED_NAME_CREDENTIALS_PROFILE = "CredentialsProfile"; + @SerializedName(SERIALIZED_NAME_CREDENTIALS_PROFILE) + private PayloadProfile credentialsProfile; + + public static final String SERIALIZED_NAME_APPLICATION_PROFILE = "ApplicationProfile"; + @SerializedName(SERIALIZED_NAME_APPLICATION_PROFILE) + private Object applicationProfile; + + public static final String SERIALIZED_NAME_PAYLOAD = "Payload"; + @SerializedName(SERIALIZED_NAME_PAYLOAD) + private Object payload; + + public static final String SERIALIZED_NAME_PAYLOAD_HASH = "PayloadHash"; + @SerializedName(SERIALIZED_NAME_PAYLOAD_HASH) + private String payloadHash; + + public static final String SERIALIZED_NAME_MESSAGE_SIGNATURE = "MessageSignature"; + @SerializedName(SERIALIZED_NAME_MESSAGE_SIGNATURE) + private String messageSignature; + + public OdapMessage() { + } + + public OdapMessage sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nullable + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + public OdapMessage phase(PhaseEnum phase) { + + this.phase = phase; + return this; + } + + /** + * Get phase + * @return phase + **/ + @javax.annotation.Nullable + public PhaseEnum getPhase() { + return phase; + } + + + public void setPhase(PhaseEnum phase) { + this.phase = phase; + } + + + public OdapMessage resourceURL(String resourceURL) { + + this.resourceURL = resourceURL; + return this; + } + + /** + * Get resourceURL + * @return resourceURL + **/ + @javax.annotation.Nullable + public String getResourceURL() { + return resourceURL; + } + + + public void setResourceURL(String resourceURL) { + this.resourceURL = resourceURL; + } + + + public OdapMessage developerURN(String developerURN) { + + this.developerURN = developerURN; + return this; + } + + /** + * Get developerURN + * @return developerURN + **/ + @javax.annotation.Nullable + public String getDeveloperURN() { + return developerURN; + } + + + public void setDeveloperURN(String developerURN) { + this.developerURN = developerURN; + } + + + public OdapMessage actionResponse(OdapMessageActionResponse actionResponse) { + + this.actionResponse = actionResponse; + return this; + } + + /** + * Get actionResponse + * @return actionResponse + **/ + @javax.annotation.Nullable + public OdapMessageActionResponse getActionResponse() { + return actionResponse; + } + + + public void setActionResponse(OdapMessageActionResponse actionResponse) { + this.actionResponse = actionResponse; + } + + + public OdapMessage credentialProfile(CredentialProfileEnum credentialProfile) { + + this.credentialProfile = credentialProfile; + return this; + } + + /** + * Get credentialProfile + * @return credentialProfile + **/ + @javax.annotation.Nullable + public CredentialProfileEnum getCredentialProfile() { + return credentialProfile; + } + + + public void setCredentialProfile(CredentialProfileEnum credentialProfile) { + this.credentialProfile = credentialProfile; + } + + + public OdapMessage credentialBlock(List credentialBlock) { + + this.credentialBlock = credentialBlock; + return this; + } + + public OdapMessage addCredentialBlockItem(Object credentialBlockItem) { + if (this.credentialBlock == null) { + this.credentialBlock = new ArrayList<>(); + } + this.credentialBlock.add(credentialBlockItem); + return this; + } + + /** + * Get credentialBlock + * @return credentialBlock + **/ + @javax.annotation.Nullable + public List getCredentialBlock() { + return credentialBlock; + } + + + public void setCredentialBlock(List credentialBlock) { + this.credentialBlock = credentialBlock; + } + + + public OdapMessage credentialsProfile(PayloadProfile credentialsProfile) { + + this.credentialsProfile = credentialsProfile; + return this; + } + + /** + * Get credentialsProfile + * @return credentialsProfile + **/ + @javax.annotation.Nullable + public PayloadProfile getCredentialsProfile() { + return credentialsProfile; + } + + + public void setCredentialsProfile(PayloadProfile credentialsProfile) { + this.credentialsProfile = credentialsProfile; + } + + + public OdapMessage applicationProfile(Object applicationProfile) { + + this.applicationProfile = applicationProfile; + return this; + } + + /** + * Get applicationProfile + * @return applicationProfile + **/ + @javax.annotation.Nullable + public Object getApplicationProfile() { + return applicationProfile; + } + + + public void setApplicationProfile(Object applicationProfile) { + this.applicationProfile = applicationProfile; + } + + + public OdapMessage payload(Object payload) { + + this.payload = payload; + return this; + } + + /** + * Get payload + * @return payload + **/ + @javax.annotation.Nullable + public Object getPayload() { + return payload; + } + + + public void setPayload(Object payload) { + this.payload = payload; + } + + + public OdapMessage payloadHash(String payloadHash) { + + this.payloadHash = payloadHash; + return this; + } + + /** + * Get payloadHash + * @return payloadHash + **/ + @javax.annotation.Nullable + public String getPayloadHash() { + return payloadHash; + } + + + public void setPayloadHash(String payloadHash) { + this.payloadHash = payloadHash; + } + + + public OdapMessage messageSignature(String messageSignature) { + + this.messageSignature = messageSignature; + return this; + } + + /** + * Get messageSignature + * @return messageSignature + **/ + @javax.annotation.Nullable + public String getMessageSignature() { + return messageSignature; + } + + + public void setMessageSignature(String messageSignature) { + this.messageSignature = messageSignature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OdapMessage odapMessage = (OdapMessage) o; + return Objects.equals(this.sequenceNumber, odapMessage.sequenceNumber) && + Objects.equals(this.phase, odapMessage.phase) && + Objects.equals(this.resourceURL, odapMessage.resourceURL) && + Objects.equals(this.developerURN, odapMessage.developerURN) && + Objects.equals(this.actionResponse, odapMessage.actionResponse) && + Objects.equals(this.credentialProfile, odapMessage.credentialProfile) && + Objects.equals(this.credentialBlock, odapMessage.credentialBlock) && + Objects.equals(this.credentialsProfile, odapMessage.credentialsProfile) && + Objects.equals(this.applicationProfile, odapMessage.applicationProfile) && + Objects.equals(this.payload, odapMessage.payload) && + Objects.equals(this.payloadHash, odapMessage.payloadHash) && + Objects.equals(this.messageSignature, odapMessage.messageSignature); + } + + @Override + public int hashCode() { + return Objects.hash(sequenceNumber, phase, resourceURL, developerURN, actionResponse, credentialProfile, credentialBlock, credentialsProfile, applicationProfile, payload, payloadHash, messageSignature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OdapMessage {\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" phase: ").append(toIndentedString(phase)).append("\n"); + sb.append(" resourceURL: ").append(toIndentedString(resourceURL)).append("\n"); + sb.append(" developerURN: ").append(toIndentedString(developerURN)).append("\n"); + sb.append(" actionResponse: ").append(toIndentedString(actionResponse)).append("\n"); + sb.append(" credentialProfile: ").append(toIndentedString(credentialProfile)).append("\n"); + sb.append(" credentialBlock: ").append(toIndentedString(credentialBlock)).append("\n"); + sb.append(" credentialsProfile: ").append(toIndentedString(credentialsProfile)).append("\n"); + sb.append(" applicationProfile: ").append(toIndentedString(applicationProfile)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append(" payloadHash: ").append(toIndentedString(payloadHash)).append("\n"); + sb.append(" messageSignature: ").append(toIndentedString(messageSignature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("SequenceNumber"); + openapiFields.add("Phase"); + openapiFields.add("ResourceURL"); + openapiFields.add("DeveloperURN"); + openapiFields.add("ActionResponse"); + openapiFields.add("CredentialProfile"); + openapiFields.add("CredentialBlock"); + openapiFields.add("CredentialsProfile"); + openapiFields.add("ApplicationProfile"); + openapiFields.add("Payload"); + openapiFields.add("PayloadHash"); + openapiFields.add("MessageSignature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to OdapMessage + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!OdapMessage.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OdapMessage is not found in the empty JSON string", OdapMessage.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OdapMessage.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OdapMessage` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("Phase") != null && !jsonObj.get("Phase").isJsonNull()) && !jsonObj.get("Phase").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Phase` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Phase").toString())); + } + if ((jsonObj.get("ResourceURL") != null && !jsonObj.get("ResourceURL").isJsonNull()) && !jsonObj.get("ResourceURL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResourceURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResourceURL").toString())); + } + if ((jsonObj.get("DeveloperURN") != null && !jsonObj.get("DeveloperURN").isJsonNull()) && !jsonObj.get("DeveloperURN").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DeveloperURN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DeveloperURN").toString())); + } + // validate the optional field `ActionResponse` + if (jsonObj.get("ActionResponse") != null && !jsonObj.get("ActionResponse").isJsonNull()) { + OdapMessageActionResponse.validateJsonObject(jsonObj.getAsJsonObject("ActionResponse")); + } + if ((jsonObj.get("CredentialProfile") != null && !jsonObj.get("CredentialProfile").isJsonNull()) && !jsonObj.get("CredentialProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CredentialProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CredentialProfile").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("CredentialBlock") != null && !jsonObj.get("CredentialBlock").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CredentialBlock` to be an array in the JSON string but got `%s`", jsonObj.get("CredentialBlock").toString())); + } + // validate the optional field `CredentialsProfile` + if (jsonObj.get("CredentialsProfile") != null && !jsonObj.get("CredentialsProfile").isJsonNull()) { + PayloadProfile.validateJsonObject(jsonObj.getAsJsonObject("CredentialsProfile")); + } + if ((jsonObj.get("PayloadHash") != null && !jsonObj.get("PayloadHash").isJsonNull()) && !jsonObj.get("PayloadHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PayloadHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayloadHash").toString())); + } + if ((jsonObj.get("MessageSignature") != null && !jsonObj.get("MessageSignature").isJsonNull()) && !jsonObj.get("MessageSignature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MessageSignature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MessageSignature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OdapMessage.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OdapMessage' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OdapMessage.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OdapMessage value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OdapMessage read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OdapMessage given an JSON string + * + * @param jsonString JSON string + * @return An instance of OdapMessage + * @throws IOException if the JSON string is invalid with respect to OdapMessage + */ + public static OdapMessage fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OdapMessage.class); + } + + /** + * Convert an instance of OdapMessage to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapMessageActionResponse.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapMessageActionResponse.java new file mode 100644 index 00000000000..26a121e1ee9 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/OdapMessageActionResponse.java @@ -0,0 +1,297 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * OdapMessageActionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OdapMessageActionResponse { + /** + * Gets or Sets responseCode + */ + @JsonAdapter(ResponseCodeEnum.Adapter.class) + public enum ResponseCodeEnum { + OK("200"), + + RESOURCE_NOT_FOUND("404"); + + private String value; + + ResponseCodeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ResponseCodeEnum fromValue(String value) { + for (ResponseCodeEnum b : ResponseCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResponseCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResponseCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResponseCodeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_RESPONSE_CODE = "ResponseCode"; + @SerializedName(SERIALIZED_NAME_RESPONSE_CODE) + private ResponseCodeEnum responseCode; + + public static final String SERIALIZED_NAME_ARGUMENTS = "Arguments"; + @SerializedName(SERIALIZED_NAME_ARGUMENTS) + private List arguments; + + public OdapMessageActionResponse() { + } + + public OdapMessageActionResponse responseCode(ResponseCodeEnum responseCode) { + + this.responseCode = responseCode; + return this; + } + + /** + * Get responseCode + * @return responseCode + **/ + @javax.annotation.Nullable + public ResponseCodeEnum getResponseCode() { + return responseCode; + } + + + public void setResponseCode(ResponseCodeEnum responseCode) { + this.responseCode = responseCode; + } + + + public OdapMessageActionResponse arguments(List arguments) { + + this.arguments = arguments; + return this; + } + + public OdapMessageActionResponse addArgumentsItem(Object argumentsItem) { + if (this.arguments == null) { + this.arguments = new ArrayList<>(); + } + this.arguments.add(argumentsItem); + return this; + } + + /** + * Get arguments + * @return arguments + **/ + @javax.annotation.Nullable + public List getArguments() { + return arguments; + } + + + public void setArguments(List arguments) { + this.arguments = arguments; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OdapMessageActionResponse odapMessageActionResponse = (OdapMessageActionResponse) o; + return Objects.equals(this.responseCode, odapMessageActionResponse.responseCode) && + Objects.equals(this.arguments, odapMessageActionResponse.arguments); + } + + @Override + public int hashCode() { + return Objects.hash(responseCode, arguments); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OdapMessageActionResponse {\n"); + sb.append(" responseCode: ").append(toIndentedString(responseCode)).append("\n"); + sb.append(" arguments: ").append(toIndentedString(arguments)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ResponseCode"); + openapiFields.add("Arguments"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to OdapMessageActionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!OdapMessageActionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OdapMessageActionResponse is not found in the empty JSON string", OdapMessageActionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OdapMessageActionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OdapMessageActionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("ResponseCode") != null && !jsonObj.get("ResponseCode").isJsonNull()) && !jsonObj.get("ResponseCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResponseCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResponseCode").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Arguments") != null && !jsonObj.get("Arguments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Arguments` to be an array in the JSON string but got `%s`", jsonObj.get("Arguments").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OdapMessageActionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OdapMessageActionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OdapMessageActionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OdapMessageActionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OdapMessageActionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OdapMessageActionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OdapMessageActionResponse + * @throws IOException if the JSON string is invalid with respect to OdapMessageActionResponse + */ + public static OdapMessageActionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OdapMessageActionResponse.class); + } + + /** + * Convert an instance of OdapMessageActionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PayloadProfile.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PayloadProfile.java new file mode 100644 index 00000000000..1f8834d0c07 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/PayloadProfile.java @@ -0,0 +1,247 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.AssetProfile; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * PayloadProfile + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PayloadProfile { + public static final String SERIALIZED_NAME_ASSET_PROFILE = "assetProfile"; + @SerializedName(SERIALIZED_NAME_ASSET_PROFILE) + private AssetProfile assetProfile; + + public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; + @SerializedName(SERIALIZED_NAME_CAPABILITIES) + private String capabilities; + + public PayloadProfile() { + } + + public PayloadProfile assetProfile(AssetProfile assetProfile) { + + this.assetProfile = assetProfile; + return this; + } + + /** + * Get assetProfile + * @return assetProfile + **/ + @javax.annotation.Nonnull + public AssetProfile getAssetProfile() { + return assetProfile; + } + + + public void setAssetProfile(AssetProfile assetProfile) { + this.assetProfile = assetProfile; + } + + + public PayloadProfile capabilities(String capabilities) { + + this.capabilities = capabilities; + return this; + } + + /** + * Get capabilities + * @return capabilities + **/ + @javax.annotation.Nullable + public String getCapabilities() { + return capabilities; + } + + + public void setCapabilities(String capabilities) { + this.capabilities = capabilities; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PayloadProfile payloadProfile = (PayloadProfile) o; + return Objects.equals(this.assetProfile, payloadProfile.assetProfile) && + Objects.equals(this.capabilities, payloadProfile.capabilities); + } + + @Override + public int hashCode() { + return Objects.hash(assetProfile, capabilities); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PayloadProfile {\n"); + sb.append(" assetProfile: ").append(toIndentedString(assetProfile)).append("\n"); + sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("assetProfile"); + openapiFields.add("capabilities"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("assetProfile"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PayloadProfile + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PayloadProfile.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PayloadProfile is not found in the empty JSON string", PayloadProfile.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PayloadProfile.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PayloadProfile` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PayloadProfile.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the required field `assetProfile` + AssetProfile.validateJsonObject(jsonObj.getAsJsonObject("assetProfile")); + if ((jsonObj.get("capabilities") != null && !jsonObj.get("capabilities").isJsonNull()) && !jsonObj.get("capabilities").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `capabilities` to be a primitive type in the JSON string but got `%s`", jsonObj.get("capabilities").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PayloadProfile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PayloadProfile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PayloadProfile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PayloadProfile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PayloadProfile read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PayloadProfile given an JSON string + * + * @param jsonString JSON string + * @return An instance of PayloadProfile + * @throws IOException if the JSON string is invalid with respect to PayloadProfile + */ + public static PayloadProfile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PayloadProfile.class); + } + + /** + * Convert an instance of PayloadProfile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverSuccessV1Message.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverSuccessV1Message.java new file mode 100644 index 00000000000..433446cda5d --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverSuccessV1Message.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RecoverSuccessV1Message + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RecoverSuccessV1Message { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public RecoverSuccessV1Message() { + } + + public RecoverSuccessV1Message sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public RecoverSuccessV1Message success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public RecoverSuccessV1Message signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecoverSuccessV1Message recoverSuccessV1Message = (RecoverSuccessV1Message) o; + return Objects.equals(this.sessionID, recoverSuccessV1Message.sessionID) && + Objects.equals(this.success, recoverSuccessV1Message.success) && + Objects.equals(this.signature, recoverSuccessV1Message.signature); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, success, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecoverSuccessV1Message {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("success"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RecoverSuccessV1Message + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RecoverSuccessV1Message.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RecoverSuccessV1Message is not found in the empty JSON string", RecoverSuccessV1Message.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RecoverSuccessV1Message.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RecoverSuccessV1Message` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RecoverSuccessV1Message.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RecoverSuccessV1Message.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RecoverSuccessV1Message' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RecoverSuccessV1Message.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RecoverSuccessV1Message value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RecoverSuccessV1Message read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RecoverSuccessV1Message given an JSON string + * + * @param jsonString JSON string + * @return An instance of RecoverSuccessV1Message + * @throws IOException if the JSON string is invalid with respect to RecoverSuccessV1Message + */ + public static RecoverSuccessV1Message fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RecoverSuccessV1Message.class); + } + + /** + * Convert an instance of RecoverSuccessV1Message to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverUpdateAckV1Message.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverUpdateAckV1Message.java new file mode 100644 index 00000000000..9c02c07c885 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverUpdateAckV1Message.java @@ -0,0 +1,322 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RecoverUpdateAckV1Message + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RecoverUpdateAckV1Message { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_CHANGED_ENTRIES_HASH = "changedEntriesHash"; + @SerializedName(SERIALIZED_NAME_CHANGED_ENTRIES_HASH) + private List changedEntriesHash = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public RecoverUpdateAckV1Message() { + } + + public RecoverUpdateAckV1Message sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public RecoverUpdateAckV1Message success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public RecoverUpdateAckV1Message changedEntriesHash(List changedEntriesHash) { + + this.changedEntriesHash = changedEntriesHash; + return this; + } + + public RecoverUpdateAckV1Message addChangedEntriesHashItem(String changedEntriesHashItem) { + if (this.changedEntriesHash == null) { + this.changedEntriesHash = new ArrayList<>(); + } + this.changedEntriesHash.add(changedEntriesHashItem); + return this; + } + + /** + * Get changedEntriesHash + * @return changedEntriesHash + **/ + @javax.annotation.Nonnull + public List getChangedEntriesHash() { + return changedEntriesHash; + } + + + public void setChangedEntriesHash(List changedEntriesHash) { + this.changedEntriesHash = changedEntriesHash; + } + + + public RecoverUpdateAckV1Message signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecoverUpdateAckV1Message recoverUpdateAckV1Message = (RecoverUpdateAckV1Message) o; + return Objects.equals(this.sessionID, recoverUpdateAckV1Message.sessionID) && + Objects.equals(this.success, recoverUpdateAckV1Message.success) && + Objects.equals(this.changedEntriesHash, recoverUpdateAckV1Message.changedEntriesHash) && + Objects.equals(this.signature, recoverUpdateAckV1Message.signature); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, success, changedEntriesHash, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecoverUpdateAckV1Message {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" changedEntriesHash: ").append(toIndentedString(changedEntriesHash)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("success"); + openapiFields.add("changedEntriesHash"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("changedEntriesHash"); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RecoverUpdateAckV1Message + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RecoverUpdateAckV1Message.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RecoverUpdateAckV1Message is not found in the empty JSON string", RecoverUpdateAckV1Message.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RecoverUpdateAckV1Message.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RecoverUpdateAckV1Message` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RecoverUpdateAckV1Message.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + // ensure the required json array is present + if (jsonObj.get("changedEntriesHash") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("changedEntriesHash").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `changedEntriesHash` to be an array in the JSON string but got `%s`", jsonObj.get("changedEntriesHash").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RecoverUpdateAckV1Message.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RecoverUpdateAckV1Message' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RecoverUpdateAckV1Message.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RecoverUpdateAckV1Message value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RecoverUpdateAckV1Message read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RecoverUpdateAckV1Message given an JSON string + * + * @param jsonString JSON string + * @return An instance of RecoverUpdateAckV1Message + * @throws IOException if the JSON string is invalid with respect to RecoverUpdateAckV1Message + */ + public static RecoverUpdateAckV1Message fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RecoverUpdateAckV1Message.class); + } + + /** + * Convert an instance of RecoverUpdateAckV1Message to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverUpdateV1Message.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverUpdateV1Message.java new file mode 100644 index 00000000000..631364fa9a4 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverUpdateV1Message.java @@ -0,0 +1,298 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.List; +import org.openapitools.client.model.OdapLocalLog; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RecoverUpdateV1Message + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RecoverUpdateV1Message { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_RECOVERED_LOGS = "recoveredLogs"; + @SerializedName(SERIALIZED_NAME_RECOVERED_LOGS) + private List recoveredLogs = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public RecoverUpdateV1Message() { + } + + public RecoverUpdateV1Message sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public RecoverUpdateV1Message recoveredLogs(List recoveredLogs) { + + this.recoveredLogs = recoveredLogs; + return this; + } + + public RecoverUpdateV1Message addRecoveredLogsItem(OdapLocalLog recoveredLogsItem) { + if (this.recoveredLogs == null) { + this.recoveredLogs = new ArrayList<>(); + } + this.recoveredLogs.add(recoveredLogsItem); + return this; + } + + /** + * Get recoveredLogs + * @return recoveredLogs + **/ + @javax.annotation.Nonnull + public List getRecoveredLogs() { + return recoveredLogs; + } + + + public void setRecoveredLogs(List recoveredLogs) { + this.recoveredLogs = recoveredLogs; + } + + + public RecoverUpdateV1Message signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecoverUpdateV1Message recoverUpdateV1Message = (RecoverUpdateV1Message) o; + return Objects.equals(this.sessionID, recoverUpdateV1Message.sessionID) && + Objects.equals(this.recoveredLogs, recoverUpdateV1Message.recoveredLogs) && + Objects.equals(this.signature, recoverUpdateV1Message.signature); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, recoveredLogs, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecoverUpdateV1Message {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" recoveredLogs: ").append(toIndentedString(recoveredLogs)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("recoveredLogs"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("recoveredLogs"); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RecoverUpdateV1Message + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RecoverUpdateV1Message.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RecoverUpdateV1Message is not found in the empty JSON string", RecoverUpdateV1Message.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RecoverUpdateV1Message.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RecoverUpdateV1Message` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RecoverUpdateV1Message.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("recoveredLogs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `recoveredLogs` to be an array in the JSON string but got `%s`", jsonObj.get("recoveredLogs").toString())); + } + + JsonArray jsonArrayrecoveredLogs = jsonObj.getAsJsonArray("recoveredLogs"); + // validate the required field `recoveredLogs` (array) + for (int i = 0; i < jsonArrayrecoveredLogs.size(); i++) { + OdapLocalLog.validateJsonObject(jsonArrayrecoveredLogs.get(i).getAsJsonObject()); + }; + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RecoverUpdateV1Message.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RecoverUpdateV1Message' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RecoverUpdateV1Message.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RecoverUpdateV1Message value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RecoverUpdateV1Message read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RecoverUpdateV1Message given an JSON string + * + * @param jsonString JSON string + * @return An instance of RecoverUpdateV1Message + * @throws IOException if the JSON string is invalid with respect to RecoverUpdateV1Message + */ + public static RecoverUpdateV1Message fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RecoverUpdateV1Message.class); + } + + /** + * Convert an instance of RecoverUpdateV1Message to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverV1Message.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverV1Message.java new file mode 100644 index 00000000000..ab11433b625 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RecoverV1Message.java @@ -0,0 +1,434 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RecoverV1Message + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RecoverV1Message { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_ODAP_PHASE = "odapPhase"; + @SerializedName(SERIALIZED_NAME_ODAP_PHASE) + private String odapPhase; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public static final String SERIALIZED_NAME_LAST_LOG_ENTRY_TIMESTAMP = "lastLogEntryTimestamp"; + @SerializedName(SERIALIZED_NAME_LAST_LOG_ENTRY_TIMESTAMP) + private String lastLogEntryTimestamp; + + public static final String SERIALIZED_NAME_IS_BACKUP = "isBackup"; + @SerializedName(SERIALIZED_NAME_IS_BACKUP) + private Boolean isBackup; + + public static final String SERIALIZED_NAME_NEW_BASE_PATH = "newBasePath"; + @SerializedName(SERIALIZED_NAME_NEW_BASE_PATH) + private String newBasePath; + + public static final String SERIALIZED_NAME_NEW_GATEWAY_PUB_KEY = "newGatewayPubKey"; + @SerializedName(SERIALIZED_NAME_NEW_GATEWAY_PUB_KEY) + private String newGatewayPubKey; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public RecoverV1Message() { + } + + public RecoverV1Message sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public RecoverV1Message odapPhase(String odapPhase) { + + this.odapPhase = odapPhase; + return this; + } + + /** + * Get odapPhase + * @return odapPhase + **/ + @javax.annotation.Nonnull + public String getOdapPhase() { + return odapPhase; + } + + + public void setOdapPhase(String odapPhase) { + this.odapPhase = odapPhase; + } + + + public RecoverV1Message sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + public RecoverV1Message lastLogEntryTimestamp(String lastLogEntryTimestamp) { + + this.lastLogEntryTimestamp = lastLogEntryTimestamp; + return this; + } + + /** + * Get lastLogEntryTimestamp + * @return lastLogEntryTimestamp + **/ + @javax.annotation.Nonnull + public String getLastLogEntryTimestamp() { + return lastLogEntryTimestamp; + } + + + public void setLastLogEntryTimestamp(String lastLogEntryTimestamp) { + this.lastLogEntryTimestamp = lastLogEntryTimestamp; + } + + + public RecoverV1Message isBackup(Boolean isBackup) { + + this.isBackup = isBackup; + return this; + } + + /** + * Get isBackup + * @return isBackup + **/ + @javax.annotation.Nonnull + public Boolean getIsBackup() { + return isBackup; + } + + + public void setIsBackup(Boolean isBackup) { + this.isBackup = isBackup; + } + + + public RecoverV1Message newBasePath(String newBasePath) { + + this.newBasePath = newBasePath; + return this; + } + + /** + * Get newBasePath + * @return newBasePath + **/ + @javax.annotation.Nonnull + public String getNewBasePath() { + return newBasePath; + } + + + public void setNewBasePath(String newBasePath) { + this.newBasePath = newBasePath; + } + + + public RecoverV1Message newGatewayPubKey(String newGatewayPubKey) { + + this.newGatewayPubKey = newGatewayPubKey; + return this; + } + + /** + * Get newGatewayPubKey + * @return newGatewayPubKey + **/ + @javax.annotation.Nullable + public String getNewGatewayPubKey() { + return newGatewayPubKey; + } + + + public void setNewGatewayPubKey(String newGatewayPubKey) { + this.newGatewayPubKey = newGatewayPubKey; + } + + + public RecoverV1Message signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecoverV1Message recoverV1Message = (RecoverV1Message) o; + return Objects.equals(this.sessionID, recoverV1Message.sessionID) && + Objects.equals(this.odapPhase, recoverV1Message.odapPhase) && + Objects.equals(this.sequenceNumber, recoverV1Message.sequenceNumber) && + Objects.equals(this.lastLogEntryTimestamp, recoverV1Message.lastLogEntryTimestamp) && + Objects.equals(this.isBackup, recoverV1Message.isBackup) && + Objects.equals(this.newBasePath, recoverV1Message.newBasePath) && + Objects.equals(this.newGatewayPubKey, recoverV1Message.newGatewayPubKey) && + Objects.equals(this.signature, recoverV1Message.signature); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, odapPhase, sequenceNumber, lastLogEntryTimestamp, isBackup, newBasePath, newGatewayPubKey, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecoverV1Message {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" odapPhase: ").append(toIndentedString(odapPhase)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" lastLogEntryTimestamp: ").append(toIndentedString(lastLogEntryTimestamp)).append("\n"); + sb.append(" isBackup: ").append(toIndentedString(isBackup)).append("\n"); + sb.append(" newBasePath: ").append(toIndentedString(newBasePath)).append("\n"); + sb.append(" newGatewayPubKey: ").append(toIndentedString(newGatewayPubKey)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("odapPhase"); + openapiFields.add("sequenceNumber"); + openapiFields.add("lastLogEntryTimestamp"); + openapiFields.add("isBackup"); + openapiFields.add("newBasePath"); + openapiFields.add("newGatewayPubKey"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("odapPhase"); + openapiRequiredFields.add("sequenceNumber"); + openapiRequiredFields.add("lastLogEntryTimestamp"); + openapiRequiredFields.add("isBackup"); + openapiRequiredFields.add("newBasePath"); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RecoverV1Message + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RecoverV1Message.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RecoverV1Message is not found in the empty JSON string", RecoverV1Message.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RecoverV1Message.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RecoverV1Message` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RecoverV1Message.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("odapPhase").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `odapPhase` to be a primitive type in the JSON string but got `%s`", jsonObj.get("odapPhase").toString())); + } + if (!jsonObj.get("lastLogEntryTimestamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastLogEntryTimestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastLogEntryTimestamp").toString())); + } + if (!jsonObj.get("newBasePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `newBasePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("newBasePath").toString())); + } + if ((jsonObj.get("newGatewayPubKey") != null && !jsonObj.get("newGatewayPubKey").isJsonNull()) && !jsonObj.get("newGatewayPubKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `newGatewayPubKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("newGatewayPubKey").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RecoverV1Message.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RecoverV1Message' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RecoverV1Message.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RecoverV1Message value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RecoverV1Message read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RecoverV1Message given an JSON string + * + * @param jsonString JSON string + * @return An instance of RecoverV1Message + * @throws IOException if the JSON string is invalid with respect to RecoverV1Message + */ + public static RecoverV1Message fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RecoverV1Message.class); + } + + /** + * Convert an instance of RecoverV1Message to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RollbackAckV1Message.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RollbackAckV1Message.java new file mode 100644 index 00000000000..0877f4fc27f --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RollbackAckV1Message.java @@ -0,0 +1,277 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RollbackAckV1Message + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RollbackAckV1Message { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public RollbackAckV1Message() { + } + + public RollbackAckV1Message sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public RollbackAckV1Message success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public RollbackAckV1Message signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RollbackAckV1Message rollbackAckV1Message = (RollbackAckV1Message) o; + return Objects.equals(this.sessionID, rollbackAckV1Message.sessionID) && + Objects.equals(this.success, rollbackAckV1Message.success) && + Objects.equals(this.signature, rollbackAckV1Message.signature); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, success, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RollbackAckV1Message {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("success"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RollbackAckV1Message + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RollbackAckV1Message.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RollbackAckV1Message is not found in the empty JSON string", RollbackAckV1Message.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RollbackAckV1Message.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RollbackAckV1Message` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RollbackAckV1Message.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RollbackAckV1Message.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RollbackAckV1Message' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RollbackAckV1Message.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RollbackAckV1Message value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RollbackAckV1Message read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RollbackAckV1Message given an JSON string + * + * @param jsonString JSON string + * @return An instance of RollbackAckV1Message + * @throws IOException if the JSON string is invalid with respect to RollbackAckV1Message + */ + public static RollbackAckV1Message fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RollbackAckV1Message.class); + } + + /** + * Convert an instance of RollbackAckV1Message to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RollbackV1Message.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RollbackV1Message.java new file mode 100644 index 00000000000..b2fb0eb43f4 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/RollbackV1Message.java @@ -0,0 +1,365 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import 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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * RollbackV1Message + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class RollbackV1Message { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_ACTION_PERFORMED = "actionPerformed"; + @SerializedName(SERIALIZED_NAME_ACTION_PERFORMED) + private List actionPerformed = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PROOFS = "proofs"; + @SerializedName(SERIALIZED_NAME_PROOFS) + private List proofs = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public RollbackV1Message() { + } + + public RollbackV1Message sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public RollbackV1Message success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nonnull + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public RollbackV1Message actionPerformed(List actionPerformed) { + + this.actionPerformed = actionPerformed; + return this; + } + + public RollbackV1Message addActionPerformedItem(String actionPerformedItem) { + if (this.actionPerformed == null) { + this.actionPerformed = new ArrayList<>(); + } + this.actionPerformed.add(actionPerformedItem); + return this; + } + + /** + * Get actionPerformed + * @return actionPerformed + **/ + @javax.annotation.Nonnull + public List getActionPerformed() { + return actionPerformed; + } + + + public void setActionPerformed(List actionPerformed) { + this.actionPerformed = actionPerformed; + } + + + public RollbackV1Message proofs(List proofs) { + + this.proofs = proofs; + return this; + } + + public RollbackV1Message addProofsItem(String proofsItem) { + if (this.proofs == null) { + this.proofs = new ArrayList<>(); + } + this.proofs.add(proofsItem); + return this; + } + + /** + * Get proofs + * @return proofs + **/ + @javax.annotation.Nonnull + public List getProofs() { + return proofs; + } + + + public void setProofs(List proofs) { + this.proofs = proofs; + } + + + public RollbackV1Message signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RollbackV1Message rollbackV1Message = (RollbackV1Message) o; + return Objects.equals(this.sessionID, rollbackV1Message.sessionID) && + Objects.equals(this.success, rollbackV1Message.success) && + Objects.equals(this.actionPerformed, rollbackV1Message.actionPerformed) && + Objects.equals(this.proofs, rollbackV1Message.proofs) && + Objects.equals(this.signature, rollbackV1Message.signature); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, success, actionPerformed, proofs, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RollbackV1Message {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" actionPerformed: ").append(toIndentedString(actionPerformed)).append("\n"); + sb.append(" proofs: ").append(toIndentedString(proofs)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("success"); + openapiFields.add("actionPerformed"); + openapiFields.add("proofs"); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("success"); + openapiRequiredFields.add("actionPerformed"); + openapiRequiredFields.add("proofs"); + openapiRequiredFields.add("signature"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RollbackV1Message + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!RollbackV1Message.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RollbackV1Message is not found in the empty JSON string", RollbackV1Message.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RollbackV1Message.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RollbackV1Message` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RollbackV1Message.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + // ensure the required json array is present + if (jsonObj.get("actionPerformed") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("actionPerformed").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `actionPerformed` to be an array in the JSON string but got `%s`", jsonObj.get("actionPerformed").toString())); + } + // ensure the required json array is present + if (jsonObj.get("proofs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("proofs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `proofs` to be an array in the JSON string but got `%s`", jsonObj.get("proofs").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RollbackV1Message.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RollbackV1Message' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RollbackV1Message.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RollbackV1Message value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RollbackV1Message read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RollbackV1Message given an JSON string + * + * @param jsonString JSON string + * @return An instance of RollbackV1Message + * @throws IOException if the JSON string is invalid with respect to RollbackV1Message + */ + public static RollbackV1Message fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RollbackV1Message.class); + } + + /** + * Convert an instance of RollbackV1Message to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SessionData.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SessionData.java new file mode 100644 index 00000000000..03c52fa050f --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/SessionData.java @@ -0,0 +1,2147 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.AssetProfile; +import org.openapitools.client.model.PayloadProfile; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SessionData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SessionData { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_STEP = "step"; + @SerializedName(SERIALIZED_NAME_STEP) + private BigDecimal step; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public static final String SERIALIZED_NAME_LAST_SEQUENCE_NUMBER = "lastSequenceNumber"; + @SerializedName(SERIALIZED_NAME_LAST_SEQUENCE_NUMBER) + private BigDecimal lastSequenceNumber; + + public static final String SERIALIZED_NAME_LOGGING_PROFILE = "loggingProfile"; + @SerializedName(SERIALIZED_NAME_LOGGING_PROFILE) + private String loggingProfile; + + public static final String SERIALIZED_NAME_ACCESS_CONTROL_PROFILE = "accessControlProfile"; + @SerializedName(SERIALIZED_NAME_ACCESS_CONTROL_PROFILE) + private String accessControlProfile; + + public static final String SERIALIZED_NAME_APPLICATION_PROFILE = "applicationProfile"; + @SerializedName(SERIALIZED_NAME_APPLICATION_PROFILE) + private String applicationProfile; + + public static final String SERIALIZED_NAME_PAYLOAD_PROFILE = "payloadProfile"; + @SerializedName(SERIALIZED_NAME_PAYLOAD_PROFILE) + private PayloadProfile payloadProfile; + + public static final String SERIALIZED_NAME_ASSET_PROFILE = "assetProfile"; + @SerializedName(SERIALIZED_NAME_ASSET_PROFILE) + private AssetProfile assetProfile; + + public static final String SERIALIZED_NAME_ALLOWED_SOURCE_BACKUP_GATEWAYS = "allowedSourceBackupGateways"; + @SerializedName(SERIALIZED_NAME_ALLOWED_SOURCE_BACKUP_GATEWAYS) + private List allowedSourceBackupGateways; + + public static final String SERIALIZED_NAME_ALLOWED_RECIPIENT_BACKUP_GATEWAYS = "allowedRecipientBackupGateways"; + @SerializedName(SERIALIZED_NAME_ALLOWED_RECIPIENT_BACKUP_GATEWAYS) + private List allowedRecipientBackupGateways; + + public static final String SERIALIZED_NAME_SOURCE_BASE_PATH = "sourceBasePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_BASE_PATH) + private String sourceBasePath; + + public static final String SERIALIZED_NAME_RECIPIENT_BASE_PATH = "recipientBasePath"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_BASE_PATH) + private String recipientBasePath; + + public static final String SERIALIZED_NAME_ORIGINATOR_PUBKEY = "originatorPubkey"; + @SerializedName(SERIALIZED_NAME_ORIGINATOR_PUBKEY) + private String originatorPubkey; + + public static final String SERIALIZED_NAME_BENEFICIARY_PUBKEY = "beneficiaryPubkey"; + @SerializedName(SERIALIZED_NAME_BENEFICIARY_PUBKEY) + private String beneficiaryPubkey; + + public static final String SERIALIZED_NAME_SOURCE_GATEWAY_PUBKEY = "sourceGatewayPubkey"; + @SerializedName(SERIALIZED_NAME_SOURCE_GATEWAY_PUBKEY) + private String sourceGatewayPubkey; + + public static final String SERIALIZED_NAME_SOURCE_GATEWAY_DLT_SYSTEM = "sourceGatewayDltSystem"; + @SerializedName(SERIALIZED_NAME_SOURCE_GATEWAY_DLT_SYSTEM) + private String sourceGatewayDltSystem; + + public static final String SERIALIZED_NAME_RECIPIENT_GATEWAY_PUBKEY = "recipientGatewayPubkey"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_GATEWAY_PUBKEY) + private String recipientGatewayPubkey; + + public static final String SERIALIZED_NAME_RECIPIENT_GATEWAY_DLT_SYSTEM = "recipientGatewayDltSystem"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_GATEWAY_DLT_SYSTEM) + private String recipientGatewayDltSystem; + + public static final String SERIALIZED_NAME_INITIALIZATION_REQUEST_MESSAGE_HASH = "initializationRequestMessageHash"; + @SerializedName(SERIALIZED_NAME_INITIALIZATION_REQUEST_MESSAGE_HASH) + private String initializationRequestMessageHash; + + public static final String SERIALIZED_NAME_INITIALIZATION_RESPONSE_MESSAGE_HASH = "initializationResponseMessageHash"; + @SerializedName(SERIALIZED_NAME_INITIALIZATION_RESPONSE_MESSAGE_HASH) + private String initializationResponseMessageHash; + + public static final String SERIALIZED_NAME_INITIALIZATION_REQUEST_MESSAGE_RCV_TIME_STAMP = "initializationRequestMessageRcvTimeStamp"; + @SerializedName(SERIALIZED_NAME_INITIALIZATION_REQUEST_MESSAGE_RCV_TIME_STAMP) + private String initializationRequestMessageRcvTimeStamp; + + public static final String SERIALIZED_NAME_INITIALIZATION_REQUEST_MESSAGE_PROCESSED_TIME_STAMP = "initializationRequestMessageProcessedTimeStamp"; + @SerializedName(SERIALIZED_NAME_INITIALIZATION_REQUEST_MESSAGE_PROCESSED_TIME_STAMP) + private String initializationRequestMessageProcessedTimeStamp; + + public static final String SERIALIZED_NAME_CLIENT_SIGNATURE_INITIALIZATION_REQUEST_MESSAGE = "clientSignatureInitializationRequestMessage"; + @SerializedName(SERIALIZED_NAME_CLIENT_SIGNATURE_INITIALIZATION_REQUEST_MESSAGE) + private String clientSignatureInitializationRequestMessage; + + public static final String SERIALIZED_NAME_SERVER_SIGNATURE_INITIALIZATION_RESPONSE_MESSAGE = "serverSignatureInitializationResponseMessage"; + @SerializedName(SERIALIZED_NAME_SERVER_SIGNATURE_INITIALIZATION_RESPONSE_MESSAGE) + private String serverSignatureInitializationResponseMessage; + + public static final String SERIALIZED_NAME_TRANSFER_COMMENCE_MESSAGE_REQUEST_HASH = "transferCommenceMessageRequestHash"; + @SerializedName(SERIALIZED_NAME_TRANSFER_COMMENCE_MESSAGE_REQUEST_HASH) + private String transferCommenceMessageRequestHash; + + public static final String SERIALIZED_NAME_TRANSFER_COMMENCE_MESSAGE_RESPONSE_HASH = "transferCommenceMessageResponseHash"; + @SerializedName(SERIALIZED_NAME_TRANSFER_COMMENCE_MESSAGE_RESPONSE_HASH) + private String transferCommenceMessageResponseHash; + + public static final String SERIALIZED_NAME_CLIENT_SIGNATURE_TRANSFER_COMMENCE_REQUEST_MESSAGE = "clientSignatureTransferCommenceRequestMessage"; + @SerializedName(SERIALIZED_NAME_CLIENT_SIGNATURE_TRANSFER_COMMENCE_REQUEST_MESSAGE) + private String clientSignatureTransferCommenceRequestMessage; + + public static final String SERIALIZED_NAME_SERVER_SIGNATURE_TRANSFER_COMMENCE_RESPONSE_MESSAGE = "serverSignatureTransferCommenceResponseMessage"; + @SerializedName(SERIALIZED_NAME_SERVER_SIGNATURE_TRANSFER_COMMENCE_RESPONSE_MESSAGE) + private String serverSignatureTransferCommenceResponseMessage; + + public static final String SERIALIZED_NAME_LOCK_EVIDENCE_REQUEST_MESSAGE_HASH = "lockEvidenceRequestMessageHash"; + @SerializedName(SERIALIZED_NAME_LOCK_EVIDENCE_REQUEST_MESSAGE_HASH) + private String lockEvidenceRequestMessageHash; + + public static final String SERIALIZED_NAME_LOCK_EVIDENCE_RESPONSE_MESSAGE_HASH = "lockEvidenceResponseMessageHash"; + @SerializedName(SERIALIZED_NAME_LOCK_EVIDENCE_RESPONSE_MESSAGE_HASH) + private String lockEvidenceResponseMessageHash; + + public static final String SERIALIZED_NAME_CLIENT_SIGNATURE_LOCK_EVIDENCE_REQUEST_MESSAGE = "clientSignatureLockEvidenceRequestMessage"; + @SerializedName(SERIALIZED_NAME_CLIENT_SIGNATURE_LOCK_EVIDENCE_REQUEST_MESSAGE) + private String clientSignatureLockEvidenceRequestMessage; + + public static final String SERIALIZED_NAME_SERVER_SIGNATURE_LOCK_EVIDENCE_RESPONSE_MESSAGE = "serverSignatureLockEvidenceResponseMessage"; + @SerializedName(SERIALIZED_NAME_SERVER_SIGNATURE_LOCK_EVIDENCE_RESPONSE_MESSAGE) + private String serverSignatureLockEvidenceResponseMessage; + + public static final String SERIALIZED_NAME_LOCK_EVIDENCE_CLAIM = "lockEvidenceClaim"; + @SerializedName(SERIALIZED_NAME_LOCK_EVIDENCE_CLAIM) + private String lockEvidenceClaim; + + public static final String SERIALIZED_NAME_COMMIT_PREPARE_REQUEST_MESSAGE_HASH = "commitPrepareRequestMessageHash"; + @SerializedName(SERIALIZED_NAME_COMMIT_PREPARE_REQUEST_MESSAGE_HASH) + private String commitPrepareRequestMessageHash; + + public static final String SERIALIZED_NAME_COMMIT_PREPARE_RESPONSE_MESSAGE_HASH = "commitPrepareResponseMessageHash"; + @SerializedName(SERIALIZED_NAME_COMMIT_PREPARE_RESPONSE_MESSAGE_HASH) + private String commitPrepareResponseMessageHash; + + public static final String SERIALIZED_NAME_CLIENT_SIGNATURE_COMMIT_PREPARATION_REQUEST_MESSAGE = "clientSignatureCommitPreparationRequestMessage"; + @SerializedName(SERIALIZED_NAME_CLIENT_SIGNATURE_COMMIT_PREPARATION_REQUEST_MESSAGE) + private String clientSignatureCommitPreparationRequestMessage; + + public static final String SERIALIZED_NAME_SERVER_SIGNATURE_COMMIT_PREPARATION_RESPONSE_MESSAGE = "serverSignatureCommitPreparationResponseMessage"; + @SerializedName(SERIALIZED_NAME_SERVER_SIGNATURE_COMMIT_PREPARATION_RESPONSE_MESSAGE) + private String serverSignatureCommitPreparationResponseMessage; + + public static final String SERIALIZED_NAME_COMMIT_FINAL_REQUEST_MESSAGE_HASH = "commitFinalRequestMessageHash"; + @SerializedName(SERIALIZED_NAME_COMMIT_FINAL_REQUEST_MESSAGE_HASH) + private String commitFinalRequestMessageHash; + + public static final String SERIALIZED_NAME_COMMIT_FINAL_RESPONSE_MESSAGE_HASH = "commitFinalResponseMessageHash"; + @SerializedName(SERIALIZED_NAME_COMMIT_FINAL_RESPONSE_MESSAGE_HASH) + private String commitFinalResponseMessageHash; + + public static final String SERIALIZED_NAME_COMMIT_FINAL_CLAIM = "commitFinalClaim"; + @SerializedName(SERIALIZED_NAME_COMMIT_FINAL_CLAIM) + private String commitFinalClaim; + + public static final String SERIALIZED_NAME_COMMIT_FINAL_CLAIM_FORMAT = "commitFinalClaimFormat"; + @SerializedName(SERIALIZED_NAME_COMMIT_FINAL_CLAIM_FORMAT) + private String commitFinalClaimFormat; + + public static final String SERIALIZED_NAME_COMMIT_ACKNOWLEDGEMENT_CLAIM = "commitAcknowledgementClaim"; + @SerializedName(SERIALIZED_NAME_COMMIT_ACKNOWLEDGEMENT_CLAIM) + private String commitAcknowledgementClaim; + + public static final String SERIALIZED_NAME_COMMIT_ACKNOWLEDGEMENT_CLAIM_FORMAT = "commitAcknowledgementClaimFormat"; + @SerializedName(SERIALIZED_NAME_COMMIT_ACKNOWLEDGEMENT_CLAIM_FORMAT) + private String commitAcknowledgementClaimFormat; + + public static final String SERIALIZED_NAME_CLIENT_SIGNATURE_COMMIT_FINAL_REQUEST_MESSAGE = "clientSignatureCommitFinalRequestMessage"; + @SerializedName(SERIALIZED_NAME_CLIENT_SIGNATURE_COMMIT_FINAL_REQUEST_MESSAGE) + private String clientSignatureCommitFinalRequestMessage; + + public static final String SERIALIZED_NAME_SERVER_SIGNATURE_COMMIT_FINAL_RESPONSE_MESSAGE = "serverSignatureCommitFinalResponseMessage"; + @SerializedName(SERIALIZED_NAME_SERVER_SIGNATURE_COMMIT_FINAL_RESPONSE_MESSAGE) + private String serverSignatureCommitFinalResponseMessage; + + public static final String SERIALIZED_NAME_TRANSFER_COMPLETE_MESSAGE_HASH = "transferCompleteMessageHash"; + @SerializedName(SERIALIZED_NAME_TRANSFER_COMPLETE_MESSAGE_HASH) + private String transferCompleteMessageHash; + + public static final String SERIALIZED_NAME_CLIENT_SIGNATURE_TRANSFER_COMPLETE_MESSAGE = "clientSignatureTransferCompleteMessage"; + @SerializedName(SERIALIZED_NAME_CLIENT_SIGNATURE_TRANSFER_COMPLETE_MESSAGE) + private String clientSignatureTransferCompleteMessage; + + public static final String SERIALIZED_NAME_MAX_RETRIES = "maxRetries"; + @SerializedName(SERIALIZED_NAME_MAX_RETRIES) + private BigDecimal maxRetries; + + public static final String SERIALIZED_NAME_RECIPIENT_LEDGER_ASSET_I_D = "recipientLedgerAssetID"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_LEDGER_ASSET_I_D) + private String recipientLedgerAssetID; + + public static final String SERIALIZED_NAME_SOURCE_LEDGER_ASSET_I_D = "sourceLedgerAssetID"; + @SerializedName(SERIALIZED_NAME_SOURCE_LEDGER_ASSET_I_D) + private String sourceLedgerAssetID; + + public static final String SERIALIZED_NAME_MAX_TIMEOUT = "maxTimeout"; + @SerializedName(SERIALIZED_NAME_MAX_TIMEOUT) + private BigDecimal maxTimeout; + + public static final String SERIALIZED_NAME_LAST_LOG_ENTRY_TIMESTAMP = "lastLogEntryTimestamp"; + @SerializedName(SERIALIZED_NAME_LAST_LOG_ENTRY_TIMESTAMP) + private String lastLogEntryTimestamp; + + public static final String SERIALIZED_NAME_UNLOCK_ASSET_CLAIM = "unlockAssetClaim"; + @SerializedName(SERIALIZED_NAME_UNLOCK_ASSET_CLAIM) + private String unlockAssetClaim; + + public static final String SERIALIZED_NAME_RECREATE_ASSET_CLAIM = "recreateAssetClaim"; + @SerializedName(SERIALIZED_NAME_RECREATE_ASSET_CLAIM) + private String recreateAssetClaim; + + public static final String SERIALIZED_NAME_DELETE_ASSET_CLAIM = "deleteAssetClaim"; + @SerializedName(SERIALIZED_NAME_DELETE_ASSET_CLAIM) + private String deleteAssetClaim; + + public static final String SERIALIZED_NAME_LAST_MESSAGE_RECEIVED_TIMESTAMP = "lastMessageReceivedTimestamp"; + @SerializedName(SERIALIZED_NAME_LAST_MESSAGE_RECEIVED_TIMESTAMP) + private String lastMessageReceivedTimestamp; + + public static final String SERIALIZED_NAME_ROLLBACK = "rollback"; + @SerializedName(SERIALIZED_NAME_ROLLBACK) + private Boolean rollback; + + public static final String SERIALIZED_NAME_ROLLBACK_MESSAGE_HASH = "rollbackMessageHash"; + @SerializedName(SERIALIZED_NAME_ROLLBACK_MESSAGE_HASH) + private String rollbackMessageHash; + + public static final String SERIALIZED_NAME_ROLLBACK_PROOFS = "rollbackProofs"; + @SerializedName(SERIALIZED_NAME_ROLLBACK_PROOFS) + private List rollbackProofs; + + /** + * Gets or Sets rollbackActionsPerformed + */ + @JsonAdapter(RollbackActionsPerformedEnum.Adapter.class) + public enum RollbackActionsPerformedEnum { + CREATE("CREATE"), + + DELETE("DELETE"), + + LOCK("LOCK"), + + UNLOCK("UNLOCK"); + + private String value; + + RollbackActionsPerformedEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RollbackActionsPerformedEnum fromValue(String value) { + for (RollbackActionsPerformedEnum b : RollbackActionsPerformedEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RollbackActionsPerformedEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RollbackActionsPerformedEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RollbackActionsPerformedEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ROLLBACK_ACTIONS_PERFORMED = "rollbackActionsPerformed"; + @SerializedName(SERIALIZED_NAME_ROLLBACK_ACTIONS_PERFORMED) + private List rollbackActionsPerformed; + + public SessionData() { + } + + public SessionData id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public SessionData step(BigDecimal step) { + + this.step = step; + return this; + } + + /** + * Get step + * @return step + **/ + @javax.annotation.Nullable + public BigDecimal getStep() { + return step; + } + + + public void setStep(BigDecimal step) { + this.step = step; + } + + + public SessionData version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + + public SessionData lastSequenceNumber(BigDecimal lastSequenceNumber) { + + this.lastSequenceNumber = lastSequenceNumber; + return this; + } + + /** + * Get lastSequenceNumber + * @return lastSequenceNumber + **/ + @javax.annotation.Nullable + public BigDecimal getLastSequenceNumber() { + return lastSequenceNumber; + } + + + public void setLastSequenceNumber(BigDecimal lastSequenceNumber) { + this.lastSequenceNumber = lastSequenceNumber; + } + + + public SessionData loggingProfile(String loggingProfile) { + + this.loggingProfile = loggingProfile; + return this; + } + + /** + * Get loggingProfile + * @return loggingProfile + **/ + @javax.annotation.Nullable + public String getLoggingProfile() { + return loggingProfile; + } + + + public void setLoggingProfile(String loggingProfile) { + this.loggingProfile = loggingProfile; + } + + + public SessionData accessControlProfile(String accessControlProfile) { + + this.accessControlProfile = accessControlProfile; + return this; + } + + /** + * Get accessControlProfile + * @return accessControlProfile + **/ + @javax.annotation.Nullable + public String getAccessControlProfile() { + return accessControlProfile; + } + + + public void setAccessControlProfile(String accessControlProfile) { + this.accessControlProfile = accessControlProfile; + } + + + public SessionData applicationProfile(String applicationProfile) { + + this.applicationProfile = applicationProfile; + return this; + } + + /** + * Get applicationProfile + * @return applicationProfile + **/ + @javax.annotation.Nullable + public String getApplicationProfile() { + return applicationProfile; + } + + + public void setApplicationProfile(String applicationProfile) { + this.applicationProfile = applicationProfile; + } + + + public SessionData payloadProfile(PayloadProfile payloadProfile) { + + this.payloadProfile = payloadProfile; + return this; + } + + /** + * Get payloadProfile + * @return payloadProfile + **/ + @javax.annotation.Nullable + public PayloadProfile getPayloadProfile() { + return payloadProfile; + } + + + public void setPayloadProfile(PayloadProfile payloadProfile) { + this.payloadProfile = payloadProfile; + } + + + public SessionData assetProfile(AssetProfile assetProfile) { + + this.assetProfile = assetProfile; + return this; + } + + /** + * Get assetProfile + * @return assetProfile + **/ + @javax.annotation.Nullable + public AssetProfile getAssetProfile() { + return assetProfile; + } + + + public void setAssetProfile(AssetProfile assetProfile) { + this.assetProfile = assetProfile; + } + + + public SessionData allowedSourceBackupGateways(List allowedSourceBackupGateways) { + + this.allowedSourceBackupGateways = allowedSourceBackupGateways; + return this; + } + + public SessionData addAllowedSourceBackupGatewaysItem(String allowedSourceBackupGatewaysItem) { + if (this.allowedSourceBackupGateways == null) { + this.allowedSourceBackupGateways = new ArrayList<>(); + } + this.allowedSourceBackupGateways.add(allowedSourceBackupGatewaysItem); + return this; + } + + /** + * Get allowedSourceBackupGateways + * @return allowedSourceBackupGateways + **/ + @javax.annotation.Nullable + public List getAllowedSourceBackupGateways() { + return allowedSourceBackupGateways; + } + + + public void setAllowedSourceBackupGateways(List allowedSourceBackupGateways) { + this.allowedSourceBackupGateways = allowedSourceBackupGateways; + } + + + public SessionData allowedRecipientBackupGateways(List allowedRecipientBackupGateways) { + + this.allowedRecipientBackupGateways = allowedRecipientBackupGateways; + return this; + } + + public SessionData addAllowedRecipientBackupGatewaysItem(String allowedRecipientBackupGatewaysItem) { + if (this.allowedRecipientBackupGateways == null) { + this.allowedRecipientBackupGateways = new ArrayList<>(); + } + this.allowedRecipientBackupGateways.add(allowedRecipientBackupGatewaysItem); + return this; + } + + /** + * Get allowedRecipientBackupGateways + * @return allowedRecipientBackupGateways + **/ + @javax.annotation.Nullable + public List getAllowedRecipientBackupGateways() { + return allowedRecipientBackupGateways; + } + + + public void setAllowedRecipientBackupGateways(List allowedRecipientBackupGateways) { + this.allowedRecipientBackupGateways = allowedRecipientBackupGateways; + } + + + public SessionData sourceBasePath(String sourceBasePath) { + + this.sourceBasePath = sourceBasePath; + return this; + } + + /** + * Get sourceBasePath + * @return sourceBasePath + **/ + @javax.annotation.Nullable + public String getSourceBasePath() { + return sourceBasePath; + } + + + public void setSourceBasePath(String sourceBasePath) { + this.sourceBasePath = sourceBasePath; + } + + + public SessionData recipientBasePath(String recipientBasePath) { + + this.recipientBasePath = recipientBasePath; + return this; + } + + /** + * Get recipientBasePath + * @return recipientBasePath + **/ + @javax.annotation.Nullable + public String getRecipientBasePath() { + return recipientBasePath; + } + + + public void setRecipientBasePath(String recipientBasePath) { + this.recipientBasePath = recipientBasePath; + } + + + public SessionData originatorPubkey(String originatorPubkey) { + + this.originatorPubkey = originatorPubkey; + return this; + } + + /** + * Get originatorPubkey + * @return originatorPubkey + **/ + @javax.annotation.Nullable + public String getOriginatorPubkey() { + return originatorPubkey; + } + + + public void setOriginatorPubkey(String originatorPubkey) { + this.originatorPubkey = originatorPubkey; + } + + + public SessionData beneficiaryPubkey(String beneficiaryPubkey) { + + this.beneficiaryPubkey = beneficiaryPubkey; + return this; + } + + /** + * Get beneficiaryPubkey + * @return beneficiaryPubkey + **/ + @javax.annotation.Nullable + public String getBeneficiaryPubkey() { + return beneficiaryPubkey; + } + + + public void setBeneficiaryPubkey(String beneficiaryPubkey) { + this.beneficiaryPubkey = beneficiaryPubkey; + } + + + public SessionData sourceGatewayPubkey(String sourceGatewayPubkey) { + + this.sourceGatewayPubkey = sourceGatewayPubkey; + return this; + } + + /** + * Get sourceGatewayPubkey + * @return sourceGatewayPubkey + **/ + @javax.annotation.Nullable + public String getSourceGatewayPubkey() { + return sourceGatewayPubkey; + } + + + public void setSourceGatewayPubkey(String sourceGatewayPubkey) { + this.sourceGatewayPubkey = sourceGatewayPubkey; + } + + + public SessionData sourceGatewayDltSystem(String sourceGatewayDltSystem) { + + this.sourceGatewayDltSystem = sourceGatewayDltSystem; + return this; + } + + /** + * Get sourceGatewayDltSystem + * @return sourceGatewayDltSystem + **/ + @javax.annotation.Nullable + public String getSourceGatewayDltSystem() { + return sourceGatewayDltSystem; + } + + + public void setSourceGatewayDltSystem(String sourceGatewayDltSystem) { + this.sourceGatewayDltSystem = sourceGatewayDltSystem; + } + + + public SessionData recipientGatewayPubkey(String recipientGatewayPubkey) { + + this.recipientGatewayPubkey = recipientGatewayPubkey; + return this; + } + + /** + * Get recipientGatewayPubkey + * @return recipientGatewayPubkey + **/ + @javax.annotation.Nullable + public String getRecipientGatewayPubkey() { + return recipientGatewayPubkey; + } + + + public void setRecipientGatewayPubkey(String recipientGatewayPubkey) { + this.recipientGatewayPubkey = recipientGatewayPubkey; + } + + + public SessionData recipientGatewayDltSystem(String recipientGatewayDltSystem) { + + this.recipientGatewayDltSystem = recipientGatewayDltSystem; + return this; + } + + /** + * Get recipientGatewayDltSystem + * @return recipientGatewayDltSystem + **/ + @javax.annotation.Nullable + public String getRecipientGatewayDltSystem() { + return recipientGatewayDltSystem; + } + + + public void setRecipientGatewayDltSystem(String recipientGatewayDltSystem) { + this.recipientGatewayDltSystem = recipientGatewayDltSystem; + } + + + public SessionData initializationRequestMessageHash(String initializationRequestMessageHash) { + + this.initializationRequestMessageHash = initializationRequestMessageHash; + return this; + } + + /** + * Get initializationRequestMessageHash + * @return initializationRequestMessageHash + **/ + @javax.annotation.Nullable + public String getInitializationRequestMessageHash() { + return initializationRequestMessageHash; + } + + + public void setInitializationRequestMessageHash(String initializationRequestMessageHash) { + this.initializationRequestMessageHash = initializationRequestMessageHash; + } + + + public SessionData initializationResponseMessageHash(String initializationResponseMessageHash) { + + this.initializationResponseMessageHash = initializationResponseMessageHash; + return this; + } + + /** + * Get initializationResponseMessageHash + * @return initializationResponseMessageHash + **/ + @javax.annotation.Nullable + public String getInitializationResponseMessageHash() { + return initializationResponseMessageHash; + } + + + public void setInitializationResponseMessageHash(String initializationResponseMessageHash) { + this.initializationResponseMessageHash = initializationResponseMessageHash; + } + + + public SessionData initializationRequestMessageRcvTimeStamp(String initializationRequestMessageRcvTimeStamp) { + + this.initializationRequestMessageRcvTimeStamp = initializationRequestMessageRcvTimeStamp; + return this; + } + + /** + * Get initializationRequestMessageRcvTimeStamp + * @return initializationRequestMessageRcvTimeStamp + **/ + @javax.annotation.Nullable + public String getInitializationRequestMessageRcvTimeStamp() { + return initializationRequestMessageRcvTimeStamp; + } + + + public void setInitializationRequestMessageRcvTimeStamp(String initializationRequestMessageRcvTimeStamp) { + this.initializationRequestMessageRcvTimeStamp = initializationRequestMessageRcvTimeStamp; + } + + + public SessionData initializationRequestMessageProcessedTimeStamp(String initializationRequestMessageProcessedTimeStamp) { + + this.initializationRequestMessageProcessedTimeStamp = initializationRequestMessageProcessedTimeStamp; + return this; + } + + /** + * Get initializationRequestMessageProcessedTimeStamp + * @return initializationRequestMessageProcessedTimeStamp + **/ + @javax.annotation.Nullable + public String getInitializationRequestMessageProcessedTimeStamp() { + return initializationRequestMessageProcessedTimeStamp; + } + + + public void setInitializationRequestMessageProcessedTimeStamp(String initializationRequestMessageProcessedTimeStamp) { + this.initializationRequestMessageProcessedTimeStamp = initializationRequestMessageProcessedTimeStamp; + } + + + public SessionData clientSignatureInitializationRequestMessage(String clientSignatureInitializationRequestMessage) { + + this.clientSignatureInitializationRequestMessage = clientSignatureInitializationRequestMessage; + return this; + } + + /** + * Get clientSignatureInitializationRequestMessage + * @return clientSignatureInitializationRequestMessage + **/ + @javax.annotation.Nullable + public String getClientSignatureInitializationRequestMessage() { + return clientSignatureInitializationRequestMessage; + } + + + public void setClientSignatureInitializationRequestMessage(String clientSignatureInitializationRequestMessage) { + this.clientSignatureInitializationRequestMessage = clientSignatureInitializationRequestMessage; + } + + + public SessionData serverSignatureInitializationResponseMessage(String serverSignatureInitializationResponseMessage) { + + this.serverSignatureInitializationResponseMessage = serverSignatureInitializationResponseMessage; + return this; + } + + /** + * Get serverSignatureInitializationResponseMessage + * @return serverSignatureInitializationResponseMessage + **/ + @javax.annotation.Nullable + public String getServerSignatureInitializationResponseMessage() { + return serverSignatureInitializationResponseMessage; + } + + + public void setServerSignatureInitializationResponseMessage(String serverSignatureInitializationResponseMessage) { + this.serverSignatureInitializationResponseMessage = serverSignatureInitializationResponseMessage; + } + + + public SessionData transferCommenceMessageRequestHash(String transferCommenceMessageRequestHash) { + + this.transferCommenceMessageRequestHash = transferCommenceMessageRequestHash; + return this; + } + + /** + * Get transferCommenceMessageRequestHash + * @return transferCommenceMessageRequestHash + **/ + @javax.annotation.Nullable + public String getTransferCommenceMessageRequestHash() { + return transferCommenceMessageRequestHash; + } + + + public void setTransferCommenceMessageRequestHash(String transferCommenceMessageRequestHash) { + this.transferCommenceMessageRequestHash = transferCommenceMessageRequestHash; + } + + + public SessionData transferCommenceMessageResponseHash(String transferCommenceMessageResponseHash) { + + this.transferCommenceMessageResponseHash = transferCommenceMessageResponseHash; + return this; + } + + /** + * Get transferCommenceMessageResponseHash + * @return transferCommenceMessageResponseHash + **/ + @javax.annotation.Nullable + public String getTransferCommenceMessageResponseHash() { + return transferCommenceMessageResponseHash; + } + + + public void setTransferCommenceMessageResponseHash(String transferCommenceMessageResponseHash) { + this.transferCommenceMessageResponseHash = transferCommenceMessageResponseHash; + } + + + public SessionData clientSignatureTransferCommenceRequestMessage(String clientSignatureTransferCommenceRequestMessage) { + + this.clientSignatureTransferCommenceRequestMessage = clientSignatureTransferCommenceRequestMessage; + return this; + } + + /** + * Get clientSignatureTransferCommenceRequestMessage + * @return clientSignatureTransferCommenceRequestMessage + **/ + @javax.annotation.Nullable + public String getClientSignatureTransferCommenceRequestMessage() { + return clientSignatureTransferCommenceRequestMessage; + } + + + public void setClientSignatureTransferCommenceRequestMessage(String clientSignatureTransferCommenceRequestMessage) { + this.clientSignatureTransferCommenceRequestMessage = clientSignatureTransferCommenceRequestMessage; + } + + + public SessionData serverSignatureTransferCommenceResponseMessage(String serverSignatureTransferCommenceResponseMessage) { + + this.serverSignatureTransferCommenceResponseMessage = serverSignatureTransferCommenceResponseMessage; + return this; + } + + /** + * Get serverSignatureTransferCommenceResponseMessage + * @return serverSignatureTransferCommenceResponseMessage + **/ + @javax.annotation.Nullable + public String getServerSignatureTransferCommenceResponseMessage() { + return serverSignatureTransferCommenceResponseMessage; + } + + + public void setServerSignatureTransferCommenceResponseMessage(String serverSignatureTransferCommenceResponseMessage) { + this.serverSignatureTransferCommenceResponseMessage = serverSignatureTransferCommenceResponseMessage; + } + + + public SessionData lockEvidenceRequestMessageHash(String lockEvidenceRequestMessageHash) { + + this.lockEvidenceRequestMessageHash = lockEvidenceRequestMessageHash; + return this; + } + + /** + * Get lockEvidenceRequestMessageHash + * @return lockEvidenceRequestMessageHash + **/ + @javax.annotation.Nullable + public String getLockEvidenceRequestMessageHash() { + return lockEvidenceRequestMessageHash; + } + + + public void setLockEvidenceRequestMessageHash(String lockEvidenceRequestMessageHash) { + this.lockEvidenceRequestMessageHash = lockEvidenceRequestMessageHash; + } + + + public SessionData lockEvidenceResponseMessageHash(String lockEvidenceResponseMessageHash) { + + this.lockEvidenceResponseMessageHash = lockEvidenceResponseMessageHash; + return this; + } + + /** + * Get lockEvidenceResponseMessageHash + * @return lockEvidenceResponseMessageHash + **/ + @javax.annotation.Nullable + public String getLockEvidenceResponseMessageHash() { + return lockEvidenceResponseMessageHash; + } + + + public void setLockEvidenceResponseMessageHash(String lockEvidenceResponseMessageHash) { + this.lockEvidenceResponseMessageHash = lockEvidenceResponseMessageHash; + } + + + public SessionData clientSignatureLockEvidenceRequestMessage(String clientSignatureLockEvidenceRequestMessage) { + + this.clientSignatureLockEvidenceRequestMessage = clientSignatureLockEvidenceRequestMessage; + return this; + } + + /** + * Get clientSignatureLockEvidenceRequestMessage + * @return clientSignatureLockEvidenceRequestMessage + **/ + @javax.annotation.Nullable + public String getClientSignatureLockEvidenceRequestMessage() { + return clientSignatureLockEvidenceRequestMessage; + } + + + public void setClientSignatureLockEvidenceRequestMessage(String clientSignatureLockEvidenceRequestMessage) { + this.clientSignatureLockEvidenceRequestMessage = clientSignatureLockEvidenceRequestMessage; + } + + + public SessionData serverSignatureLockEvidenceResponseMessage(String serverSignatureLockEvidenceResponseMessage) { + + this.serverSignatureLockEvidenceResponseMessage = serverSignatureLockEvidenceResponseMessage; + return this; + } + + /** + * Get serverSignatureLockEvidenceResponseMessage + * @return serverSignatureLockEvidenceResponseMessage + **/ + @javax.annotation.Nullable + public String getServerSignatureLockEvidenceResponseMessage() { + return serverSignatureLockEvidenceResponseMessage; + } + + + public void setServerSignatureLockEvidenceResponseMessage(String serverSignatureLockEvidenceResponseMessage) { + this.serverSignatureLockEvidenceResponseMessage = serverSignatureLockEvidenceResponseMessage; + } + + + public SessionData lockEvidenceClaim(String lockEvidenceClaim) { + + this.lockEvidenceClaim = lockEvidenceClaim; + return this; + } + + /** + * Get lockEvidenceClaim + * @return lockEvidenceClaim + **/ + @javax.annotation.Nullable + public String getLockEvidenceClaim() { + return lockEvidenceClaim; + } + + + public void setLockEvidenceClaim(String lockEvidenceClaim) { + this.lockEvidenceClaim = lockEvidenceClaim; + } + + + public SessionData commitPrepareRequestMessageHash(String commitPrepareRequestMessageHash) { + + this.commitPrepareRequestMessageHash = commitPrepareRequestMessageHash; + return this; + } + + /** + * Get commitPrepareRequestMessageHash + * @return commitPrepareRequestMessageHash + **/ + @javax.annotation.Nullable + public String getCommitPrepareRequestMessageHash() { + return commitPrepareRequestMessageHash; + } + + + public void setCommitPrepareRequestMessageHash(String commitPrepareRequestMessageHash) { + this.commitPrepareRequestMessageHash = commitPrepareRequestMessageHash; + } + + + public SessionData commitPrepareResponseMessageHash(String commitPrepareResponseMessageHash) { + + this.commitPrepareResponseMessageHash = commitPrepareResponseMessageHash; + return this; + } + + /** + * Get commitPrepareResponseMessageHash + * @return commitPrepareResponseMessageHash + **/ + @javax.annotation.Nullable + public String getCommitPrepareResponseMessageHash() { + return commitPrepareResponseMessageHash; + } + + + public void setCommitPrepareResponseMessageHash(String commitPrepareResponseMessageHash) { + this.commitPrepareResponseMessageHash = commitPrepareResponseMessageHash; + } + + + public SessionData clientSignatureCommitPreparationRequestMessage(String clientSignatureCommitPreparationRequestMessage) { + + this.clientSignatureCommitPreparationRequestMessage = clientSignatureCommitPreparationRequestMessage; + return this; + } + + /** + * Get clientSignatureCommitPreparationRequestMessage + * @return clientSignatureCommitPreparationRequestMessage + **/ + @javax.annotation.Nullable + public String getClientSignatureCommitPreparationRequestMessage() { + return clientSignatureCommitPreparationRequestMessage; + } + + + public void setClientSignatureCommitPreparationRequestMessage(String clientSignatureCommitPreparationRequestMessage) { + this.clientSignatureCommitPreparationRequestMessage = clientSignatureCommitPreparationRequestMessage; + } + + + public SessionData serverSignatureCommitPreparationResponseMessage(String serverSignatureCommitPreparationResponseMessage) { + + this.serverSignatureCommitPreparationResponseMessage = serverSignatureCommitPreparationResponseMessage; + return this; + } + + /** + * Get serverSignatureCommitPreparationResponseMessage + * @return serverSignatureCommitPreparationResponseMessage + **/ + @javax.annotation.Nullable + public String getServerSignatureCommitPreparationResponseMessage() { + return serverSignatureCommitPreparationResponseMessage; + } + + + public void setServerSignatureCommitPreparationResponseMessage(String serverSignatureCommitPreparationResponseMessage) { + this.serverSignatureCommitPreparationResponseMessage = serverSignatureCommitPreparationResponseMessage; + } + + + public SessionData commitFinalRequestMessageHash(String commitFinalRequestMessageHash) { + + this.commitFinalRequestMessageHash = commitFinalRequestMessageHash; + return this; + } + + /** + * Get commitFinalRequestMessageHash + * @return commitFinalRequestMessageHash + **/ + @javax.annotation.Nullable + public String getCommitFinalRequestMessageHash() { + return commitFinalRequestMessageHash; + } + + + public void setCommitFinalRequestMessageHash(String commitFinalRequestMessageHash) { + this.commitFinalRequestMessageHash = commitFinalRequestMessageHash; + } + + + public SessionData commitFinalResponseMessageHash(String commitFinalResponseMessageHash) { + + this.commitFinalResponseMessageHash = commitFinalResponseMessageHash; + return this; + } + + /** + * Get commitFinalResponseMessageHash + * @return commitFinalResponseMessageHash + **/ + @javax.annotation.Nullable + public String getCommitFinalResponseMessageHash() { + return commitFinalResponseMessageHash; + } + + + public void setCommitFinalResponseMessageHash(String commitFinalResponseMessageHash) { + this.commitFinalResponseMessageHash = commitFinalResponseMessageHash; + } + + + public SessionData commitFinalClaim(String commitFinalClaim) { + + this.commitFinalClaim = commitFinalClaim; + return this; + } + + /** + * Get commitFinalClaim + * @return commitFinalClaim + **/ + @javax.annotation.Nullable + public String getCommitFinalClaim() { + return commitFinalClaim; + } + + + public void setCommitFinalClaim(String commitFinalClaim) { + this.commitFinalClaim = commitFinalClaim; + } + + + public SessionData commitFinalClaimFormat(String commitFinalClaimFormat) { + + this.commitFinalClaimFormat = commitFinalClaimFormat; + return this; + } + + /** + * Get commitFinalClaimFormat + * @return commitFinalClaimFormat + **/ + @javax.annotation.Nullable + public String getCommitFinalClaimFormat() { + return commitFinalClaimFormat; + } + + + public void setCommitFinalClaimFormat(String commitFinalClaimFormat) { + this.commitFinalClaimFormat = commitFinalClaimFormat; + } + + + public SessionData commitAcknowledgementClaim(String commitAcknowledgementClaim) { + + this.commitAcknowledgementClaim = commitAcknowledgementClaim; + return this; + } + + /** + * Get commitAcknowledgementClaim + * @return commitAcknowledgementClaim + **/ + @javax.annotation.Nullable + public String getCommitAcknowledgementClaim() { + return commitAcknowledgementClaim; + } + + + public void setCommitAcknowledgementClaim(String commitAcknowledgementClaim) { + this.commitAcknowledgementClaim = commitAcknowledgementClaim; + } + + + public SessionData commitAcknowledgementClaimFormat(String commitAcknowledgementClaimFormat) { + + this.commitAcknowledgementClaimFormat = commitAcknowledgementClaimFormat; + return this; + } + + /** + * Get commitAcknowledgementClaimFormat + * @return commitAcknowledgementClaimFormat + **/ + @javax.annotation.Nullable + public String getCommitAcknowledgementClaimFormat() { + return commitAcknowledgementClaimFormat; + } + + + public void setCommitAcknowledgementClaimFormat(String commitAcknowledgementClaimFormat) { + this.commitAcknowledgementClaimFormat = commitAcknowledgementClaimFormat; + } + + + public SessionData clientSignatureCommitFinalRequestMessage(String clientSignatureCommitFinalRequestMessage) { + + this.clientSignatureCommitFinalRequestMessage = clientSignatureCommitFinalRequestMessage; + return this; + } + + /** + * Get clientSignatureCommitFinalRequestMessage + * @return clientSignatureCommitFinalRequestMessage + **/ + @javax.annotation.Nullable + public String getClientSignatureCommitFinalRequestMessage() { + return clientSignatureCommitFinalRequestMessage; + } + + + public void setClientSignatureCommitFinalRequestMessage(String clientSignatureCommitFinalRequestMessage) { + this.clientSignatureCommitFinalRequestMessage = clientSignatureCommitFinalRequestMessage; + } + + + public SessionData serverSignatureCommitFinalResponseMessage(String serverSignatureCommitFinalResponseMessage) { + + this.serverSignatureCommitFinalResponseMessage = serverSignatureCommitFinalResponseMessage; + return this; + } + + /** + * Get serverSignatureCommitFinalResponseMessage + * @return serverSignatureCommitFinalResponseMessage + **/ + @javax.annotation.Nullable + public String getServerSignatureCommitFinalResponseMessage() { + return serverSignatureCommitFinalResponseMessage; + } + + + public void setServerSignatureCommitFinalResponseMessage(String serverSignatureCommitFinalResponseMessage) { + this.serverSignatureCommitFinalResponseMessage = serverSignatureCommitFinalResponseMessage; + } + + + public SessionData transferCompleteMessageHash(String transferCompleteMessageHash) { + + this.transferCompleteMessageHash = transferCompleteMessageHash; + return this; + } + + /** + * Get transferCompleteMessageHash + * @return transferCompleteMessageHash + **/ + @javax.annotation.Nullable + public String getTransferCompleteMessageHash() { + return transferCompleteMessageHash; + } + + + public void setTransferCompleteMessageHash(String transferCompleteMessageHash) { + this.transferCompleteMessageHash = transferCompleteMessageHash; + } + + + public SessionData clientSignatureTransferCompleteMessage(String clientSignatureTransferCompleteMessage) { + + this.clientSignatureTransferCompleteMessage = clientSignatureTransferCompleteMessage; + return this; + } + + /** + * Get clientSignatureTransferCompleteMessage + * @return clientSignatureTransferCompleteMessage + **/ + @javax.annotation.Nullable + public String getClientSignatureTransferCompleteMessage() { + return clientSignatureTransferCompleteMessage; + } + + + public void setClientSignatureTransferCompleteMessage(String clientSignatureTransferCompleteMessage) { + this.clientSignatureTransferCompleteMessage = clientSignatureTransferCompleteMessage; + } + + + public SessionData maxRetries(BigDecimal maxRetries) { + + this.maxRetries = maxRetries; + return this; + } + + /** + * Get maxRetries + * @return maxRetries + **/ + @javax.annotation.Nullable + public BigDecimal getMaxRetries() { + return maxRetries; + } + + + public void setMaxRetries(BigDecimal maxRetries) { + this.maxRetries = maxRetries; + } + + + public SessionData recipientLedgerAssetID(String recipientLedgerAssetID) { + + this.recipientLedgerAssetID = recipientLedgerAssetID; + return this; + } + + /** + * Get recipientLedgerAssetID + * @return recipientLedgerAssetID + **/ + @javax.annotation.Nullable + public String getRecipientLedgerAssetID() { + return recipientLedgerAssetID; + } + + + public void setRecipientLedgerAssetID(String recipientLedgerAssetID) { + this.recipientLedgerAssetID = recipientLedgerAssetID; + } + + + public SessionData sourceLedgerAssetID(String sourceLedgerAssetID) { + + this.sourceLedgerAssetID = sourceLedgerAssetID; + return this; + } + + /** + * Get sourceLedgerAssetID + * @return sourceLedgerAssetID + **/ + @javax.annotation.Nullable + public String getSourceLedgerAssetID() { + return sourceLedgerAssetID; + } + + + public void setSourceLedgerAssetID(String sourceLedgerAssetID) { + this.sourceLedgerAssetID = sourceLedgerAssetID; + } + + + public SessionData maxTimeout(BigDecimal maxTimeout) { + + this.maxTimeout = maxTimeout; + return this; + } + + /** + * Get maxTimeout + * @return maxTimeout + **/ + @javax.annotation.Nullable + public BigDecimal getMaxTimeout() { + return maxTimeout; + } + + + public void setMaxTimeout(BigDecimal maxTimeout) { + this.maxTimeout = maxTimeout; + } + + + public SessionData lastLogEntryTimestamp(String lastLogEntryTimestamp) { + + this.lastLogEntryTimestamp = lastLogEntryTimestamp; + return this; + } + + /** + * Get lastLogEntryTimestamp + * @return lastLogEntryTimestamp + **/ + @javax.annotation.Nullable + public String getLastLogEntryTimestamp() { + return lastLogEntryTimestamp; + } + + + public void setLastLogEntryTimestamp(String lastLogEntryTimestamp) { + this.lastLogEntryTimestamp = lastLogEntryTimestamp; + } + + + public SessionData unlockAssetClaim(String unlockAssetClaim) { + + this.unlockAssetClaim = unlockAssetClaim; + return this; + } + + /** + * Get unlockAssetClaim + * @return unlockAssetClaim + **/ + @javax.annotation.Nullable + public String getUnlockAssetClaim() { + return unlockAssetClaim; + } + + + public void setUnlockAssetClaim(String unlockAssetClaim) { + this.unlockAssetClaim = unlockAssetClaim; + } + + + public SessionData recreateAssetClaim(String recreateAssetClaim) { + + this.recreateAssetClaim = recreateAssetClaim; + return this; + } + + /** + * Get recreateAssetClaim + * @return recreateAssetClaim + **/ + @javax.annotation.Nullable + public String getRecreateAssetClaim() { + return recreateAssetClaim; + } + + + public void setRecreateAssetClaim(String recreateAssetClaim) { + this.recreateAssetClaim = recreateAssetClaim; + } + + + public SessionData deleteAssetClaim(String deleteAssetClaim) { + + this.deleteAssetClaim = deleteAssetClaim; + return this; + } + + /** + * Get deleteAssetClaim + * @return deleteAssetClaim + **/ + @javax.annotation.Nullable + public String getDeleteAssetClaim() { + return deleteAssetClaim; + } + + + public void setDeleteAssetClaim(String deleteAssetClaim) { + this.deleteAssetClaim = deleteAssetClaim; + } + + + public SessionData lastMessageReceivedTimestamp(String lastMessageReceivedTimestamp) { + + this.lastMessageReceivedTimestamp = lastMessageReceivedTimestamp; + return this; + } + + /** + * Get lastMessageReceivedTimestamp + * @return lastMessageReceivedTimestamp + **/ + @javax.annotation.Nullable + public String getLastMessageReceivedTimestamp() { + return lastMessageReceivedTimestamp; + } + + + public void setLastMessageReceivedTimestamp(String lastMessageReceivedTimestamp) { + this.lastMessageReceivedTimestamp = lastMessageReceivedTimestamp; + } + + + public SessionData rollback(Boolean rollback) { + + this.rollback = rollback; + return this; + } + + /** + * Get rollback + * @return rollback + **/ + @javax.annotation.Nullable + public Boolean getRollback() { + return rollback; + } + + + public void setRollback(Boolean rollback) { + this.rollback = rollback; + } + + + public SessionData rollbackMessageHash(String rollbackMessageHash) { + + this.rollbackMessageHash = rollbackMessageHash; + return this; + } + + /** + * Get rollbackMessageHash + * @return rollbackMessageHash + **/ + @javax.annotation.Nullable + public String getRollbackMessageHash() { + return rollbackMessageHash; + } + + + public void setRollbackMessageHash(String rollbackMessageHash) { + this.rollbackMessageHash = rollbackMessageHash; + } + + + public SessionData rollbackProofs(List rollbackProofs) { + + this.rollbackProofs = rollbackProofs; + return this; + } + + public SessionData addRollbackProofsItem(String rollbackProofsItem) { + if (this.rollbackProofs == null) { + this.rollbackProofs = new ArrayList<>(); + } + this.rollbackProofs.add(rollbackProofsItem); + return this; + } + + /** + * Get rollbackProofs + * @return rollbackProofs + **/ + @javax.annotation.Nullable + public List getRollbackProofs() { + return rollbackProofs; + } + + + public void setRollbackProofs(List rollbackProofs) { + this.rollbackProofs = rollbackProofs; + } + + + public SessionData rollbackActionsPerformed(List rollbackActionsPerformed) { + + this.rollbackActionsPerformed = rollbackActionsPerformed; + return this; + } + + public SessionData addRollbackActionsPerformedItem(RollbackActionsPerformedEnum rollbackActionsPerformedItem) { + if (this.rollbackActionsPerformed == null) { + this.rollbackActionsPerformed = new ArrayList<>(); + } + this.rollbackActionsPerformed.add(rollbackActionsPerformedItem); + return this; + } + + /** + * Get rollbackActionsPerformed + * @return rollbackActionsPerformed + **/ + @javax.annotation.Nullable + public List getRollbackActionsPerformed() { + return rollbackActionsPerformed; + } + + + public void setRollbackActionsPerformed(List rollbackActionsPerformed) { + this.rollbackActionsPerformed = rollbackActionsPerformed; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SessionData sessionData = (SessionData) o; + return Objects.equals(this.id, sessionData.id) && + Objects.equals(this.step, sessionData.step) && + Objects.equals(this.version, sessionData.version) && + Objects.equals(this.lastSequenceNumber, sessionData.lastSequenceNumber) && + Objects.equals(this.loggingProfile, sessionData.loggingProfile) && + Objects.equals(this.accessControlProfile, sessionData.accessControlProfile) && + Objects.equals(this.applicationProfile, sessionData.applicationProfile) && + Objects.equals(this.payloadProfile, sessionData.payloadProfile) && + Objects.equals(this.assetProfile, sessionData.assetProfile) && + Objects.equals(this.allowedSourceBackupGateways, sessionData.allowedSourceBackupGateways) && + Objects.equals(this.allowedRecipientBackupGateways, sessionData.allowedRecipientBackupGateways) && + Objects.equals(this.sourceBasePath, sessionData.sourceBasePath) && + Objects.equals(this.recipientBasePath, sessionData.recipientBasePath) && + Objects.equals(this.originatorPubkey, sessionData.originatorPubkey) && + Objects.equals(this.beneficiaryPubkey, sessionData.beneficiaryPubkey) && + Objects.equals(this.sourceGatewayPubkey, sessionData.sourceGatewayPubkey) && + Objects.equals(this.sourceGatewayDltSystem, sessionData.sourceGatewayDltSystem) && + Objects.equals(this.recipientGatewayPubkey, sessionData.recipientGatewayPubkey) && + Objects.equals(this.recipientGatewayDltSystem, sessionData.recipientGatewayDltSystem) && + Objects.equals(this.initializationRequestMessageHash, sessionData.initializationRequestMessageHash) && + Objects.equals(this.initializationResponseMessageHash, sessionData.initializationResponseMessageHash) && + Objects.equals(this.initializationRequestMessageRcvTimeStamp, sessionData.initializationRequestMessageRcvTimeStamp) && + Objects.equals(this.initializationRequestMessageProcessedTimeStamp, sessionData.initializationRequestMessageProcessedTimeStamp) && + Objects.equals(this.clientSignatureInitializationRequestMessage, sessionData.clientSignatureInitializationRequestMessage) && + Objects.equals(this.serverSignatureInitializationResponseMessage, sessionData.serverSignatureInitializationResponseMessage) && + Objects.equals(this.transferCommenceMessageRequestHash, sessionData.transferCommenceMessageRequestHash) && + Objects.equals(this.transferCommenceMessageResponseHash, sessionData.transferCommenceMessageResponseHash) && + Objects.equals(this.clientSignatureTransferCommenceRequestMessage, sessionData.clientSignatureTransferCommenceRequestMessage) && + Objects.equals(this.serverSignatureTransferCommenceResponseMessage, sessionData.serverSignatureTransferCommenceResponseMessage) && + Objects.equals(this.lockEvidenceRequestMessageHash, sessionData.lockEvidenceRequestMessageHash) && + Objects.equals(this.lockEvidenceResponseMessageHash, sessionData.lockEvidenceResponseMessageHash) && + Objects.equals(this.clientSignatureLockEvidenceRequestMessage, sessionData.clientSignatureLockEvidenceRequestMessage) && + Objects.equals(this.serverSignatureLockEvidenceResponseMessage, sessionData.serverSignatureLockEvidenceResponseMessage) && + Objects.equals(this.lockEvidenceClaim, sessionData.lockEvidenceClaim) && + Objects.equals(this.commitPrepareRequestMessageHash, sessionData.commitPrepareRequestMessageHash) && + Objects.equals(this.commitPrepareResponseMessageHash, sessionData.commitPrepareResponseMessageHash) && + Objects.equals(this.clientSignatureCommitPreparationRequestMessage, sessionData.clientSignatureCommitPreparationRequestMessage) && + Objects.equals(this.serverSignatureCommitPreparationResponseMessage, sessionData.serverSignatureCommitPreparationResponseMessage) && + Objects.equals(this.commitFinalRequestMessageHash, sessionData.commitFinalRequestMessageHash) && + Objects.equals(this.commitFinalResponseMessageHash, sessionData.commitFinalResponseMessageHash) && + Objects.equals(this.commitFinalClaim, sessionData.commitFinalClaim) && + Objects.equals(this.commitFinalClaimFormat, sessionData.commitFinalClaimFormat) && + Objects.equals(this.commitAcknowledgementClaim, sessionData.commitAcknowledgementClaim) && + Objects.equals(this.commitAcknowledgementClaimFormat, sessionData.commitAcknowledgementClaimFormat) && + Objects.equals(this.clientSignatureCommitFinalRequestMessage, sessionData.clientSignatureCommitFinalRequestMessage) && + Objects.equals(this.serverSignatureCommitFinalResponseMessage, sessionData.serverSignatureCommitFinalResponseMessage) && + Objects.equals(this.transferCompleteMessageHash, sessionData.transferCompleteMessageHash) && + Objects.equals(this.clientSignatureTransferCompleteMessage, sessionData.clientSignatureTransferCompleteMessage) && + Objects.equals(this.maxRetries, sessionData.maxRetries) && + Objects.equals(this.recipientLedgerAssetID, sessionData.recipientLedgerAssetID) && + Objects.equals(this.sourceLedgerAssetID, sessionData.sourceLedgerAssetID) && + Objects.equals(this.maxTimeout, sessionData.maxTimeout) && + Objects.equals(this.lastLogEntryTimestamp, sessionData.lastLogEntryTimestamp) && + Objects.equals(this.unlockAssetClaim, sessionData.unlockAssetClaim) && + Objects.equals(this.recreateAssetClaim, sessionData.recreateAssetClaim) && + Objects.equals(this.deleteAssetClaim, sessionData.deleteAssetClaim) && + Objects.equals(this.lastMessageReceivedTimestamp, sessionData.lastMessageReceivedTimestamp) && + Objects.equals(this.rollback, sessionData.rollback) && + Objects.equals(this.rollbackMessageHash, sessionData.rollbackMessageHash) && + Objects.equals(this.rollbackProofs, sessionData.rollbackProofs) && + Objects.equals(this.rollbackActionsPerformed, sessionData.rollbackActionsPerformed); + } + + @Override + public int hashCode() { + return Objects.hash(id, step, version, lastSequenceNumber, loggingProfile, accessControlProfile, applicationProfile, payloadProfile, assetProfile, allowedSourceBackupGateways, allowedRecipientBackupGateways, sourceBasePath, recipientBasePath, originatorPubkey, beneficiaryPubkey, sourceGatewayPubkey, sourceGatewayDltSystem, recipientGatewayPubkey, recipientGatewayDltSystem, initializationRequestMessageHash, initializationResponseMessageHash, initializationRequestMessageRcvTimeStamp, initializationRequestMessageProcessedTimeStamp, clientSignatureInitializationRequestMessage, serverSignatureInitializationResponseMessage, transferCommenceMessageRequestHash, transferCommenceMessageResponseHash, clientSignatureTransferCommenceRequestMessage, serverSignatureTransferCommenceResponseMessage, lockEvidenceRequestMessageHash, lockEvidenceResponseMessageHash, clientSignatureLockEvidenceRequestMessage, serverSignatureLockEvidenceResponseMessage, lockEvidenceClaim, commitPrepareRequestMessageHash, commitPrepareResponseMessageHash, clientSignatureCommitPreparationRequestMessage, serverSignatureCommitPreparationResponseMessage, commitFinalRequestMessageHash, commitFinalResponseMessageHash, commitFinalClaim, commitFinalClaimFormat, commitAcknowledgementClaim, commitAcknowledgementClaimFormat, clientSignatureCommitFinalRequestMessage, serverSignatureCommitFinalResponseMessage, transferCompleteMessageHash, clientSignatureTransferCompleteMessage, maxRetries, recipientLedgerAssetID, sourceLedgerAssetID, maxTimeout, lastLogEntryTimestamp, unlockAssetClaim, recreateAssetClaim, deleteAssetClaim, lastMessageReceivedTimestamp, rollback, rollbackMessageHash, rollbackProofs, rollbackActionsPerformed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SessionData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" step: ").append(toIndentedString(step)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" lastSequenceNumber: ").append(toIndentedString(lastSequenceNumber)).append("\n"); + sb.append(" loggingProfile: ").append(toIndentedString(loggingProfile)).append("\n"); + sb.append(" accessControlProfile: ").append(toIndentedString(accessControlProfile)).append("\n"); + sb.append(" applicationProfile: ").append(toIndentedString(applicationProfile)).append("\n"); + sb.append(" payloadProfile: ").append(toIndentedString(payloadProfile)).append("\n"); + sb.append(" assetProfile: ").append(toIndentedString(assetProfile)).append("\n"); + sb.append(" allowedSourceBackupGateways: ").append(toIndentedString(allowedSourceBackupGateways)).append("\n"); + sb.append(" allowedRecipientBackupGateways: ").append(toIndentedString(allowedRecipientBackupGateways)).append("\n"); + sb.append(" sourceBasePath: ").append(toIndentedString(sourceBasePath)).append("\n"); + sb.append(" recipientBasePath: ").append(toIndentedString(recipientBasePath)).append("\n"); + sb.append(" originatorPubkey: ").append(toIndentedString(originatorPubkey)).append("\n"); + sb.append(" beneficiaryPubkey: ").append(toIndentedString(beneficiaryPubkey)).append("\n"); + sb.append(" sourceGatewayPubkey: ").append(toIndentedString(sourceGatewayPubkey)).append("\n"); + sb.append(" sourceGatewayDltSystem: ").append(toIndentedString(sourceGatewayDltSystem)).append("\n"); + sb.append(" recipientGatewayPubkey: ").append(toIndentedString(recipientGatewayPubkey)).append("\n"); + sb.append(" recipientGatewayDltSystem: ").append(toIndentedString(recipientGatewayDltSystem)).append("\n"); + sb.append(" initializationRequestMessageHash: ").append(toIndentedString(initializationRequestMessageHash)).append("\n"); + sb.append(" initializationResponseMessageHash: ").append(toIndentedString(initializationResponseMessageHash)).append("\n"); + sb.append(" initializationRequestMessageRcvTimeStamp: ").append(toIndentedString(initializationRequestMessageRcvTimeStamp)).append("\n"); + sb.append(" initializationRequestMessageProcessedTimeStamp: ").append(toIndentedString(initializationRequestMessageProcessedTimeStamp)).append("\n"); + sb.append(" clientSignatureInitializationRequestMessage: ").append(toIndentedString(clientSignatureInitializationRequestMessage)).append("\n"); + sb.append(" serverSignatureInitializationResponseMessage: ").append(toIndentedString(serverSignatureInitializationResponseMessage)).append("\n"); + sb.append(" transferCommenceMessageRequestHash: ").append(toIndentedString(transferCommenceMessageRequestHash)).append("\n"); + sb.append(" transferCommenceMessageResponseHash: ").append(toIndentedString(transferCommenceMessageResponseHash)).append("\n"); + sb.append(" clientSignatureTransferCommenceRequestMessage: ").append(toIndentedString(clientSignatureTransferCommenceRequestMessage)).append("\n"); + sb.append(" serverSignatureTransferCommenceResponseMessage: ").append(toIndentedString(serverSignatureTransferCommenceResponseMessage)).append("\n"); + sb.append(" lockEvidenceRequestMessageHash: ").append(toIndentedString(lockEvidenceRequestMessageHash)).append("\n"); + sb.append(" lockEvidenceResponseMessageHash: ").append(toIndentedString(lockEvidenceResponseMessageHash)).append("\n"); + sb.append(" clientSignatureLockEvidenceRequestMessage: ").append(toIndentedString(clientSignatureLockEvidenceRequestMessage)).append("\n"); + sb.append(" serverSignatureLockEvidenceResponseMessage: ").append(toIndentedString(serverSignatureLockEvidenceResponseMessage)).append("\n"); + sb.append(" lockEvidenceClaim: ").append(toIndentedString(lockEvidenceClaim)).append("\n"); + sb.append(" commitPrepareRequestMessageHash: ").append(toIndentedString(commitPrepareRequestMessageHash)).append("\n"); + sb.append(" commitPrepareResponseMessageHash: ").append(toIndentedString(commitPrepareResponseMessageHash)).append("\n"); + sb.append(" clientSignatureCommitPreparationRequestMessage: ").append(toIndentedString(clientSignatureCommitPreparationRequestMessage)).append("\n"); + sb.append(" serverSignatureCommitPreparationResponseMessage: ").append(toIndentedString(serverSignatureCommitPreparationResponseMessage)).append("\n"); + sb.append(" commitFinalRequestMessageHash: ").append(toIndentedString(commitFinalRequestMessageHash)).append("\n"); + sb.append(" commitFinalResponseMessageHash: ").append(toIndentedString(commitFinalResponseMessageHash)).append("\n"); + sb.append(" commitFinalClaim: ").append(toIndentedString(commitFinalClaim)).append("\n"); + sb.append(" commitFinalClaimFormat: ").append(toIndentedString(commitFinalClaimFormat)).append("\n"); + sb.append(" commitAcknowledgementClaim: ").append(toIndentedString(commitAcknowledgementClaim)).append("\n"); + sb.append(" commitAcknowledgementClaimFormat: ").append(toIndentedString(commitAcknowledgementClaimFormat)).append("\n"); + sb.append(" clientSignatureCommitFinalRequestMessage: ").append(toIndentedString(clientSignatureCommitFinalRequestMessage)).append("\n"); + sb.append(" serverSignatureCommitFinalResponseMessage: ").append(toIndentedString(serverSignatureCommitFinalResponseMessage)).append("\n"); + sb.append(" transferCompleteMessageHash: ").append(toIndentedString(transferCompleteMessageHash)).append("\n"); + sb.append(" clientSignatureTransferCompleteMessage: ").append(toIndentedString(clientSignatureTransferCompleteMessage)).append("\n"); + sb.append(" maxRetries: ").append(toIndentedString(maxRetries)).append("\n"); + sb.append(" recipientLedgerAssetID: ").append(toIndentedString(recipientLedgerAssetID)).append("\n"); + sb.append(" sourceLedgerAssetID: ").append(toIndentedString(sourceLedgerAssetID)).append("\n"); + sb.append(" maxTimeout: ").append(toIndentedString(maxTimeout)).append("\n"); + sb.append(" lastLogEntryTimestamp: ").append(toIndentedString(lastLogEntryTimestamp)).append("\n"); + sb.append(" unlockAssetClaim: ").append(toIndentedString(unlockAssetClaim)).append("\n"); + sb.append(" recreateAssetClaim: ").append(toIndentedString(recreateAssetClaim)).append("\n"); + sb.append(" deleteAssetClaim: ").append(toIndentedString(deleteAssetClaim)).append("\n"); + sb.append(" lastMessageReceivedTimestamp: ").append(toIndentedString(lastMessageReceivedTimestamp)).append("\n"); + sb.append(" rollback: ").append(toIndentedString(rollback)).append("\n"); + sb.append(" rollbackMessageHash: ").append(toIndentedString(rollbackMessageHash)).append("\n"); + sb.append(" rollbackProofs: ").append(toIndentedString(rollbackProofs)).append("\n"); + sb.append(" rollbackActionsPerformed: ").append(toIndentedString(rollbackActionsPerformed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("step"); + openapiFields.add("version"); + openapiFields.add("lastSequenceNumber"); + openapiFields.add("loggingProfile"); + openapiFields.add("accessControlProfile"); + openapiFields.add("applicationProfile"); + openapiFields.add("payloadProfile"); + openapiFields.add("assetProfile"); + openapiFields.add("allowedSourceBackupGateways"); + openapiFields.add("allowedRecipientBackupGateways"); + openapiFields.add("sourceBasePath"); + openapiFields.add("recipientBasePath"); + openapiFields.add("originatorPubkey"); + openapiFields.add("beneficiaryPubkey"); + openapiFields.add("sourceGatewayPubkey"); + openapiFields.add("sourceGatewayDltSystem"); + openapiFields.add("recipientGatewayPubkey"); + openapiFields.add("recipientGatewayDltSystem"); + openapiFields.add("initializationRequestMessageHash"); + openapiFields.add("initializationResponseMessageHash"); + openapiFields.add("initializationRequestMessageRcvTimeStamp"); + openapiFields.add("initializationRequestMessageProcessedTimeStamp"); + openapiFields.add("clientSignatureInitializationRequestMessage"); + openapiFields.add("serverSignatureInitializationResponseMessage"); + openapiFields.add("transferCommenceMessageRequestHash"); + openapiFields.add("transferCommenceMessageResponseHash"); + openapiFields.add("clientSignatureTransferCommenceRequestMessage"); + openapiFields.add("serverSignatureTransferCommenceResponseMessage"); + openapiFields.add("lockEvidenceRequestMessageHash"); + openapiFields.add("lockEvidenceResponseMessageHash"); + openapiFields.add("clientSignatureLockEvidenceRequestMessage"); + openapiFields.add("serverSignatureLockEvidenceResponseMessage"); + openapiFields.add("lockEvidenceClaim"); + openapiFields.add("commitPrepareRequestMessageHash"); + openapiFields.add("commitPrepareResponseMessageHash"); + openapiFields.add("clientSignatureCommitPreparationRequestMessage"); + openapiFields.add("serverSignatureCommitPreparationResponseMessage"); + openapiFields.add("commitFinalRequestMessageHash"); + openapiFields.add("commitFinalResponseMessageHash"); + openapiFields.add("commitFinalClaim"); + openapiFields.add("commitFinalClaimFormat"); + openapiFields.add("commitAcknowledgementClaim"); + openapiFields.add("commitAcknowledgementClaimFormat"); + openapiFields.add("clientSignatureCommitFinalRequestMessage"); + openapiFields.add("serverSignatureCommitFinalResponseMessage"); + openapiFields.add("transferCompleteMessageHash"); + openapiFields.add("clientSignatureTransferCompleteMessage"); + openapiFields.add("maxRetries"); + openapiFields.add("recipientLedgerAssetID"); + openapiFields.add("sourceLedgerAssetID"); + openapiFields.add("maxTimeout"); + openapiFields.add("lastLogEntryTimestamp"); + openapiFields.add("unlockAssetClaim"); + openapiFields.add("recreateAssetClaim"); + openapiFields.add("deleteAssetClaim"); + openapiFields.add("lastMessageReceivedTimestamp"); + openapiFields.add("rollback"); + openapiFields.add("rollbackMessageHash"); + openapiFields.add("rollbackProofs"); + openapiFields.add("rollbackActionsPerformed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SessionData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!SessionData.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SessionData is not found in the empty JSON string", SessionData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SessionData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SessionData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + if ((jsonObj.get("loggingProfile") != null && !jsonObj.get("loggingProfile").isJsonNull()) && !jsonObj.get("loggingProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `loggingProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loggingProfile").toString())); + } + if ((jsonObj.get("accessControlProfile") != null && !jsonObj.get("accessControlProfile").isJsonNull()) && !jsonObj.get("accessControlProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accessControlProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accessControlProfile").toString())); + } + if ((jsonObj.get("applicationProfile") != null && !jsonObj.get("applicationProfile").isJsonNull()) && !jsonObj.get("applicationProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `applicationProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("applicationProfile").toString())); + } + // validate the optional field `payloadProfile` + if (jsonObj.get("payloadProfile") != null && !jsonObj.get("payloadProfile").isJsonNull()) { + PayloadProfile.validateJsonObject(jsonObj.getAsJsonObject("payloadProfile")); + } + // validate the optional field `assetProfile` + if (jsonObj.get("assetProfile") != null && !jsonObj.get("assetProfile").isJsonNull()) { + AssetProfile.validateJsonObject(jsonObj.getAsJsonObject("assetProfile")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("allowedSourceBackupGateways") != null && !jsonObj.get("allowedSourceBackupGateways").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `allowedSourceBackupGateways` to be an array in the JSON string but got `%s`", jsonObj.get("allowedSourceBackupGateways").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("allowedRecipientBackupGateways") != null && !jsonObj.get("allowedRecipientBackupGateways").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `allowedRecipientBackupGateways` to be an array in the JSON string but got `%s`", jsonObj.get("allowedRecipientBackupGateways").toString())); + } + if ((jsonObj.get("sourceBasePath") != null && !jsonObj.get("sourceBasePath").isJsonNull()) && !jsonObj.get("sourceBasePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceBasePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceBasePath").toString())); + } + if ((jsonObj.get("recipientBasePath") != null && !jsonObj.get("recipientBasePath").isJsonNull()) && !jsonObj.get("recipientBasePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientBasePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientBasePath").toString())); + } + if ((jsonObj.get("originatorPubkey") != null && !jsonObj.get("originatorPubkey").isJsonNull()) && !jsonObj.get("originatorPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `originatorPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originatorPubkey").toString())); + } + if ((jsonObj.get("beneficiaryPubkey") != null && !jsonObj.get("beneficiaryPubkey").isJsonNull()) && !jsonObj.get("beneficiaryPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `beneficiaryPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("beneficiaryPubkey").toString())); + } + if ((jsonObj.get("sourceGatewayPubkey") != null && !jsonObj.get("sourceGatewayPubkey").isJsonNull()) && !jsonObj.get("sourceGatewayPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceGatewayPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceGatewayPubkey").toString())); + } + if ((jsonObj.get("sourceGatewayDltSystem") != null && !jsonObj.get("sourceGatewayDltSystem").isJsonNull()) && !jsonObj.get("sourceGatewayDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceGatewayDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceGatewayDltSystem").toString())); + } + if ((jsonObj.get("recipientGatewayPubkey") != null && !jsonObj.get("recipientGatewayPubkey").isJsonNull()) && !jsonObj.get("recipientGatewayPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientGatewayPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientGatewayPubkey").toString())); + } + if ((jsonObj.get("recipientGatewayDltSystem") != null && !jsonObj.get("recipientGatewayDltSystem").isJsonNull()) && !jsonObj.get("recipientGatewayDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientGatewayDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientGatewayDltSystem").toString())); + } + if ((jsonObj.get("initializationRequestMessageHash") != null && !jsonObj.get("initializationRequestMessageHash").isJsonNull()) && !jsonObj.get("initializationRequestMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `initializationRequestMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("initializationRequestMessageHash").toString())); + } + if ((jsonObj.get("initializationResponseMessageHash") != null && !jsonObj.get("initializationResponseMessageHash").isJsonNull()) && !jsonObj.get("initializationResponseMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `initializationResponseMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("initializationResponseMessageHash").toString())); + } + if ((jsonObj.get("initializationRequestMessageRcvTimeStamp") != null && !jsonObj.get("initializationRequestMessageRcvTimeStamp").isJsonNull()) && !jsonObj.get("initializationRequestMessageRcvTimeStamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `initializationRequestMessageRcvTimeStamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("initializationRequestMessageRcvTimeStamp").toString())); + } + if ((jsonObj.get("initializationRequestMessageProcessedTimeStamp") != null && !jsonObj.get("initializationRequestMessageProcessedTimeStamp").isJsonNull()) && !jsonObj.get("initializationRequestMessageProcessedTimeStamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `initializationRequestMessageProcessedTimeStamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("initializationRequestMessageProcessedTimeStamp").toString())); + } + if ((jsonObj.get("clientSignatureInitializationRequestMessage") != null && !jsonObj.get("clientSignatureInitializationRequestMessage").isJsonNull()) && !jsonObj.get("clientSignatureInitializationRequestMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientSignatureInitializationRequestMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientSignatureInitializationRequestMessage").toString())); + } + if ((jsonObj.get("serverSignatureInitializationResponseMessage") != null && !jsonObj.get("serverSignatureInitializationResponseMessage").isJsonNull()) && !jsonObj.get("serverSignatureInitializationResponseMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverSignatureInitializationResponseMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverSignatureInitializationResponseMessage").toString())); + } + if ((jsonObj.get("transferCommenceMessageRequestHash") != null && !jsonObj.get("transferCommenceMessageRequestHash").isJsonNull()) && !jsonObj.get("transferCommenceMessageRequestHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transferCommenceMessageRequestHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferCommenceMessageRequestHash").toString())); + } + if ((jsonObj.get("transferCommenceMessageResponseHash") != null && !jsonObj.get("transferCommenceMessageResponseHash").isJsonNull()) && !jsonObj.get("transferCommenceMessageResponseHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transferCommenceMessageResponseHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferCommenceMessageResponseHash").toString())); + } + if ((jsonObj.get("clientSignatureTransferCommenceRequestMessage") != null && !jsonObj.get("clientSignatureTransferCommenceRequestMessage").isJsonNull()) && !jsonObj.get("clientSignatureTransferCommenceRequestMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientSignatureTransferCommenceRequestMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientSignatureTransferCommenceRequestMessage").toString())); + } + if ((jsonObj.get("serverSignatureTransferCommenceResponseMessage") != null && !jsonObj.get("serverSignatureTransferCommenceResponseMessage").isJsonNull()) && !jsonObj.get("serverSignatureTransferCommenceResponseMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverSignatureTransferCommenceResponseMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverSignatureTransferCommenceResponseMessage").toString())); + } + if ((jsonObj.get("lockEvidenceRequestMessageHash") != null && !jsonObj.get("lockEvidenceRequestMessageHash").isJsonNull()) && !jsonObj.get("lockEvidenceRequestMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lockEvidenceRequestMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lockEvidenceRequestMessageHash").toString())); + } + if ((jsonObj.get("lockEvidenceResponseMessageHash") != null && !jsonObj.get("lockEvidenceResponseMessageHash").isJsonNull()) && !jsonObj.get("lockEvidenceResponseMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lockEvidenceResponseMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lockEvidenceResponseMessageHash").toString())); + } + if ((jsonObj.get("clientSignatureLockEvidenceRequestMessage") != null && !jsonObj.get("clientSignatureLockEvidenceRequestMessage").isJsonNull()) && !jsonObj.get("clientSignatureLockEvidenceRequestMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientSignatureLockEvidenceRequestMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientSignatureLockEvidenceRequestMessage").toString())); + } + if ((jsonObj.get("serverSignatureLockEvidenceResponseMessage") != null && !jsonObj.get("serverSignatureLockEvidenceResponseMessage").isJsonNull()) && !jsonObj.get("serverSignatureLockEvidenceResponseMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverSignatureLockEvidenceResponseMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverSignatureLockEvidenceResponseMessage").toString())); + } + if ((jsonObj.get("lockEvidenceClaim") != null && !jsonObj.get("lockEvidenceClaim").isJsonNull()) && !jsonObj.get("lockEvidenceClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lockEvidenceClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lockEvidenceClaim").toString())); + } + if ((jsonObj.get("commitPrepareRequestMessageHash") != null && !jsonObj.get("commitPrepareRequestMessageHash").isJsonNull()) && !jsonObj.get("commitPrepareRequestMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitPrepareRequestMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitPrepareRequestMessageHash").toString())); + } + if ((jsonObj.get("commitPrepareResponseMessageHash") != null && !jsonObj.get("commitPrepareResponseMessageHash").isJsonNull()) && !jsonObj.get("commitPrepareResponseMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitPrepareResponseMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitPrepareResponseMessageHash").toString())); + } + if ((jsonObj.get("clientSignatureCommitPreparationRequestMessage") != null && !jsonObj.get("clientSignatureCommitPreparationRequestMessage").isJsonNull()) && !jsonObj.get("clientSignatureCommitPreparationRequestMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientSignatureCommitPreparationRequestMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientSignatureCommitPreparationRequestMessage").toString())); + } + if ((jsonObj.get("serverSignatureCommitPreparationResponseMessage") != null && !jsonObj.get("serverSignatureCommitPreparationResponseMessage").isJsonNull()) && !jsonObj.get("serverSignatureCommitPreparationResponseMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverSignatureCommitPreparationResponseMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverSignatureCommitPreparationResponseMessage").toString())); + } + if ((jsonObj.get("commitFinalRequestMessageHash") != null && !jsonObj.get("commitFinalRequestMessageHash").isJsonNull()) && !jsonObj.get("commitFinalRequestMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitFinalRequestMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitFinalRequestMessageHash").toString())); + } + if ((jsonObj.get("commitFinalResponseMessageHash") != null && !jsonObj.get("commitFinalResponseMessageHash").isJsonNull()) && !jsonObj.get("commitFinalResponseMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitFinalResponseMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitFinalResponseMessageHash").toString())); + } + if ((jsonObj.get("commitFinalClaim") != null && !jsonObj.get("commitFinalClaim").isJsonNull()) && !jsonObj.get("commitFinalClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitFinalClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitFinalClaim").toString())); + } + if ((jsonObj.get("commitFinalClaimFormat") != null && !jsonObj.get("commitFinalClaimFormat").isJsonNull()) && !jsonObj.get("commitFinalClaimFormat").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitFinalClaimFormat` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitFinalClaimFormat").toString())); + } + if ((jsonObj.get("commitAcknowledgementClaim") != null && !jsonObj.get("commitAcknowledgementClaim").isJsonNull()) && !jsonObj.get("commitAcknowledgementClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitAcknowledgementClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitAcknowledgementClaim").toString())); + } + if ((jsonObj.get("commitAcknowledgementClaimFormat") != null && !jsonObj.get("commitAcknowledgementClaimFormat").isJsonNull()) && !jsonObj.get("commitAcknowledgementClaimFormat").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `commitAcknowledgementClaimFormat` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commitAcknowledgementClaimFormat").toString())); + } + if ((jsonObj.get("clientSignatureCommitFinalRequestMessage") != null && !jsonObj.get("clientSignatureCommitFinalRequestMessage").isJsonNull()) && !jsonObj.get("clientSignatureCommitFinalRequestMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientSignatureCommitFinalRequestMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientSignatureCommitFinalRequestMessage").toString())); + } + if ((jsonObj.get("serverSignatureCommitFinalResponseMessage") != null && !jsonObj.get("serverSignatureCommitFinalResponseMessage").isJsonNull()) && !jsonObj.get("serverSignatureCommitFinalResponseMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverSignatureCommitFinalResponseMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverSignatureCommitFinalResponseMessage").toString())); + } + if ((jsonObj.get("transferCompleteMessageHash") != null && !jsonObj.get("transferCompleteMessageHash").isJsonNull()) && !jsonObj.get("transferCompleteMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transferCompleteMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferCompleteMessageHash").toString())); + } + if ((jsonObj.get("clientSignatureTransferCompleteMessage") != null && !jsonObj.get("clientSignatureTransferCompleteMessage").isJsonNull()) && !jsonObj.get("clientSignatureTransferCompleteMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientSignatureTransferCompleteMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientSignatureTransferCompleteMessage").toString())); + } + if ((jsonObj.get("recipientLedgerAssetID") != null && !jsonObj.get("recipientLedgerAssetID").isJsonNull()) && !jsonObj.get("recipientLedgerAssetID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientLedgerAssetID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientLedgerAssetID").toString())); + } + if ((jsonObj.get("sourceLedgerAssetID") != null && !jsonObj.get("sourceLedgerAssetID").isJsonNull()) && !jsonObj.get("sourceLedgerAssetID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceLedgerAssetID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceLedgerAssetID").toString())); + } + if ((jsonObj.get("lastLogEntryTimestamp") != null && !jsonObj.get("lastLogEntryTimestamp").isJsonNull()) && !jsonObj.get("lastLogEntryTimestamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastLogEntryTimestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastLogEntryTimestamp").toString())); + } + if ((jsonObj.get("unlockAssetClaim") != null && !jsonObj.get("unlockAssetClaim").isJsonNull()) && !jsonObj.get("unlockAssetClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `unlockAssetClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("unlockAssetClaim").toString())); + } + if ((jsonObj.get("recreateAssetClaim") != null && !jsonObj.get("recreateAssetClaim").isJsonNull()) && !jsonObj.get("recreateAssetClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recreateAssetClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recreateAssetClaim").toString())); + } + if ((jsonObj.get("deleteAssetClaim") != null && !jsonObj.get("deleteAssetClaim").isJsonNull()) && !jsonObj.get("deleteAssetClaim").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deleteAssetClaim` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deleteAssetClaim").toString())); + } + if ((jsonObj.get("lastMessageReceivedTimestamp") != null && !jsonObj.get("lastMessageReceivedTimestamp").isJsonNull()) && !jsonObj.get("lastMessageReceivedTimestamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastMessageReceivedTimestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastMessageReceivedTimestamp").toString())); + } + if ((jsonObj.get("rollbackMessageHash") != null && !jsonObj.get("rollbackMessageHash").isJsonNull()) && !jsonObj.get("rollbackMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rollbackMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rollbackMessageHash").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("rollbackProofs") != null && !jsonObj.get("rollbackProofs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rollbackProofs` to be an array in the JSON string but got `%s`", jsonObj.get("rollbackProofs").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("rollbackActionsPerformed") != null && !jsonObj.get("rollbackActionsPerformed").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rollbackActionsPerformed` to be an array in the JSON string but got `%s`", jsonObj.get("rollbackActionsPerformed").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SessionData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SessionData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SessionData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SessionData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SessionData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SessionData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SessionData + * @throws IOException if the JSON string is invalid with respect to SessionData + */ + public static SessionData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SessionData.class); + } + + /** + * Convert an instance of SessionData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCommenceV1Request.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCommenceV1Request.java new file mode 100644 index 00000000000..0dd0d61d519 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCommenceV1Request.java @@ -0,0 +1,633 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TransferCommenceV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransferCommenceV1Request { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_ORIGINATOR_PUBKEY = "originatorPubkey"; + @SerializedName(SERIALIZED_NAME_ORIGINATOR_PUBKEY) + private String originatorPubkey; + + public static final String SERIALIZED_NAME_BENEFICIARY_PUBKEY = "beneficiaryPubkey"; + @SerializedName(SERIALIZED_NAME_BENEFICIARY_PUBKEY) + private String beneficiaryPubkey; + + public static final String SERIALIZED_NAME_SENDER_DLT_SYSTEM = "senderDltSystem"; + @SerializedName(SERIALIZED_NAME_SENDER_DLT_SYSTEM) + private String senderDltSystem; + + public static final String SERIALIZED_NAME_RECIPIENT_DLT_SYSTEM = "recipientDltSystem"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_DLT_SYSTEM) + private String recipientDltSystem; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_HASH_ASSET_PROFILE = "hashAssetProfile"; + @SerializedName(SERIALIZED_NAME_HASH_ASSET_PROFILE) + private String hashAssetProfile; + + public static final String SERIALIZED_NAME_ASSET_UNIT = "assetUnit"; + @SerializedName(SERIALIZED_NAME_ASSET_UNIT) + private Integer assetUnit; + + public static final String SERIALIZED_NAME_HASH_PREV_MESSAGE = "hashPrevMessage"; + @SerializedName(SERIALIZED_NAME_HASH_PREV_MESSAGE) + private String hashPrevMessage; + + public static final String SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER = "clientTransferNumber"; + @SerializedName(SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER) + private Integer clientTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private Integer sequenceNumber; + + public TransferCommenceV1Request() { + } + + public TransferCommenceV1Request sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public TransferCommenceV1Request messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public TransferCommenceV1Request originatorPubkey(String originatorPubkey) { + + this.originatorPubkey = originatorPubkey; + return this; + } + + /** + * Get originatorPubkey + * @return originatorPubkey + **/ + @javax.annotation.Nonnull + public String getOriginatorPubkey() { + return originatorPubkey; + } + + + public void setOriginatorPubkey(String originatorPubkey) { + this.originatorPubkey = originatorPubkey; + } + + + public TransferCommenceV1Request beneficiaryPubkey(String beneficiaryPubkey) { + + this.beneficiaryPubkey = beneficiaryPubkey; + return this; + } + + /** + * Get beneficiaryPubkey + * @return beneficiaryPubkey + **/ + @javax.annotation.Nonnull + public String getBeneficiaryPubkey() { + return beneficiaryPubkey; + } + + + public void setBeneficiaryPubkey(String beneficiaryPubkey) { + this.beneficiaryPubkey = beneficiaryPubkey; + } + + + public TransferCommenceV1Request senderDltSystem(String senderDltSystem) { + + this.senderDltSystem = senderDltSystem; + return this; + } + + /** + * Get senderDltSystem + * @return senderDltSystem + **/ + @javax.annotation.Nonnull + public String getSenderDltSystem() { + return senderDltSystem; + } + + + public void setSenderDltSystem(String senderDltSystem) { + this.senderDltSystem = senderDltSystem; + } + + + public TransferCommenceV1Request recipientDltSystem(String recipientDltSystem) { + + this.recipientDltSystem = recipientDltSystem; + return this; + } + + /** + * Get recipientDltSystem + * @return recipientDltSystem + **/ + @javax.annotation.Nonnull + public String getRecipientDltSystem() { + return recipientDltSystem; + } + + + public void setRecipientDltSystem(String recipientDltSystem) { + this.recipientDltSystem = recipientDltSystem; + } + + + public TransferCommenceV1Request clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public TransferCommenceV1Request serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public TransferCommenceV1Request hashAssetProfile(String hashAssetProfile) { + + this.hashAssetProfile = hashAssetProfile; + return this; + } + + /** + * Get hashAssetProfile + * @return hashAssetProfile + **/ + @javax.annotation.Nonnull + public String getHashAssetProfile() { + return hashAssetProfile; + } + + + public void setHashAssetProfile(String hashAssetProfile) { + this.hashAssetProfile = hashAssetProfile; + } + + + public TransferCommenceV1Request assetUnit(Integer assetUnit) { + + this.assetUnit = assetUnit; + return this; + } + + /** + * Get assetUnit + * @return assetUnit + **/ + @javax.annotation.Nullable + public Integer getAssetUnit() { + return assetUnit; + } + + + public void setAssetUnit(Integer assetUnit) { + this.assetUnit = assetUnit; + } + + + public TransferCommenceV1Request hashPrevMessage(String hashPrevMessage) { + + this.hashPrevMessage = hashPrevMessage; + return this; + } + + /** + * Get hashPrevMessage + * @return hashPrevMessage + **/ + @javax.annotation.Nonnull + public String getHashPrevMessage() { + return hashPrevMessage; + } + + + public void setHashPrevMessage(String hashPrevMessage) { + this.hashPrevMessage = hashPrevMessage; + } + + + public TransferCommenceV1Request clientTransferNumber(Integer clientTransferNumber) { + + this.clientTransferNumber = clientTransferNumber; + return this; + } + + /** + * Get clientTransferNumber + * @return clientTransferNumber + **/ + @javax.annotation.Nullable + public Integer getClientTransferNumber() { + return clientTransferNumber; + } + + + public void setClientTransferNumber(Integer clientTransferNumber) { + this.clientTransferNumber = clientTransferNumber; + } + + + public TransferCommenceV1Request signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public TransferCommenceV1Request sequenceNumber(Integer sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferCommenceV1Request transferCommenceV1Request = (TransferCommenceV1Request) o; + return Objects.equals(this.sessionID, transferCommenceV1Request.sessionID) && + Objects.equals(this.messageType, transferCommenceV1Request.messageType) && + Objects.equals(this.originatorPubkey, transferCommenceV1Request.originatorPubkey) && + Objects.equals(this.beneficiaryPubkey, transferCommenceV1Request.beneficiaryPubkey) && + Objects.equals(this.senderDltSystem, transferCommenceV1Request.senderDltSystem) && + Objects.equals(this.recipientDltSystem, transferCommenceV1Request.recipientDltSystem) && + Objects.equals(this.clientIdentityPubkey, transferCommenceV1Request.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, transferCommenceV1Request.serverIdentityPubkey) && + Objects.equals(this.hashAssetProfile, transferCommenceV1Request.hashAssetProfile) && + Objects.equals(this.assetUnit, transferCommenceV1Request.assetUnit) && + Objects.equals(this.hashPrevMessage, transferCommenceV1Request.hashPrevMessage) && + Objects.equals(this.clientTransferNumber, transferCommenceV1Request.clientTransferNumber) && + Objects.equals(this.signature, transferCommenceV1Request.signature) && + Objects.equals(this.sequenceNumber, transferCommenceV1Request.sequenceNumber); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, messageType, originatorPubkey, beneficiaryPubkey, senderDltSystem, recipientDltSystem, clientIdentityPubkey, serverIdentityPubkey, hashAssetProfile, assetUnit, hashPrevMessage, clientTransferNumber, signature, sequenceNumber); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferCommenceV1Request {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" originatorPubkey: ").append(toIndentedString(originatorPubkey)).append("\n"); + sb.append(" beneficiaryPubkey: ").append(toIndentedString(beneficiaryPubkey)).append("\n"); + sb.append(" senderDltSystem: ").append(toIndentedString(senderDltSystem)).append("\n"); + sb.append(" recipientDltSystem: ").append(toIndentedString(recipientDltSystem)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" hashAssetProfile: ").append(toIndentedString(hashAssetProfile)).append("\n"); + sb.append(" assetUnit: ").append(toIndentedString(assetUnit)).append("\n"); + sb.append(" hashPrevMessage: ").append(toIndentedString(hashPrevMessage)).append("\n"); + sb.append(" clientTransferNumber: ").append(toIndentedString(clientTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("messageType"); + openapiFields.add("originatorPubkey"); + openapiFields.add("beneficiaryPubkey"); + openapiFields.add("senderDltSystem"); + openapiFields.add("recipientDltSystem"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("hashAssetProfile"); + openapiFields.add("assetUnit"); + openapiFields.add("hashPrevMessage"); + openapiFields.add("clientTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("originatorPubkey"); + openapiRequiredFields.add("beneficiaryPubkey"); + openapiRequiredFields.add("senderDltSystem"); + openapiRequiredFields.add("recipientDltSystem"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("hashAssetProfile"); + openapiRequiredFields.add("hashPrevMessage"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferCommenceV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransferCommenceV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferCommenceV1Request is not found in the empty JSON string", TransferCommenceV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferCommenceV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransferCommenceV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransferCommenceV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if (!jsonObj.get("originatorPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `originatorPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originatorPubkey").toString())); + } + if (!jsonObj.get("beneficiaryPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `beneficiaryPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("beneficiaryPubkey").toString())); + } + if (!jsonObj.get("senderDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `senderDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("senderDltSystem").toString())); + } + if (!jsonObj.get("recipientDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientDltSystem").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("hashAssetProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashAssetProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashAssetProfile").toString())); + } + if (!jsonObj.get("hashPrevMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashPrevMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashPrevMessage").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransferCommenceV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferCommenceV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferCommenceV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferCommenceV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferCommenceV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferCommenceV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferCommenceV1Request + * @throws IOException if the JSON string is invalid with respect to TransferCommenceV1Request + */ + public static TransferCommenceV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferCommenceV1Request.class); + } + + /** + * Convert an instance of TransferCommenceV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCommenceV1Response.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCommenceV1Response.java new file mode 100644 index 00000000000..2576995e7fb --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCommenceV1Response.java @@ -0,0 +1,477 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TransferCommenceV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransferCommenceV1Response { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_HASH_COMMENCE_REQUEST = "hashCommenceRequest"; + @SerializedName(SERIALIZED_NAME_HASH_COMMENCE_REQUEST) + private String hashCommenceRequest; + + public static final String SERIALIZED_NAME_SERVER_TRANSFER_NUMBER = "serverTransferNumber"; + @SerializedName(SERIALIZED_NAME_SERVER_TRANSFER_NUMBER) + private Integer serverTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_MESSAGE_HASH = "messageHash"; + @SerializedName(SERIALIZED_NAME_MESSAGE_HASH) + private String messageHash; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public TransferCommenceV1Response() { + } + + public TransferCommenceV1Response sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public TransferCommenceV1Response clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public TransferCommenceV1Response serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public TransferCommenceV1Response hashCommenceRequest(String hashCommenceRequest) { + + this.hashCommenceRequest = hashCommenceRequest; + return this; + } + + /** + * Get hashCommenceRequest + * @return hashCommenceRequest + **/ + @javax.annotation.Nonnull + public String getHashCommenceRequest() { + return hashCommenceRequest; + } + + + public void setHashCommenceRequest(String hashCommenceRequest) { + this.hashCommenceRequest = hashCommenceRequest; + } + + + public TransferCommenceV1Response serverTransferNumber(Integer serverTransferNumber) { + + this.serverTransferNumber = serverTransferNumber; + return this; + } + + /** + * Get serverTransferNumber + * @return serverTransferNumber + **/ + @javax.annotation.Nullable + public Integer getServerTransferNumber() { + return serverTransferNumber; + } + + + public void setServerTransferNumber(Integer serverTransferNumber) { + this.serverTransferNumber = serverTransferNumber; + } + + + public TransferCommenceV1Response signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public TransferCommenceV1Response messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public TransferCommenceV1Response messageHash(String messageHash) { + + this.messageHash = messageHash; + return this; + } + + /** + * Get messageHash + * @return messageHash + **/ + @javax.annotation.Nullable + public String getMessageHash() { + return messageHash; + } + + + public void setMessageHash(String messageHash) { + this.messageHash = messageHash; + } + + + public TransferCommenceV1Response sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferCommenceV1Response transferCommenceV1Response = (TransferCommenceV1Response) o; + return Objects.equals(this.sessionID, transferCommenceV1Response.sessionID) && + Objects.equals(this.clientIdentityPubkey, transferCommenceV1Response.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, transferCommenceV1Response.serverIdentityPubkey) && + Objects.equals(this.hashCommenceRequest, transferCommenceV1Response.hashCommenceRequest) && + Objects.equals(this.serverTransferNumber, transferCommenceV1Response.serverTransferNumber) && + Objects.equals(this.signature, transferCommenceV1Response.signature) && + Objects.equals(this.messageType, transferCommenceV1Response.messageType) && + Objects.equals(this.messageHash, transferCommenceV1Response.messageHash) && + Objects.equals(this.sequenceNumber, transferCommenceV1Response.sequenceNumber); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, clientIdentityPubkey, serverIdentityPubkey, hashCommenceRequest, serverTransferNumber, signature, messageType, messageHash, sequenceNumber); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferCommenceV1Response {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" hashCommenceRequest: ").append(toIndentedString(hashCommenceRequest)).append("\n"); + sb.append(" serverTransferNumber: ").append(toIndentedString(serverTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" messageHash: ").append(toIndentedString(messageHash)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("hashCommenceRequest"); + openapiFields.add("serverTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("messageType"); + openapiFields.add("messageHash"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("hashCommenceRequest"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferCommenceV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransferCommenceV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferCommenceV1Response is not found in the empty JSON string", TransferCommenceV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferCommenceV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransferCommenceV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransferCommenceV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("hashCommenceRequest").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashCommenceRequest` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashCommenceRequest").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if ((jsonObj.get("messageHash") != null && !jsonObj.get("messageHash").isJsonNull()) && !jsonObj.get("messageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransferCommenceV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferCommenceV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferCommenceV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferCommenceV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferCommenceV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferCommenceV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferCommenceV1Response + * @throws IOException if the JSON string is invalid with respect to TransferCommenceV1Response + */ + public static TransferCommenceV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferCommenceV1Response.class); + } + + /** + * Convert an instance of TransferCommenceV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCompleteV1Request.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCompleteV1Request.java new file mode 100644 index 00000000000..e48439375db --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferCompleteV1Request.java @@ -0,0 +1,478 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TransferCompleteV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransferCompleteV1Request { + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY = "clientIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_CLIENT_IDENTITY_PUBKEY) + private String clientIdentityPubkey; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_HASH_COMMIT_FINAL_ACK = "hashCommitFinalAck"; + @SerializedName(SERIALIZED_NAME_HASH_COMMIT_FINAL_ACK) + private String hashCommitFinalAck; + + public static final String SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER = "clientTransferNumber"; + @SerializedName(SERIALIZED_NAME_CLIENT_TRANSFER_NUMBER) + private Integer clientTransferNumber; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_HASH_TRANSFER_COMMENCE = "hashTransferCommence"; + @SerializedName(SERIALIZED_NAME_HASH_TRANSFER_COMMENCE) + private String hashTransferCommence; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + public TransferCompleteV1Request() { + } + + public TransferCompleteV1Request sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public TransferCompleteV1Request messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public TransferCompleteV1Request clientIdentityPubkey(String clientIdentityPubkey) { + + this.clientIdentityPubkey = clientIdentityPubkey; + return this; + } + + /** + * Get clientIdentityPubkey + * @return clientIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getClientIdentityPubkey() { + return clientIdentityPubkey; + } + + + public void setClientIdentityPubkey(String clientIdentityPubkey) { + this.clientIdentityPubkey = clientIdentityPubkey; + } + + + public TransferCompleteV1Request serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public TransferCompleteV1Request hashCommitFinalAck(String hashCommitFinalAck) { + + this.hashCommitFinalAck = hashCommitFinalAck; + return this; + } + + /** + * Get hashCommitFinalAck + * @return hashCommitFinalAck + **/ + @javax.annotation.Nonnull + public String getHashCommitFinalAck() { + return hashCommitFinalAck; + } + + + public void setHashCommitFinalAck(String hashCommitFinalAck) { + this.hashCommitFinalAck = hashCommitFinalAck; + } + + + public TransferCompleteV1Request clientTransferNumber(Integer clientTransferNumber) { + + this.clientTransferNumber = clientTransferNumber; + return this; + } + + /** + * Get clientTransferNumber + * @return clientTransferNumber + **/ + @javax.annotation.Nullable + public Integer getClientTransferNumber() { + return clientTransferNumber; + } + + + public void setClientTransferNumber(Integer clientTransferNumber) { + this.clientTransferNumber = clientTransferNumber; + } + + + public TransferCompleteV1Request signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public TransferCompleteV1Request hashTransferCommence(String hashTransferCommence) { + + this.hashTransferCommence = hashTransferCommence; + return this; + } + + /** + * Get hashTransferCommence + * @return hashTransferCommence + **/ + @javax.annotation.Nonnull + public String getHashTransferCommence() { + return hashTransferCommence; + } + + + public void setHashTransferCommence(String hashTransferCommence) { + this.hashTransferCommence = hashTransferCommence; + } + + + public TransferCompleteV1Request sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferCompleteV1Request transferCompleteV1Request = (TransferCompleteV1Request) o; + return Objects.equals(this.sessionID, transferCompleteV1Request.sessionID) && + Objects.equals(this.messageType, transferCompleteV1Request.messageType) && + Objects.equals(this.clientIdentityPubkey, transferCompleteV1Request.clientIdentityPubkey) && + Objects.equals(this.serverIdentityPubkey, transferCompleteV1Request.serverIdentityPubkey) && + Objects.equals(this.hashCommitFinalAck, transferCompleteV1Request.hashCommitFinalAck) && + Objects.equals(this.clientTransferNumber, transferCompleteV1Request.clientTransferNumber) && + Objects.equals(this.signature, transferCompleteV1Request.signature) && + Objects.equals(this.hashTransferCommence, transferCompleteV1Request.hashTransferCommence) && + Objects.equals(this.sequenceNumber, transferCompleteV1Request.sequenceNumber); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(sessionID, messageType, clientIdentityPubkey, serverIdentityPubkey, hashCommitFinalAck, clientTransferNumber, signature, hashTransferCommence, sequenceNumber); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferCompleteV1Request {\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" clientIdentityPubkey: ").append(toIndentedString(clientIdentityPubkey)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" hashCommitFinalAck: ").append(toIndentedString(hashCommitFinalAck)).append("\n"); + sb.append(" clientTransferNumber: ").append(toIndentedString(clientTransferNumber)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" hashTransferCommence: ").append(toIndentedString(hashTransferCommence)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sessionID"); + openapiFields.add("messageType"); + openapiFields.add("clientIdentityPubkey"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("hashCommitFinalAck"); + openapiFields.add("clientTransferNumber"); + openapiFields.add("signature"); + openapiFields.add("hashTransferCommence"); + openapiFields.add("sequenceNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("clientIdentityPubkey"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("hashCommitFinalAck"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("hashTransferCommence"); + openapiRequiredFields.add("sequenceNumber"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferCompleteV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransferCompleteV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferCompleteV1Request is not found in the empty JSON string", TransferCompleteV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferCompleteV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransferCompleteV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransferCompleteV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if (!jsonObj.get("clientIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientIdentityPubkey").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("hashCommitFinalAck").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashCommitFinalAck` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashCommitFinalAck").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if (!jsonObj.get("hashTransferCommence").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `hashTransferCommence` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hashTransferCommence").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransferCompleteV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferCompleteV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferCompleteV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferCompleteV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferCompleteV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferCompleteV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferCompleteV1Request + * @throws IOException if the JSON string is invalid with respect to TransferCompleteV1Request + */ + public static TransferCompleteV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferCompleteV1Request.class); + } + + /** + * Convert an instance of TransferCompleteV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferInitializationV1Request.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferInitializationV1Request.java new file mode 100644 index 00000000000..2f1e9598d29 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferInitializationV1Request.java @@ -0,0 +1,1232 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.CredentialProfile; +import org.openapitools.client.model.History; +import org.openapitools.client.model.PayloadProfile; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TransferInitializationV1Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransferInitializationV1Request { + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private String version; + + public static final String SERIALIZED_NAME_DEVELOPER_U_R_N = "developerURN"; + @SerializedName(SERIALIZED_NAME_DEVELOPER_U_R_N) + private String developerURN; + + public static final String SERIALIZED_NAME_CREDENTIAL_PROFILE = "credentialProfile"; + @SerializedName(SERIALIZED_NAME_CREDENTIAL_PROFILE) + private CredentialProfile credentialProfile; + + public static final String SERIALIZED_NAME_PAYLOAD_PROFILE = "payloadProfile"; + @SerializedName(SERIALIZED_NAME_PAYLOAD_PROFILE) + private PayloadProfile payloadProfile; + + public static final String SERIALIZED_NAME_APPLICATION_PROFILE = "applicationProfile"; + @SerializedName(SERIALIZED_NAME_APPLICATION_PROFILE) + private String applicationProfile; + + public static final String SERIALIZED_NAME_LOGGING_PROFILE = "loggingProfile"; + @SerializedName(SERIALIZED_NAME_LOGGING_PROFILE) + private String loggingProfile; + + public static final String SERIALIZED_NAME_ACCESS_CONTROL_PROFILE = "accessControlProfile"; + @SerializedName(SERIALIZED_NAME_ACCESS_CONTROL_PROFILE) + private String accessControlProfile; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_SOURCE_GATEWAY_PUBKEY = "sourceGatewayPubkey"; + @SerializedName(SERIALIZED_NAME_SOURCE_GATEWAY_PUBKEY) + private String sourceGatewayPubkey; + + public static final String SERIALIZED_NAME_SOURCE_GATEWAY_DLT_SYSTEM = "sourceGatewayDltSystem"; + @SerializedName(SERIALIZED_NAME_SOURCE_GATEWAY_DLT_SYSTEM) + private String sourceGatewayDltSystem; + + public static final String SERIALIZED_NAME_RECIPIENT_GATEWAY_PUBKEY = "recipientGatewayPubkey"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_GATEWAY_PUBKEY) + private String recipientGatewayPubkey; + + public static final String SERIALIZED_NAME_RECIPIENT_GATEWAY_DLT_SYSTEM = "recipientGatewayDltSystem"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_GATEWAY_DLT_SYSTEM) + private String recipientGatewayDltSystem; + + /** + * Gets or Sets escrowType + */ + @JsonAdapter(EscrowTypeEnum.Adapter.class) + public enum EscrowTypeEnum { + FAUCET("FAUCET"), + + TIMELOCK("TIMELOCK"), + + HASHLOCK("HASHLOCK"), + + HASHTIMELOCK("HASHTIMELOCK"), + + MULTICLAIMPC("MULTICLAIMPC"), + + DESTROY("DESTROY"), + + BURN("BURN"); + + private String value; + + EscrowTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EscrowTypeEnum fromValue(String value) { + for (EscrowTypeEnum b : EscrowTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EscrowTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EscrowTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EscrowTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ESCROW_TYPE = "escrowType"; + @SerializedName(SERIALIZED_NAME_ESCROW_TYPE) + private EscrowTypeEnum escrowType; + + public static final String SERIALIZED_NAME_EXPIRY_TIME = "expiryTime"; + @SerializedName(SERIALIZED_NAME_EXPIRY_TIME) + private String expiryTime; + + public static final String SERIALIZED_NAME_MULTIPLE_CLAIMS_ALLOWED = "multipleClaimsAllowed"; + @SerializedName(SERIALIZED_NAME_MULTIPLE_CLAIMS_ALLOWED) + private Boolean multipleClaimsAllowed; + + public static final String SERIALIZED_NAME_MULTIPLE_CANCELS_ALLOWED = "multipleCancelsAllowed"; + @SerializedName(SERIALIZED_NAME_MULTIPLE_CANCELS_ALLOWED) + private Boolean multipleCancelsAllowed; + + public static final String SERIALIZED_NAME_PERMISSIONS = "permissions"; + @SerializedName(SERIALIZED_NAME_PERMISSIONS) + private Object permissions; + + public static final String SERIALIZED_NAME_ORIGIN = "origin"; + @SerializedName(SERIALIZED_NAME_ORIGIN) + private String origin; + + public static final String SERIALIZED_NAME_DESTINATION = "destination"; + @SerializedName(SERIALIZED_NAME_DESTINATION) + private String destination; + + public static final String SERIALIZED_NAME_SUBSEQUENT_CALLS = "subsequentCalls"; + @SerializedName(SERIALIZED_NAME_SUBSEQUENT_CALLS) + private Object subsequentCalls; + + public static final String SERIALIZED_NAME_HISTORIES = "histories"; + @SerializedName(SERIALIZED_NAME_HISTORIES) + private List histories; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private Integer sequenceNumber; + + public static final String SERIALIZED_NAME_SOURCE_BASE_PATH = "sourceBasePath"; + @SerializedName(SERIALIZED_NAME_SOURCE_BASE_PATH) + private String sourceBasePath; + + public static final String SERIALIZED_NAME_RECIPIENT_BASE_PATH = "recipientBasePath"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_BASE_PATH) + private String recipientBasePath; + + public static final String SERIALIZED_NAME_MAX_RETRIES = "maxRetries"; + @SerializedName(SERIALIZED_NAME_MAX_RETRIES) + private BigDecimal maxRetries; + + public static final String SERIALIZED_NAME_MAX_TIMEOUT = "maxTimeout"; + @SerializedName(SERIALIZED_NAME_MAX_TIMEOUT) + private BigDecimal maxTimeout; + + public static final String SERIALIZED_NAME_BACKUP_GATEWAYS_ALLOWED = "backupGatewaysAllowed"; + @SerializedName(SERIALIZED_NAME_BACKUP_GATEWAYS_ALLOWED) + private List backupGatewaysAllowed = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RECIPIENT_LEDGER_ASSET_I_D = "recipientLedgerAssetID"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_LEDGER_ASSET_I_D) + private String recipientLedgerAssetID; + + public static final String SERIALIZED_NAME_SOURCE_LEDGER_ASSET_I_D = "sourceLedgerAssetID"; + @SerializedName(SERIALIZED_NAME_SOURCE_LEDGER_ASSET_I_D) + private String sourceLedgerAssetID; + + public TransferInitializationV1Request() { + } + + public TransferInitializationV1Request messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public TransferInitializationV1Request sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public TransferInitializationV1Request version(String version) { + + this.version = version; + return this; + } + + /** + * Get version + * @return version + **/ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + + public void setVersion(String version) { + this.version = version; + } + + + public TransferInitializationV1Request developerURN(String developerURN) { + + this.developerURN = developerURN; + return this; + } + + /** + * Get developerURN + * @return developerURN + **/ + @javax.annotation.Nullable + public String getDeveloperURN() { + return developerURN; + } + + + public void setDeveloperURN(String developerURN) { + this.developerURN = developerURN; + } + + + public TransferInitializationV1Request credentialProfile(CredentialProfile credentialProfile) { + + this.credentialProfile = credentialProfile; + return this; + } + + /** + * Get credentialProfile + * @return credentialProfile + **/ + @javax.annotation.Nullable + public CredentialProfile getCredentialProfile() { + return credentialProfile; + } + + + public void setCredentialProfile(CredentialProfile credentialProfile) { + this.credentialProfile = credentialProfile; + } + + + public TransferInitializationV1Request payloadProfile(PayloadProfile payloadProfile) { + + this.payloadProfile = payloadProfile; + return this; + } + + /** + * Get payloadProfile + * @return payloadProfile + **/ + @javax.annotation.Nonnull + public PayloadProfile getPayloadProfile() { + return payloadProfile; + } + + + public void setPayloadProfile(PayloadProfile payloadProfile) { + this.payloadProfile = payloadProfile; + } + + + public TransferInitializationV1Request applicationProfile(String applicationProfile) { + + this.applicationProfile = applicationProfile; + return this; + } + + /** + * Get applicationProfile + * @return applicationProfile + **/ + @javax.annotation.Nonnull + public String getApplicationProfile() { + return applicationProfile; + } + + + public void setApplicationProfile(String applicationProfile) { + this.applicationProfile = applicationProfile; + } + + + public TransferInitializationV1Request loggingProfile(String loggingProfile) { + + this.loggingProfile = loggingProfile; + return this; + } + + /** + * Get loggingProfile + * @return loggingProfile + **/ + @javax.annotation.Nonnull + public String getLoggingProfile() { + return loggingProfile; + } + + + public void setLoggingProfile(String loggingProfile) { + this.loggingProfile = loggingProfile; + } + + + public TransferInitializationV1Request accessControlProfile(String accessControlProfile) { + + this.accessControlProfile = accessControlProfile; + return this; + } + + /** + * Get accessControlProfile + * @return accessControlProfile + **/ + @javax.annotation.Nonnull + public String getAccessControlProfile() { + return accessControlProfile; + } + + + public void setAccessControlProfile(String accessControlProfile) { + this.accessControlProfile = accessControlProfile; + } + + + public TransferInitializationV1Request signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public TransferInitializationV1Request sourceGatewayPubkey(String sourceGatewayPubkey) { + + this.sourceGatewayPubkey = sourceGatewayPubkey; + return this; + } + + /** + * Get sourceGatewayPubkey + * @return sourceGatewayPubkey + **/ + @javax.annotation.Nonnull + public String getSourceGatewayPubkey() { + return sourceGatewayPubkey; + } + + + public void setSourceGatewayPubkey(String sourceGatewayPubkey) { + this.sourceGatewayPubkey = sourceGatewayPubkey; + } + + + public TransferInitializationV1Request sourceGatewayDltSystem(String sourceGatewayDltSystem) { + + this.sourceGatewayDltSystem = sourceGatewayDltSystem; + return this; + } + + /** + * Get sourceGatewayDltSystem + * @return sourceGatewayDltSystem + **/ + @javax.annotation.Nonnull + public String getSourceGatewayDltSystem() { + return sourceGatewayDltSystem; + } + + + public void setSourceGatewayDltSystem(String sourceGatewayDltSystem) { + this.sourceGatewayDltSystem = sourceGatewayDltSystem; + } + + + public TransferInitializationV1Request recipientGatewayPubkey(String recipientGatewayPubkey) { + + this.recipientGatewayPubkey = recipientGatewayPubkey; + return this; + } + + /** + * Get recipientGatewayPubkey + * @return recipientGatewayPubkey + **/ + @javax.annotation.Nonnull + public String getRecipientGatewayPubkey() { + return recipientGatewayPubkey; + } + + + public void setRecipientGatewayPubkey(String recipientGatewayPubkey) { + this.recipientGatewayPubkey = recipientGatewayPubkey; + } + + + public TransferInitializationV1Request recipientGatewayDltSystem(String recipientGatewayDltSystem) { + + this.recipientGatewayDltSystem = recipientGatewayDltSystem; + return this; + } + + /** + * Get recipientGatewayDltSystem + * @return recipientGatewayDltSystem + **/ + @javax.annotation.Nonnull + public String getRecipientGatewayDltSystem() { + return recipientGatewayDltSystem; + } + + + public void setRecipientGatewayDltSystem(String recipientGatewayDltSystem) { + this.recipientGatewayDltSystem = recipientGatewayDltSystem; + } + + + public TransferInitializationV1Request escrowType(EscrowTypeEnum escrowType) { + + this.escrowType = escrowType; + return this; + } + + /** + * Get escrowType + * @return escrowType + **/ + @javax.annotation.Nullable + public EscrowTypeEnum getEscrowType() { + return escrowType; + } + + + public void setEscrowType(EscrowTypeEnum escrowType) { + this.escrowType = escrowType; + } + + + public TransferInitializationV1Request expiryTime(String expiryTime) { + + this.expiryTime = expiryTime; + return this; + } + + /** + * Get expiryTime + * @return expiryTime + **/ + @javax.annotation.Nullable + public String getExpiryTime() { + return expiryTime; + } + + + public void setExpiryTime(String expiryTime) { + this.expiryTime = expiryTime; + } + + + public TransferInitializationV1Request multipleClaimsAllowed(Boolean multipleClaimsAllowed) { + + this.multipleClaimsAllowed = multipleClaimsAllowed; + return this; + } + + /** + * Get multipleClaimsAllowed + * @return multipleClaimsAllowed + **/ + @javax.annotation.Nullable + public Boolean getMultipleClaimsAllowed() { + return multipleClaimsAllowed; + } + + + public void setMultipleClaimsAllowed(Boolean multipleClaimsAllowed) { + this.multipleClaimsAllowed = multipleClaimsAllowed; + } + + + public TransferInitializationV1Request multipleCancelsAllowed(Boolean multipleCancelsAllowed) { + + this.multipleCancelsAllowed = multipleCancelsAllowed; + return this; + } + + /** + * Get multipleCancelsAllowed + * @return multipleCancelsAllowed + **/ + @javax.annotation.Nullable + public Boolean getMultipleCancelsAllowed() { + return multipleCancelsAllowed; + } + + + public void setMultipleCancelsAllowed(Boolean multipleCancelsAllowed) { + this.multipleCancelsAllowed = multipleCancelsAllowed; + } + + + public TransferInitializationV1Request permissions(Object permissions) { + + this.permissions = permissions; + return this; + } + + /** + * Get permissions + * @return permissions + **/ + @javax.annotation.Nullable + public Object getPermissions() { + return permissions; + } + + + public void setPermissions(Object permissions) { + this.permissions = permissions; + } + + + public TransferInitializationV1Request origin(String origin) { + + this.origin = origin; + return this; + } + + /** + * Get origin + * @return origin + **/ + @javax.annotation.Nullable + public String getOrigin() { + return origin; + } + + + public void setOrigin(String origin) { + this.origin = origin; + } + + + public TransferInitializationV1Request destination(String destination) { + + this.destination = destination; + return this; + } + + /** + * Get destination + * @return destination + **/ + @javax.annotation.Nullable + public String getDestination() { + return destination; + } + + + public void setDestination(String destination) { + this.destination = destination; + } + + + public TransferInitializationV1Request subsequentCalls(Object subsequentCalls) { + + this.subsequentCalls = subsequentCalls; + return this; + } + + /** + * Get subsequentCalls + * @return subsequentCalls + **/ + @javax.annotation.Nullable + public Object getSubsequentCalls() { + return subsequentCalls; + } + + + public void setSubsequentCalls(Object subsequentCalls) { + this.subsequentCalls = subsequentCalls; + } + + + public TransferInitializationV1Request histories(List histories) { + + this.histories = histories; + return this; + } + + public TransferInitializationV1Request addHistoriesItem(History historiesItem) { + if (this.histories == null) { + this.histories = new ArrayList<>(); + } + this.histories.add(historiesItem); + return this; + } + + /** + * Get histories + * @return histories + **/ + @javax.annotation.Nullable + public List getHistories() { + return histories; + } + + + public void setHistories(List histories) { + this.histories = histories; + } + + + public TransferInitializationV1Request sequenceNumber(Integer sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + public TransferInitializationV1Request sourceBasePath(String sourceBasePath) { + + this.sourceBasePath = sourceBasePath; + return this; + } + + /** + * Get sourceBasePath + * @return sourceBasePath + **/ + @javax.annotation.Nonnull + public String getSourceBasePath() { + return sourceBasePath; + } + + + public void setSourceBasePath(String sourceBasePath) { + this.sourceBasePath = sourceBasePath; + } + + + public TransferInitializationV1Request recipientBasePath(String recipientBasePath) { + + this.recipientBasePath = recipientBasePath; + return this; + } + + /** + * Get recipientBasePath + * @return recipientBasePath + **/ + @javax.annotation.Nonnull + public String getRecipientBasePath() { + return recipientBasePath; + } + + + public void setRecipientBasePath(String recipientBasePath) { + this.recipientBasePath = recipientBasePath; + } + + + public TransferInitializationV1Request maxRetries(BigDecimal maxRetries) { + + this.maxRetries = maxRetries; + return this; + } + + /** + * Get maxRetries + * @return maxRetries + **/ + @javax.annotation.Nonnull + public BigDecimal getMaxRetries() { + return maxRetries; + } + + + public void setMaxRetries(BigDecimal maxRetries) { + this.maxRetries = maxRetries; + } + + + public TransferInitializationV1Request maxTimeout(BigDecimal maxTimeout) { + + this.maxTimeout = maxTimeout; + return this; + } + + /** + * Get maxTimeout + * @return maxTimeout + **/ + @javax.annotation.Nonnull + public BigDecimal getMaxTimeout() { + return maxTimeout; + } + + + public void setMaxTimeout(BigDecimal maxTimeout) { + this.maxTimeout = maxTimeout; + } + + + public TransferInitializationV1Request backupGatewaysAllowed(List backupGatewaysAllowed) { + + this.backupGatewaysAllowed = backupGatewaysAllowed; + return this; + } + + public TransferInitializationV1Request addBackupGatewaysAllowedItem(String backupGatewaysAllowedItem) { + if (this.backupGatewaysAllowed == null) { + this.backupGatewaysAllowed = new ArrayList<>(); + } + this.backupGatewaysAllowed.add(backupGatewaysAllowedItem); + return this; + } + + /** + * Get backupGatewaysAllowed + * @return backupGatewaysAllowed + **/ + @javax.annotation.Nonnull + public List getBackupGatewaysAllowed() { + return backupGatewaysAllowed; + } + + + public void setBackupGatewaysAllowed(List backupGatewaysAllowed) { + this.backupGatewaysAllowed = backupGatewaysAllowed; + } + + + public TransferInitializationV1Request recipientLedgerAssetID(String recipientLedgerAssetID) { + + this.recipientLedgerAssetID = recipientLedgerAssetID; + return this; + } + + /** + * Get recipientLedgerAssetID + * @return recipientLedgerAssetID + **/ + @javax.annotation.Nonnull + public String getRecipientLedgerAssetID() { + return recipientLedgerAssetID; + } + + + public void setRecipientLedgerAssetID(String recipientLedgerAssetID) { + this.recipientLedgerAssetID = recipientLedgerAssetID; + } + + + public TransferInitializationV1Request sourceLedgerAssetID(String sourceLedgerAssetID) { + + this.sourceLedgerAssetID = sourceLedgerAssetID; + return this; + } + + /** + * Get sourceLedgerAssetID + * @return sourceLedgerAssetID + **/ + @javax.annotation.Nonnull + public String getSourceLedgerAssetID() { + return sourceLedgerAssetID; + } + + + public void setSourceLedgerAssetID(String sourceLedgerAssetID) { + this.sourceLedgerAssetID = sourceLedgerAssetID; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferInitializationV1Request transferInitializationV1Request = (TransferInitializationV1Request) o; + return Objects.equals(this.messageType, transferInitializationV1Request.messageType) && + Objects.equals(this.sessionID, transferInitializationV1Request.sessionID) && + Objects.equals(this.version, transferInitializationV1Request.version) && + Objects.equals(this.developerURN, transferInitializationV1Request.developerURN) && + Objects.equals(this.credentialProfile, transferInitializationV1Request.credentialProfile) && + Objects.equals(this.payloadProfile, transferInitializationV1Request.payloadProfile) && + Objects.equals(this.applicationProfile, transferInitializationV1Request.applicationProfile) && + Objects.equals(this.loggingProfile, transferInitializationV1Request.loggingProfile) && + Objects.equals(this.accessControlProfile, transferInitializationV1Request.accessControlProfile) && + Objects.equals(this.signature, transferInitializationV1Request.signature) && + Objects.equals(this.sourceGatewayPubkey, transferInitializationV1Request.sourceGatewayPubkey) && + Objects.equals(this.sourceGatewayDltSystem, transferInitializationV1Request.sourceGatewayDltSystem) && + Objects.equals(this.recipientGatewayPubkey, transferInitializationV1Request.recipientGatewayPubkey) && + Objects.equals(this.recipientGatewayDltSystem, transferInitializationV1Request.recipientGatewayDltSystem) && + Objects.equals(this.escrowType, transferInitializationV1Request.escrowType) && + Objects.equals(this.expiryTime, transferInitializationV1Request.expiryTime) && + Objects.equals(this.multipleClaimsAllowed, transferInitializationV1Request.multipleClaimsAllowed) && + Objects.equals(this.multipleCancelsAllowed, transferInitializationV1Request.multipleCancelsAllowed) && + Objects.equals(this.permissions, transferInitializationV1Request.permissions) && + Objects.equals(this.origin, transferInitializationV1Request.origin) && + Objects.equals(this.destination, transferInitializationV1Request.destination) && + Objects.equals(this.subsequentCalls, transferInitializationV1Request.subsequentCalls) && + Objects.equals(this.histories, transferInitializationV1Request.histories) && + Objects.equals(this.sequenceNumber, transferInitializationV1Request.sequenceNumber) && + Objects.equals(this.sourceBasePath, transferInitializationV1Request.sourceBasePath) && + Objects.equals(this.recipientBasePath, transferInitializationV1Request.recipientBasePath) && + Objects.equals(this.maxRetries, transferInitializationV1Request.maxRetries) && + Objects.equals(this.maxTimeout, transferInitializationV1Request.maxTimeout) && + Objects.equals(this.backupGatewaysAllowed, transferInitializationV1Request.backupGatewaysAllowed) && + Objects.equals(this.recipientLedgerAssetID, transferInitializationV1Request.recipientLedgerAssetID) && + Objects.equals(this.sourceLedgerAssetID, transferInitializationV1Request.sourceLedgerAssetID); + } + + @Override + public int hashCode() { + return Objects.hash(messageType, sessionID, version, developerURN, credentialProfile, payloadProfile, applicationProfile, loggingProfile, accessControlProfile, signature, sourceGatewayPubkey, sourceGatewayDltSystem, recipientGatewayPubkey, recipientGatewayDltSystem, escrowType, expiryTime, multipleClaimsAllowed, multipleCancelsAllowed, permissions, origin, destination, subsequentCalls, histories, sequenceNumber, sourceBasePath, recipientBasePath, maxRetries, maxTimeout, backupGatewaysAllowed, recipientLedgerAssetID, sourceLedgerAssetID); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferInitializationV1Request {\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" developerURN: ").append(toIndentedString(developerURN)).append("\n"); + sb.append(" credentialProfile: ").append(toIndentedString(credentialProfile)).append("\n"); + sb.append(" payloadProfile: ").append(toIndentedString(payloadProfile)).append("\n"); + sb.append(" applicationProfile: ").append(toIndentedString(applicationProfile)).append("\n"); + sb.append(" loggingProfile: ").append(toIndentedString(loggingProfile)).append("\n"); + sb.append(" accessControlProfile: ").append(toIndentedString(accessControlProfile)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" sourceGatewayPubkey: ").append(toIndentedString(sourceGatewayPubkey)).append("\n"); + sb.append(" sourceGatewayDltSystem: ").append(toIndentedString(sourceGatewayDltSystem)).append("\n"); + sb.append(" recipientGatewayPubkey: ").append(toIndentedString(recipientGatewayPubkey)).append("\n"); + sb.append(" recipientGatewayDltSystem: ").append(toIndentedString(recipientGatewayDltSystem)).append("\n"); + sb.append(" escrowType: ").append(toIndentedString(escrowType)).append("\n"); + sb.append(" expiryTime: ").append(toIndentedString(expiryTime)).append("\n"); + sb.append(" multipleClaimsAllowed: ").append(toIndentedString(multipleClaimsAllowed)).append("\n"); + sb.append(" multipleCancelsAllowed: ").append(toIndentedString(multipleCancelsAllowed)).append("\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" subsequentCalls: ").append(toIndentedString(subsequentCalls)).append("\n"); + sb.append(" histories: ").append(toIndentedString(histories)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" sourceBasePath: ").append(toIndentedString(sourceBasePath)).append("\n"); + sb.append(" recipientBasePath: ").append(toIndentedString(recipientBasePath)).append("\n"); + sb.append(" maxRetries: ").append(toIndentedString(maxRetries)).append("\n"); + sb.append(" maxTimeout: ").append(toIndentedString(maxTimeout)).append("\n"); + sb.append(" backupGatewaysAllowed: ").append(toIndentedString(backupGatewaysAllowed)).append("\n"); + sb.append(" recipientLedgerAssetID: ").append(toIndentedString(recipientLedgerAssetID)).append("\n"); + sb.append(" sourceLedgerAssetID: ").append(toIndentedString(sourceLedgerAssetID)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("messageType"); + openapiFields.add("sessionID"); + openapiFields.add("version"); + openapiFields.add("developerURN"); + openapiFields.add("credentialProfile"); + openapiFields.add("payloadProfile"); + openapiFields.add("applicationProfile"); + openapiFields.add("loggingProfile"); + openapiFields.add("accessControlProfile"); + openapiFields.add("signature"); + openapiFields.add("sourceGatewayPubkey"); + openapiFields.add("sourceGatewayDltSystem"); + openapiFields.add("recipientGatewayPubkey"); + openapiFields.add("recipientGatewayDltSystem"); + openapiFields.add("escrowType"); + openapiFields.add("expiryTime"); + openapiFields.add("multipleClaimsAllowed"); + openapiFields.add("multipleCancelsAllowed"); + openapiFields.add("permissions"); + openapiFields.add("origin"); + openapiFields.add("destination"); + openapiFields.add("subsequentCalls"); + openapiFields.add("histories"); + openapiFields.add("sequenceNumber"); + openapiFields.add("sourceBasePath"); + openapiFields.add("recipientBasePath"); + openapiFields.add("maxRetries"); + openapiFields.add("maxTimeout"); + openapiFields.add("backupGatewaysAllowed"); + openapiFields.add("recipientLedgerAssetID"); + openapiFields.add("sourceLedgerAssetID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("payloadProfile"); + openapiRequiredFields.add("applicationProfile"); + openapiRequiredFields.add("loggingProfile"); + openapiRequiredFields.add("accessControlProfile"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("sourceGatewayPubkey"); + openapiRequiredFields.add("sourceGatewayDltSystem"); + openapiRequiredFields.add("recipientGatewayPubkey"); + openapiRequiredFields.add("recipientGatewayDltSystem"); + openapiRequiredFields.add("sequenceNumber"); + openapiRequiredFields.add("sourceBasePath"); + openapiRequiredFields.add("recipientBasePath"); + openapiRequiredFields.add("maxRetries"); + openapiRequiredFields.add("maxTimeout"); + openapiRequiredFields.add("backupGatewaysAllowed"); + openapiRequiredFields.add("recipientLedgerAssetID"); + openapiRequiredFields.add("sourceLedgerAssetID"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferInitializationV1Request + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransferInitializationV1Request.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferInitializationV1Request is not found in the empty JSON string", TransferInitializationV1Request.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferInitializationV1Request.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransferInitializationV1Request` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransferInitializationV1Request.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if ((jsonObj.get("version") != null && !jsonObj.get("version").isJsonNull()) && !jsonObj.get("version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + } + if ((jsonObj.get("developerURN") != null && !jsonObj.get("developerURN").isJsonNull()) && !jsonObj.get("developerURN").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `developerURN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("developerURN").toString())); + } + // validate the required field `payloadProfile` + PayloadProfile.validateJsonObject(jsonObj.getAsJsonObject("payloadProfile")); + if (!jsonObj.get("applicationProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `applicationProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("applicationProfile").toString())); + } + if (!jsonObj.get("loggingProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `loggingProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loggingProfile").toString())); + } + if (!jsonObj.get("accessControlProfile").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accessControlProfile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accessControlProfile").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if (!jsonObj.get("sourceGatewayPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceGatewayPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceGatewayPubkey").toString())); + } + if (!jsonObj.get("sourceGatewayDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceGatewayDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceGatewayDltSystem").toString())); + } + if (!jsonObj.get("recipientGatewayPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientGatewayPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientGatewayPubkey").toString())); + } + if (!jsonObj.get("recipientGatewayDltSystem").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientGatewayDltSystem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientGatewayDltSystem").toString())); + } + if ((jsonObj.get("escrowType") != null && !jsonObj.get("escrowType").isJsonNull()) && !jsonObj.get("escrowType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `escrowType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("escrowType").toString())); + } + if ((jsonObj.get("expiryTime") != null && !jsonObj.get("expiryTime").isJsonNull()) && !jsonObj.get("expiryTime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expiryTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryTime").toString())); + } + if ((jsonObj.get("origin") != null && !jsonObj.get("origin").isJsonNull()) && !jsonObj.get("origin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); + } + if ((jsonObj.get("destination") != null && !jsonObj.get("destination").isJsonNull()) && !jsonObj.get("destination").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `destination` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destination").toString())); + } + if (jsonObj.get("histories") != null && !jsonObj.get("histories").isJsonNull()) { + JsonArray jsonArrayhistories = jsonObj.getAsJsonArray("histories"); + if (jsonArrayhistories != null) { + // ensure the json data is an array + if (!jsonObj.get("histories").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `histories` to be an array in the JSON string but got `%s`", jsonObj.get("histories").toString())); + } + + // validate the optional field `histories` (array) + for (int i = 0; i < jsonArrayhistories.size(); i++) { + History.validateJsonObject(jsonArrayhistories.get(i).getAsJsonObject()); + }; + } + } + if (!jsonObj.get("sourceBasePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceBasePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceBasePath").toString())); + } + if (!jsonObj.get("recipientBasePath").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientBasePath` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientBasePath").toString())); + } + // ensure the required json array is present + if (jsonObj.get("backupGatewaysAllowed") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("backupGatewaysAllowed").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `backupGatewaysAllowed` to be an array in the JSON string but got `%s`", jsonObj.get("backupGatewaysAllowed").toString())); + } + if (!jsonObj.get("recipientLedgerAssetID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientLedgerAssetID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientLedgerAssetID").toString())); + } + if (!jsonObj.get("sourceLedgerAssetID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sourceLedgerAssetID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sourceLedgerAssetID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransferInitializationV1Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferInitializationV1Request' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferInitializationV1Request.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferInitializationV1Request value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferInitializationV1Request read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferInitializationV1Request given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferInitializationV1Request + * @throws IOException if the JSON string is invalid with respect to TransferInitializationV1Request + */ + public static TransferInitializationV1Request fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferInitializationV1Request.class); + } + + /** + * Convert an instance of TransferInitializationV1Request to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferInitializationV1Response.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferInitializationV1Response.java new file mode 100644 index 00000000000..37319179dff --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TransferInitializationV1Response.java @@ -0,0 +1,594 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * TransferInitializationV1Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransferInitializationV1Response { + public static final String SERIALIZED_NAME_MESSAGE_TYPE = "messageType"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TYPE) + private String messageType; + + public static final String SERIALIZED_NAME_SESSION_I_D = "sessionID"; + @SerializedName(SERIALIZED_NAME_SESSION_I_D) + private String sessionID; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private BigDecimal sequenceNumber; + + /** + * Gets or Sets odapPhase + */ + @JsonAdapter(OdapPhaseEnum.Adapter.class) + public enum OdapPhaseEnum { + TRANSFERINITIALIZATION("TransferInitialization"), + + LOCKEVIDENCEVERIFICATION("LockEvidenceVerification"), + + COMMITMENTESTABLISHMENT("CommitmentEstablishment"); + + private String value; + + OdapPhaseEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OdapPhaseEnum fromValue(String value) { + for (OdapPhaseEnum b : OdapPhaseEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OdapPhaseEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OdapPhaseEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OdapPhaseEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ODAP_PHASE = "odapPhase"; + @SerializedName(SERIALIZED_NAME_ODAP_PHASE) + private OdapPhaseEnum odapPhase; + + public static final String SERIALIZED_NAME_INITIAL_REQUEST_MESSAGE_HASH = "initialRequestMessageHash"; + @SerializedName(SERIALIZED_NAME_INITIAL_REQUEST_MESSAGE_HASH) + private String initialRequestMessageHash; + + public static final String SERIALIZED_NAME_DESTINATION = "destination"; + @SerializedName(SERIALIZED_NAME_DESTINATION) + private String destination; + + public static final String SERIALIZED_NAME_TIME_STAMP = "timeStamp"; + @SerializedName(SERIALIZED_NAME_TIME_STAMP) + private String timeStamp; + + public static final String SERIALIZED_NAME_PROCESSED_TIME_STAMP = "processedTimeStamp"; + @SerializedName(SERIALIZED_NAME_PROCESSED_TIME_STAMP) + private String processedTimeStamp; + + public static final String SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY = "serverIdentityPubkey"; + @SerializedName(SERIALIZED_NAME_SERVER_IDENTITY_PUBKEY) + private String serverIdentityPubkey; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + + public static final String SERIALIZED_NAME_BACKUP_GATEWAYS_ALLOWED = "backupGatewaysAllowed"; + @SerializedName(SERIALIZED_NAME_BACKUP_GATEWAYS_ALLOWED) + private List backupGatewaysAllowed = new ArrayList<>(); + + public TransferInitializationV1Response() { + } + + public TransferInitializationV1Response messageType(String messageType) { + + this.messageType = messageType; + return this; + } + + /** + * Get messageType + * @return messageType + **/ + @javax.annotation.Nonnull + public String getMessageType() { + return messageType; + } + + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + + public TransferInitializationV1Response sessionID(String sessionID) { + + this.sessionID = sessionID; + return this; + } + + /** + * Get sessionID + * @return sessionID + **/ + @javax.annotation.Nonnull + public String getSessionID() { + return sessionID; + } + + + public void setSessionID(String sessionID) { + this.sessionID = sessionID; + } + + + public TransferInitializationV1Response sequenceNumber(BigDecimal sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Get sequenceNumber + * @return sequenceNumber + **/ + @javax.annotation.Nonnull + public BigDecimal getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(BigDecimal sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + public TransferInitializationV1Response odapPhase(OdapPhaseEnum odapPhase) { + + this.odapPhase = odapPhase; + return this; + } + + /** + * Get odapPhase + * @return odapPhase + **/ + @javax.annotation.Nullable + public OdapPhaseEnum getOdapPhase() { + return odapPhase; + } + + + public void setOdapPhase(OdapPhaseEnum odapPhase) { + this.odapPhase = odapPhase; + } + + + public TransferInitializationV1Response initialRequestMessageHash(String initialRequestMessageHash) { + + this.initialRequestMessageHash = initialRequestMessageHash; + return this; + } + + /** + * Get initialRequestMessageHash + * @return initialRequestMessageHash + **/ + @javax.annotation.Nonnull + public String getInitialRequestMessageHash() { + return initialRequestMessageHash; + } + + + public void setInitialRequestMessageHash(String initialRequestMessageHash) { + this.initialRequestMessageHash = initialRequestMessageHash; + } + + + public TransferInitializationV1Response destination(String destination) { + + this.destination = destination; + return this; + } + + /** + * Get destination + * @return destination + **/ + @javax.annotation.Nullable + public String getDestination() { + return destination; + } + + + public void setDestination(String destination) { + this.destination = destination; + } + + + public TransferInitializationV1Response timeStamp(String timeStamp) { + + this.timeStamp = timeStamp; + return this; + } + + /** + * Get timeStamp + * @return timeStamp + **/ + @javax.annotation.Nonnull + public String getTimeStamp() { + return timeStamp; + } + + + public void setTimeStamp(String timeStamp) { + this.timeStamp = timeStamp; + } + + + public TransferInitializationV1Response processedTimeStamp(String processedTimeStamp) { + + this.processedTimeStamp = processedTimeStamp; + return this; + } + + /** + * Get processedTimeStamp + * @return processedTimeStamp + **/ + @javax.annotation.Nonnull + public String getProcessedTimeStamp() { + return processedTimeStamp; + } + + + public void setProcessedTimeStamp(String processedTimeStamp) { + this.processedTimeStamp = processedTimeStamp; + } + + + public TransferInitializationV1Response serverIdentityPubkey(String serverIdentityPubkey) { + + this.serverIdentityPubkey = serverIdentityPubkey; + return this; + } + + /** + * Get serverIdentityPubkey + * @return serverIdentityPubkey + **/ + @javax.annotation.Nonnull + public String getServerIdentityPubkey() { + return serverIdentityPubkey; + } + + + public void setServerIdentityPubkey(String serverIdentityPubkey) { + this.serverIdentityPubkey = serverIdentityPubkey; + } + + + public TransferInitializationV1Response signature(String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + **/ + @javax.annotation.Nonnull + public String getSignature() { + return signature; + } + + + public void setSignature(String signature) { + this.signature = signature; + } + + + public TransferInitializationV1Response backupGatewaysAllowed(List backupGatewaysAllowed) { + + this.backupGatewaysAllowed = backupGatewaysAllowed; + return this; + } + + public TransferInitializationV1Response addBackupGatewaysAllowedItem(String backupGatewaysAllowedItem) { + if (this.backupGatewaysAllowed == null) { + this.backupGatewaysAllowed = new ArrayList<>(); + } + this.backupGatewaysAllowed.add(backupGatewaysAllowedItem); + return this; + } + + /** + * Get backupGatewaysAllowed + * @return backupGatewaysAllowed + **/ + @javax.annotation.Nonnull + public List getBackupGatewaysAllowed() { + return backupGatewaysAllowed; + } + + + public void setBackupGatewaysAllowed(List backupGatewaysAllowed) { + this.backupGatewaysAllowed = backupGatewaysAllowed; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferInitializationV1Response transferInitializationV1Response = (TransferInitializationV1Response) o; + return Objects.equals(this.messageType, transferInitializationV1Response.messageType) && + Objects.equals(this.sessionID, transferInitializationV1Response.sessionID) && + Objects.equals(this.sequenceNumber, transferInitializationV1Response.sequenceNumber) && + Objects.equals(this.odapPhase, transferInitializationV1Response.odapPhase) && + Objects.equals(this.initialRequestMessageHash, transferInitializationV1Response.initialRequestMessageHash) && + Objects.equals(this.destination, transferInitializationV1Response.destination) && + Objects.equals(this.timeStamp, transferInitializationV1Response.timeStamp) && + Objects.equals(this.processedTimeStamp, transferInitializationV1Response.processedTimeStamp) && + Objects.equals(this.serverIdentityPubkey, transferInitializationV1Response.serverIdentityPubkey) && + Objects.equals(this.signature, transferInitializationV1Response.signature) && + Objects.equals(this.backupGatewaysAllowed, transferInitializationV1Response.backupGatewaysAllowed); + } + + @Override + public int hashCode() { + return Objects.hash(messageType, sessionID, sequenceNumber, odapPhase, initialRequestMessageHash, destination, timeStamp, processedTimeStamp, serverIdentityPubkey, signature, backupGatewaysAllowed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferInitializationV1Response {\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" sessionID: ").append(toIndentedString(sessionID)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" odapPhase: ").append(toIndentedString(odapPhase)).append("\n"); + sb.append(" initialRequestMessageHash: ").append(toIndentedString(initialRequestMessageHash)).append("\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" timeStamp: ").append(toIndentedString(timeStamp)).append("\n"); + sb.append(" processedTimeStamp: ").append(toIndentedString(processedTimeStamp)).append("\n"); + sb.append(" serverIdentityPubkey: ").append(toIndentedString(serverIdentityPubkey)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" backupGatewaysAllowed: ").append(toIndentedString(backupGatewaysAllowed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("messageType"); + openapiFields.add("sessionID"); + openapiFields.add("sequenceNumber"); + openapiFields.add("odapPhase"); + openapiFields.add("initialRequestMessageHash"); + openapiFields.add("destination"); + openapiFields.add("timeStamp"); + openapiFields.add("processedTimeStamp"); + openapiFields.add("serverIdentityPubkey"); + openapiFields.add("signature"); + openapiFields.add("backupGatewaysAllowed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("messageType"); + openapiRequiredFields.add("sessionID"); + openapiRequiredFields.add("sequenceNumber"); + openapiRequiredFields.add("initialRequestMessageHash"); + openapiRequiredFields.add("timeStamp"); + openapiRequiredFields.add("processedTimeStamp"); + openapiRequiredFields.add("serverIdentityPubkey"); + openapiRequiredFields.add("signature"); + openapiRequiredFields.add("backupGatewaysAllowed"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferInitializationV1Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TransferInitializationV1Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferInitializationV1Response is not found in the empty JSON string", TransferInitializationV1Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferInitializationV1Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransferInitializationV1Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransferInitializationV1Response.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("messageType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `messageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageType").toString())); + } + if (!jsonObj.get("sessionID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sessionID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionID").toString())); + } + if ((jsonObj.get("odapPhase") != null && !jsonObj.get("odapPhase").isJsonNull()) && !jsonObj.get("odapPhase").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `odapPhase` to be a primitive type in the JSON string but got `%s`", jsonObj.get("odapPhase").toString())); + } + if (!jsonObj.get("initialRequestMessageHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `initialRequestMessageHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("initialRequestMessageHash").toString())); + } + if ((jsonObj.get("destination") != null && !jsonObj.get("destination").isJsonNull()) && !jsonObj.get("destination").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `destination` to be a primitive type in the JSON string but got `%s`", jsonObj.get("destination").toString())); + } + if (!jsonObj.get("timeStamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timeStamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeStamp").toString())); + } + if (!jsonObj.get("processedTimeStamp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `processedTimeStamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processedTimeStamp").toString())); + } + if (!jsonObj.get("serverIdentityPubkey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serverIdentityPubkey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serverIdentityPubkey").toString())); + } + if (!jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + // ensure the required json array is present + if (jsonObj.get("backupGatewaysAllowed") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("backupGatewaysAllowed").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `backupGatewaysAllowed` to be an array in the JSON string but got `%s`", jsonObj.get("backupGatewaysAllowed").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransferInitializationV1Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferInitializationV1Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferInitializationV1Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferInitializationV1Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferInitializationV1Response read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferInitializationV1Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferInitializationV1Response + * @throws IOException if the JSON string is invalid with respect to TransferInitializationV1Response + */ + public static TransferInitializationV1Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferInitializationV1Response.class); + } + + /** + * Convert an instance of TransferInitializationV1Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..70c9966b646 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,267 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.ClientV1Request; +import org.openapitools.client.model.CommitFinalV1Request; +import org.openapitools.client.model.CommitFinalV1Response; +import org.openapitools.client.model.CommitPreparationV1Request; +import org.openapitools.client.model.CommitPreparationV1Response; +import org.openapitools.client.model.LockEvidenceV1Request; +import org.openapitools.client.model.LockEvidenceV1Response; +import org.openapitools.client.model.RecoverSuccessV1Message; +import org.openapitools.client.model.RecoverUpdateAckV1Message; +import org.openapitools.client.model.RecoverUpdateV1Message; +import org.openapitools.client.model.RecoverV1Message; +import org.openapitools.client.model.RollbackAckV1Message; +import org.openapitools.client.model.RollbackV1Message; +import org.openapitools.client.model.TransferCommenceV1Request; +import org.openapitools.client.model.TransferCommenceV1Response; +import org.openapitools.client.model.TransferCompleteV1Request; +import org.openapitools.client.model.TransferInitializationV1Request; +import org.openapitools.client.model.TransferInitializationV1Response; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void clientRequestV1Test() throws ApiException { + ClientV1Request clientV1Request = null; + Object response = api.clientRequestV1(clientV1Request); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase1TransferInitiationRequestV1Test() throws ApiException { + TransferInitializationV1Request transferInitializationV1Request = null; + api.phase1TransferInitiationRequestV1(transferInitializationV1Request); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase1TransferInitiationResponseV1Test() throws ApiException { + TransferInitializationV1Response transferInitializationV1Response = null; + api.phase1TransferInitiationResponseV1(transferInitializationV1Response); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase2LockEvidenceRequestV1Test() throws ApiException { + LockEvidenceV1Request lockEvidenceV1Request = null; + api.phase2LockEvidenceRequestV1(lockEvidenceV1Request); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase2LockEvidenceResponseV1Test() throws ApiException { + LockEvidenceV1Response lockEvidenceV1Response = null; + api.phase2LockEvidenceResponseV1(lockEvidenceV1Response); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase2TransferCommenceRequestV1Test() throws ApiException { + TransferCommenceV1Request transferCommenceV1Request = null; + api.phase2TransferCommenceRequestV1(transferCommenceV1Request); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase2TransferCommenceResponseV1Test() throws ApiException { + TransferCommenceV1Response transferCommenceV1Response = null; + api.phase2TransferCommenceResponseV1(transferCommenceV1Response); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase3CommitFinalRequestV1Test() throws ApiException { + CommitFinalV1Request commitFinalV1Request = null; + api.phase3CommitFinalRequestV1(commitFinalV1Request); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase3CommitFinalResponseV1Test() throws ApiException { + CommitFinalV1Response commitFinalV1Response = null; + api.phase3CommitFinalResponseV1(commitFinalV1Response); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase3CommitPreparationRequestV1Test() throws ApiException { + CommitPreparationV1Request commitPreparationV1Request = null; + api.phase3CommitPreparationRequestV1(commitPreparationV1Request); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase3CommitPreparationResponseV1Test() throws ApiException { + CommitPreparationV1Response commitPreparationV1Response = null; + api.phase3CommitPreparationResponseV1(commitPreparationV1Response); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void phase3TransferCompleteRequestV1Test() throws ApiException { + TransferCompleteV1Request transferCompleteV1Request = null; + api.phase3TransferCompleteRequestV1(transferCompleteV1Request); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void recoverUpdateAckV1MessageTest() throws ApiException { + RecoverUpdateAckV1Message recoverUpdateAckV1Message = null; + api.recoverUpdateAckV1Message(recoverUpdateAckV1Message); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void recoverUpdateV1MessageTest() throws ApiException { + RecoverUpdateV1Message recoverUpdateV1Message = null; + api.recoverUpdateV1Message(recoverUpdateV1Message); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void recoverV1MessageTest() throws ApiException { + RecoverV1Message recoverV1Message = null; + api.recoverV1Message(recoverV1Message); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void recoverV1SuccessTest() throws ApiException { + RecoverSuccessV1Message recoverSuccessV1Message = null; + api.recoverV1Success(recoverSuccessV1Message); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void rollbackAckV1MessageTest() throws ApiException { + RollbackAckV1Message rollbackAckV1Message = null; + api.rollbackAckV1Message(rollbackAckV1Message); + // TODO: test validations + } + + /** + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void rollbackV1MessageTest() throws ApiException { + RollbackV1Message rollbackV1Message = null; + api.rollbackV1Message(rollbackV1Message); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AssetProfileTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AssetProfileTest.java new file mode 100644 index 00000000000..2c156f3c4ae --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/AssetProfileTest.java @@ -0,0 +1,138 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AssetProfile + */ +public class AssetProfileTest { + private final AssetProfile model = new AssetProfile(); + + /** + * Model tests for AssetProfile + */ + @Test + public void testAssetProfile() { + // TODO: test AssetProfile + } + + /** + * Test the property 'issuer' + */ + @Test + public void issuerTest() { + // TODO: test issuer + } + + /** + * Test the property 'assetCode' + */ + @Test + public void assetCodeTest() { + // TODO: test assetCode + } + + /** + * Test the property 'assetCodeType' + */ + @Test + public void assetCodeTypeTest() { + // TODO: test assetCodeType + } + + /** + * Test the property 'issuanceDate' + */ + @Test + public void issuanceDateTest() { + // TODO: test issuanceDate + } + + /** + * Test the property 'expirationDate' + */ + @Test + public void expirationDateTest() { + // TODO: test expirationDate + } + + /** + * Test the property 'verificationEndPoint' + */ + @Test + public void verificationEndPointTest() { + // TODO: test verificationEndPoint + } + + /** + * Test the property 'digitalSignature' + */ + @Test + public void digitalSignatureTest() { + // TODO: test digitalSignature + } + + /** + * Test the property 'prospectusLink' + */ + @Test + public void prospectusLinkTest() { + // TODO: test prospectusLink + } + + /** + * Test the property 'keyInformationLink' + */ + @Test + public void keyInformationLinkTest() { + // TODO: test keyInformationLink + } + + /** + * Test the property 'keyWord' + */ + @Test + public void keyWordTest() { + // TODO: test keyWord + } + + /** + * Test the property 'transferRestriction' + */ + @Test + public void transferRestrictionTest() { + // TODO: test transferRestriction + } + + /** + * Test the property 'ledgerRequirements' + */ + @Test + public void ledgerRequirementsTest() { + // TODO: test ledgerRequirements + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfigurationTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfigurationTest.java new file mode 100644 index 00000000000..8ab4fd23976 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClientV1RequestClientGatewayConfigurationTest.java @@ -0,0 +1,48 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ClientV1RequestClientGatewayConfiguration + */ +public class ClientV1RequestClientGatewayConfigurationTest { + private final ClientV1RequestClientGatewayConfiguration model = new ClientV1RequestClientGatewayConfiguration(); + + /** + * Model tests for ClientV1RequestClientGatewayConfiguration + */ + @Test + public void testClientV1RequestClientGatewayConfiguration() { + // TODO: test ClientV1RequestClientGatewayConfiguration + } + + /** + * Test the property 'apiHost' + */ + @Test + public void apiHostTest() { + // TODO: test apiHost + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClientV1RequestTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClientV1RequestTest.java new file mode 100644 index 00000000000..3c73a6f1dbf --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ClientV1RequestTest.java @@ -0,0 +1,220 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.client.model.AssetProfile; +import org.openapitools.client.model.ClientV1RequestClientGatewayConfiguration; +import org.openapitools.client.model.PayloadProfile; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ClientV1Request + */ +public class ClientV1RequestTest { + private final ClientV1Request model = new ClientV1Request(); + + /** + * Model tests for ClientV1Request + */ + @Test + public void testClientV1Request() { + // TODO: test ClientV1Request + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property 'loggingProfile' + */ + @Test + public void loggingProfileTest() { + // TODO: test loggingProfile + } + + /** + * Test the property 'accessControlProfile' + */ + @Test + public void accessControlProfileTest() { + // TODO: test accessControlProfile + } + + /** + * Test the property 'assetControlProfile' + */ + @Test + public void assetControlProfileTest() { + // TODO: test assetControlProfile + } + + /** + * Test the property 'applicationProfile' + */ + @Test + public void applicationProfileTest() { + // TODO: test applicationProfile + } + + /** + * Test the property 'assetProfile' + */ + @Test + public void assetProfileTest() { + // TODO: test assetProfile + } + + /** + * Test the property 'payloadProfile' + */ + @Test + public void payloadProfileTest() { + // TODO: test payloadProfile + } + + /** + * Test the property 'sourceGatewayDltSystem' + */ + @Test + public void sourceGatewayDltSystemTest() { + // TODO: test sourceGatewayDltSystem + } + + /** + * Test the property 'recipientGatewayDltSystem' + */ + @Test + public void recipientGatewayDltSystemTest() { + // TODO: test recipientGatewayDltSystem + } + + /** + * Test the property 'recipientGatewayPubkey' + */ + @Test + public void recipientGatewayPubkeyTest() { + // TODO: test recipientGatewayPubkey + } + + /** + * Test the property 'originatorPubkey' + */ + @Test + public void originatorPubkeyTest() { + // TODO: test originatorPubkey + } + + /** + * Test the property 'beneficiaryPubkey' + */ + @Test + public void beneficiaryPubkeyTest() { + // TODO: test beneficiaryPubkey + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'clientDltSystem' + */ + @Test + public void clientDltSystemTest() { + // TODO: test clientDltSystem + } + + /** + * Test the property 'serverDltSystem' + */ + @Test + public void serverDltSystemTest() { + // TODO: test serverDltSystem + } + + /** + * Test the property 'clientGatewayConfiguration' + */ + @Test + public void clientGatewayConfigurationTest() { + // TODO: test clientGatewayConfiguration + } + + /** + * Test the property 'serverGatewayConfiguration' + */ + @Test + public void serverGatewayConfigurationTest() { + // TODO: test serverGatewayConfiguration + } + + /** + * Test the property 'maxRetries' + */ + @Test + public void maxRetriesTest() { + // TODO: test maxRetries + } + + /** + * Test the property 'maxTimeout' + */ + @Test + public void maxTimeoutTest() { + // TODO: test maxTimeout + } + + /** + * Test the property 'sourceLedgerAssetID' + */ + @Test + public void sourceLedgerAssetIDTest() { + // TODO: test sourceLedgerAssetID + } + + /** + * Test the property 'recipientLedgerAssetID' + */ + @Test + public void recipientLedgerAssetIDTest() { + // TODO: test recipientLedgerAssetID + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitFinalV1RequestTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitFinalV1RequestTest.java new file mode 100644 index 00000000000..208aa8561e4 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitFinalV1RequestTest.java @@ -0,0 +1,122 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CommitFinalV1Request + */ +public class CommitFinalV1RequestTest { + private final CommitFinalV1Request model = new CommitFinalV1Request(); + + /** + * Model tests for CommitFinalV1Request + */ + @Test + public void testCommitFinalV1Request() { + // TODO: test CommitFinalV1Request + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'commitFinalClaim' + */ + @Test + public void commitFinalClaimTest() { + // TODO: test commitFinalClaim + } + + /** + * Test the property 'commitFinalClaimFormat' + */ + @Test + public void commitFinalClaimFormatTest() { + // TODO: test commitFinalClaimFormat + } + + /** + * Test the property 'hashCommitPrepareAck' + */ + @Test + public void hashCommitPrepareAckTest() { + // TODO: test hashCommitPrepareAck + } + + /** + * Test the property 'clientTransferNumber' + */ + @Test + public void clientTransferNumberTest() { + // TODO: test clientTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitFinalV1ResponseTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitFinalV1ResponseTest.java new file mode 100644 index 00000000000..f12fe74994f --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitFinalV1ResponseTest.java @@ -0,0 +1,121 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CommitFinalV1Response + */ +public class CommitFinalV1ResponseTest { + private final CommitFinalV1Response model = new CommitFinalV1Response(); + + /** + * Model tests for CommitFinalV1Response + */ + @Test + public void testCommitFinalV1Response() { + // TODO: test CommitFinalV1Response + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'commitAcknowledgementClaim' + */ + @Test + public void commitAcknowledgementClaimTest() { + // TODO: test commitAcknowledgementClaim + } + + /** + * Test the property 'commitAcknowledgementClaimFormat' + */ + @Test + public void commitAcknowledgementClaimFormatTest() { + // TODO: test commitAcknowledgementClaimFormat + } + + /** + * Test the property 'hashCommitFinal' + */ + @Test + public void hashCommitFinalTest() { + // TODO: test hashCommitFinal + } + + /** + * Test the property 'serverTransferNumber' + */ + @Test + public void serverTransferNumberTest() { + // TODO: test serverTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitPreparationV1RequestTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitPreparationV1RequestTest.java new file mode 100644 index 00000000000..d92a3ef9026 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitPreparationV1RequestTest.java @@ -0,0 +1,105 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CommitPreparationV1Request + */ +public class CommitPreparationV1RequestTest { + private final CommitPreparationV1Request model = new CommitPreparationV1Request(); + + /** + * Model tests for CommitPreparationV1Request + */ + @Test + public void testCommitPreparationV1Request() { + // TODO: test CommitPreparationV1Request + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'hashLockEvidenceAck' + */ + @Test + public void hashLockEvidenceAckTest() { + // TODO: test hashLockEvidenceAck + } + + /** + * Test the property 'clientTransferNumber' + */ + @Test + public void clientTransferNumberTest() { + // TODO: test clientTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitPreparationV1ResponseTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitPreparationV1ResponseTest.java new file mode 100644 index 00000000000..5acbcde7d34 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CommitPreparationV1ResponseTest.java @@ -0,0 +1,105 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CommitPreparationV1Response + */ +public class CommitPreparationV1ResponseTest { + private final CommitPreparationV1Response model = new CommitPreparationV1Response(); + + /** + * Model tests for CommitPreparationV1Response + */ + @Test + public void testCommitPreparationV1Response() { + // TODO: test CommitPreparationV1Response + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'hashCommitPrep' + */ + @Test + public void hashCommitPrepTest() { + // TODO: test hashCommitPrep + } + + /** + * Test the property 'serverTransferNumber' + */ + @Test + public void serverTransferNumberTest() { + // TODO: test serverTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CredentialProfileTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CredentialProfileTest.java new file mode 100644 index 00000000000..0b02171545e --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/CredentialProfileTest.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CredentialProfile + */ +public class CredentialProfileTest { + /** + * Model tests for CredentialProfile + */ + @Test + public void testCredentialProfile() { + // TODO: test CredentialProfile + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HistoryTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HistoryTest.java new file mode 100644 index 00000000000..488afc74a02 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/HistoryTest.java @@ -0,0 +1,98 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for History + */ +public class HistoryTest { + private final History model = new History(); + + /** + * Model tests for History + */ + @Test + public void testHistory() { + // TODO: test History + } + + /** + * Test the property 'transactions' + */ + @Test + public void transactionsTest() { + // TODO: test transactions + } + + /** + * Test the property 'actions' + */ + @Test + public void actionsTest() { + // TODO: test actions + } + + /** + * Test the property 'origin' + */ + @Test + public void originTest() { + // TODO: test origin + } + + /** + * Test the property 'destination' + */ + @Test + public void destinationTest() { + // TODO: test destination + } + + /** + * Test the property 'balance' + */ + @Test + public void balanceTest() { + // TODO: test balance + } + + /** + * Test the property 'currentStatus' + */ + @Test + public void currentStatusTest() { + // TODO: test currentStatus + } + + /** + * Test the property 'applicationSpecificParameters' + */ + @Test + public void applicationSpecificParametersTest() { + // TODO: test applicationSpecificParameters + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LockEvidenceV1RequestTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LockEvidenceV1RequestTest.java new file mode 100644 index 00000000000..0002bac7828 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LockEvidenceV1RequestTest.java @@ -0,0 +1,138 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for LockEvidenceV1Request + */ +public class LockEvidenceV1RequestTest { + private final LockEvidenceV1Request model = new LockEvidenceV1Request(); + + /** + * Model tests for LockEvidenceV1Request + */ + @Test + public void testLockEvidenceV1Request() { + // TODO: test LockEvidenceV1Request + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'lockEvidenceClaim' + */ + @Test + public void lockEvidenceClaimTest() { + // TODO: test lockEvidenceClaim + } + + /** + * Test the property 'lockEvidenceFormat' + */ + @Test + public void lockEvidenceFormatTest() { + // TODO: test lockEvidenceFormat + } + + /** + * Test the property 'lockEvidenceExpiration' + */ + @Test + public void lockEvidenceExpirationTest() { + // TODO: test lockEvidenceExpiration + } + + /** + * Test the property 'hashCommenceAckRequest' + */ + @Test + public void hashCommenceAckRequestTest() { + // TODO: test hashCommenceAckRequest + } + + /** + * Test the property 'clientTransferNumber' + */ + @Test + public void clientTransferNumberTest() { + // TODO: test clientTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'messageHash' + */ + @Test + public void messageHashTest() { + // TODO: test messageHash + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LockEvidenceV1ResponseTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LockEvidenceV1ResponseTest.java new file mode 100644 index 00000000000..1592efa3d26 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/LockEvidenceV1ResponseTest.java @@ -0,0 +1,106 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for LockEvidenceV1Response + */ +public class LockEvidenceV1ResponseTest { + private final LockEvidenceV1Response model = new LockEvidenceV1Response(); + + /** + * Model tests for LockEvidenceV1Response + */ + @Test + public void testLockEvidenceV1Response() { + // TODO: test LockEvidenceV1Response + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'hashLockEvidenceRequest' + */ + @Test + public void hashLockEvidenceRequestTest() { + // TODO: test hashLockEvidenceRequest + } + + /** + * Test the property 'serverTransferNumber' + */ + @Test + public void serverTransferNumberTest() { + // TODO: test serverTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapLocalLogTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapLocalLogTest.java new file mode 100644 index 00000000000..32d33d02300 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapLocalLogTest.java @@ -0,0 +1,88 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OdapLocalLog + */ +public class OdapLocalLogTest { + private final OdapLocalLog model = new OdapLocalLog(); + + /** + * Model tests for OdapLocalLog + */ + @Test + public void testOdapLocalLog() { + // TODO: test OdapLocalLog + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'operation' + */ + @Test + public void operationTest() { + // TODO: test operation + } + + /** + * Test the property 'timestamp' + */ + @Test + public void timestampTest() { + // TODO: test timestamp + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapMessageActionResponseTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapMessageActionResponseTest.java new file mode 100644 index 00000000000..58f8a7bc0d6 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapMessageActionResponseTest.java @@ -0,0 +1,58 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OdapMessageActionResponse + */ +public class OdapMessageActionResponseTest { + private final OdapMessageActionResponse model = new OdapMessageActionResponse(); + + /** + * Model tests for OdapMessageActionResponse + */ + @Test + public void testOdapMessageActionResponse() { + // TODO: test OdapMessageActionResponse + } + + /** + * Test the property 'responseCode' + */ + @Test + public void responseCodeTest() { + // TODO: test responseCode + } + + /** + * Test the property 'arguments' + */ + @Test + public void argumentsTest() { + // TODO: test arguments + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapMessageTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapMessageTest.java new file mode 100644 index 00000000000..c9028ae56fa --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/OdapMessageTest.java @@ -0,0 +1,141 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.OdapMessageActionResponse; +import org.openapitools.client.model.PayloadProfile; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OdapMessage + */ +public class OdapMessageTest { + private final OdapMessage model = new OdapMessage(); + + /** + * Model tests for OdapMessage + */ + @Test + public void testOdapMessage() { + // TODO: test OdapMessage + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + + /** + * Test the property 'phase' + */ + @Test + public void phaseTest() { + // TODO: test phase + } + + /** + * Test the property 'resourceURL' + */ + @Test + public void resourceURLTest() { + // TODO: test resourceURL + } + + /** + * Test the property 'developerURN' + */ + @Test + public void developerURNTest() { + // TODO: test developerURN + } + + /** + * Test the property 'actionResponse' + */ + @Test + public void actionResponseTest() { + // TODO: test actionResponse + } + + /** + * Test the property 'credentialProfile' + */ + @Test + public void credentialProfileTest() { + // TODO: test credentialProfile + } + + /** + * Test the property 'credentialBlock' + */ + @Test + public void credentialBlockTest() { + // TODO: test credentialBlock + } + + /** + * Test the property 'credentialsProfile' + */ + @Test + public void credentialsProfileTest() { + // TODO: test credentialsProfile + } + + /** + * Test the property 'applicationProfile' + */ + @Test + public void applicationProfileTest() { + // TODO: test applicationProfile + } + + /** + * Test the property 'payload' + */ + @Test + public void payloadTest() { + // TODO: test payload + } + + /** + * Test the property 'payloadHash' + */ + @Test + public void payloadHashTest() { + // TODO: test payloadHash + } + + /** + * Test the property 'messageSignature' + */ + @Test + public void messageSignatureTest() { + // TODO: test messageSignature + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PayloadProfileTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PayloadProfileTest.java new file mode 100644 index 00000000000..4f7109549a9 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/PayloadProfileTest.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.AssetProfile; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for PayloadProfile + */ +public class PayloadProfileTest { + private final PayloadProfile model = new PayloadProfile(); + + /** + * Model tests for PayloadProfile + */ + @Test + public void testPayloadProfile() { + // TODO: test PayloadProfile + } + + /** + * Test the property 'assetProfile' + */ + @Test + public void assetProfileTest() { + // TODO: test assetProfile + } + + /** + * Test the property 'capabilities' + */ + @Test + public void capabilitiesTest() { + // TODO: test capabilities + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverSuccessV1MessageTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverSuccessV1MessageTest.java new file mode 100644 index 00000000000..94899d8ec8a --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverSuccessV1MessageTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RecoverSuccessV1Message + */ +public class RecoverSuccessV1MessageTest { + private final RecoverSuccessV1Message model = new RecoverSuccessV1Message(); + + /** + * Model tests for RecoverSuccessV1Message + */ + @Test + public void testRecoverSuccessV1Message() { + // TODO: test RecoverSuccessV1Message + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverUpdateAckV1MessageTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverUpdateAckV1MessageTest.java new file mode 100644 index 00000000000..bbed24d719b --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverUpdateAckV1MessageTest.java @@ -0,0 +1,74 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RecoverUpdateAckV1Message + */ +public class RecoverUpdateAckV1MessageTest { + private final RecoverUpdateAckV1Message model = new RecoverUpdateAckV1Message(); + + /** + * Model tests for RecoverUpdateAckV1Message + */ + @Test + public void testRecoverUpdateAckV1Message() { + // TODO: test RecoverUpdateAckV1Message + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'changedEntriesHash' + */ + @Test + public void changedEntriesHashTest() { + // TODO: test changedEntriesHash + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverUpdateV1MessageTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverUpdateV1MessageTest.java new file mode 100644 index 00000000000..4da8af188ee --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverUpdateV1MessageTest.java @@ -0,0 +1,67 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.openapitools.client.model.OdapLocalLog; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RecoverUpdateV1Message + */ +public class RecoverUpdateV1MessageTest { + private final RecoverUpdateV1Message model = new RecoverUpdateV1Message(); + + /** + * Model tests for RecoverUpdateV1Message + */ + @Test + public void testRecoverUpdateV1Message() { + // TODO: test RecoverUpdateV1Message + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'recoveredLogs' + */ + @Test + public void recoveredLogsTest() { + // TODO: test recoveredLogs + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverV1MessageTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverV1MessageTest.java new file mode 100644 index 00000000000..bcd65a19758 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RecoverV1MessageTest.java @@ -0,0 +1,105 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RecoverV1Message + */ +public class RecoverV1MessageTest { + private final RecoverV1Message model = new RecoverV1Message(); + + /** + * Model tests for RecoverV1Message + */ + @Test + public void testRecoverV1Message() { + // TODO: test RecoverV1Message + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'odapPhase' + */ + @Test + public void odapPhaseTest() { + // TODO: test odapPhase + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + + /** + * Test the property 'lastLogEntryTimestamp' + */ + @Test + public void lastLogEntryTimestampTest() { + // TODO: test lastLogEntryTimestamp + } + + /** + * Test the property 'isBackup' + */ + @Test + public void isBackupTest() { + // TODO: test isBackup + } + + /** + * Test the property 'newBasePath' + */ + @Test + public void newBasePathTest() { + // TODO: test newBasePath + } + + /** + * Test the property 'newGatewayPubKey' + */ + @Test + public void newGatewayPubKeyTest() { + // TODO: test newGatewayPubKey + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RollbackAckV1MessageTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RollbackAckV1MessageTest.java new file mode 100644 index 00000000000..ed862a81836 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RollbackAckV1MessageTest.java @@ -0,0 +1,64 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RollbackAckV1Message + */ +public class RollbackAckV1MessageTest { + private final RollbackAckV1Message model = new RollbackAckV1Message(); + + /** + * Model tests for RollbackAckV1Message + */ + @Test + public void testRollbackAckV1Message() { + // TODO: test RollbackAckV1Message + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RollbackV1MessageTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RollbackV1MessageTest.java new file mode 100644 index 00000000000..b7b9ea71a7d --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/RollbackV1MessageTest.java @@ -0,0 +1,82 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for RollbackV1Message + */ +public class RollbackV1MessageTest { + private final RollbackV1Message model = new RollbackV1Message(); + + /** + * Model tests for RollbackV1Message + */ + @Test + public void testRollbackV1Message() { + // TODO: test RollbackV1Message + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'success' + */ + @Test + public void successTest() { + // TODO: test success + } + + /** + * Test the property 'actionPerformed' + */ + @Test + public void actionPerformedTest() { + // TODO: test actionPerformed + } + + /** + * Test the property 'proofs' + */ + @Test + public void proofsTest() { + // TODO: test proofs + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SessionDataTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SessionDataTest.java new file mode 100644 index 00000000000..1de9c2bf703 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/SessionDataTest.java @@ -0,0 +1,533 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.AssetProfile; +import org.openapitools.client.model.PayloadProfile; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SessionData + */ +public class SessionDataTest { + private final SessionData model = new SessionData(); + + /** + * Model tests for SessionData + */ + @Test + public void testSessionData() { + // TODO: test SessionData + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'step' + */ + @Test + public void stepTest() { + // TODO: test step + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property 'lastSequenceNumber' + */ + @Test + public void lastSequenceNumberTest() { + // TODO: test lastSequenceNumber + } + + /** + * Test the property 'loggingProfile' + */ + @Test + public void loggingProfileTest() { + // TODO: test loggingProfile + } + + /** + * Test the property 'accessControlProfile' + */ + @Test + public void accessControlProfileTest() { + // TODO: test accessControlProfile + } + + /** + * Test the property 'applicationProfile' + */ + @Test + public void applicationProfileTest() { + // TODO: test applicationProfile + } + + /** + * Test the property 'payloadProfile' + */ + @Test + public void payloadProfileTest() { + // TODO: test payloadProfile + } + + /** + * Test the property 'assetProfile' + */ + @Test + public void assetProfileTest() { + // TODO: test assetProfile + } + + /** + * Test the property 'allowedSourceBackupGateways' + */ + @Test + public void allowedSourceBackupGatewaysTest() { + // TODO: test allowedSourceBackupGateways + } + + /** + * Test the property 'allowedRecipientBackupGateways' + */ + @Test + public void allowedRecipientBackupGatewaysTest() { + // TODO: test allowedRecipientBackupGateways + } + + /** + * Test the property 'sourceBasePath' + */ + @Test + public void sourceBasePathTest() { + // TODO: test sourceBasePath + } + + /** + * Test the property 'recipientBasePath' + */ + @Test + public void recipientBasePathTest() { + // TODO: test recipientBasePath + } + + /** + * Test the property 'originatorPubkey' + */ + @Test + public void originatorPubkeyTest() { + // TODO: test originatorPubkey + } + + /** + * Test the property 'beneficiaryPubkey' + */ + @Test + public void beneficiaryPubkeyTest() { + // TODO: test beneficiaryPubkey + } + + /** + * Test the property 'sourceGatewayPubkey' + */ + @Test + public void sourceGatewayPubkeyTest() { + // TODO: test sourceGatewayPubkey + } + + /** + * Test the property 'sourceGatewayDltSystem' + */ + @Test + public void sourceGatewayDltSystemTest() { + // TODO: test sourceGatewayDltSystem + } + + /** + * Test the property 'recipientGatewayPubkey' + */ + @Test + public void recipientGatewayPubkeyTest() { + // TODO: test recipientGatewayPubkey + } + + /** + * Test the property 'recipientGatewayDltSystem' + */ + @Test + public void recipientGatewayDltSystemTest() { + // TODO: test recipientGatewayDltSystem + } + + /** + * Test the property 'initializationRequestMessageHash' + */ + @Test + public void initializationRequestMessageHashTest() { + // TODO: test initializationRequestMessageHash + } + + /** + * Test the property 'initializationResponseMessageHash' + */ + @Test + public void initializationResponseMessageHashTest() { + // TODO: test initializationResponseMessageHash + } + + /** + * Test the property 'initializationRequestMessageRcvTimeStamp' + */ + @Test + public void initializationRequestMessageRcvTimeStampTest() { + // TODO: test initializationRequestMessageRcvTimeStamp + } + + /** + * Test the property 'initializationRequestMessageProcessedTimeStamp' + */ + @Test + public void initializationRequestMessageProcessedTimeStampTest() { + // TODO: test initializationRequestMessageProcessedTimeStamp + } + + /** + * Test the property 'clientSignatureInitializationRequestMessage' + */ + @Test + public void clientSignatureInitializationRequestMessageTest() { + // TODO: test clientSignatureInitializationRequestMessage + } + + /** + * Test the property 'serverSignatureInitializationResponseMessage' + */ + @Test + public void serverSignatureInitializationResponseMessageTest() { + // TODO: test serverSignatureInitializationResponseMessage + } + + /** + * Test the property 'transferCommenceMessageRequestHash' + */ + @Test + public void transferCommenceMessageRequestHashTest() { + // TODO: test transferCommenceMessageRequestHash + } + + /** + * Test the property 'transferCommenceMessageResponseHash' + */ + @Test + public void transferCommenceMessageResponseHashTest() { + // TODO: test transferCommenceMessageResponseHash + } + + /** + * Test the property 'clientSignatureTransferCommenceRequestMessage' + */ + @Test + public void clientSignatureTransferCommenceRequestMessageTest() { + // TODO: test clientSignatureTransferCommenceRequestMessage + } + + /** + * Test the property 'serverSignatureTransferCommenceResponseMessage' + */ + @Test + public void serverSignatureTransferCommenceResponseMessageTest() { + // TODO: test serverSignatureTransferCommenceResponseMessage + } + + /** + * Test the property 'lockEvidenceRequestMessageHash' + */ + @Test + public void lockEvidenceRequestMessageHashTest() { + // TODO: test lockEvidenceRequestMessageHash + } + + /** + * Test the property 'lockEvidenceResponseMessageHash' + */ + @Test + public void lockEvidenceResponseMessageHashTest() { + // TODO: test lockEvidenceResponseMessageHash + } + + /** + * Test the property 'clientSignatureLockEvidenceRequestMessage' + */ + @Test + public void clientSignatureLockEvidenceRequestMessageTest() { + // TODO: test clientSignatureLockEvidenceRequestMessage + } + + /** + * Test the property 'serverSignatureLockEvidenceResponseMessage' + */ + @Test + public void serverSignatureLockEvidenceResponseMessageTest() { + // TODO: test serverSignatureLockEvidenceResponseMessage + } + + /** + * Test the property 'lockEvidenceClaim' + */ + @Test + public void lockEvidenceClaimTest() { + // TODO: test lockEvidenceClaim + } + + /** + * Test the property 'commitPrepareRequestMessageHash' + */ + @Test + public void commitPrepareRequestMessageHashTest() { + // TODO: test commitPrepareRequestMessageHash + } + + /** + * Test the property 'commitPrepareResponseMessageHash' + */ + @Test + public void commitPrepareResponseMessageHashTest() { + // TODO: test commitPrepareResponseMessageHash + } + + /** + * Test the property 'clientSignatureCommitPreparationRequestMessage' + */ + @Test + public void clientSignatureCommitPreparationRequestMessageTest() { + // TODO: test clientSignatureCommitPreparationRequestMessage + } + + /** + * Test the property 'serverSignatureCommitPreparationResponseMessage' + */ + @Test + public void serverSignatureCommitPreparationResponseMessageTest() { + // TODO: test serverSignatureCommitPreparationResponseMessage + } + + /** + * Test the property 'commitFinalRequestMessageHash' + */ + @Test + public void commitFinalRequestMessageHashTest() { + // TODO: test commitFinalRequestMessageHash + } + + /** + * Test the property 'commitFinalResponseMessageHash' + */ + @Test + public void commitFinalResponseMessageHashTest() { + // TODO: test commitFinalResponseMessageHash + } + + /** + * Test the property 'commitFinalClaim' + */ + @Test + public void commitFinalClaimTest() { + // TODO: test commitFinalClaim + } + + /** + * Test the property 'commitFinalClaimFormat' + */ + @Test + public void commitFinalClaimFormatTest() { + // TODO: test commitFinalClaimFormat + } + + /** + * Test the property 'commitAcknowledgementClaim' + */ + @Test + public void commitAcknowledgementClaimTest() { + // TODO: test commitAcknowledgementClaim + } + + /** + * Test the property 'commitAcknowledgementClaimFormat' + */ + @Test + public void commitAcknowledgementClaimFormatTest() { + // TODO: test commitAcknowledgementClaimFormat + } + + /** + * Test the property 'clientSignatureCommitFinalRequestMessage' + */ + @Test + public void clientSignatureCommitFinalRequestMessageTest() { + // TODO: test clientSignatureCommitFinalRequestMessage + } + + /** + * Test the property 'serverSignatureCommitFinalResponseMessage' + */ + @Test + public void serverSignatureCommitFinalResponseMessageTest() { + // TODO: test serverSignatureCommitFinalResponseMessage + } + + /** + * Test the property 'transferCompleteMessageHash' + */ + @Test + public void transferCompleteMessageHashTest() { + // TODO: test transferCompleteMessageHash + } + + /** + * Test the property 'clientSignatureTransferCompleteMessage' + */ + @Test + public void clientSignatureTransferCompleteMessageTest() { + // TODO: test clientSignatureTransferCompleteMessage + } + + /** + * Test the property 'maxRetries' + */ + @Test + public void maxRetriesTest() { + // TODO: test maxRetries + } + + /** + * Test the property 'recipientLedgerAssetID' + */ + @Test + public void recipientLedgerAssetIDTest() { + // TODO: test recipientLedgerAssetID + } + + /** + * Test the property 'sourceLedgerAssetID' + */ + @Test + public void sourceLedgerAssetIDTest() { + // TODO: test sourceLedgerAssetID + } + + /** + * Test the property 'maxTimeout' + */ + @Test + public void maxTimeoutTest() { + // TODO: test maxTimeout + } + + /** + * Test the property 'lastLogEntryTimestamp' + */ + @Test + public void lastLogEntryTimestampTest() { + // TODO: test lastLogEntryTimestamp + } + + /** + * Test the property 'unlockAssetClaim' + */ + @Test + public void unlockAssetClaimTest() { + // TODO: test unlockAssetClaim + } + + /** + * Test the property 'recreateAssetClaim' + */ + @Test + public void recreateAssetClaimTest() { + // TODO: test recreateAssetClaim + } + + /** + * Test the property 'deleteAssetClaim' + */ + @Test + public void deleteAssetClaimTest() { + // TODO: test deleteAssetClaim + } + + /** + * Test the property 'lastMessageReceivedTimestamp' + */ + @Test + public void lastMessageReceivedTimestampTest() { + // TODO: test lastMessageReceivedTimestamp + } + + /** + * Test the property 'rollback' + */ + @Test + public void rollbackTest() { + // TODO: test rollback + } + + /** + * Test the property 'rollbackMessageHash' + */ + @Test + public void rollbackMessageHashTest() { + // TODO: test rollbackMessageHash + } + + /** + * Test the property 'rollbackProofs' + */ + @Test + public void rollbackProofsTest() { + // TODO: test rollbackProofs + } + + /** + * Test the property 'rollbackActionsPerformed' + */ + @Test + public void rollbackActionsPerformedTest() { + // TODO: test rollbackActionsPerformed + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCommenceV1RequestTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCommenceV1RequestTest.java new file mode 100644 index 00000000000..cb09ccf1008 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCommenceV1RequestTest.java @@ -0,0 +1,153 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransferCommenceV1Request + */ +public class TransferCommenceV1RequestTest { + private final TransferCommenceV1Request model = new TransferCommenceV1Request(); + + /** + * Model tests for TransferCommenceV1Request + */ + @Test + public void testTransferCommenceV1Request() { + // TODO: test TransferCommenceV1Request + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'originatorPubkey' + */ + @Test + public void originatorPubkeyTest() { + // TODO: test originatorPubkey + } + + /** + * Test the property 'beneficiaryPubkey' + */ + @Test + public void beneficiaryPubkeyTest() { + // TODO: test beneficiaryPubkey + } + + /** + * Test the property 'senderDltSystem' + */ + @Test + public void senderDltSystemTest() { + // TODO: test senderDltSystem + } + + /** + * Test the property 'recipientDltSystem' + */ + @Test + public void recipientDltSystemTest() { + // TODO: test recipientDltSystem + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'hashAssetProfile' + */ + @Test + public void hashAssetProfileTest() { + // TODO: test hashAssetProfile + } + + /** + * Test the property 'assetUnit' + */ + @Test + public void assetUnitTest() { + // TODO: test assetUnit + } + + /** + * Test the property 'hashPrevMessage' + */ + @Test + public void hashPrevMessageTest() { + // TODO: test hashPrevMessage + } + + /** + * Test the property 'clientTransferNumber' + */ + @Test + public void clientTransferNumberTest() { + // TODO: test clientTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCommenceV1ResponseTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCommenceV1ResponseTest.java new file mode 100644 index 00000000000..0296e6aefed --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCommenceV1ResponseTest.java @@ -0,0 +1,114 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransferCommenceV1Response + */ +public class TransferCommenceV1ResponseTest { + private final TransferCommenceV1Response model = new TransferCommenceV1Response(); + + /** + * Model tests for TransferCommenceV1Response + */ + @Test + public void testTransferCommenceV1Response() { + // TODO: test TransferCommenceV1Response + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'hashCommenceRequest' + */ + @Test + public void hashCommenceRequestTest() { + // TODO: test hashCommenceRequest + } + + /** + * Test the property 'serverTransferNumber' + */ + @Test + public void serverTransferNumberTest() { + // TODO: test serverTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'messageHash' + */ + @Test + public void messageHashTest() { + // TODO: test messageHash + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCompleteV1RequestTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCompleteV1RequestTest.java new file mode 100644 index 00000000000..fc95d844fa4 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferCompleteV1RequestTest.java @@ -0,0 +1,114 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransferCompleteV1Request + */ +public class TransferCompleteV1RequestTest { + private final TransferCompleteV1Request model = new TransferCompleteV1Request(); + + /** + * Model tests for TransferCompleteV1Request + */ + @Test + public void testTransferCompleteV1Request() { + // TODO: test TransferCompleteV1Request + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'clientIdentityPubkey' + */ + @Test + public void clientIdentityPubkeyTest() { + // TODO: test clientIdentityPubkey + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'hashCommitFinalAck' + */ + @Test + public void hashCommitFinalAckTest() { + // TODO: test hashCommitFinalAck + } + + /** + * Test the property 'clientTransferNumber' + */ + @Test + public void clientTransferNumberTest() { + // TODO: test clientTransferNumber + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'hashTransferCommence' + */ + @Test + public void hashTransferCommenceTest() { + // TODO: test hashTransferCommence + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferInitializationV1RequestTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferInitializationV1RequestTest.java new file mode 100644 index 00000000000..c3b5b3fcc3d --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferInitializationV1RequestTest.java @@ -0,0 +1,294 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.CredentialProfile; +import org.openapitools.client.model.History; +import org.openapitools.client.model.PayloadProfile; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransferInitializationV1Request + */ +public class TransferInitializationV1RequestTest { + private final TransferInitializationV1Request model = new TransferInitializationV1Request(); + + /** + * Model tests for TransferInitializationV1Request + */ + @Test + public void testTransferInitializationV1Request() { + // TODO: test TransferInitializationV1Request + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'version' + */ + @Test + public void versionTest() { + // TODO: test version + } + + /** + * Test the property 'developerURN' + */ + @Test + public void developerURNTest() { + // TODO: test developerURN + } + + /** + * Test the property 'credentialProfile' + */ + @Test + public void credentialProfileTest() { + // TODO: test credentialProfile + } + + /** + * Test the property 'payloadProfile' + */ + @Test + public void payloadProfileTest() { + // TODO: test payloadProfile + } + + /** + * Test the property 'applicationProfile' + */ + @Test + public void applicationProfileTest() { + // TODO: test applicationProfile + } + + /** + * Test the property 'loggingProfile' + */ + @Test + public void loggingProfileTest() { + // TODO: test loggingProfile + } + + /** + * Test the property 'accessControlProfile' + */ + @Test + public void accessControlProfileTest() { + // TODO: test accessControlProfile + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'sourceGatewayPubkey' + */ + @Test + public void sourceGatewayPubkeyTest() { + // TODO: test sourceGatewayPubkey + } + + /** + * Test the property 'sourceGatewayDltSystem' + */ + @Test + public void sourceGatewayDltSystemTest() { + // TODO: test sourceGatewayDltSystem + } + + /** + * Test the property 'recipientGatewayPubkey' + */ + @Test + public void recipientGatewayPubkeyTest() { + // TODO: test recipientGatewayPubkey + } + + /** + * Test the property 'recipientGatewayDltSystem' + */ + @Test + public void recipientGatewayDltSystemTest() { + // TODO: test recipientGatewayDltSystem + } + + /** + * Test the property 'escrowType' + */ + @Test + public void escrowTypeTest() { + // TODO: test escrowType + } + + /** + * Test the property 'expiryTime' + */ + @Test + public void expiryTimeTest() { + // TODO: test expiryTime + } + + /** + * Test the property 'multipleClaimsAllowed' + */ + @Test + public void multipleClaimsAllowedTest() { + // TODO: test multipleClaimsAllowed + } + + /** + * Test the property 'multipleCancelsAllowed' + */ + @Test + public void multipleCancelsAllowedTest() { + // TODO: test multipleCancelsAllowed + } + + /** + * Test the property 'permissions' + */ + @Test + public void permissionsTest() { + // TODO: test permissions + } + + /** + * Test the property 'origin' + */ + @Test + public void originTest() { + // TODO: test origin + } + + /** + * Test the property 'destination' + */ + @Test + public void destinationTest() { + // TODO: test destination + } + + /** + * Test the property 'subsequentCalls' + */ + @Test + public void subsequentCallsTest() { + // TODO: test subsequentCalls + } + + /** + * Test the property 'histories' + */ + @Test + public void historiesTest() { + // TODO: test histories + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + + /** + * Test the property 'sourceBasePath' + */ + @Test + public void sourceBasePathTest() { + // TODO: test sourceBasePath + } + + /** + * Test the property 'recipientBasePath' + */ + @Test + public void recipientBasePathTest() { + // TODO: test recipientBasePath + } + + /** + * Test the property 'maxRetries' + */ + @Test + public void maxRetriesTest() { + // TODO: test maxRetries + } + + /** + * Test the property 'maxTimeout' + */ + @Test + public void maxTimeoutTest() { + // TODO: test maxTimeout + } + + /** + * Test the property 'backupGatewaysAllowed' + */ + @Test + public void backupGatewaysAllowedTest() { + // TODO: test backupGatewaysAllowed + } + + /** + * Test the property 'recipientLedgerAssetID' + */ + @Test + public void recipientLedgerAssetIDTest() { + // TODO: test recipientLedgerAssetID + } + + /** + * Test the property 'sourceLedgerAssetID' + */ + @Test + public void sourceLedgerAssetIDTest() { + // TODO: test sourceLedgerAssetID + } + +} diff --git a/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferInitializationV1ResponseTest.java b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferInitializationV1ResponseTest.java new file mode 100644 index 00000000000..c3e1857ea31 --- /dev/null +++ b/packages/cactus-plugin-odap-hermes/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TransferInitializationV1ResponseTest.java @@ -0,0 +1,131 @@ +/* + * Hyperledger Cactus Plugin - Odap Hermes + * Implementation for Odap and Hermes + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TransferInitializationV1Response + */ +public class TransferInitializationV1ResponseTest { + private final TransferInitializationV1Response model = new TransferInitializationV1Response(); + + /** + * Model tests for TransferInitializationV1Response + */ + @Test + public void testTransferInitializationV1Response() { + // TODO: test TransferInitializationV1Response + } + + /** + * Test the property 'messageType' + */ + @Test + public void messageTypeTest() { + // TODO: test messageType + } + + /** + * Test the property 'sessionID' + */ + @Test + public void sessionIDTest() { + // TODO: test sessionID + } + + /** + * Test the property 'sequenceNumber' + */ + @Test + public void sequenceNumberTest() { + // TODO: test sequenceNumber + } + + /** + * Test the property 'odapPhase' + */ + @Test + public void odapPhaseTest() { + // TODO: test odapPhase + } + + /** + * Test the property 'initialRequestMessageHash' + */ + @Test + public void initialRequestMessageHashTest() { + // TODO: test initialRequestMessageHash + } + + /** + * Test the property 'destination' + */ + @Test + public void destinationTest() { + // TODO: test destination + } + + /** + * Test the property 'timeStamp' + */ + @Test + public void timeStampTest() { + // TODO: test timeStamp + } + + /** + * Test the property 'processedTimeStamp' + */ + @Test + public void processedTimeStampTest() { + // TODO: test processedTimeStamp + } + + /** + * Test the property 'serverIdentityPubkey' + */ + @Test + public void serverIdentityPubkeyTest() { + // TODO: test serverIdentityPubkey + } + + /** + * Test the property 'signature' + */ + @Test + public void signatureTest() { + // TODO: test signature + } + + /** + * Test the property 'backupGatewaysAllowed' + */ + @Test + public void backupGatewaysAllowedTest() { + // TODO: test backupGatewaysAllowed + } + +} diff --git a/packages/cactus-plugin-persistence-ethereum/package.json b/packages/cactus-plugin-persistence-ethereum/package.json index 5be367856fe..ce8cbd4fb4e 100644 --- a/packages/cactus-plugin-persistence-ethereum/package.json +++ b/packages/cactus-plugin-persistence-ethereum/package.json @@ -54,7 +54,10 @@ "codegen:openapi": "npm run generate-sdk", "copy-sql": "cp -raf ./src/main/sql ./dist/lib/main/", "copy-yarn-lock": "cp -af ../../yarn.lock ./dist/yarn.lock", - "generate-sdk": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore" + "generate-sdk": "run-p 'generate-sdk:*'", + "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore" }, "dependencies": { "@ethersproject/abi": "5.7.0", diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..2bb23947ab3 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,16 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_error_exception_response_v1.go +model_monitored_token.go +model_status_response_v1.go +model_token_type_v1.go +model_tracked_operation_v1.go +response.go +test/api_default_test.go +utils.go diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..57f48c67754 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,116 @@ +# Go API client for cactus-plugin-persistence-ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-persistence-ethereum "github.com/hyperledger/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-persistence-ethereum.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-persistence-ethereum.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-persistence-ethereum.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-persistence-ethereum.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetStatusV1**](docs/DefaultApi.md#getstatusv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-persistence-ethereum/status | Get the status of persistence plugin for ethereum + + +## Documentation For Models + + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [MonitoredToken](docs/MonitoredToken.md) + - [StatusResponseV1](docs/StatusResponseV1.md) + - [TokenTypeV1](docs/TokenTypeV1.md) + - [TrackedOperationV1](docs/TrackedOperationV1.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..6d11933009e --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,148 @@ +openapi: 3.0.3 +info: + description: Synchronizes state of an ethereum ledger into a DB that can later be + viewed in GUI + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Persistence Ethereum + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-persistence-ethereum/status: + get: + operationId: getStatusV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/StatusResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Get the status of persistence plugin for ethereum + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-persistence-ethereum/status +components: + schemas: + TokenTypeV1: + enum: + - erc20 + - erc721 + type: string + x-enum-descriptions: + - "EIP-20: Token Standard" + - "EIP-721: Non-Fungible Token Standard" + x-enum-varnames: + - ERC20 + - ERC721 + MonitoredToken: + description: Ethereum tokens that are being monitored by the persistence plugin. + properties: + type: + $ref: '#/components/schemas/TokenTypeV1' + name: + description: Token name + nullable: false + type: string + symbol: + description: Token symbol + nullable: false + type: string + required: + - name + - symbol + - type + type: object + TrackedOperationV1: + description: Persistence plugin operation that is tracked and returned in status + report. + example: + operation: operation + startAt: startAt + properties: + startAt: + description: Start time of the operation. + nullable: false + type: string + operation: + description: Operation name. + nullable: false + type: string + required: + - operation + - startAt + type: object + StatusResponseV1: + description: Response with plugin status report. + example: + connected: true + monitoredTokensCount: 0.8008281904610115 + instanceId: instanceId + lastSeenBlock: 6.027456183070403 + monitorRunning: true + webServicesRegistered: true + operationsRunning: + - operation: operation + startAt: startAt + - operation: operation + startAt: startAt + properties: + instanceId: + description: Plugin instance id. + nullable: false + type: string + connected: + description: "True if successfully connected to the database, false otherwise." + nullable: false + type: boolean + webServicesRegistered: + description: True if web services were correctly exported. + nullable: false + type: boolean + monitoredTokensCount: + description: Total number of tokens being monitored by the plugin. + nullable: false + type: number + operationsRunning: + items: + $ref: '#/components/schemas/TrackedOperationV1' + type: array + monitorRunning: + description: "True if block monitoring is running, false otherwise." + nullable: false + type: boolean + lastSeenBlock: + description: Number of the last block seen by the block monitor. + nullable: false + type: number + required: + - connected + - instanceId + - lastSeenBlock + - monitorRunning + - monitoredTokensCount + - operationsRunning + - webServicesRegistered + type: object + ErrorExceptionResponseV1: + properties: + message: + nullable: false + type: string + error: + nullable: false + type: string + required: + - error + - message + type: object diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..156bc00da68 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,130 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGetStatusV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetStatusV1Request) Execute() (*StatusResponseV1, *http.Response, error) { + return r.ApiService.GetStatusV1Execute(r) +} + +/* +GetStatusV1 Get the status of persistence plugin for ethereum + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetStatusV1Request +*/ +func (a *DefaultApiService) GetStatusV1(ctx context.Context) ApiGetStatusV1Request { + return ApiGetStatusV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return StatusResponseV1 +func (a *DefaultApiService) GetStatusV1Execute(r ApiGetStatusV1Request) (*StatusResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *StatusResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetStatusV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-persistence-ethereum/status" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"text/plain", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponseV1 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..28629cf6ab7 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Persistence Ethereum API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultApi *DefaultApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultApi = (*DefaultApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..2631a549473 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..7b679f4baa0 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go new file mode 100644 index 00000000000..8cf28bb9684 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "encoding/json" +) + +// checks if the ErrorExceptionResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorExceptionResponseV1{} + +// ErrorExceptionResponseV1 struct for ErrorExceptionResponseV1 +type ErrorExceptionResponseV1 struct { + Message string `json:"message"` + Error string `json:"error"` +} + +// NewErrorExceptionResponseV1 instantiates a new ErrorExceptionResponseV1 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 +// will change when the set of required properties is changed +func NewErrorExceptionResponseV1(message string, error_ string) *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + this.Message = message + this.Error = error_ + return &this +} + +// NewErrorExceptionResponseV1WithDefaults instantiates a new ErrorExceptionResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorExceptionResponseV1WithDefaults() *ErrorExceptionResponseV1 { + this := ErrorExceptionResponseV1{} + return &this +} + +// GetMessage returns the Message field value +func (o *ErrorExceptionResponseV1) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ErrorExceptionResponseV1) SetMessage(v string) { + o.Message = v +} + +// GetError returns the Error field value +func (o *ErrorExceptionResponseV1) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *ErrorExceptionResponseV1) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *ErrorExceptionResponseV1) SetError(v string) { + o.Error = v +} + +func (o ErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorExceptionResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + toSerialize["error"] = o.Error + return toSerialize, nil +} + +type NullableErrorExceptionResponseV1 struct { + value *ErrorExceptionResponseV1 + isSet bool +} + +func (v NullableErrorExceptionResponseV1) Get() *ErrorExceptionResponseV1 { + return v.value +} + +func (v *NullableErrorExceptionResponseV1) Set(val *ErrorExceptionResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableErrorExceptionResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorExceptionResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorExceptionResponseV1(val *ErrorExceptionResponseV1) *NullableErrorExceptionResponseV1 { + return &NullableErrorExceptionResponseV1{value: val, isSet: true} +} + +func (v NullableErrorExceptionResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorExceptionResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_monitored_token.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_monitored_token.go new file mode 100644 index 00000000000..e3eff3110c8 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_monitored_token.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "encoding/json" +) + +// checks if the MonitoredToken type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MonitoredToken{} + +// MonitoredToken Ethereum tokens that are being monitored by the persistence plugin. +type MonitoredToken struct { + Type TokenTypeV1 `json:"type"` + // Token name + Name string `json:"name"` + // Token symbol + Symbol string `json:"symbol"` +} + +// NewMonitoredToken instantiates a new MonitoredToken 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 +// will change when the set of required properties is changed +func NewMonitoredToken(type_ TokenTypeV1, name string, symbol string) *MonitoredToken { + this := MonitoredToken{} + this.Type = type_ + this.Name = name + this.Symbol = symbol + return &this +} + +// NewMonitoredTokenWithDefaults instantiates a new MonitoredToken object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMonitoredTokenWithDefaults() *MonitoredToken { + this := MonitoredToken{} + return &this +} + +// GetType returns the Type field value +func (o *MonitoredToken) GetType() TokenTypeV1 { + if o == nil { + var ret TokenTypeV1 + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *MonitoredToken) GetTypeOk() (*TokenTypeV1, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *MonitoredToken) SetType(v TokenTypeV1) { + o.Type = v +} + +// GetName returns the Name field value +func (o *MonitoredToken) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MonitoredToken) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MonitoredToken) SetName(v string) { + o.Name = v +} + +// GetSymbol returns the Symbol field value +func (o *MonitoredToken) GetSymbol() string { + if o == nil { + var ret string + return ret + } + + return o.Symbol +} + +// GetSymbolOk returns a tuple with the Symbol field value +// and a boolean to check if the value has been set. +func (o *MonitoredToken) GetSymbolOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Symbol, true +} + +// SetSymbol sets field value +func (o *MonitoredToken) SetSymbol(v string) { + o.Symbol = v +} + +func (o MonitoredToken) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MonitoredToken) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["name"] = o.Name + toSerialize["symbol"] = o.Symbol + return toSerialize, nil +} + +type NullableMonitoredToken struct { + value *MonitoredToken + isSet bool +} + +func (v NullableMonitoredToken) Get() *MonitoredToken { + return v.value +} + +func (v *NullableMonitoredToken) Set(val *MonitoredToken) { + v.value = val + v.isSet = true +} + +func (v NullableMonitoredToken) IsSet() bool { + return v.isSet +} + +func (v *NullableMonitoredToken) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMonitoredToken(val *MonitoredToken) *NullableMonitoredToken { + return &NullableMonitoredToken{value: val, isSet: true} +} + +func (v NullableMonitoredToken) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMonitoredToken) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_status_response_v1.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_status_response_v1.go new file mode 100644 index 00000000000..c6562fc5896 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_status_response_v1.go @@ -0,0 +1,285 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "encoding/json" +) + +// checks if the StatusResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StatusResponseV1{} + +// StatusResponseV1 Response with plugin status report. +type StatusResponseV1 struct { + // Plugin instance id. + InstanceId string `json:"instanceId"` + // True if successfully connected to the database, false otherwise. + Connected bool `json:"connected"` + // True if web services were correctly exported. + WebServicesRegistered bool `json:"webServicesRegistered"` + // Total number of tokens being monitored by the plugin. + MonitoredTokensCount float32 `json:"monitoredTokensCount"` + OperationsRunning []TrackedOperationV1 `json:"operationsRunning"` + // True if block monitoring is running, false otherwise. + MonitorRunning bool `json:"monitorRunning"` + // Number of the last block seen by the block monitor. + LastSeenBlock float32 `json:"lastSeenBlock"` +} + +// NewStatusResponseV1 instantiates a new StatusResponseV1 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 +// will change when the set of required properties is changed +func NewStatusResponseV1(instanceId string, connected bool, webServicesRegistered bool, monitoredTokensCount float32, operationsRunning []TrackedOperationV1, monitorRunning bool, lastSeenBlock float32) *StatusResponseV1 { + this := StatusResponseV1{} + this.InstanceId = instanceId + this.Connected = connected + this.WebServicesRegistered = webServicesRegistered + this.MonitoredTokensCount = monitoredTokensCount + this.OperationsRunning = operationsRunning + this.MonitorRunning = monitorRunning + this.LastSeenBlock = lastSeenBlock + return &this +} + +// NewStatusResponseV1WithDefaults instantiates a new StatusResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStatusResponseV1WithDefaults() *StatusResponseV1 { + this := StatusResponseV1{} + return &this +} + +// GetInstanceId returns the InstanceId field value +func (o *StatusResponseV1) GetInstanceId() string { + if o == nil { + var ret string + return ret + } + + return o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceId, true +} + +// SetInstanceId sets field value +func (o *StatusResponseV1) SetInstanceId(v string) { + o.InstanceId = v +} + +// GetConnected returns the Connected field value +func (o *StatusResponseV1) GetConnected() bool { + if o == nil { + var ret bool + return ret + } + + return o.Connected +} + +// GetConnectedOk returns a tuple with the Connected field value +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetConnectedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Connected, true +} + +// SetConnected sets field value +func (o *StatusResponseV1) SetConnected(v bool) { + o.Connected = v +} + +// GetWebServicesRegistered returns the WebServicesRegistered field value +func (o *StatusResponseV1) GetWebServicesRegistered() bool { + if o == nil { + var ret bool + return ret + } + + return o.WebServicesRegistered +} + +// GetWebServicesRegisteredOk returns a tuple with the WebServicesRegistered field value +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetWebServicesRegisteredOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.WebServicesRegistered, true +} + +// SetWebServicesRegistered sets field value +func (o *StatusResponseV1) SetWebServicesRegistered(v bool) { + o.WebServicesRegistered = v +} + +// GetMonitoredTokensCount returns the MonitoredTokensCount field value +func (o *StatusResponseV1) GetMonitoredTokensCount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MonitoredTokensCount +} + +// GetMonitoredTokensCountOk returns a tuple with the MonitoredTokensCount field value +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetMonitoredTokensCountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MonitoredTokensCount, true +} + +// SetMonitoredTokensCount sets field value +func (o *StatusResponseV1) SetMonitoredTokensCount(v float32) { + o.MonitoredTokensCount = v +} + +// GetOperationsRunning returns the OperationsRunning field value +func (o *StatusResponseV1) GetOperationsRunning() []TrackedOperationV1 { + if o == nil { + var ret []TrackedOperationV1 + return ret + } + + return o.OperationsRunning +} + +// GetOperationsRunningOk returns a tuple with the OperationsRunning field value +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetOperationsRunningOk() ([]TrackedOperationV1, bool) { + if o == nil { + return nil, false + } + return o.OperationsRunning, true +} + +// SetOperationsRunning sets field value +func (o *StatusResponseV1) SetOperationsRunning(v []TrackedOperationV1) { + o.OperationsRunning = v +} + +// GetMonitorRunning returns the MonitorRunning field value +func (o *StatusResponseV1) GetMonitorRunning() bool { + if o == nil { + var ret bool + return ret + } + + return o.MonitorRunning +} + +// GetMonitorRunningOk returns a tuple with the MonitorRunning field value +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetMonitorRunningOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.MonitorRunning, true +} + +// SetMonitorRunning sets field value +func (o *StatusResponseV1) SetMonitorRunning(v bool) { + o.MonitorRunning = v +} + +// GetLastSeenBlock returns the LastSeenBlock field value +func (o *StatusResponseV1) GetLastSeenBlock() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.LastSeenBlock +} + +// GetLastSeenBlockOk returns a tuple with the LastSeenBlock field value +// and a boolean to check if the value has been set. +func (o *StatusResponseV1) GetLastSeenBlockOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.LastSeenBlock, true +} + +// SetLastSeenBlock sets field value +func (o *StatusResponseV1) SetLastSeenBlock(v float32) { + o.LastSeenBlock = v +} + +func (o StatusResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StatusResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instanceId"] = o.InstanceId + toSerialize["connected"] = o.Connected + toSerialize["webServicesRegistered"] = o.WebServicesRegistered + toSerialize["monitoredTokensCount"] = o.MonitoredTokensCount + toSerialize["operationsRunning"] = o.OperationsRunning + toSerialize["monitorRunning"] = o.MonitorRunning + toSerialize["lastSeenBlock"] = o.LastSeenBlock + return toSerialize, nil +} + +type NullableStatusResponseV1 struct { + value *StatusResponseV1 + isSet bool +} + +func (v NullableStatusResponseV1) Get() *StatusResponseV1 { + return v.value +} + +func (v *NullableStatusResponseV1) Set(val *StatusResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableStatusResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableStatusResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatusResponseV1(val *StatusResponseV1) *NullableStatusResponseV1 { + return &NullableStatusResponseV1{value: val, isSet: true} +} + +func (v NullableStatusResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatusResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_token_type_v1.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_token_type_v1.go new file mode 100644 index 00000000000..fb407dba8c0 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_token_type_v1.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "encoding/json" + "fmt" +) + +// TokenTypeV1 the model 'TokenTypeV1' +type TokenTypeV1 string + +// List of TokenTypeV1 +const ( + ERC20 TokenTypeV1 = "erc20" + ERC721 TokenTypeV1 = "erc721" +) + +// All allowed values of TokenTypeV1 enum +var AllowedTokenTypeV1EnumValues = []TokenTypeV1{ + "erc20", + "erc721", +} + +func (v *TokenTypeV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TokenTypeV1(value) + for _, existing := range AllowedTokenTypeV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid TokenTypeV1", value) +} + +// NewTokenTypeV1FromValue returns a pointer to a valid TokenTypeV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTokenTypeV1FromValue(v string) (*TokenTypeV1, error) { + ev := TokenTypeV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TokenTypeV1: valid values are %v", v, AllowedTokenTypeV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TokenTypeV1) IsValid() bool { + for _, existing := range AllowedTokenTypeV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TokenTypeV1 value +func (v TokenTypeV1) Ptr() *TokenTypeV1 { + return &v +} + +type NullableTokenTypeV1 struct { + value *TokenTypeV1 + isSet bool +} + +func (v NullableTokenTypeV1) Get() *TokenTypeV1 { + return v.value +} + +func (v *NullableTokenTypeV1) Set(val *TokenTypeV1) { + v.value = val + v.isSet = true +} + +func (v NullableTokenTypeV1) IsSet() bool { + return v.isSet +} + +func (v *NullableTokenTypeV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTokenTypeV1(val *TokenTypeV1) *NullableTokenTypeV1 { + return &NullableTokenTypeV1{value: val, isSet: true} +} + +func (v NullableTokenTypeV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTokenTypeV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_tracked_operation_v1.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_tracked_operation_v1.go new file mode 100644 index 00000000000..ea07dfae656 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/model_tracked_operation_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "encoding/json" +) + +// checks if the TrackedOperationV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TrackedOperationV1{} + +// TrackedOperationV1 Persistence plugin operation that is tracked and returned in status report. +type TrackedOperationV1 struct { + // Start time of the operation. + StartAt string `json:"startAt"` + // Operation name. + Operation string `json:"operation"` +} + +// NewTrackedOperationV1 instantiates a new TrackedOperationV1 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 +// will change when the set of required properties is changed +func NewTrackedOperationV1(startAt string, operation string) *TrackedOperationV1 { + this := TrackedOperationV1{} + this.StartAt = startAt + this.Operation = operation + return &this +} + +// NewTrackedOperationV1WithDefaults instantiates a new TrackedOperationV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTrackedOperationV1WithDefaults() *TrackedOperationV1 { + this := TrackedOperationV1{} + return &this +} + +// GetStartAt returns the StartAt field value +func (o *TrackedOperationV1) GetStartAt() string { + if o == nil { + var ret string + return ret + } + + return o.StartAt +} + +// GetStartAtOk returns a tuple with the StartAt field value +// and a boolean to check if the value has been set. +func (o *TrackedOperationV1) GetStartAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StartAt, true +} + +// SetStartAt sets field value +func (o *TrackedOperationV1) SetStartAt(v string) { + o.StartAt = v +} + +// GetOperation returns the Operation field value +func (o *TrackedOperationV1) GetOperation() string { + if o == nil { + var ret string + return ret + } + + return o.Operation +} + +// GetOperationOk returns a tuple with the Operation field value +// and a boolean to check if the value has been set. +func (o *TrackedOperationV1) GetOperationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Operation, true +} + +// SetOperation sets field value +func (o *TrackedOperationV1) SetOperation(v string) { + o.Operation = v +} + +func (o TrackedOperationV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TrackedOperationV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["startAt"] = o.StartAt + toSerialize["operation"] = o.Operation + return toSerialize, nil +} + +type NullableTrackedOperationV1 struct { + value *TrackedOperationV1 + isSet bool +} + +func (v NullableTrackedOperationV1) Get() *TrackedOperationV1 { + return v.value +} + +func (v *NullableTrackedOperationV1) Set(val *TrackedOperationV1) { + v.value = val + v.isSet = true +} + +func (v NullableTrackedOperationV1) IsSet() bool { + return v.isSet +} + +func (v *NullableTrackedOperationV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTrackedOperationV1(val *TrackedOperationV1) *NullableTrackedOperationV1 { + return &NullableTrackedOperationV1{value: val, isSet: true} +} + +func (v NullableTrackedOperationV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTrackedOperationV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..52f26e5d1f9 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..a44c39da811 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,37 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-persistence-ethereum + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-persistence-ethereum_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService GetStatusV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetStatusV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..b796a960e60 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Persistence Ethereum + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-ethereum + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..b97f81edc8c --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - Persistence Ethereum + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..debac31c4b0 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,42 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java +src/main/java/org/openapitools/client/model/MonitoredToken.java +src/main/java/org/openapitools/client/model/StatusResponseV1.java +src/main/java/org/openapitools/client/model/TokenTypeV1.java +src/main/java/org/openapitools/client/model/TrackedOperationV1.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java +src/test/java/org/openapitools/client/model/MonitoredTokenTest.java +src/test/java/org/openapitools/client/model/StatusResponseV1Test.java +src/test/java/org/openapitools/client/model/TokenTypeV1Test.java +src/test/java/org/openapitools/client/model/TrackedOperationV1Test.java diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..024ebdceb55 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,140 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Persistence Ethereum +- API version: v2.0.0-alpha.2 + +Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + StatusResponseV1 result = apiInstance.getStatusV1(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#getStatusV1"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**getStatusV1**](docs/DefaultApi.md#getStatusV1) | **GET** /api/v1/plugins/@hyperledger/cactus-plugin-persistence-ethereum/status | Get the status of persistence plugin for ethereum + + +## Documentation for Models + + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [MonitoredToken](docs/MonitoredToken.md) + - [StatusResponseV1](docs/StatusResponseV1.md) + - [TokenTypeV1](docs/TokenTypeV1.md) + - [TrackedOperationV1](docs/TrackedOperationV1.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..0b8da54cd8a --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,150 @@ +openapi: 3.0.3 +info: + description: Synchronizes state of an ethereum ledger into a DB that can later be + viewed in GUI + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Persistence Ethereum + version: v2.0.0-alpha.2 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-persistence-ethereum/status: + get: + operationId: getStatusV1 + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/StatusResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Get the status of persistence plugin for ethereum + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-persistence-ethereum/status + x-accepts: application/json +components: + schemas: + TokenTypeV1: + enum: + - erc20 + - erc721 + type: string + x-enum-descriptions: + - "EIP-20: Token Standard" + - "EIP-721: Non-Fungible Token Standard" + x-enum-varnames: + - ERC20 + - ERC721 + MonitoredToken: + description: Ethereum tokens that are being monitored by the persistence plugin. + properties: + type: + $ref: '#/components/schemas/TokenTypeV1' + name: + description: Token name + nullable: false + type: string + symbol: + description: Token symbol + nullable: false + type: string + required: + - name + - symbol + - type + type: object + TrackedOperationV1: + description: Persistence plugin operation that is tracked and returned in status + report. + example: + operation: operation + startAt: startAt + properties: + startAt: + description: Start time of the operation. + nullable: false + type: string + operation: + description: Operation name. + nullable: false + type: string + required: + - operation + - startAt + type: object + StatusResponseV1: + description: Response with plugin status report. + example: + connected: true + monitoredTokensCount: 0.8008281904610115 + instanceId: instanceId + lastSeenBlock: 6.027456183070403 + monitorRunning: true + webServicesRegistered: true + operationsRunning: + - operation: operation + startAt: startAt + - operation: operation + startAt: startAt + properties: + instanceId: + description: Plugin instance id. + nullable: false + type: string + connected: + description: "True if successfully connected to the database, false otherwise." + nullable: false + type: boolean + webServicesRegistered: + description: True if web services were correctly exported. + nullable: false + type: boolean + monitoredTokensCount: + description: Total number of tokens being monitored by the plugin. + nullable: false + type: number + operationsRunning: + items: + $ref: '#/components/schemas/TrackedOperationV1' + type: array + monitorRunning: + description: "True if block monitoring is running, false otherwise." + nullable: false + type: boolean + lastSeenBlock: + description: Number of the last block seen by the block monitor. + nullable: false + type: number + required: + - connected + - instanceId + - lastSeenBlock + - monitorRunning + - monitoredTokensCount + - operationsRunning + - webServicesRegistered + type: object + ErrorExceptionResponseV1: + properties: + message: + nullable: false + type: string + error: + nullable: false + type: string + required: + - error + - message + type: object + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..6c1e299176b --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..0efcebdee7f --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..71a314af90d --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..6253efdb401 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..efb7f6aeee2 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..ac18df91e58 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..64169998087 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,404 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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.ErrorExceptionResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.MonitoredToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.StatusResponseV1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TrackedOperationV1.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); + } + } + } + + /** + * 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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..0dc9f7565a4 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..a651636fb48 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..aca5db1a1f0 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..f319bff832e --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..fab584e9275 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,195 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.ErrorExceptionResponseV1; +import org.openapitools.client.model.StatusResponseV1; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class DefaultApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(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 getStatusV1 + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call getStatusV1Call(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v1/plugins/@hyperledger/cactus-plugin-persistence-ethereum/status"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "text/plain", + "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 getStatusV1ValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getStatusV1Call(_callback); + + } + + /** + * Get the status of persistence plugin for ethereum + * + * @return StatusResponseV1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public StatusResponseV1 getStatusV1() throws ApiException { + ApiResponse localVarResp = getStatusV1WithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Get the status of persistence plugin for ethereum + * + * @return ApiResponse<StatusResponseV1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public ApiResponse getStatusV1WithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getStatusV1ValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the status of persistence plugin for ethereum (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 + + + + +
Status Code Description Response Headers
200 OK -
500 Internal Server Error -
+ */ + public okhttp3.Call getStatusV1Async(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getStatusV1ValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..871df0b1a7c --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..371d7257987 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..94acbd23ccc --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..88eed38497b --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..e4c0fa89484 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java new file mode 100644 index 00000000000..230d098dfb5 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/ErrorExceptionResponseV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ErrorExceptionResponseV1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ErrorExceptionResponseV1 { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private String error; + + public ErrorExceptionResponseV1() { + } + + public ErrorExceptionResponseV1 message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ErrorExceptionResponseV1 error(String error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nonnull + public String getError() { + return error; + } + + + public void setError(String error) { + this.error = error; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorExceptionResponseV1 errorExceptionResponseV1 = (ErrorExceptionResponseV1) o; + return Objects.equals(this.message, errorExceptionResponseV1.message) && + Objects.equals(this.error, errorExceptionResponseV1.error); + } + + @Override + public int hashCode() { + return Objects.hash(message, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorExceptionResponseV1 {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + openapiFields.add("error"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("error"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ErrorExceptionResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ErrorExceptionResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorExceptionResponseV1 is not found in the empty JSON string", ErrorExceptionResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ErrorExceptionResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorExceptionResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ErrorExceptionResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if (!jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorExceptionResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorExceptionResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorExceptionResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorExceptionResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorExceptionResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorExceptionResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorExceptionResponseV1 + * @throws IOException if the JSON string is invalid with respect to ErrorExceptionResponseV1 + */ + public static ErrorExceptionResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorExceptionResponseV1.class); + } + + /** + * Convert an instance of ErrorExceptionResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/MonitoredToken.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/MonitoredToken.java new file mode 100644 index 00000000000..ede55b2a573 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/MonitoredToken.java @@ -0,0 +1,278 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import org.openapitools.client.model.TokenTypeV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Ethereum tokens that are being monitored by the persistence plugin. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MonitoredToken { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TokenTypeV1 type; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + @SerializedName(SERIALIZED_NAME_SYMBOL) + private String symbol; + + public MonitoredToken() { + } + + public MonitoredToken type(TokenTypeV1 type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + public TokenTypeV1 getType() { + return type; + } + + + public void setType(TokenTypeV1 type) { + this.type = type; + } + + + public MonitoredToken name(String name) { + + this.name = name; + return this; + } + + /** + * Token name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public MonitoredToken symbol(String symbol) { + + this.symbol = symbol; + return this; + } + + /** + * Token symbol + * @return symbol + **/ + @javax.annotation.Nonnull + public String getSymbol() { + return symbol; + } + + + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MonitoredToken monitoredToken = (MonitoredToken) o; + return Objects.equals(this.type, monitoredToken.type) && + Objects.equals(this.name, monitoredToken.name) && + Objects.equals(this.symbol, monitoredToken.symbol); + } + + @Override + public int hashCode() { + return Objects.hash(type, name, symbol); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MonitoredToken {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("name"); + openapiFields.add("symbol"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("symbol"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MonitoredToken + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!MonitoredToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MonitoredToken is not found in the empty JSON string", MonitoredToken.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MonitoredToken.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MonitoredToken` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MonitoredToken.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("symbol").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `symbol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("symbol").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MonitoredToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MonitoredToken' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MonitoredToken.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MonitoredToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MonitoredToken read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MonitoredToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of MonitoredToken + * @throws IOException if the JSON string is invalid with respect to MonitoredToken + */ + public static MonitoredToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MonitoredToken.class); + } + + /** + * Convert an instance of MonitoredToken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StatusResponseV1.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StatusResponseV1.java new file mode 100644 index 00000000000..a728261e26d --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/StatusResponseV1.java @@ -0,0 +1,412 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.TrackedOperationV1; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Response with plugin status report. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StatusResponseV1 { + public static final String SERIALIZED_NAME_INSTANCE_ID = "instanceId"; + @SerializedName(SERIALIZED_NAME_INSTANCE_ID) + private String instanceId; + + public static final String SERIALIZED_NAME_CONNECTED = "connected"; + @SerializedName(SERIALIZED_NAME_CONNECTED) + private Boolean connected; + + public static final String SERIALIZED_NAME_WEB_SERVICES_REGISTERED = "webServicesRegistered"; + @SerializedName(SERIALIZED_NAME_WEB_SERVICES_REGISTERED) + private Boolean webServicesRegistered; + + public static final String SERIALIZED_NAME_MONITORED_TOKENS_COUNT = "monitoredTokensCount"; + @SerializedName(SERIALIZED_NAME_MONITORED_TOKENS_COUNT) + private BigDecimal monitoredTokensCount; + + public static final String SERIALIZED_NAME_OPERATIONS_RUNNING = "operationsRunning"; + @SerializedName(SERIALIZED_NAME_OPERATIONS_RUNNING) + private List operationsRunning = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MONITOR_RUNNING = "monitorRunning"; + @SerializedName(SERIALIZED_NAME_MONITOR_RUNNING) + private Boolean monitorRunning; + + public static final String SERIALIZED_NAME_LAST_SEEN_BLOCK = "lastSeenBlock"; + @SerializedName(SERIALIZED_NAME_LAST_SEEN_BLOCK) + private BigDecimal lastSeenBlock; + + public StatusResponseV1() { + } + + public StatusResponseV1 instanceId(String instanceId) { + + this.instanceId = instanceId; + return this; + } + + /** + * Plugin instance id. + * @return instanceId + **/ + @javax.annotation.Nonnull + public String getInstanceId() { + return instanceId; + } + + + public void setInstanceId(String instanceId) { + this.instanceId = instanceId; + } + + + public StatusResponseV1 connected(Boolean connected) { + + this.connected = connected; + return this; + } + + /** + * True if successfully connected to the database, false otherwise. + * @return connected + **/ + @javax.annotation.Nonnull + public Boolean getConnected() { + return connected; + } + + + public void setConnected(Boolean connected) { + this.connected = connected; + } + + + public StatusResponseV1 webServicesRegistered(Boolean webServicesRegistered) { + + this.webServicesRegistered = webServicesRegistered; + return this; + } + + /** + * True if web services were correctly exported. + * @return webServicesRegistered + **/ + @javax.annotation.Nonnull + public Boolean getWebServicesRegistered() { + return webServicesRegistered; + } + + + public void setWebServicesRegistered(Boolean webServicesRegistered) { + this.webServicesRegistered = webServicesRegistered; + } + + + public StatusResponseV1 monitoredTokensCount(BigDecimal monitoredTokensCount) { + + this.monitoredTokensCount = monitoredTokensCount; + return this; + } + + /** + * Total number of tokens being monitored by the plugin. + * @return monitoredTokensCount + **/ + @javax.annotation.Nonnull + public BigDecimal getMonitoredTokensCount() { + return monitoredTokensCount; + } + + + public void setMonitoredTokensCount(BigDecimal monitoredTokensCount) { + this.monitoredTokensCount = monitoredTokensCount; + } + + + public StatusResponseV1 operationsRunning(List operationsRunning) { + + this.operationsRunning = operationsRunning; + return this; + } + + public StatusResponseV1 addOperationsRunningItem(TrackedOperationV1 operationsRunningItem) { + if (this.operationsRunning == null) { + this.operationsRunning = new ArrayList<>(); + } + this.operationsRunning.add(operationsRunningItem); + return this; + } + + /** + * Get operationsRunning + * @return operationsRunning + **/ + @javax.annotation.Nonnull + public List getOperationsRunning() { + return operationsRunning; + } + + + public void setOperationsRunning(List operationsRunning) { + this.operationsRunning = operationsRunning; + } + + + public StatusResponseV1 monitorRunning(Boolean monitorRunning) { + + this.monitorRunning = monitorRunning; + return this; + } + + /** + * True if block monitoring is running, false otherwise. + * @return monitorRunning + **/ + @javax.annotation.Nonnull + public Boolean getMonitorRunning() { + return monitorRunning; + } + + + public void setMonitorRunning(Boolean monitorRunning) { + this.monitorRunning = monitorRunning; + } + + + public StatusResponseV1 lastSeenBlock(BigDecimal lastSeenBlock) { + + this.lastSeenBlock = lastSeenBlock; + return this; + } + + /** + * Number of the last block seen by the block monitor. + * @return lastSeenBlock + **/ + @javax.annotation.Nonnull + public BigDecimal getLastSeenBlock() { + return lastSeenBlock; + } + + + public void setLastSeenBlock(BigDecimal lastSeenBlock) { + this.lastSeenBlock = lastSeenBlock; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StatusResponseV1 statusResponseV1 = (StatusResponseV1) o; + return Objects.equals(this.instanceId, statusResponseV1.instanceId) && + Objects.equals(this.connected, statusResponseV1.connected) && + Objects.equals(this.webServicesRegistered, statusResponseV1.webServicesRegistered) && + Objects.equals(this.monitoredTokensCount, statusResponseV1.monitoredTokensCount) && + Objects.equals(this.operationsRunning, statusResponseV1.operationsRunning) && + Objects.equals(this.monitorRunning, statusResponseV1.monitorRunning) && + Objects.equals(this.lastSeenBlock, statusResponseV1.lastSeenBlock); + } + + @Override + public int hashCode() { + return Objects.hash(instanceId, connected, webServicesRegistered, monitoredTokensCount, operationsRunning, monitorRunning, lastSeenBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StatusResponseV1 {\n"); + sb.append(" instanceId: ").append(toIndentedString(instanceId)).append("\n"); + sb.append(" connected: ").append(toIndentedString(connected)).append("\n"); + sb.append(" webServicesRegistered: ").append(toIndentedString(webServicesRegistered)).append("\n"); + sb.append(" monitoredTokensCount: ").append(toIndentedString(monitoredTokensCount)).append("\n"); + sb.append(" operationsRunning: ").append(toIndentedString(operationsRunning)).append("\n"); + sb.append(" monitorRunning: ").append(toIndentedString(monitorRunning)).append("\n"); + sb.append(" lastSeenBlock: ").append(toIndentedString(lastSeenBlock)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("instanceId"); + openapiFields.add("connected"); + openapiFields.add("webServicesRegistered"); + openapiFields.add("monitoredTokensCount"); + openapiFields.add("operationsRunning"); + openapiFields.add("monitorRunning"); + openapiFields.add("lastSeenBlock"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("instanceId"); + openapiRequiredFields.add("connected"); + openapiRequiredFields.add("webServicesRegistered"); + openapiRequiredFields.add("monitoredTokensCount"); + openapiRequiredFields.add("operationsRunning"); + openapiRequiredFields.add("monitorRunning"); + openapiRequiredFields.add("lastSeenBlock"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StatusResponseV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!StatusResponseV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in StatusResponseV1 is not found in the empty JSON string", StatusResponseV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StatusResponseV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StatusResponseV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StatusResponseV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("instanceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `instanceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("instanceId").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("operationsRunning").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `operationsRunning` to be an array in the JSON string but got `%s`", jsonObj.get("operationsRunning").toString())); + } + + JsonArray jsonArrayoperationsRunning = jsonObj.getAsJsonArray("operationsRunning"); + // validate the required field `operationsRunning` (array) + for (int i = 0; i < jsonArrayoperationsRunning.size(); i++) { + TrackedOperationV1.validateJsonObject(jsonArrayoperationsRunning.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StatusResponseV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StatusResponseV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StatusResponseV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StatusResponseV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StatusResponseV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StatusResponseV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of StatusResponseV1 + * @throws IOException if the JSON string is invalid with respect to StatusResponseV1 + */ + public static StatusResponseV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StatusResponseV1.class); + } + + /** + * Convert an instance of StatusResponseV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TokenTypeV1.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TokenTypeV1.java new file mode 100644 index 00000000000..98e8bb1f42c --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TokenTypeV1.java @@ -0,0 +1,79 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets TokenTypeV1 + */ +@JsonAdapter(TokenTypeV1.Adapter.class) +public enum TokenTypeV1 { + + /** + * EIP-20: Token Standard + */ + ERC20("erc20"), + + /** + * EIP-721: Non-Fungible Token Standard + */ + ERC721("erc721"); + + private String value; + + TokenTypeV1(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TokenTypeV1 fromValue(String value) { + for (TokenTypeV1 b : TokenTypeV1.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TokenTypeV1 enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TokenTypeV1 read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TokenTypeV1.fromValue(value); + } + } +} + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TrackedOperationV1.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TrackedOperationV1.java new file mode 100644 index 00000000000..d446448c78c --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/TrackedOperationV1.java @@ -0,0 +1,248 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Persistence plugin operation that is tracked and returned in status report. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TrackedOperationV1 { + public static final String SERIALIZED_NAME_START_AT = "startAt"; + @SerializedName(SERIALIZED_NAME_START_AT) + private String startAt; + + public static final String SERIALIZED_NAME_OPERATION = "operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + private String operation; + + public TrackedOperationV1() { + } + + public TrackedOperationV1 startAt(String startAt) { + + this.startAt = startAt; + return this; + } + + /** + * Start time of the operation. + * @return startAt + **/ + @javax.annotation.Nonnull + public String getStartAt() { + return startAt; + } + + + public void setStartAt(String startAt) { + this.startAt = startAt; + } + + + public TrackedOperationV1 operation(String operation) { + + this.operation = operation; + return this; + } + + /** + * Operation name. + * @return operation + **/ + @javax.annotation.Nonnull + public String getOperation() { + return operation; + } + + + public void setOperation(String operation) { + this.operation = operation; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TrackedOperationV1 trackedOperationV1 = (TrackedOperationV1) o; + return Objects.equals(this.startAt, trackedOperationV1.startAt) && + Objects.equals(this.operation, trackedOperationV1.operation); + } + + @Override + public int hashCode() { + return Objects.hash(startAt, operation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TrackedOperationV1 {\n"); + sb.append(" startAt: ").append(toIndentedString(startAt)).append("\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("startAt"); + openapiFields.add("operation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("startAt"); + openapiRequiredFields.add("operation"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TrackedOperationV1 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!TrackedOperationV1.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TrackedOperationV1 is not found in the empty JSON string", TrackedOperationV1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TrackedOperationV1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TrackedOperationV1` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TrackedOperationV1.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("startAt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `startAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startAt").toString())); + } + if (!jsonObj.get("operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TrackedOperationV1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TrackedOperationV1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TrackedOperationV1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TrackedOperationV1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TrackedOperationV1 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TrackedOperationV1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of TrackedOperationV1 + * @throws IOException if the JSON string is invalid with respect to TrackedOperationV1 + */ + public static TrackedOperationV1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TrackedOperationV1.class); + } + + /** + * Convert an instance of TrackedOperationV1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..91f60efdc41 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,46 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.ErrorExceptionResponseV1; +import org.openapitools.client.model.StatusResponseV1; +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 DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Get the status of persistence plugin for ethereum + * + * @throws ApiException if the Api call fails + */ + @Test + public void getStatusV1Test() throws ApiException { + StatusResponseV1 response = api.getStatusV1(); + // TODO: test validations + } + +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java new file mode 100644 index 00000000000..e36c8caecf6 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/ErrorExceptionResponseV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ErrorExceptionResponseV1 + */ +public class ErrorExceptionResponseV1Test { + private final ErrorExceptionResponseV1 model = new ErrorExceptionResponseV1(); + + /** + * Model tests for ErrorExceptionResponseV1 + */ + @Test + public void testErrorExceptionResponseV1() { + // TODO: test ErrorExceptionResponseV1 + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/MonitoredTokenTest.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/MonitoredTokenTest.java new file mode 100644 index 00000000000..e054c53de1e --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/MonitoredTokenTest.java @@ -0,0 +1,65 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.model.TokenTypeV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for MonitoredToken + */ +public class MonitoredTokenTest { + private final MonitoredToken model = new MonitoredToken(); + + /** + * Model tests for MonitoredToken + */ + @Test + public void testMonitoredToken() { + // TODO: test MonitoredToken + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'symbol' + */ + @Test + public void symbolTest() { + // TODO: test symbol + } + +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StatusResponseV1Test.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StatusResponseV1Test.java new file mode 100644 index 00000000000..48e17cfd1aa --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/StatusResponseV1Test.java @@ -0,0 +1,100 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.TrackedOperationV1; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for StatusResponseV1 + */ +public class StatusResponseV1Test { + private final StatusResponseV1 model = new StatusResponseV1(); + + /** + * Model tests for StatusResponseV1 + */ + @Test + public void testStatusResponseV1() { + // TODO: test StatusResponseV1 + } + + /** + * Test the property 'instanceId' + */ + @Test + public void instanceIdTest() { + // TODO: test instanceId + } + + /** + * Test the property 'connected' + */ + @Test + public void connectedTest() { + // TODO: test connected + } + + /** + * Test the property 'webServicesRegistered' + */ + @Test + public void webServicesRegisteredTest() { + // TODO: test webServicesRegistered + } + + /** + * Test the property 'monitoredTokensCount' + */ + @Test + public void monitoredTokensCountTest() { + // TODO: test monitoredTokensCount + } + + /** + * Test the property 'operationsRunning' + */ + @Test + public void operationsRunningTest() { + // TODO: test operationsRunning + } + + /** + * Test the property 'monitorRunning' + */ + @Test + public void monitorRunningTest() { + // TODO: test monitorRunning + } + + /** + * Test the property 'lastSeenBlock' + */ + @Test + public void lastSeenBlockTest() { + // TODO: test lastSeenBlock + } + +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TokenTypeV1Test.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TokenTypeV1Test.java new file mode 100644 index 00000000000..c8b1af8fd69 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TokenTypeV1Test.java @@ -0,0 +1,33 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.annotations.SerializedName; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TokenTypeV1 + */ +public class TokenTypeV1Test { + /** + * Model tests for TokenTypeV1 + */ + @Test + public void testTokenTypeV1() { + // TODO: test TokenTypeV1 + } + +} diff --git a/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TrackedOperationV1Test.java b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TrackedOperationV1Test.java new file mode 100644 index 00000000000..3bff4257efd --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/src/main/java/generated/openapi/java-client/src/test/java/org/openapitools/client/model/TrackedOperationV1Test.java @@ -0,0 +1,56 @@ +/* + * Hyperledger Cactus Plugin - Persistence Ethereum + * Synchronizes state of an ethereum ledger into a DB that can later be viewed in GUI + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for TrackedOperationV1 + */ +public class TrackedOperationV1Test { + private final TrackedOperationV1 model = new TrackedOperationV1(); + + /** + * Model tests for TrackedOperationV1 + */ + @Test + public void testTrackedOperationV1() { + // TODO: test TrackedOperationV1 + } + + /** + * Test the property 'startAt' + */ + @Test + public void startAtTest() { + // TODO: test startAt + } + + /** + * Test the property 'operation' + */ + @Test + public void operationTest() { + // TODO: test operation + } + +} diff --git a/packages/cactus-plugin-persistence-fabric/package.json b/packages/cactus-plugin-persistence-fabric/package.json index d26afea85f5..ad6246a8fc1 100644 --- a/packages/cactus-plugin-persistence-fabric/package.json +++ b/packages/cactus-plugin-persistence-fabric/package.json @@ -59,7 +59,10 @@ "codegen": "run-p 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "copy-yarn-lock": "cp -af ../../yarn.lock ./dist/yarn.lock", - "generate-sdk": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk": "run-p 'generate-sdk:*'", + "generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", + "generate-sdk:java": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g java -o ./src/main/java/generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", "webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..021139f8149 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,9 @@ +.travis.yml +README.md +api/openapi.yaml +client.go +configuration.go +go.mod +go.sum +response.go +utils.go diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..1071ac73554 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,109 @@ +# Go API client for cactus-plugin-persistence-fabric + +Scrap fabric ledger into database. Needs administrative privileges. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: v2.0.0-alpha.2 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import cactus-plugin-persistence-fabric "github.com/hyperledger/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-persistence-fabric.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-persistence-fabric.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), cactus-plugin-persistence-fabric.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-persistence-fabric.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- + + +## Documentation For Models + + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..89d1a3138d4 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,13 @@ +openapi: 3.0.3 +info: + description: Scrap fabric ledger into database. Needs administrative privileges. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Block Fabrick PErsistance + version: v2.0.0-alpha.2 +servers: +- url: / +paths: {} +components: + schemas: {} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..58bb7fa3843 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,653 @@ +/* +Hyperledger Cactus Plugin - Block Fabrick PErsistance + +Scrap fabric ledger into database. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-fabric + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Hyperledger Cactus Plugin - Block Fabrick PErsistance API vv2.0.0-alpha.2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..1aee29d815d --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Block Fabrick PErsistance + +Scrap fabric ledger into database. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-fabric + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..f02f97435b8 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..36dea735466 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Block Fabrick PErsistance + +Scrap fabric ledger into database. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-fabric + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..24c64ec2042 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Block Fabrick PErsistance + +Scrap fabric ledger into database. Needs administrative privileges. + +API version: v2.0.0-alpha.2 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-fabric + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.github/workflows/maven.yml new file mode 100644 index 00000000000..d76fe98032a --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.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 Hyperledger Cactus Plugin - Block Fabrick PErsistance + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + 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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/FILES b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/FILES new file mode 100644 index 00000000000..fda97db7d19 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/FILES @@ -0,0 +1,30 @@ +.github/workflows/maven.yml +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +gradle.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.travis.yml b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/README.md b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/README.md new file mode 100644 index 00000000000..eef130f8d45 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/README.md @@ -0,0 +1,107 @@ +# openapi-java-client + +Hyperledger Cactus Plugin - Block Fabrick PErsistance +- API version: v2.0.0-alpha.2 + +Scrap fabric ledger into database. Needs administrative privileges. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- + + +## Documentation for Models + + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/api/openapi.yaml b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/api/openapi.yaml new file mode 100644 index 00000000000..22a61afe64b --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/api/openapi.yaml @@ -0,0 +1,14 @@ +openapi: 3.0.3 +info: + description: Scrap fabric ledger into database. Needs administrative privileges. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Block Fabrick PErsistance + version: v2.0.0-alpha.2 +servers: +- url: / +paths: {} +components: + schemas: {} + diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/build.gradle b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/build.gradle new file mode 100644 index 00000000000..5dc4412c317 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/build.gradle @@ -0,0 +1,168 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '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.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${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 = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.8.5' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' +} + +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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/build.sbt b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/build.sbt new file mode 100644 index 00000000000..52a62bdcd12 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/build.sbt @@ -0,0 +1,28 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.10.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "io.gsonfire" % "gson-fire" % "1.8.5" % "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.9.1" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradle.properties b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradlew b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradlew new file mode 100644 index 00000000000..005bcde0428 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# 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 + which java >/dev/null 2>&1 || 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 + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + 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 + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# 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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradlew.bat b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradlew.bat new file mode 100644 index 00000000000..6a68175eb70 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/gradlew.bat @@ -0,0 +1,89 @@ +@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=. +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=-Dfile.encoding=UTF-8 "-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%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +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%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/pom.xml b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/pom.xml new file mode 100644 index 00000000000..0c564255341 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/pom.xml @@ -0,0 +1,353 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 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 + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + 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.1.0 + + + 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.3.0 + + + 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.3.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.4.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + 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.0.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} + + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + org.mockito + mockito-core + ${mockito-core-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.5 + 1.6.6 + 4.10.0 + 2.9.1 + 3.12.0 + 0.2.6 + 1.3.5 + 5.9.1 + 1.9.1 + 3.12.4 + 2.1.1 + 1.1.1 + UTF-8 + 2.27.2 + + diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/settings.gradle b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..b6a4c901b00 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..3ee98bec14c --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1547 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.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 { + + private String basePath = "http://localhost"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + // 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); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1/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://localhost + * @return An instance of OkHttpClient + */ + 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 Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

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!"); + } + + /** + * 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 collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param 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); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws 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 { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + 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); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + 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( + "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("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws 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 + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..e0c475142b0 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,166 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 javax.ws.rs.core.GenericType; + +/** + *

ApiException class.

+ */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiException extends Exception { + 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("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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..d5ea165e419 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..4e4cf4bc077 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Configuration { + public static final String VERSION = "1"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..b18a5ca23d4 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..2531627922f --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,400 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + { + 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); + 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); + } + } + } + + /** + * 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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..e36d8c1359d --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..cd2fd4dec5c --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..c45581dc4fb --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..59edc528a44 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..c2f13e21666 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..c1b6351c3cf --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..f40ed5192e6 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..e03641e376a --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..b6cc3cb2cd9 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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; + +import java.io.UnsupportedEncodingException; + +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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..84ef8b9ddd2 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,63 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + 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 bearerToken; + } + + /** + * 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.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + 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/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..fd94b3eae39 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/java/generated/openapi/java-client/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,149 @@ +/* + * Hyperledger Cactus Plugin - Block Fabrick PErsistance + * Scrap fabric ledger into database. Needs administrative privileges. + * + * The version of the OpenAPI document: v2.0.0-alpha.2 + * + * + * 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 org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +//import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +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/tools/clear-openapi-codegen-folders.js b/tools/clear-openapi-codegen-folders.js index 2006ad1ee68..badb9189b2b 100644 --- a/tools/clear-openapi-codegen-folders.js +++ b/tools/clear-openapi-codegen-folders.js @@ -13,6 +13,8 @@ const PROJECT_DIR = path.join(SCRIPT_DIR, "../"); const OPENAPI_CODEGEN_PATHS = [ "src/main/kotlin/generated/openapi/**", "src/main/typescript/generated/openapi/typescript-axios/**", + "src/main/go/generated/openapi/go-client/**", + "src/main/java/generated/openapi/java-client/**", ]; const lernaJsonStr = await readFile(PROJECT_DIR + LERNA_JSON, "utf-8"); const lernaJson = JSON.parse(lernaJsonStr); diff --git a/yarn.lock b/yarn.lock index 3a9114e90c9..f5350edcaef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8422,6 +8422,7 @@ __metadata: openapi-types: 12.1.3 prettier: 3.0.3 protoc-gen-ts: 0.8.6 + replace: 1.2.2 run-time-error: 1.4.0 run-time-error-cjs: 1.4.0 secp256k1: 4.0.3 @@ -18532,6 +18533,17 @@ __metadata: languageName: node linkType: hard +"chalk@npm:2.4.2, chalk@npm:^2.0.0, chalk@npm:^2.1.0, chalk@npm:^2.3.0, chalk@npm:^2.3.2, chalk@npm:^2.4.1, chalk@npm:^2.4.2": + version: 2.4.2 + resolution: "chalk@npm:2.4.2" + dependencies: + ansi-styles: ^3.2.1 + escape-string-regexp: ^1.0.5 + supports-color: ^5.3.0 + checksum: ec3661d38fe77f681200f878edbd9448821924e0f93a9cefc0e26a33b145f1027a2084bf19967160d11e1f03bfe4eaffcabf5493b89098b2782c3fe0b03d80c2 + languageName: node + linkType: hard + "chalk@npm:4.1.2, chalk@npm:^4.0.0, chalk@npm:^4.0.2, chalk@npm:^4.1.0, chalk@npm:^4.1.1, chalk@npm:^4.1.2": version: 4.1.2 resolution: "chalk@npm:4.1.2" @@ -18555,17 +18567,6 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^2.0.0, chalk@npm:^2.1.0, chalk@npm:^2.3.0, chalk@npm:^2.3.2, chalk@npm:^2.4.1, chalk@npm:^2.4.2": - version: 2.4.2 - resolution: "chalk@npm:2.4.2" - dependencies: - ansi-styles: ^3.2.1 - escape-string-regexp: ^1.0.5 - supports-color: ^5.3.0 - checksum: ec3661d38fe77f681200f878edbd9448821924e0f93a9cefc0e26a33b145f1027a2084bf19967160d11e1f03bfe4eaffcabf5493b89098b2782c3fe0b03d80c2 - languageName: node - linkType: hard - "chalk@npm:^3.0.0": version: 3.0.0 resolution: "chalk@npm:3.0.0" @@ -34733,6 +34734,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:3.0.5": + version: 3.0.5 + resolution: "minimatch@npm:3.0.5" + dependencies: + brace-expansion: ^1.1.7 + checksum: a3b84b426eafca947741b864502cee02860c4e7b145de11ad98775cfcf3066fef422583bc0ffce0952ddf4750c1ccf4220b1556430d4ce10139f66247d87d69e + languageName: node + linkType: hard + "minimatch@npm:5.0.1, minimatch@npm:^5.0.1": version: 5.0.1 resolution: "minimatch@npm:5.0.1" @@ -41431,6 +41441,20 @@ __metadata: languageName: node linkType: hard +"replace@npm:1.2.2": + version: 1.2.2 + resolution: "replace@npm:1.2.2" + dependencies: + chalk: 2.4.2 + minimatch: 3.0.5 + yargs: ^15.3.1 + bin: + replace: bin/replace.js + search: bin/search.js + checksum: 1d69f43937a5fdf9dea278e78d6f3b51c1889ba5135bd201918bbda6330684adf8276e8e90e1c021034420dd4df239e51c23ca40752cb9bc6180c153d6d46a37 + languageName: node + linkType: hard + "request-progress@npm:^3.0.0": version: 3.0.0 resolution: "request-progress@npm:3.0.0" @@ -52038,7 +52062,7 @@ __metadata: languageName: node linkType: hard -"yargs@npm:^15.0.2": +"yargs@npm:^15.0.2, yargs@npm:^15.3.1": version: 15.4.1 resolution: "yargs@npm:15.4.1" dependencies: